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