Changeset f6297e0 in mainline for arch/ia32/src/boot
- Timestamp:
- 2005-09-03T15:45:14Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ab08b42
- Parents:
- 2f08a55d
- File:
-
- 1 edited
-
arch/ia32/src/boot/boot.S (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/boot/boot.S
r2f08a55d rf6297e0 32 32 .global kernel_image_start 33 33 34 KTEXT=8 35 KDATA=16 36 34 37 .code16 35 38 # … … 45 48 xorw %ax, %ax 46 49 movw %ax, %ds 47 movw %ax, %ss # initialize stack segment register48 movl $ 0x7c00, %esp# initialize stack pointer50 movw %ax, %ss # initialize stack segment register 51 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer 49 52 50 53 call memmap_arch_init 51 54 52 lgdt gdtr# initialize Global Descriptor Table register55 lgdt bsp_bootstrap_gdtr # initialize Global Descriptor Table register 53 56 54 57 movl %cr0, %eax 55 58 orl $0x1, %eax 56 movl %eax, %cr0 # switch to protected mode59 movl %eax, %cr0 # switch to protected mode 57 60 58 jmpl $ 8, $boot_image_start61 jmpl $KTEXT, $boot_image_start 59 62 60 63 .code32 … … 71 74 72 75 boot_image_start: 73 movw $ 16, %ax76 movw $KDATA, %ax 74 77 movw %ax, %es 75 78 movw %ax, %gs … … 85 88 outb %al, $0x60 86 89 87 movl $ 0x8000, %esi88 movl $ 0x8000+ BOOT_OFFSET, %edi90 movl $BOOTSTRAP_OFFSET, %esi 91 movl $BOOTSTRAP_OFFSET + BOOT_OFFSET, %edi 89 92 movl $_hardcoded_kernel_size, %ecx 90 93 cld … … 94 97 95 98 multiboot_image_start: 96 movl $0x7c00, %esp # initialize stack pointer99 movl BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer 97 100 98 lgdt gdtr 101 lgdt gdtr # initialize Global Descriptor Table register 99 102 100 movw $ 16, %ax103 movw $KDATA, %ax 101 104 movw %ax, %es 102 105 movw %ax, %gs 103 106 movw %ax, %fs 104 movw %ax, %ds # kernel data + stack107 movw %ax, %ds # kernel data + stack 105 108 movw %ax, %ss 106 109 107 call map_kernel # map kernel and turn paging on110 call map_kernel # map kernel and turn paging on 108 111 109 112 protected: 110 call main_bsp # never returns113 call main_bsp # never returns 111 114 112 115 cli
Note:
See TracChangeset
for help on using the changeset viewer.
