Changeset 8ccec3c1 in mainline for arch/ia32/src/boot/boot.S
- Timestamp:
- 2006-01-04T22:41:05Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 45ba9cf
- Parents:
- a59e81e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/boot/boot.S
ra59e81e r8ccec3c1 33 33 34 34 .section K_TEXT_START, "ax" 35 .global kernel_image_start36 35 37 36 KTEXT=8 38 37 KDATA=16 39 38 40 .code1641 #42 # This is where we require any SPARTAN-kernel-compatible boot loader43 # to pass control in real mode.44 #45 # Protected mode tables are statically initialised during compile46 # time. So we can just load the respective table registers and47 # switch to protected mode.48 #49 kernel_image_start:50 cli51 xorw %ax, %ax52 movw %ax, %ds53 movw %ax, %es54 movw %ax, %ss # initialize stack segment register55 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer56 57 call memmap_arch_init58 59 lgdt real_bootstrap_gdtr_boot # initialize Global Descriptor Table register60 61 movl %cr0, %eax62 orl $0x1, %eax63 movl %eax, %cr0 # switch to protected mode64 65 jmpl $KTEXT, $boot_image_start66 67 39 .code32 68 40 .align 4 … … 77 49 .long multiboot_image_start + BOOT_OFFSET 78 50 79 boot_image_start:80 movw $KDATA, %ax81 movw %ax, %es82 movw %ax, %gs83 movw %ax, %fs84 movw %ax, %ds # kernel data + stack85 movw %ax, %ss86 87 movb $0xd1, %al # enable A20 using i8042 controller88 outb %al, $0x6489 movb $0xdf, %al90 outb %al, $0x6091 92 movl $BOOTSTRAP_OFFSET, %esi93 movl $BOOTSTRAP_OFFSET + BOOT_OFFSET, %edi94 movl $_hardcoded_kernel_size, %ecx95 cld96 rep movsb97 98 call map_kernel # map kernel and turn paging on99 100 call main_bsp # never returns101 102 cli103 hlt104 105 51 multiboot_image_start: 106 52 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer
Note:
See TracChangeset
for help on using the changeset viewer.