Changeset b0edf3b2 in mainline for arch/ia32/src/boot/boot.S
- Timestamp:
- 2005-09-09T11:59:25Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 38de8a5
- Parents:
- ba1b7393
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/boot/boot.S
rba1b7393 rb0edf3b2 54 54 movw %ax, %ds 55 55 movw %ax, %ss # initialize stack segment register 56 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer56 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer 57 57 58 58 call memmap_arch_init 59 59 60 lgdt real_bootstrap_gdtr_boot # initialize Global Descriptor Table register60 lgdt real_bootstrap_gdtr_boot # initialize Global Descriptor Table register 61 61 62 62 movl %cr0, %eax … … 83 83 movw %ax, %gs 84 84 movw %ax, %fs 85 movw %ax, %ds # kernel data + stack85 movw %ax, %ds # kernel data + stack 86 86 movw %ax, %ss 87 87 88 movb $0xd1, %al # enable A20 using the keyboard controller88 movb $0xd1, %al # enable A20 using the keyboard controller 89 89 outb %al, $0x64 90 90 movb $0xdf, %al … … 97 97 rep movsb 98 98 99 call map_kernel # map kernel and turn paging on100 101 call main_bsp # never returns99 call map_kernel # map kernel and turn paging on 100 101 call main_bsp # never returns 102 102 103 103 cli … … 105 105 106 106 multiboot_image_start: 107 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer108 109 lgdt protected_bootstrap_gdtr - 0x80000000 # initialize Global Descriptor Table register107 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer 108 109 lgdt protected_bootstrap_gdtr - 0x80000000 # initialize Global Descriptor Table register 110 110 111 111 movw $KDATA, %cx … … 113 113 movw %cx, %gs 114 114 movw %cx, %fs 115 movw %cx, %ds 115 movw %cx, %ds # kernel data + stack 116 116 movw %cx, %ss 117 117 … … 119 119 multiboot_meeting_point: 120 120 121 pushl %ebx 121 pushl %ebx # save parameters from GRUB 122 122 pushl %eax 123 123 … … 128 128 rep movsb 129 129 130 call map_kernel 130 call map_kernel # map kernel and turn paging on 131 131 132 132 popl %eax 133 133 popl %ebx 134 cmpl $MULTIBOOT_LOADER_MAGIC, %eax # compare GRUB signature134 cmpl $MULTIBOOT_LOADER_MAGIC, %eax # compare GRUB signature 135 135 je valid_boot 136 136 … … 204 204 invalid_boot: 205 205 206 call main_bsp - BOOT_OFFSET 206 call main_bsp - BOOT_OFFSET # never returns 207 207 208 208 cli … … 217 217 movl %cr4, %ecx 218 218 orl $(1<<4), %ecx 219 movl %ecx, %cr4 # turn PSE on219 movl %ecx, %cr4 # turn PSE on 220 220 221 221 movl $((1<<7)|(1<<0)), %eax 222 movl %eax, page_directory # mapping 0x00000000 => 0x00000000222 movl %eax, page_directory # mapping 0x00000000 => 0x00000000 223 223 224 224 movl $(page_directory+2048), %edx 225 movl %eax, (%edx) # mapping 0x80000000 => 0x00000000225 movl %eax, (%edx) # mapping 0x80000000 => 0x00000000 226 226 227 227 leal page_directory, %eax
Note:
See TracChangeset
for help on using the changeset viewer.