Changes between Version 25 and Version 26 of boot_procedure

May 3, 2017, 6:57:47 PM (5 years ago)



  • boot_procedure

    v25 v26  
    5252Le chargement d'ALMOS-MK sur l'architecture TSAR se fait donc en 4 phases:
    5353A core is identified by  two indexes[cxy][lid] : ''cxy'' is the cluster identifier, an ''lid'' is the core local index in cluster cxy.
    54  In all clusters, the core with local index 0 is called ''CP0''.
     54In all clusters, the core with local index 0 is called ''CP0''.
    5656=== B1. Preloader phase ===
    119119== D) Generic kernel initialization procedure
     121The kernel_init( boot_info_t * info ) function is the kernel entry point when the boot_loader transfer control to kernel.
     122The ''info'' argument is a pointer on the fixed size boot_info_t structure, that is stored in the data kernel segment.
     124All cores execute this procedure in parallel, but some tasks are only executed by the CP0 core.
     125This procedure uses two synchronisation barriers, defined as global variables in the data segment:
     126 * the global_barrier variable is used to synchronize all CP0 cores in all clusters containing a kernel instance.
     127 * the local_barrier variable is used to synchronize all cores in a given cluster.
     129The kernel initialization procedure execute sequentially the following steps:
     131=== D1) Core and cluster identification ===
     133Each core has an unique hardware identifier, called '''gid''', that is hard-wired in a read-only register.
     134From 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.
     135In 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.
     136Then the CP0 initialize the global variable '''local_cxy''' defining the local cluster identifier.
     138=== D2) TXT0 device initialization ===
     140The core[io_cxy][0] (i.e. CP0 in I/O cluster) initializes the chdev descriptor associated to the kernel text terminal 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 :
     141the calling thread call directly the relevant TXT driver, without using a server thread.
     143A first synchonization barrier is used to avoid other cores to use the TXT0 terminal before initialization completion.
     145=== D3) Cluster manager Initialization ===
     147In Each cluster the CP0 makes the cluster manager initialization, namely the cores descriptors array, and the physical memory allocators.
     148Then it initializes the local process_zero, containing al kernel threads in a given cluster.
     150A second synchonization barrier is used to avoid other cores to access cluster manager before initialization completion.
     152=== D4) Internal & external devices Initialization ===
     154In each cluster, the CP0 makes the devices initialization. For multi-channels devices, there is one channel device (called chdev_t) per channel.
     155For internal (replicated) devices, the khedive descriptors are allocated in the local cluster. For external (shared) devices, the chdev descriptors are regularly distributed on all clusters. These external chdev are indexed by a global index, and the host cluster is computed from this
     156index by a modulo.
     158The internal devices descriptors are created first( ICU, then MMC, then DMA ), because the ICU device is used by all other devices.
     159Then the WTI mailboxes used for IPIs (Inter Processor Interrupt) are allocated in local ICU : one WTI mailbox per core.
     160Then each external chdev descriptor is created by the CP0 in the cluster where it must be created.
     162A third synchonization barrier is used to avoid other cores to access devices before initialization completion. 
     164=== D5) Idle thread Initialization ===
     166In this step, each core creates and initializes, its private idle thread.
     168=== D6) File system initialization ===
     170The CP0 in I/O cluster) initializes the file system.
     172A fourth synchonization barrier is used to avoid other cores to access file system before initialization completion. 
     174=== D7) Scheduler activation ===
     176Finally, each core enables its private timer IRQ to activate its private scheduler, and jump to the idle thread code.