Skip to content
Mohamed Anwar edited this page Apr 4, 2018 · 2 revisions

All files relevant to (bootstrap) CPU Initialization should be fully contained in kernel/arch/{ARCH}/cpu/

x86

cpu_init is defined in cpu/init.c it sets up everything required for kernel to work on x86, here is how it looks like

void cpu_init(void)
{
    x86_gdt_setup(); /* defined in cpu/gdt.c */
    x86_idt_setup(); /* defined in cpu/idt.c */
    x86_isr_setup(); /* defined in cpu/isr.c */

    /* Process boot info into generic boot structure */
    struct boot *boot = process_multiboot_info(multiboot_info);

    pmm_setup(boot); /* Physical Memory Manager Setup */
    vmm_setup(); /* Virtual Memory Manager Setup */
    
    chipset_init(); /* Initialize chipset */

    kmain(boot); /* Start kernel main function */
}

Clone this wiki locally