Changes between Version 65 and Version 66 of boot_procedure
- Timestamp:
- Dec 7, 2019, 1:44:40 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
boot_procedure
v65 v66 9 9 * The architecture independent phase, implemented by a generic (architecture independent) '''kernel-init''' procedure. 10 10 11 As the generic (i.e. architecture independent) kernel initialization procedure is executed in parallel by all kernel instances in all clusters containing at least one core and one memory bank, the main task of the bootloader is to load - in each cluster - a local copy of 12 the ALMOS-MKH kernel code, and a description of the hardware architecture, contained in a local ''boot_info'' data-structure, . 13 14 This fixed size ''boot_info'' structure is build by the boot-loader, and stored at the beginning of the local copy of the kdata segment. As it contains both general and cluster specific information, the content depends on the cluster: 11 As the generic (i.e. architecture independent) kernel initialization procedure is executed in parallel by all kernel instances in all clusters containing at least one core and one memory bank, the main task of the bootloader is to load - in each cluster - a local copy of the ALMOS-MKH kernel code, and a description of the hardware architecture, contained in a local ''boot_info'' data-structure, . 12 13 This fixed size '''boot_info''' structure is build by the boot-loader, and stored at the beginning of the local copy of the kdata segment. As it contains both general and cluster specific information, the content depends on the cluster: 15 14 * general hardware architecture features : number of clusters, topology, etc. 16 15 * available external (shared) peripherals : types and features. … … 19 18 * available physical memory in cluster. 20 19 21 This boot_infostructure is defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/tools/arch_info/boot_info.h almos-mkh/tools/arch_info/boot_info.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/tools/arch_info/boot_info.c almos-mkh/tools/arch_info_info/boot_info.c] files.20 This '''boot_info''' structure is defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/tools/arch_info/boot_info.h almos-mkh/tools/arch_info/boot_info.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/tools/arch_info/boot_info.c almos-mkh/tools/arch_info_info/boot_info.c] files. 22 21 23 22 To build the various boot_info structures (one per cluster), the boot-loader uses the '''arch_info''' binary structure, that is described in 24 section [wiki:arch_info Hardware Platform Definition]. This '''arch_info''' structure is defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/tools/arch_info/arch_info.h almos-mkh/tools/arch_info/arch_info.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/tools/arch_info/arch_info.c almos-mkh/tools/arch_info/arch_info.c] files. 23 section [wiki:arch_info Hardware Platform Definition]. 24 25 This '''arch_info''' structure is defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/tools/arch_info/arch_info.h almos-mkh/tools/arch_info/arch_info.h] and [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/tools/arch_info/arch_info.c almos-mkh/tools/arch_info/arch_info.c] files. 26 25 27 To be accessed by the boot loader, the binary file '''arch_info.bin''' file must be stored on disk, in the file system root directory. 26 28 27 This method allows an intelligent boot_loader to check and - if required - reconfigure the hardware components, to guaranty that the generated boot_info_tstructures contain only functionally tested hardware components.29 This method allows an intelligent boot_loader to check the hardware components, to guaranty that the generated '''boot_info''' structures contain only functionally tested hardware components. 28 30 29 31 We describe below the boot_loader for the TSAR architecture, the boot_loader for the I86 architecture, and the generic kernel initialization procedure. … … 31 33 == B) __Boot-loader for the TSAR architecture__ == 32 34 33 The TSAR boot-loader uses an OS-independent '''pre-loader''', stored in an addressable but non-volatile device, that load the TSAR34 '''boot -loader''' code from an external block-device to the cluster 0 physical memory. This preloader is specific for the TSAR architecture, butindependent on the Operating System. It is used by ALMOS-MKH, but also by LINUX, NetBSD, ALMOS_MKH, or the GIET-VM.35 The bootloader uses an OS-independent '''preloader''', stored in an addressable but non-volatile device, that load the 36 '''bootloader''' code from an external block-device to the cluster 0 physical memory. This preloader is specific for the TSAR architecture, but is independent on the Operating System. It is used by ALMOS-MKH, but also by LINUX, NetBSD, ALMOS_MKH, or the GIET-VM. 35 37 36 38 The TSAR boot_loader allocates - in each cluster containing a physical memory bank - six fixed size memory zones, to store various 37 binary files or data structures. The two first zones are permanently allocated: The '''PRE_LOADER''' zone is only defined in cluster 0, and contains the pre-loader code. The '''KERNEL_CODE''' zone containing the ''kcode'' and ''kdata'' sgments is directly used by the kernel when the boot_loader transfers control - in each cluster - to the kernel_init procedure. The '''BOOT_CODE''', '''ARCH_INFO''', '''KERNEL_ELF''', and '''BOOT_STACK''' zones are temporary: they are only used - in each cluster - by the boot-loader code, andthe corresponding physical memory can be freely re-allocated by the local kernel instance when it starts execution.39 binary files or data structures. The two first zones are permanently allocated: The '''PRE_LOADER''' zone can contain (for example in the TSAR-LETI architecture) the preloader code. The '''KERNEL_CODE''' zone containing the ''kcode'' and ''kdata'' sgments is directly used by the kernel when the bootloader transfers control - in each cluster - to the kernel_init procedure. The '''BOOT_CODE''', '''ARCH_INFO''', '''KERNEL_ELF''', and '''BOOT_STACK''' zones are temporary: they are only used - in each cluster - by the boot-loader code, but the corresponding physical memory can be freely re-allocated by the local kernel instance when it starts execution. 38 40 39 41 || name || description || base address (physical) || size || … … 50 52 * the BOOT_CODE zone (containing the boot loader instructions and data) must be entirely contained in the next big physical page, because it will be mapped in the boot-loader page table to allow the cores to access locally the boot code as soon as it has been copied in the local cluster. 51 53 52 A core[cxy][lid] is identified by two indexes: '''cxy''' is the cluster identifier, an '''lid''' is the core local index in cluster. 53 The CP0 register containing the core gid (global hardware identifier) has a fixed format: '''gid''' = ('''cxy''' << 2) + '''lid''' 54 For almos-mkh, a core is identified by two - architecture independent - indexes: '''cxy''' is the cluster identifier, an '''lid''' is the core local index in cluster. 55 56 For the TSAR architecture, the MIPS32 CP0 register containing the core gid (global hardware identifier) that has a fixed format: '''gid''' = ('''cxy''' << 2) + '''lid''' 54 57 55 58 All cores contribute to the boot procedure, but all cores are not simultaneously active: … … 58 61 * in the last phase - fully parallel - all core[cxy][lid] are running. 59 62 60 We describe below the f our phases of the TSAR boot-loader:61 62 === B1. Pre -loader ===63 64 * In the TSAR_LETI architecture, the pre -loader code is stored in the first 16 kbytes of the physical address space in cluster 0.63 We describe below the five phases of the TSAR bootloader: 64 65 === B1. Preloader === 66 67 * In the TSAR_LETI architecture, the preloader code is stored in the first 16 kbytes of the physical address space in cluster 0. 65 68 * 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 69 67 At reset, the MMU is de-activated (for both data and instructions), and the extension address register supporting direct access to remote memory banks (for data only) contain the 0 value. 68 Therefore, all cores can only access the physical address space of cluster 0. 69 70 All cores execute the same pre-loader code, but the work done depends on the core identifier: 70 At reset, the MMU is de-activated (for both data and instructions), and the extension address register supporting direct access to remote memory banks (for data only) contain the 0 value. Therefore, in this first phase, all cores can only access the physical address space of cluster 0. 71 72 All cores execute the same preloader code, but the work done depends on the core identifier: 71 73 * The core[0][0] load in the BOOT_CODE zone of cluster 0, the boot-loader code stored on disk. 72 74 * 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). 73 75 74 === B2. Boot -loader entry ===75 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, but not at the same time.76 === B2. Bootloader entry === 77 78 The first instructions of the bootloader are defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/boot/tsar_mips32/boot_entry.S almos-mkh/boot/tsar_mips32/boot_entry.S] file. This assembly code is executed by all cores entering the boot-loader, but not at the same time. 77 79 78 80 Each core running this assembly code makes the 3 following actions: … … 85 87 In this phase, only core [0][0] is running, while all other cores are blocked in the preloader, waiting to be activated by an IPI. 86 88 87 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. 88 89 Each core running this assembly code makes the 3 following actions: 90 * 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, 91 * It changes the value of the DATA address extension CP2 register, using the '''cxy''' value extracted from the '''gid''', to force all cores to use the local stack segments. 92 * It jumps to the boot_loader() C function defined in the ''boot.c'' file, passing the two (cxy , lid) arguments. 93 94 In this sequencial phase, the core[0][0] executing this C function makes the following actions: 89 In this sequencial phase, the core[0][0] executes the boot_loader() C function, defined in the [https://www-soc.lip6.fr/trac/almos-mkh/browser/trunk/boot/tsar_mips32/boot.c almos-mkh/boot/tsar_mips32/boot.c] function. 90 91 It makes the following actions: 95 92 * The core[0][0] initializes 2 peripherals: The '''TTY''' terminal (channel 0) to display log messages, and the '''IOC''' peripheral to access the disk file system. 96 93 * The core[0][0] initializes the boot-loader FAT32, allowing the boot loader to access files stored in the FAT32 file system on disk. … … 103 100 === B4. Boot-loader partially parallel phase === 104 101 105 In this phase all core[cxy][0], other than the core[0][0] are running .102 In this phase all core[cxy][0], other than the core[0][0] are running (one core per cluster). 106 103 107 104 At this point, all DATA extension registers point already on the local cluster( to use the local stack).