Changeset 66def8d in mainline for arch/ia32/src/boot/boot.S
- Timestamp:
- 2006-01-08T17:51:36Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8725fb4
- Parents:
- 078a0a1
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ia32/src/boot/boot.S
r078a0a1 r66def8d 1 1 # 2 2 # Copyright (C) 2001-2004 Jakub Jermar 3 # Copyright (C) 2005-2006 Martin Decky 3 4 # All rights reserved. 4 5 # … … 32 33 #include <arch/pm.h> 33 34 35 #define START_STACK (BOOT_OFFSET - BOOT_STACK_SIZE) 36 34 37 .section K_TEXT_START, "ax" 35 38 … … 39 42 .code32 40 43 .align 4 44 .global multiboot_image_start 41 45 multiboot_header: 42 46 .long MULTIBOOT_HEADER_MAGIC 43 47 .long MULTIBOOT_HEADER_FLAGS 44 48 .long -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) # checksum 45 .long multiboot_header + BOOT_OFFSET46 .long unmapped_ktext_start + BOOT_OFFSET49 .long multiboot_header 50 .long unmapped_ktext_start 47 51 .long 0 48 52 .long 0 49 .long multiboot_image_start + BOOT_OFFSET53 .long multiboot_image_start 50 54 51 55 multiboot_image_start: 52 movl $BOOTSTRAP_OFFSET - 0x400, %esp # initialize stack pointer 53 54 lgdt protected_bootstrap_gdtr - 0x80000000 # initialize Global Descriptor Table register 56 movl $START_STACK, %esp # initialize stack pointer 57 lgdt KA2PA(bootstrap_gdtr) # initialize Global Descriptor Table register 55 58 56 59 movw $KDATA, %cx … … 58 61 movw %cx, %gs 59 62 movw %cx, %fs 60 movw %cx, %ds 63 movw %cx, %ds # kernel data + stack 61 64 movw %cx, %ss 62 65 63 jmpl $KTEXT, $multiboot_meeting_point + BOOT_OFFSET66 jmpl $KTEXT, $multiboot_meeting_point 64 67 multiboot_meeting_point: 65 68 66 69 pushl %ebx # save parameters from GRUB 67 70 pushl %eax 68 69 movl $BOOTSTRAP_OFFSET + BOOT_OFFSET, %esi70 movl $BOOTSTRAP_OFFSET, %edi71 movl $_hardcoded_unmapped_size, %ecx72 cld73 rep movsb74 71 75 72 call map_kernel # map kernel and turn paging on … … 171 168 invalid_boot: 172 169 173 call main_bsp - BOOT_OFFSET # never returns 170 #ifdef CONFIG_SMP 171 172 # copy AP bootstrap routines below 1 MB 173 174 movl $BOOT_OFFSET, %esi 175 movl $AP_BOOT_OFFSET, %edi 176 movl $_hardcoded_unmapped_size, %ecx 177 cld 178 rep movsb 179 180 #endif 181 182 call main_bsp # never returns 174 183 175 184 cli … … 215 224 page_directory: 216 225 .space 4096, 0 217 218 .global real_bootstrap_gdtr_boot219 real_bootstrap_gdtr_boot:220 .word selector(GDT_ITEMS)221 .long KA2PA(gdt)-BOOT_OFFSET222
Note:
See TracChangeset
for help on using the changeset viewer.