Changes between Version 52 and Version 53 of boot_procedure
- Timestamp:
- Feb 28, 2019, 1:34:48 PM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
boot_procedure
v52 v53 46 46 47 47 The values given in this array are indicative. The actual values are defined by configuration parameters in the ''boot_config.h'' file. 48 The main constraint is the following: the ''kcode'' segment (in the KERNEL_CODE zone) must be entirely contained in one single big physical page (2 MBytes) because it will be mapped as one single big page in all process virtual spaces. 49 48 The two main constraint are the following: 49 * the ''kcode'' segment (in the KERNEL_CODE zone) must be entirely contained in one single big physical page (2 Mbytes), because it will be mapped as one single big page in all process virtual spaces. 50 * the BOOT_CODE region (containing the boot loader instructions and data) must be entirely contained in the 51 next big physical page, because it will be mapped in the boot-loader virtual space yo allow the cores to access locally the boot code as soon as it has been copied in the local cluster. 50 52 51 53 A core is identified by two indexes: '''cxy''' is the cluster identifier, an '''lid''' is the core local index in cluster. 54 The CP0 register containing the core gid (global hardware identifier) has a fixed format: '''gid''' = ('''cxy''' << 2) + '''lid''' 52 55 53 56 All cores contribute to the boot procedure, but all cores are not simultaneously active: … … 60 63 === B1. Preloader phase === 61 64 62 At reset, the MMU is de-activated (for both data and instructions), and the extension address registers supporting direct access to remote memory banks (for both data and instructions) in all cores[cxy][lid] contain the 0 value.63 Therefore, all cores can only access the physical address space of cluster 0.64 65 * In the TSAR_LETI architecture, the preloader is loaded in the first 16 kbytes of the physical address space in cluster 0. 65 66 * In the TSAR_IOB architecture, the preloader is stored in an external ROM, that is accessed throug the IO_bridge located in cluster 0. 66 67 68 At reset, the MMU is de-activated (for both data and instructions), and the extension address registers supporting direct access to remote memory banks (for data only) contain the 0 value. 69 Therefore, all cores can only access the physical address space of cluster 0. 70 67 71 All cores execute the same preloader code (stored in cluster 0, but the work done depends on the core identifier: 68 * The core[0][0] load in the BOOT_CODE zone of cluster 0, the boot-loader code .72 * The core[0][0] load in the BOOT_CODE zone of cluster 0, the boot-loader code stored on disk. 69 73 * All other cores do only one task before going to sleep (i.e. low-power state): each core activates its private WTI channel in the local ICU (Interrupt Controller Unit) to be later activated by an IPI (Inter Processor Interrupt). 70 71 This shows the memory content after this pre-loader phase.72 [[Image(Phys_Mem1.svg)]]73 74 74 75 === B2. Boot-loader Sequencial phase === 75 76 76 The first instructions of the boot-loader are defined in the ''boot_entry.S'' file. This assembly code is executed by all cores entering the boot loader, 77 but not at the same time, because in this phase, only core [0][0] is running, while all other cores are blocked in the preloaded, waiting to be activated by an IPI. 77 In this phase, only core [0][0] is running, while all other cores are blocked in the preloaded, waiting to be activated by an IPI. 78 78 79 Th is assembly code makes the assuption that the CP0 register containing the core gid (global hardware identifier) has a fixed format: '''gid''' == ('''cxy''' << 2) + '''lid'''79 The first instructions of the boot-loader are defined in the ''boot_entry.S'' file. This assembly code is executed by all cores entering the boot loader, but not at the same time. 80 80 81 81 Each core running this code makes the 3 following actions: 82 * It initializes the core stack pointer depending on the '''lid''' value extracted from the '''gid''', using the BOOT_STACK_BASE and BOOT_STACK_SIZE parameters defined in the ''boot_config.h'' file, *82 * It initializes the core stack pointer depending on the '''lid''' value extracted from the '''gid''', using the BOOT_STACK_BASE and BOOT_STACK_SIZE parameters defined in the ''boot_config.h'' file, 83 83 * It changes the value of the DATA address extension CP2 register, using the '''cxy''' value extracted from the '''gid''' 84 84 * It jumps to the boot_loader() C function defined in the ''boot.c'' file, passing the two (cxy , lid) arguments. … … 93 93 * The core[0][0] send IPIs to activate all cores [i][0] in all other clusters. 94 94 95 This shows the memory content after this phase.96 [[Image(Phys_Mem2.svg)]]97 98 95 === B3. Boot-loader partially parallel phase === 99 96 100 This phase is executed by all core[cxy][0], but the core[0][0].97 In this phase all core[cxy][0], other than the core[0][0] are running. 101 98 102 At this point, all INSTRUCTION address extension registers point on cluster(0,0), but allDATA extension registers point already on the local cluster to use the local stack. To access the bootloader global variables the core[cxy][0] must first copy the boot code (data and instructions) in the BOOT_CORE zone of cluster cxy.99 At this point, all DATA extension registers point already on the local cluster to use the local stack. To access the bootloader global variables the core[cxy][0] must first copy the boot code (data and instructions) in the BOOT_CORE zone of cluster cxy. 103 100 104 101 Therefore, the core[cxy][0] exécutes the boot-loader code (stored in physical memory of cluster 0), to do he following tasks: 105 * The core[cxy][0] copies the boot-loader code from cluster 0 to BOOT_CORE zone in cluster cxy. 106 * The core[cxy][0] copies the ''arch_info.bin'' structure from cluster 0 to ARCH_INFO zone in cluster cxy. 107 * The core[cxy][0] copies the ''kcode'' and ''kdata'' segments from cluster 0 to KERNEL_CODE zone in cluster cxy. 102 * The core[cxy][0] copies the boot-loader code from BOOT_CODE zone in cluster 0 to BOOT_CORE zone in cluster cxy. 103 * [TO BE DONE] The core[cxy][0] map the boot-loader code (one big page) and activates the instruction MMU to use the local copy of the boot-loader code. 104 * The core[cxy][0] copies the ''arch_info.bin'' structure from ARCH_INFO zone in cluster 0 to ARCH_INFO zone in cluster cxy. 105 * The core[cxy][0] copies the ''kcode'' and ''kdata'' segments from KERNEL_CODE zone in cluster 0 to KERNEL_CODE zone in cluster cxy. 108 106 * The core[cxy][0] builds from the ''arch_info.t'' the specific ''boot_info_t'' structure for cluster cxy, and stores it in the local ''kdata'' segment. 109 * Il arrive à la barrière de synchronisation, et le dernier '''CP0''' débloque tous les '''CP0''' (y compris '''bscpu'''),110 107 * All core[cxy][0], including core[0][0], synchronize using a global barrier. 111 * in each cluster cxy, the core[cxy][0] activates the other cores that are still blocked in the preloaded. 112 113 This shows the memory content after this phase. 114 [[Image(Phys_Mem3.svg)]] 108 * in each cluster cxy, the core[cxy][0] activates the other cores that are blocked in the pre-loader. 115 109 116 110 === B4. Boot-loader fully parallel phase === … … 195 189 196 190 Finally, each core enables its private timer IRQ to activate its private scheduler, and jump to the idle thread code.= Boot procedure = 197