Changes between Version 68 and Version 69 of boot_procedure
- Timestamp:
- Dec 7, 2019, 3:52:14 PM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
boot_procedure
v68 v69 140 140 The source code for this function is defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/kern/kernel_init.c almos-mkh/kernel/kern/kernel_init.c] file. 141 141 142 When a core enters this function,the MMU status depends on the target architecture:142 All the kernel_init() code is independent on the architecture, but the MMU status depends on the target architecture: 143 143 * For the '''TSAR''' architectures, the instruction MMU has been activated and uses the Page Table defined by the boot-loader. The data MMU is de-activated, and the DATA address extension register points on the local physical memory. 144 144 * For the '''I86''' architectures, both the instruction and the data MMUs have been activated, an use the Page Table defined by the boot-loader. 145 145 146 In both cases, a new GPT (Generic Page Table), and a new VSL (Virtual Segments List) must be created in each cluster. These structures will be used by all kernel threads (all threads directly attached to the local kernel process) and are stored in the process_zero VMM. The ''kcode'' and (possibly) ''kdata'' segments are copied in all user process descriptors.146 In both cases, the kernel_init() function must create in each cluster a new kernel '''GPT''' (Generic Page Table), and a new kernel '''VSL''' (Virtual Segments List), to be used by the local core MMUs to access the local ''kcode'' and ''kdata'' segments. In each cluster, an unique kernel '''process_zero''' contains all kernel threads running in this cluster. These kernel '''VSL''' and '''GPT''' structures are registered in the '''process_zero''' descriptor, to be used by the kernel threads. The informations registered in these '''VSL''' and '''GPT''' kernel structures will be copied later in the user '''VSL''' and '''GPT''' structures contained in all user process descriptors created in the cluster, to be used by the user threads associated to this process. 147 147 148 148 In each cluster, all local cores execute this procedure in parallel, but most tasks are only executed by core[0]. … … 155 155 === D1) Core and cluster identification === 156 156 157 Each core has an unique hardware identifier, called '''gid''', that ishard-wired in a read-only register.157 Each core is supposed to have an unique hardware identifier, called '''gid''', hard-wired in a read-only register. 158 158 From the kernel point of view a core is identified by a composite index (cxy,lid), where '''cxy''' is the cluster identifier, and ''lid'' is a local (continuous) index in the cluster. The association between the gid hardware index and the (cxy,lid) composite index is defined in the boot_info_t structure. In this first step, each core makes an associative search in the boot_info_t structure to obtain the ('''cxy,lid''') indexes from the '''gid''' index. 159 159 160 The core[ 0] initialize the global variable '''local_cxy''' defining the local cluster identifier, and initialises the local cluster descriptor from informations found in the boot_info_tstructure.161 All cores make s a first initialization of their private kernel ''idle_thread''.162 Finally, the core[0] in cluster[0] initialise the kernel TXT0. This terminal is used by any kernel instance running on any core to display log or debug messages. This terminal is configured in ''non-descheduling'' mode : the calling thread call directly the relevant TXT driver, without using a serverthread.163 164 A synchronization barrier is used to avoid other cores touse the TXT0 terminal before initialization.160 The core[cxy][0] initialize the global variable '''local_cxy''' defining the local cluster identifier, and initialises the local cluster descriptor from informations found in the boot_info structure. 161 All cores make a first initialization of their private kernel IDLE thread. 162 Finally, the core[0][0] initialise the kernel TXT0. This terminal is used by the kernel code, running on any core, to display log or debug messages. This terminal is configured in ''non-descheduling'' mode : the calling thread executes directly the relevant TXT driver, without using the dedicated DEV kernel thread. 163 164 A first synchronization barrier is used to avoid that other cores use the TXT0 terminal before initialization. 165 165 166 166 === D2) Cluster manager initialization === 167 167 168 In each cluster, the core[0] makes the cluster manager initialization, namely the cores descriptors array, the DQDT, and the local physical memory allocators. 169 170 A synchonization barrier is used to avoid access to cluster manager before initialization. 168 In each cluster, the core[0] makes the cluster manager initialization. The cluster manager contains the structures describing the main kernel ressources in the cluster : 169 * the hardware architecture parameters (both local and global). 170 * an array of cores descriptors, and the associated schedulers. 171 * the physical memory allocator(s) in this cluster. 172 * the DQDT, that is a global, distributed structure registering the current level of ressource (cores and memory) availability. 173 174 The cluster manager is defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/kern/cluster.h almos-mkh/kernel/kern/cluster.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/kernel/kern/cluster.c almos-mkh/kernel/kern/cluster.c] files. 175 176 As all cluster managers are global variables, accessible by any kernel instance, running in any cluster, a synchonization barrier is required to avoid access to a cluster manager before initialization. 171 177 172 178 === D3) Kernel entry point and process_zero initialization === … … 174 180 All cores initialise the registers, defining the kernel entry point(s) in case of interrupt, exception or system call. 175 181 This must be done here because the VFS initialization uses RPCs requiring Inter Processor Interrupts. 176 All core initialise their (currently running) IDLE thread descriptor.177 In each cluster the core[ 0] initializes the local process_zero descriptor, containing al kernel threads in a given cluster.182 All cores initialise their (currently running) IDLE thread descriptor. 183 In each cluster the core[cxy][0] initializes the local kernel process_zero descriptor. 178 184 This include the creation of the local kernel GPT and VSL. 179 185 180 A synchronization barrier is used to avoid access to VSL/GPT before initialization.186 Here again, a synchronization barrier is required to avoid access to VSL/GPT before initialization. 181 187 182 188 === D4) MMU activation === … … 186 192 Moreover, the core[0] in cluster[0] initializes the external IOPIC device 187 193 188 A synchronization barrier is used to avoid access to IOPIC before initialization.194 A synchronization barrier is required to avoid access to IOPIC before initialization. 189 195 190 196 === D5) Internal & external devices initialization === … … 197 203 Then each external chdev descriptor is created in the cluster where it must be created. 198 204 199 A synchronization barrier is used to avoid access to devices before initialization.205 A synchronization barrier is required to avoid access to devices before initialization. 200 206 201 207 === D6) IPI, Idle thread, and VFS root initialization === … … 204 210 Then core[0] in cluster[0] creates the root VFS in cluster[0]. This requires to access the file system on disk. 205 211 206 A synchronization barrier is used to avoid access to VFS root before initialization.212 A synchronization barrier is required to avoid access to VFS root before initialization. 207 213 208 214 === D7) VFS root initialisation in all clusters === … … 211 217 from values registered in cluster[0]. 212 218 213 A synchronization barrier is used to avoid access to VFS before initialization.219 A synchronization barrier is required to avoid access to VFS before initialization. 214 220 215 221 === D8) DEVFS global initialization === … … 217 223 The core[0] in cluster[0] makes the DEVFS global initialization: It initializes the DEVFS context, and creates the DEVFSb''dev'' and ''external'' directory inodes in cluster[0]. 218 224 219 A synchronization barrier is used to avoid access to DEVFS root before initialization.225 A synchronization barrier is required to avoid access to DEVFS root before initialization. 220 226 221 227 === D9) DEVFS local initialization ===