Changeset c245372b in mainline for arch/amd64/src/boot/boot.S
- Timestamp:
- 2005-08-29T13:56:47Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4dd0704
- Parents:
- b52da8d7
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/amd64/src/boot/boot.S
rb52da8d7 rc245372b 40 40 # 41 41 kernel_image_start: 42 cli 43 xorw %ax,%ax 44 movw %ax,%ds 45 movw %ax,%ss # initialize stack segment register 46 movl $0x7c00,%esp # initialize stack pointer 47 48 call memmap_arch_init 49 50 mov $0x80000000, %eax 51 cpuid 52 cmp $0x80000000, %eax # any function > 80000000h? 53 jbe no_long_mode 54 mov $0x80000001, %eax # Extended function code 80000001 55 cpuid 56 bt $29, %edx # Test if long mode is supported. 57 jnc no_long_mode 42 58 43 meeting_point: 44 .code32 59 # Fill out GDTR.base, IDTR.base 60 leal gdtr, %eax 61 movl gdt_addr, %ebx 62 movl %ebx, 2(%eax) 45 63 64 movl idt_addr, %ebx 65 leal idtr, %eax 66 movl %ebx, 2(%eax) 46 67 47 .section K_DATA_START 68 # Load gdtr, idtr 69 lgdt gdtr 70 lidt idtr 71 72 mov $1, %eax # Enable protected mode (CR0.PE = 1) 73 mov %eax, %cr0 48 74 75 jmpl $8, $now_in_prot 76 77 now_in_prot: 78 79 80 no_long_mode: 81 1: 82 jmp 1b 83 84 85 .section K_DATA_START 49 86 .align 4096 50 87 page_directory: 51 88 .space 4096, 0 89 90 gdt_addr: 91 .quad gdt + 0x80000000 92 idt_addr: 93 .quad idt + 0x80000000
Note:
See TracChangeset
for help on using the changeset viewer.