Changeset 6e5252a in mainline for kernel/arch/ia32
- Timestamp:
- 2018-11-13T20:22:20Z (7 years ago)
- Children:
- 156bae23
- Parents:
- 2214382
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-23 21:48:41)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-13 20:22:20)
- Location:
- kernel/arch/ia32
- Files:
-
- 7 edited
-
_link.ld.in (modified) (3 diffs)
-
include/arch/boot/boot.h (modified) (1 diff)
-
src/boot/multiboot.S (modified) (2 diffs)
-
src/boot/multiboot2.S (modified) (1 diff)
-
src/ia32.c (modified) (1 diff)
-
src/mm/frame.c (modified) (2 diffs)
-
src/smp/ap.S (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/_link.ld.in
r2214382 r6e5252a 14 14 ENTRY(multiboot_image_start) 15 15 16 PHDRS { 17 ap_boot PT_LOAD ; 18 unmapped PT_LOAD ; 19 mapped PT_LOAD ; 20 } 21 16 22 SECTIONS { 17 23 kernel_load_address = PA2KA(BOOT_OFFSET); 18 24 19 .unmapped (BOOT_OFFSET + SIZEOF_HEADERS): AT (BOOT_OFFSET + SIZEOF_HEADERS) { 25 .ap_bootstrap (AP_BOOT_OFFSET): AT (AP_BOOT_OFFSET) { 26 ap_bootstrap_start = .; 27 28 /* Must be first. */ 29 *(.multiboot); 30 31 *(K_AP_TEXT_START); 32 *(K_AP_DATA_START); 33 ap_bootstrap_end = .; 34 } :ap_boot 35 36 .unmapped (BOOT_OFFSET): AT (BOOT_OFFSET) { 20 37 unmapped_start = .; 21 38 *(K_TEXT_START); 22 39 *(K_DATA_START); 23 40 unmapped_end = .; 24 } 41 } :unmapped 25 42 26 .mapped (PA2KA(BOOT_OFFSET) + SIZEOF _HEADERS + SIZEOF(.unmapped)): AT (BOOT_OFFSET + SIZEOF_HEADERS+ SIZEOF(.unmapped)) {43 .mapped (PA2KA(BOOT_OFFSET) + SIZEOF(.unmapped)): AT (BOOT_OFFSET + SIZEOF(.unmapped)) { 27 44 ktext_start = .; 28 45 *(.text .text.*); … … 41 58 *(symtab.*); /* Symbol table, must be LAST symbol! */ 42 59 kdata_end = .; 43 } 60 } :mapped 44 61 45 62 #ifdef CONFIG_LINE_DEBUG … … 61 78 62 79 #ifdef CONFIG_SMP 63 64 ap_boot = unmapped_ap_boot - BOOT_OFFSET + AP_BOOT_OFFSET;65 ap_gdtr = unmapped_ap_gdtr - BOOT_OFFSET + AP_BOOT_OFFSET;66 80 protected_ap_gdtr = PA2KA(ap_gdtr); 67 68 81 #endif /* CONFIG_SMP */ 69 82 -
kernel/arch/ia32/include/arch/boot/boot.h
r2214382 r6e5252a 44 44 #ifdef CONFIG_SMP 45 45 46 extern uint8_t unmapped_end[]; 46 extern uint8_t ap_bootstrap_start[]; 47 extern uint8_t ap_bootstrap_end[]; 47 48 48 49 #endif /* CONFIG_SMP */ -
kernel/arch/ia32/src/boot/multiboot.S
r2214382 r6e5252a 46 46 #define START_STACK (BOOT_OFFSET - BOOT_STACK_SIZE) 47 47 48 .section K_TEXT_START, "ax" 49 50 .code32 51 52 .macro pm_status msg 53 #if defined(CONFIG_EGA) && !defined(CONFIG_FB) 54 pushl %esi 55 movl \msg, %esi 56 call pm_early_puts 57 popl %esi 58 #endif 59 .endm 60 61 .macro pm2_status msg 62 pushl \msg 63 call early_puts 64 .endm 48 .section .multiboot, "a" 65 49 66 50 .align 4 … … 85 69 .long CONFIG_BFB_BPP 86 70 #endif 71 72 .section K_TEXT_START, "ax" 73 74 .code32 75 76 .macro pm_status msg 77 #if defined(CONFIG_EGA) && !defined(CONFIG_FB) 78 pushl %esi 79 movl \msg, %esi 80 call pm_early_puts 81 popl %esi 82 #endif 83 .endm 84 85 .macro pm2_status msg 86 pushl \msg 87 call early_puts 88 .endm 87 89 88 90 SYMBOL(multiboot_image_start) -
kernel/arch/ia32/src/boot/multiboot2.S
r2214382 r6e5252a 33 33 #include <genarch/multiboot/multiboot2.h> 34 34 35 .section K_TEXT_START, "ax" 36 37 .code32 35 .section .multiboot, "a" 38 36 39 37 .align 8 -
kernel/arch/ia32/src/ia32.c
r2214382 r6e5252a 92 92 multiboot_info_parse(signature, (multiboot_info_t *) info); 93 93 multiboot2_info_parse(signature, (multiboot2_info_t *) info); 94 95 #ifdef CONFIG_SMP96 size_t unmapped_size = (uintptr_t) unmapped_end - BOOT_OFFSET;97 /* Copy AP bootstrap routines below 1 MB. */98 memcpy((void *) AP_BOOT_OFFSET, (void *) BOOT_OFFSET, unmapped_size);99 #endif100 94 } 101 95 -
kernel/arch/ia32/src/mm/frame.c
r2214382 r6e5252a 152 152 153 153 #ifdef CONFIG_SMP 154 size_t unmapped_size = 155 (uintptr_t) unmapped_end - BOOT_OFFSET; 156 157 minconf = max(minconf, 158 ADDR2PFN(AP_BOOT_OFFSET + unmapped_size)); 154 // FIXME: What is the purpose of minconf? Can we remove it? 155 uintptr_t ap_end = ALIGN_UP((uintptr_t) ap_bootstrap_end, FRAME_SIZE); 156 minconf = max(minconf, ADDR2PFN(ap_end)); 159 157 #endif 160 158 … … 165 163 166 164 #ifdef CONFIG_SMP 165 // TODO: should go away implicitly with section table 166 167 167 /* Reserve AP real mode bootstrap memory */ 168 size_t ap_size = 169 ALIGN_UP(ap_bootstrap_end - ap_bootstrap_start, FRAME_SIZE); 168 170 frame_mark_unavailable(AP_BOOT_OFFSET >> FRAME_WIDTH, 169 unmapped_size >> FRAME_WIDTH);171 ap_size >> FRAME_WIDTH); 170 172 #endif 171 173 } -
kernel/arch/ia32/src/smp/ap.S
r2214382 r6e5252a 40 40 #include <arch/context_struct.h> 41 41 42 .section K_ TEXT_START, "ax"42 .section K_AP_TEXT_START, "ax" 43 43 44 44 #ifdef CONFIG_SMP … … 54 54 55 55 .align 4096 56 SYMBOL( unmapped_ap_boot)56 SYMBOL(ap_boot) 57 57 .code16 58 58 cli … … 67 67 orl $CR0_PE, %eax 68 68 movl %eax, %cr0 69 jmpl $KTEXT, $jump_to_kernel - BOOT_OFFSET + AP_BOOT_OFFSET69 jmpl $KTEXT, $jump_to_kernel 70 70 71 71 jump_to_kernel: … … 96 96 97 97 98 .section K_ DATA_START, "aw", @progbits98 .section K_AP_DATA_START, "aw", @progbits 99 99 100 100 #ifdef CONFIG_SMP 101 101 102 SYMBOL( unmapped_ap_gdtr)102 SYMBOL(ap_gdtr) 103 103 .word 0 104 104 .long 0
Note:
See TracChangeset
for help on using the changeset viewer.
