|
| 1 | +================== |
| 2 | +Architecture Layer |
| 3 | +================== |
| 4 | + |
| 5 | +`View slides <arch-slides.html>`_ |
| 6 | + |
| 7 | +.. slideconf:: |
| 8 | + :autoslides: False |
| 9 | + :theme: single-level |
| 10 | + |
| 11 | +Lecture objectives: |
| 12 | +=================== |
| 13 | + |
| 14 | +.. slide:: Introduction |
| 15 | + :inline-contents: True |
| 16 | + :level: 2 |
| 17 | + |
| 18 | + * Overview of the arch layer |
| 19 | + |
| 20 | + * Overview of the boot process |
| 21 | + |
| 22 | + |
| 23 | +Overview of the arch layer |
| 24 | +========================== |
| 25 | + |
| 26 | +.. slide:: Overview of the arch layer |
| 27 | + :level: 2 |
| 28 | + :inline-contents: True |
| 29 | + |
| 30 | + .. ditaa:: |
| 31 | + :height: 100% |
| 32 | + |
| 33 | + +---------------+ +--------------+ +---------------+ |
| 34 | + | Application 1 | | Application2 | ... | Application n | |
| 35 | + +---------------+ +--------------+ +---------------+ |
| 36 | + | | | |
| 37 | + v v v |
| 38 | + +--------------------------------+------------------------+ |
| 39 | + | Kernel core & subsystems | Generic Drivers | |
| 40 | + +--------------------------------+------------------------+ |
| 41 | + | Generic Architecture Code | |
| 42 | + +---------------------------------------------------------+ |
| 43 | + | Architecture Specific Code | |
| 44 | + | | |
| 45 | + | +-----------+ +--------+ +---------+ +--------+ | |
| 46 | + | | Bootstrap | | Memory | | Threads | | Timers | | |
| 47 | + | +-----------+ +--------+ +---------+ +--------+ | |
| 48 | + | +------+ +----------+ +------------------+ | |
| 49 | + | | IRQs | | Syscalls | | Platform Drivers | | |
| 50 | + | +------+ +----------+ +------------------+ | |
| 51 | + | +------------------+ +---------+ +---------+ | |
| 52 | + | | Platform Drivers | | machine | ... | machine | | |
| 53 | + | +------------------+ +---------+ +---------+ | |
| 54 | + +---------------------------------------------------------+ |
| 55 | + | | | |
| 56 | + v v v |
| 57 | + +--------------------------------------------------------+ |
| 58 | + | Hardware | |
| 59 | + +--------------------------------------------------------+ |
| 60 | + |
| 61 | + |
| 62 | +Boot strap |
| 63 | +---------- |
| 64 | + |
| 65 | +.. slide:: Bootstrap |
| 66 | + :level: 2 |
| 67 | + :inline-contents: True |
| 68 | + |
| 69 | + * The first kernel code that runs |
| 70 | + |
| 71 | + * Typically runs with the MMU disabled |
| 72 | + |
| 73 | + * Move / Relocate kernel code |
| 74 | + |
| 75 | + |
| 76 | +Boot strap |
| 77 | +---------- |
| 78 | + |
| 79 | +.. slide:: Bootstrap |
| 80 | + :level: 2 |
| 81 | + :inline-contents: True |
| 82 | + |
| 83 | + * The first kernel code that runs |
| 84 | + |
| 85 | + * Typically runs with the MMU disabled |
| 86 | + |
| 87 | + * Copy bootloader arguments and determine kernel run location |
| 88 | + |
| 89 | + * Move / relocate kernel code to final location |
| 90 | + |
| 91 | + * Initial MMU setup - map the kernel |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | +Memory setup |
| 96 | +------------ |
| 97 | + |
| 98 | +.. slide:: Memory Setup |
| 99 | + :level: 2 |
| 100 | + :inline-contents: True |
| 101 | + |
| 102 | + * Determine available memory and setup the boot memory allocator |
| 103 | + |
| 104 | + * Manages memory regions before the page allocator is setup |
| 105 | + |
| 106 | + * Bootmem - used a bitmap to track free blocks |
| 107 | + |
| 108 | + * Memblock - deprecates bootmem and adds support for memory ranges |
| 109 | + |
| 110 | + * Supports both physical and virtual addresses |
| 111 | + |
| 112 | + * support NUMA architectures |
| 113 | + |
| 114 | + |
| 115 | +MMU management |
| 116 | +-------------- |
| 117 | + |
| 118 | +.. slide:: MMU management |
| 119 | + :level: 2 |
| 120 | + :inline-contents: True |
| 121 | + |
| 122 | + * Implements the generic page table manipulation APIs: types, |
| 123 | + accessors, flags |
| 124 | + |
| 125 | + * Implement TLB management APIs: flush, invalidate |
| 126 | + |
| 127 | + |
| 128 | +Thread Management |
| 129 | +----------------- |
| 130 | + |
| 131 | +.. slide:: Thread Management |
| 132 | + :level: 2 |
| 133 | + :inline-contents: True |
| 134 | + |
| 135 | + * Defines the thread type (struct thread_info) and implements |
| 136 | + functions for allocating threads (if needed) |
| 137 | + |
| 138 | + * Implement :c:func:`copy_thread` and :c:func:`switch_context` |
| 139 | + |
| 140 | + |
| 141 | +Time Management |
| 142 | +---------------- |
| 143 | + |
| 144 | +.. slide:: Timer Management |
| 145 | + :level: 2 |
| 146 | + :inline-contents: True |
| 147 | + |
| 148 | + * Setup the timer tick and provide a time source |
| 149 | + |
| 150 | + * Mostly transitioned to platform drivers |
| 151 | + |
| 152 | + * clock_event_device - for scheduling timers |
| 153 | + |
| 154 | + * clocksource - for reading the time |
| 155 | + |
| 156 | + |
| 157 | +IRQs and exception management |
| 158 | +----------------------------- |
| 159 | + |
| 160 | +.. slide:: IRQs and exception management |
| 161 | + :level: 2 |
| 162 | + :inline-contents: True |
| 163 | + |
| 164 | + * Define interrupt and exception handlers / entry points |
| 165 | + |
| 166 | + * Setup priorities |
| 167 | + |
| 168 | + * Platform drivers for interrupt controllers |
| 169 | + |
| 170 | + |
| 171 | +System calls |
| 172 | +------------ |
| 173 | + |
| 174 | +.. slide:: System calls |
| 175 | + :level: 2 |
| 176 | + :inline-contents: True |
| 177 | + |
| 178 | + * Define system call entry point(s) |
| 179 | + |
| 180 | + * Implement user-space access primitives (e.g. copy_to_user) |
| 181 | + |
| 182 | + |
| 183 | +Platform Drivers |
| 184 | +---------------- |
| 185 | + |
| 186 | +.. slide:: Platform Drivers |
| 187 | + :level: 2 |
| 188 | + :inline-contents: True |
| 189 | + |
| 190 | + * Platform and architecture specific drivers |
| 191 | + |
| 192 | + * Bindings to platform device enumeration methods (e.g. device tree |
| 193 | + or ACPI) |
| 194 | + |
| 195 | +Machine specific code |
| 196 | +--------------------- |
| 197 | + |
| 198 | +.. slide:: Machine specific code |
| 199 | + :level: 2 |
| 200 | + :inline-contents: True |
| 201 | + |
| 202 | + * Some architectures use a "machine" / "platform" abstraction |
| 203 | + |
| 204 | + * Typical for architecture used in embedded systems with a lot of |
| 205 | + variety (e.g. ARM, powerPC) |
| 206 | + |
| 207 | + |
| 208 | +Overview of the boot process |
| 209 | +============================ |
| 210 | + |
| 211 | + |
| 212 | +.. slide:: Boot flow inspection |
| 213 | + :level: 2 |
| 214 | + :inline-contents: True |
| 215 | + |
| 216 | + |
| 217 | + .. asciicast:: ../res/boot.cast |
0 commit comments