Changes in kernel/arch/amd64/src/boot/multiboot.S [4bf0926e:17af882] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/boot/multiboot.S
r4bf0926e r17af882 29 29 */ 30 30 31 #include <abi/asmtool.h>32 31 #include <arch/boot/boot.h> 33 32 #include <arch/mm/page.h> … … 65 64 66 65 .align 4 66 .global multiboot_image_start 67 67 multiboot_header: 68 68 .long MULTIBOOT_HEADER_MAGIC … … 75 75 .long multiboot_image_start 76 76 77 SYMBOL(multiboot_image_start) 77 multiboot_image_start: 78 78 cli 79 79 cld … … 168 168 169 169 movl %cr4, %eax 170 orl $CR4_PAE, %eax170 btsl $5, %eax 171 171 movl %eax, %cr4 172 172 … … 176 176 177 177 /* Enable long mode */ 178 movl $ AMD_MSR_EFER, %ecx178 movl $EFER_MSR_NUM, %ecx 179 179 rdmsr /* read EFER */ 180 orl $AMD_LME, %eax/* set LME = 1 */180 btsl $AMD_LME_FLAG, %eax /* set LME = 1 */ 181 181 wrmsr 182 182 183 183 /* Enable paging to activate long mode (set CR0.PG = 1) */ 184 184 movl %cr0, %eax 185 orl $CR0_PG, %eax185 btsl $31, %eax 186 186 movl %eax, %cr0 187 187 … … 427 427 long_status $status_long 428 428 429 /* Call a md64_pre_main(multiboot_eax, multiboot_ebx) */429 /* Call arch_pre_main(multiboot_eax, multiboot_ebx) */ 430 430 movl multiboot_eax, %edi 431 431 movl multiboot_ebx, %esi 432 433 #ifdef MEMORY_MODEL_large 434 movabsq $amd64_pre_main, %rax 435 callq *%rax 436 #else 437 callq amd64_pre_main 438 #endif 439 432 callq arch_pre_main 433 440 434 long_status $status_main 441 435 442 436 /* Call main_bsp() */ 443 #ifdef MEMORY_MODEL_large 444 movabsq $main_bsp, %rax 445 callq *%rax 446 #else 447 callq main_bsp 448 #endif 437 callq main_bsp 449 438 450 439 /* Not reached */ … … 633 622 ptl2gen 512 7 634 623 635 #ifdef MEMORY_MODEL_kernel636 624 .align 4096 637 625 ptl_1: … … 650 638 .quad ptl_2_1g + (PTL_WRITABLE | PTL_PRESENT) 651 639 652 .align 4096 653 SYMBOL(ptl_0) 640 641 .align 4096 642 .global ptl_0 643 ptl_0: 654 644 .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT) 655 645 .fill 510, 8, 0 656 646 .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT) 657 #endif658 659 #ifdef MEMORY_MODEL_large660 .align 4096661 ptl_1:662 /* Identity mapping for [0; 8G) */663 .quad ptl_2_0g + (PTL_WRITABLE | PTL_PRESENT)664 .quad ptl_2_1g + (PTL_WRITABLE | PTL_PRESENT)665 .quad ptl_2_2g + (PTL_WRITABLE | PTL_PRESENT)666 .quad ptl_2_3g + (PTL_WRITABLE | PTL_PRESENT)667 .quad ptl_2_4g + (PTL_WRITABLE | PTL_PRESENT)668 .quad ptl_2_5g + (PTL_WRITABLE | PTL_PRESENT)669 .quad ptl_2_6g + (PTL_WRITABLE | PTL_PRESENT)670 .quad ptl_2_7g + (PTL_WRITABLE | PTL_PRESENT)671 .fill 504, 8, 0672 673 .align 4096674 SYMBOL(ptl_0)675 .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT)676 .fill 255, 8, 0677 .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT)678 .fill 255, 8, 0679 #endif680 647 681 648 .section K_DATA_START, "aw", @progbits 682 649 683 SYMBOL(bootstrap_idtr) 650 .global bootstrap_idtr 651 bootstrap_idtr: 684 652 .word 0 685 653 .long 0 686 654 687 SYMBOL(bootstrap_gdtr) 655 .global bootstrap_gdtr 656 bootstrap_gdtr: 688 657 .word GDT_SELECTOR(GDT_ITEMS) 689 658 .long KA2PA(gdt) 690 659 691 SYMBOL(multiboot_eax) 660 .global multiboot_eax 661 multiboot_eax: 692 662 .long 0 693 663 694 SYMBOL(multiboot_ebx) 664 .global multiboot_ebx 665 multiboot_ebx: 695 666 .long 0 696 667
Note:
See TracChangeset
for help on using the changeset viewer.