Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/boot/multiboot2.S

    r36df4109 r17af882  
    2727 */
    2828
    29 #include <abi/asmtool.h>
    3029#include <arch/boot/boot.h>
    3130#include <arch/mm/page.h>
     
    4241
    4342.align 8
     43.global multiboot2_image_start
    4444multiboot2_header_start:
    4545        .long MULTIBOOT2_HEADER_MAGIC
     
    4949       
    5050        /* Information request tag */
    51         .align 8
    5251        tag_info_req_start:
    5352                .word MULTIBOOT2_TAG_INFO_REQ
     
    6261       
    6362        /* Address tag */
    64         .align 8
    6563        tag_address_start:
    6664                .word MULTIBOOT2_TAG_ADDRESS
     
    7472       
    7573        /* Entry address tag */
    76         .align 8
    7774        tag_entry_address_start:
    7875                .word MULTIBOOT2_TAG_ENTRY_ADDRESS
     
    8380       
    8481        /* Flags tag */
    85         .align 8
    8682        tag_flags_start:
    8783                .word MULTIBOOT2_TAG_FLAGS
     
    9389#ifdef CONFIG_FB
    9490        /* Framebuffer tag */
    95         .align 8
    9691        tag_framebuffer_start:
    9792                .word MULTIBOOT2_TAG_FRAMEBUFFER
     
    105100       
    106101        /* Module alignment tag */
    107         .align 8
    108102        tag_module_align_start:
    109103                .word MULTIBOOT2_TAG_MODULE_ALIGN
     
    114108       
    115109        /* Tag terminator */
    116         .align 8
    117110        tag_terminator_start:
    118111                .word MULTIBOOT2_TAG_TERMINATOR
     
    122115multiboot2_header_end:
    123116
    124 SYMBOL(multiboot2_image_start)
     117multiboot2_image_start:
    125118        cli
    126119        cld
     
    209202       
    210203        movl %cr4, %eax
    211         orl $CR4_PAE, %eax
     204        btsl $5, %eax
    212205        movl %eax, %cr4
    213206       
     
    217210       
    218211        /* Enable long mode */
    219         movl $AMD_MSR_EFER, %ecx
     212        movl $EFER_MSR_NUM, %ecx
    220213        rdmsr                     /* read EFER */
    221         orl $AMD_LME, %eax        /* set LME = 1 */
     214        btsl $AMD_LME_FLAG, %eax  /* set LME = 1 */
    222215        wrmsr
    223216       
    224217        /* Enable paging to activate long mode (set CR0.PG = 1) */
    225218        movl %cr0, %eax
    226         orl $CR0_PG, %eax
     219        btsl $31, %eax
    227220        movl %eax, %cr0
    228221       
     
    250243        movq %rsp, %rbp
    251244       
    252         /* Call amd64_pre_main(multiboot_eax, multiboot_ebx) */
     245        /* Call arch_pre_main(multiboot_eax, multiboot_ebx) */
    253246        movl multiboot_eax, %edi
    254247        movl multiboot_ebx, %esi
    255         callq amd64_pre_main
     248        callq arch_pre_main
    256249       
    257250        /* Call main_bsp() */
Note: See TracChangeset for help on using the changeset viewer.