Changeset 4b241f3 in mainline
- Timestamp:
- 2009-03-01T19:27:33Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bf25efb
- Parents:
- bc18d63
- Location:
- kernel
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/Makefile.inc
rbc18d63 r4b241f3 100 100 arch/$(KARCH)/src/drivers/vesa.c \ 101 101 arch/$(KARCH)/src/boot/boot.S \ 102 arch/$(KARCH)/src/boot/cboot.c \ 102 103 arch/$(KARCH)/src/boot/memmap.c \ 103 104 arch/$(KARCH)/src/fpu_context.c \ -
kernel/arch/ia32/src/boot/boot.S
rbc18d63 r4b241f3 102 102 mov %bx, KA2PA(vesa_bpp) 103 103 #endif 104 104 105 105 call map_kernel # map kernel and turn paging on 106 106 107 107 movl grub_eax, %eax 108 108 movl grub_ebx, %ebx 109 109 cmpl $MULTIBOOT_LOADER_MAGIC, %eax # compare GRUB signature 110 110 je valid_boot 111 111 112 112 xorl %ecx, %ecx # no memory map available 113 113 movl %ecx, e820counter 114 114 115 115 jmp invalid_boot 116 116 117 117 valid_boot: 118 119 movl (%ebx), %eax # ebx = physical address of struct multiboot_info 120 121 bt $3, %eax # mbi->flags[3] (mods_count, mods_addr valid) 122 jc mods_valid 123 124 xorl %ecx, %ecx 125 movl %ecx, init 126 jmp mods_end 127 128 mods_valid: 129 130 movl 20(%ebx), %ecx # mbi->mods_count 131 movl %ecx, init 132 133 cmpl $0, %ecx 134 je mods_end 135 136 movl 24(%ebx), %esi # mbi->mods_addr 137 movl $init, %edi 138 139 mods_loop: 140 141 movl 0(%esi), %edx # mods->mod_start 142 addl $0x80000000, %edx 143 movl %edx, 4(%edi) 144 145 movl 4(%esi), %edx 146 subl 0(%esi), %edx # mods->mod_end - mods->mod_start 147 movl %edx, 8(%edi) 148 149 addl $16, %esi 150 addl $8 , %edi 151 152 loop mods_loop 153 154 mods_end: 155 156 bt $6, %eax # mbi->flags[6] (mmap_length, mmap_addr valid) 157 jc mmap_valid 158 159 xorl %edx, %edx 160 jmp mmap_invalid 161 162 mmap_valid: 163 movl 44(%ebx), %ecx # mbi->mmap_length 164 movl 48(%ebx), %esi # mbi->mmap_addr 165 movl $e820table, %edi 166 xorl %edx, %edx 167 168 mmap_loop: 169 cmpl $0, %ecx 170 jle mmap_end 171 172 movl 4(%esi), %eax # mmap->base_addr_low 173 movl %eax, (%edi) 174 175 movl 8(%esi), %eax # mmap->base_addr_high 176 movl %eax, 4(%edi) 177 178 movl 12(%esi), %eax # mmap->length_low 179 movl %eax, 8(%edi) 180 181 movl 16(%esi), %eax # mmap->length_high 182 movl %eax, 12(%edi) 183 184 movl 20(%esi), %eax # mmap->type 185 movl %eax, 16(%edi) 186 187 movl (%esi), %eax # mmap->size 188 addl $0x4, %eax 189 addl %eax, %esi 190 subl %eax, %ecx 191 addl $MEMMAP_E820_RECORD_SIZE, %edi 192 incl %edx 193 jmp mmap_loop 194 195 mmap_end: 196 197 mmap_invalid: 198 movl %edx, e820counter 199 118 119 movl grub_eax, %eax 120 movl grub_ebx, %ebx 121 122 # ia32_boot(grub_eax, grub_ebx) 123 pushl %ebx 124 pushl %eax 125 call ia32_cboot # Does not return. 126 127 # Not reached. 128 200 129 invalid_boot: 201 202 #ifdef CONFIG_SMP203 204 # copy AP bootstrap routines below 1 MB205 206 movl $BOOT_OFFSET, %esi207 movl $AP_BOOT_OFFSET, %edi208 movl $_hardcoded_unmapped_size, %ecx209 rep movsb210 211 #endif212 213 call main_bsp # never returns214 130 215 131 cli -
kernel/generic/include/main/main.h
rbc18d63 r4b241f3 36 36 #define KERN_MAIN_H_ 37 37 38 #include <arch/types.h> 39 38 40 extern uintptr_t stack_safe; 41 42 extern void main_bsp(void); 43 extern void main_ap(void); 39 44 40 45 #endif -
kernel/generic/src/main/main.c
rbc18d63 r4b241f3 82 82 #include <smp/smp.h> 83 83 #include <ddi/ddi.h> 84 84 #include <main/main.h> 85 85 86 86 /** Global configuration structure. */ … … 114 114 /** Lowest safe stack virtual address. */ 115 115 uintptr_t stack_safe = 0; 116 117 void main_bsp(void);118 void main_ap(void);119 116 120 117 /*
Note:
See TracChangeset
for help on using the changeset viewer.