Changeset cfdeedc in mainline
- Timestamp:
- 2018-10-21T23:12:23Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bf05c74
- Parents:
- d59718e
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-21 22:53:48)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-10-21 23:12:23)
- Files:
-
- 2 added
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/Makefile.common
rd59718e rcfdeedc 250 250 251 251 COMPONENTS = \ 252 $(KERNEL_PATH)/kernel. bin\252 $(KERNEL_PATH)/kernel.elf \ 253 253 $(INIT_TASKS) \ 254 254 $(INITRD).img -
boot/Makefile.grub
rd59718e rcfdeedc 85 85 for module in $(MODULES) ; do \ 86 86 echo " echo 'Loading $$module'" >> $(BOOT_CONFIG) ; \ 87 if [ "$$module" = "kernel. bin" ] ; then \87 if [ "$$module" = "kernel.elf" ] ; then \ 88 88 echo " $(MULTIBOOT_CMD) /boot/$$module" >> $(BOOT_CONFIG) ; \ 89 89 else \ -
boot/arch/arm32/Makefile.inc
rd59718e rcfdeedc 107 107 generic/src/gzip.c \ 108 108 generic/src/tar.c \ 109 generic/src/kernel.c \ 109 110 generic/src/payload.c -
boot/arch/arm32/src/main.c
rd59718e rcfdeedc 50 50 #include <arch/cp15.h> 51 51 #include <payload.h> 52 #include <kernel.h> 52 53 53 54 static void clean_dcache_poc(void *address, size_t size) … … 104 105 clean_dcache_poc(boot_pt, PTL0_ENTRIES * PTL0_ENTRY_SIZE); 105 106 107 uintptr_t entry = check_kernel((void *) PA2KA(BOOT_OFFSET)); 108 106 109 printf("Booting the kernel...\n"); 107 jump_to_kernel((void *) PA2KA(BOOT_OFFSET), &bootinfo);110 jump_to_kernel((void *) entry, &bootinfo); 108 111 } 109 112 -
boot/arch/ia64/Makefile.inc
rd59718e rcfdeedc 61 61 generic/src/tar.c \ 62 62 generic/src/gzip.c \ 63 generic/src/kernel.c \ 63 64 generic/src/payload.c 64 65 -
boot/arch/ia64/include/arch/arch.h
rd59718e rcfdeedc 36 36 #define LOADER_ADDRESS 0x4400000 37 37 #define KERNEL_ADDRESS 0x4800000 38 #define KERNEL_VADDRESS 0xe000000004800000 38 39 39 40 #define STACK_SIZE 8192 -
boot/arch/ia64/src/main.c
rd59718e rcfdeedc 44 44 #include <errno.h> 45 45 #include <payload.h> 46 #include <kernel.h> 46 47 47 48 #define DEFAULT_MEMORY_BASE 0x4000000ULL … … 182 183 (uintptr_t) kernel_start, NULL); 183 184 184 printf("Booting the kernel ...\n"); 185 jump_to_kernel(&bootinfo, kernel_start); 185 uintptr_t entry = check_kernel(kernel_start); 186 187 // FIXME: kernel's entry point is linked at a different address than 188 // where it is run from. 189 entry = entry - KERNEL_VADDRESS + KERNEL_ADDRESS; 190 191 printf("Booting the kernel at %p...\n", (void *) entry); 192 jump_to_kernel(&bootinfo, (void *) entry); 186 193 } -
boot/arch/mips32/Makefile.inc
rd59718e rcfdeedc 88 88 generic/src/gzip.c \ 89 89 generic/src/tar.c \ 90 generic/src/kernel.c \ 90 91 generic/src/payload.c -
boot/arch/mips32/src/main.c
rd59718e rcfdeedc 40 40 #include <errno.h> 41 41 #include <payload.h> 42 #include <kernel.h> 42 43 43 44 static bootinfo_t *bootinfo = (bootinfo_t *) PA2KA(BOOTINFO_OFFSET); … … 78 79 } 79 80 80 printf("Booting the kernel ... \n"); 81 jump_to_kernel((void *) PA2KA(BOOT_OFFSET), bootinfo); 81 uintptr_t entry = check_kernel(kernel_start); 82 83 printf("Booting the kernel...\n"); 84 jump_to_kernel((void *) entry, bootinfo); 82 85 } -
boot/arch/ppc32/Makefile.inc
rd59718e rcfdeedc 76 76 generic/src/gzip.c \ 77 77 generic/src/tar.c \ 78 generic/src/kernel.c \ 78 79 generic/src/payload.c -
boot/arch/ppc32/_link.ld.in
rd59718e rcfdeedc 6 6 loader_start = .; 7 7 *(BOOTSTRAP); 8 *(REALMODE);9 8 *(.text); 10 9 } -
boot/arch/ppc32/src/asm.S
rd59718e rcfdeedc 152 152 FUNCTION_END(jump_to_kernel) 153 153 154 .section REALMODE, "ax"155 156 .align PAGE_WIDTH157 154 SYMBOL(real_mode) 158 155 -
boot/arch/ppc32/src/main.c
rd59718e rcfdeedc 42 42 #include <errno.h> 43 43 #include <payload.h> 44 #include <kernel.h> 44 45 45 46 #define BALLOC_MAX_SIZE 131072 … … 68 69 printf(" %p|%p: real mode trampoline\n", &real_mode, real_mode_pa); 69 70 printf(" %p|%p: boot info structure\n", &bootinfo, bootinfo_pa); 70 printf(" %p|%p: kernel entry point\n",71 (void *) PA2KA(BOOT_OFFSET), (void *) BOOT_OFFSET);72 71 printf(" %p|%p: loader entry point\n", 73 72 (void *) LOADER_ADDRESS, loader_address_pa); … … 144 143 } 145 144 145 uintptr_t entry = check_kernel_translated(inflate_base, 0); 146 146 147 printf("Booting the kernel...\n"); 147 jump_to_kernel(bootinfo_pa, transtable_pa, pages, real_mode_pa, 148 PA2KA(BOOT_OFFSET)); 148 jump_to_kernel(bootinfo_pa, transtable_pa, pages, real_mode_pa, entry); 149 149 } -
boot/arch/riscv64/Makefile.inc
rd59718e rcfdeedc 30 30 BFD_OUTPUT = $(BFD_NAME) 31 31 BFD_ARCH = riscv 32 BFD = binary33 32 34 33 BITS = 64 … … 51 50 generic/src/gzip.c \ 52 51 generic/src/tar.c \ 52 generic/src/kernel.c \ 53 53 generic/src/payload.c -
boot/arch/riscv64/include/arch/asm.h
rd59718e rcfdeedc 36 36 extern char pt_page[]; 37 37 38 extern _Noreturn void jump_to_kernel(uintptr_t );38 extern _Noreturn void jump_to_kernel(uintptr_t, uintptr_t); 39 39 40 40 #endif -
boot/arch/riscv64/src/asm.S
rd59718e rcfdeedc 125 125 csrw mstatus, t0 126 126 127 li ra, PA2KA(BOOT_OFFSET) 127 /* Entry point address is in a1. */ 128 mv ra, a1 128 129 csrw mepc, ra 129 130 -
boot/arch/riscv64/src/main.c
rd59718e rcfdeedc 42 42 #include <halt.h> 43 43 #include <payload.h> 44 #include <kernel.h> 44 45 45 46 static bootinfo_t bootinfo; … … 88 89 extract_payload(&bootinfo.taskmap, load_addr, end, kernel_addr, NULL); 89 90 91 uintptr_t entry = check_kernel(load_addr); 92 90 93 printf("Booting the kernel...\n"); 91 jump_to_kernel(PA2KA(&bootinfo) );94 jump_to_kernel(PA2KA(&bootinfo), entry); 92 95 } -
boot/arch/sparc64/Makefile.inc
rd59718e rcfdeedc 72 72 generic/src/gzip.c \ 73 73 generic/src/tar.c \ 74 generic/src/kernel.c \ 74 75 generic/src/payload.c -
boot/arch/sparc64/src/main.c
rd59718e rcfdeedc 43 43 #include <errno.h> 44 44 #include <payload.h> 45 #include <kernel.h> 45 46 46 47 /* The lowest ID (read from the VER register) of some US3 CPU model */ … … 257 258 sun4u_smp(); 258 259 260 uintptr_t entry = check_kernel((void *) KERNEL_ADDRESS); 261 259 262 printf("Booting the kernel ...\n"); 260 jump_to_kernel(bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo, subarch,261 (void *) KERNEL_ADDRESS);262 } 263 jump_to_kernel(bootinfo.physmem_start | BSP_PROCESSOR, &bootinfo, 264 subarch, (void *) entry); 265 } -
kernel/Makefile
rd59718e rcfdeedc 49 49 50 50 AUTOCHECK = $(realpath $(ROOT_PATH)/tools/autocheck.awk) 51 RAW = kernel.raw 52 BIN = kernel.bin 51 KERNEL = kernel.elf 53 52 MAP = kernel.map 54 53 JOB = kernel.job … … 75 74 .DELETE_ON_ERROR: 76 75 77 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $( BIN) $(DISASM)76 all: $(VERSION_DEF) $(COMMON_MAKEFILE) $(COMMON_HEADER) $(CONFIG_MAKEFILE) $(CONFIG_HEADER) $(KERNEL) $(DISASM) 78 77 79 78 clean: autogen_clean 80 rm -f $( RAW) $(BIN) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* arch/*/_link.ld arch/*/include/arch/common.h79 rm -f $(KERNEL) $(MAP) $(JOB) $(MAP_PREV) $(DISASM) $(DUMP) $(REAL_MAP).* arch/*/_link.ld arch/*/include/arch/common.h 81 80 find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.o' -follow -exec rm '{}' \; 82 81 find generic/src/ arch/*/src/ genarch/src/ test/ -name '*.d' -follow -exec rm '{}' \; … … 370 369 endif 371 370 372 $(BIN): $(RAW) 373 $(OBJCOPY) -O $(BFD) $< $@ 374 375 $(DISASM): $(RAW) 371 $(DISASM): $(KERNEL) 376 372 ifeq ($(CONFIG_LINE_DEBUG),y) 377 373 $(OBJDUMP) -d -S $< > $@ … … 380 376 endif 381 377 382 $( RAW): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS)378 $(KERNEL): $(LINK) $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(SYMTAB_OBJECTS) 383 379 $(CC) $(DEFS) $(CFLAGS) $(LDFLAGS) -Wl,-Map,$(MAP) -o $@ $(ARCH_OBJECTS) $(GENARCH_OBJECTS) $(GENERIC_OBJECTS) $(EXTRA_OBJECTS) $(SYMTAB_OBJECTS) 384 380 -
kernel/arch/abs32le/Makefile.inc
rd59718e rcfdeedc 27 27 # 28 28 29 BFD = binary30 29 31 30 ifeq ($(COMPILER),gcc_cross) -
kernel/arch/amd64/Makefile.inc
rd59718e rcfdeedc 27 27 # 28 28 29 BFD_NAME = elf64-x86-6430 BFD_ARCH = i386:x86-6431 BFD = binary32 29 33 30 FPU_NO_CFLAGS = -mno-sse -mno-sse2 -
kernel/arch/amd64/_link.ld.in
rd59718e rcfdeedc 33 33 *(COMMON); /* global variables */ 34 34 35 /* XXX: bss can't be omitted from the ELF image. */ 36 *(.bss); /* uninitialized static variables */ 37 35 38 . = ALIGN(8); 36 39 symbol_table = .; 37 40 *(symtab.*); /* Symbol table, must be LAST symbol!*/ 38 39 *(.bss); /* uninitialized static variables */40 41 41 42 kdata_end = .; -
kernel/arch/arm32/Makefile.inc
rd59718e rcfdeedc 27 27 # 28 28 29 BFD_NAME = elf32-littlearm30 BFD_ARCH = arm31 BFD = binary32 29 33 30 ATSIGN = % -
kernel/arch/arm32/_link.ld.in
rd59718e rcfdeedc 25 25 . = KERNEL_LOAD_ADDRESS; 26 26 kernel_load_address = .; 27 . = . + SIZEOF_HEADERS; 27 28 .text : { 28 29 ktext_start = .; -
kernel/arch/ia32/Makefile.inc
rd59718e rcfdeedc 27 27 # 28 28 29 BFD_NAME = elf32-i38630 BFD_ARCH = i38631 BFD = binary32 29 33 30 BITS = 32 -
kernel/arch/ia32/_link.ld.in
rd59718e rcfdeedc 31 31 *(.rodata .rodata.*); /* string literals */ 32 32 *(COMMON); /* global variables */ 33 34 /* XXX: bss can't be omitted from the ELF image. */ 35 *(.bss); /* uninitialized static variables */ 36 33 37 . = ALIGN(8); 34 38 symbol_table = .; 35 39 *(symtab.*); /* Symbol table, must be LAST symbol! */ 36 *(.bss); /* uninitialized static variables */37 40 kdata_end = .; 38 41 } -
kernel/arch/ia64/Makefile.inc
rd59718e rcfdeedc 27 27 # 28 28 29 BFD_NAME = elf64-little30 BFD_ARCH = ia64-elf6431 29 32 30 COMMON_CFLAGS += -mconstant-gp -fno-unwind-tables -mfixed-range=f32-f127 … … 65 63 ifeq ($(MACHINE),ski) 66 64 ARCH_SOURCES += arch/$(KARCH)/src/drivers/ski.c 67 BFD = binary68 65 endif 69 66 70 67 ifeq ($(MACHINE),i460GX) 71 68 DEFS += -DI460GX 72 BFD = binary73 69 endif 74 70 -
kernel/arch/ia64/_link.ld.in
rd59718e rcfdeedc 15 15 kernel_load_address = LOAD_ADDRESS_V; 16 16 17 .image LOAD_ADDRESS_V: AT (LOAD_ADDRESS_P) { 17 .image (LOAD_ADDRESS_V + SIZEOF_HEADERS): AT (LOAD_ADDRESS_P + SIZEOF_HEADERS) { 18 . = ALIGN(16); 18 19 ktext_start = .; 19 20 *(K_TEXT_START); -
kernel/arch/mips32/Makefile.inc
rd59718e rcfdeedc 27 27 # 28 28 29 BFD_ARCH = mips30 BFD = binary31 29 COMMON_CFLAGS += -msoft-float -mno-abicalls -G 0 -fno-zero-initialized-in-bss -mabi=32 32 30 AS_PROLOG = .module softfloat; … … 38 36 39 37 ifeq ($(MACHINE),msim) 40 BFD_NAME = elf32-tradlittlemips41 38 ENDIANESS = LE 42 39 COMMON_CFLAGS += -march=r4000 43 40 endif 44 41 ifeq ($(MACHINE),bmalta) 45 BFD_NAME = elf32-tradbigmips46 42 ENDIANESS = BE 47 43 COMMON_CFLAGS += -D__BE__ -march=4kc 48 44 endif 49 45 ifeq ($(MACHINE),lmalta) 50 BFD_NAME = elf32-tradlittlemips51 46 ENDIANESS = LE 52 47 COMMON_CFLAGS += -march=4kc -
kernel/arch/mips32/_link.ld.in
rd59718e rcfdeedc 24 24 . = KERNEL_LOAD_ADDRESS; 25 25 kernel_load_address = .; 26 . = . + SIZEOF_HEADERS; 26 27 27 28 .text : { -
kernel/arch/ppc32/Makefile.inc
rd59718e rcfdeedc 27 27 # 28 28 29 BFD_NAME = elf32-powerpc30 BFD_ARCH = powerpc:common31 BFD = binary32 29 33 30 COMMON_CFLAGS += -mcpu=powerpc -msoft-float -m32 -
kernel/arch/ppc32/_link.ld.in
rd59718e rcfdeedc 20 20 kernel_load_address = PA2KA(0); 21 21 22 .unmapped 0: AT (0) { 22 .unmapped (SIZEOF_HEADERS): AT (SIZEOF_HEADERS) { 23 . = ALIGN(0x100); 23 24 *(K_UNMAPPED_TEXT_START); 24 25 } … … 46 47 kdata_end = .; 47 48 } 49 50 /DISCARD/ : { 51 *(*); 52 } 48 53 } -
kernel/arch/ppc32/src/exception.S
rd59718e rcfdeedc 126 126 .endm 127 127 128 .org 0x100 128 // XXX: K_UNMAPPED_TEXT_START section starts at 0x100, 129 // so all the following .org directives are relative to that. 130 #define ABSOLUTE(x) ((x) - 0x100) 131 132 .org ABSOLUTE(0x100) 129 133 SYMBOL(exc_system_reset) 130 134 CONTEXT_STORE … … 133 137 b jump_to_kernel 134 138 135 .org 0x200139 .org ABSOLUTE(0x200) 136 140 SYMBOL(exc_machine_check) 137 141 CONTEXT_STORE … … 140 144 b jump_to_kernel 141 145 142 .org 0x300146 .org ABSOLUTE(0x300) 143 147 SYMBOL(exc_data_storage) 144 148 CONTEXT_STORE … … 147 151 b jump_to_kernel 148 152 149 .org 0x400153 .org ABSOLUTE(0x400) 150 154 SYMBOL(exc_instruction_storage) 151 155 CONTEXT_STORE … … 154 158 b jump_to_kernel 155 159 156 .org 0x500160 .org ABSOLUTE(0x500) 157 161 SYMBOL(exc_external) 158 162 CONTEXT_STORE … … 161 165 b jump_to_kernel 162 166 163 .org 0x600167 .org ABSOLUTE(0x600) 164 168 SYMBOL(exc_alignment) 165 169 CONTEXT_STORE … … 168 172 b jump_to_kernel 169 173 170 .org 0x700174 .org ABSOLUTE(0x700) 171 175 SYMBOL(exc_program) 172 176 CONTEXT_STORE … … 175 179 b jump_to_kernel 176 180 177 .org 0x800181 .org ABSOLUTE(0x800) 178 182 SYMBOL(exc_fp_unavailable) 179 183 CONTEXT_STORE … … 182 186 b jump_to_kernel 183 187 184 .org 0x900188 .org ABSOLUTE(0x900) 185 189 SYMBOL(exc_decrementer) 186 190 CONTEXT_STORE … … 189 193 b jump_to_kernel 190 194 191 .org 0xa00195 .org ABSOLUTE(0xa00) 192 196 SYMBOL(exc_reserved0) 193 197 CONTEXT_STORE … … 196 200 b jump_to_kernel 197 201 198 .org 0xb00202 .org ABSOLUTE(0xb00) 199 203 SYMBOL(exc_reserved1) 200 204 CONTEXT_STORE … … 203 207 b jump_to_kernel 204 208 205 .org 0xc00209 .org ABSOLUTE(0xc00) 206 210 SYMBOL(exc_syscall) 207 211 CONTEXT_STORE … … 209 213 b jump_to_kernel_syscall 210 214 211 .org 0xd00215 .org ABSOLUTE(0xd00) 212 216 SYMBOL(exc_trace) 213 217 CONTEXT_STORE … … 216 220 b jump_to_kernel 217 221 218 .org 0x1000222 .org ABSOLUTE(0x1000) 219 223 SYMBOL(exc_itlb_miss) 220 224 CONTEXT_STORE … … 223 227 b jump_to_kernel 224 228 225 .org 0x1100229 .org ABSOLUTE(0x1100) 226 230 SYMBOL(exc_dtlb_miss_load) 227 231 CONTEXT_STORE … … 230 234 b jump_to_kernel 231 235 232 .org 0x1200236 .org ABSOLUTE(0x1200) 233 237 SYMBOL(exc_dtlb_miss_store) 234 238 CONTEXT_STORE … … 237 241 b jump_to_kernel 238 242 239 .org 0x4000243 .org ABSOLUTE(0x4000) 240 244 jump_to_kernel: 241 245 mfsrr1 r5 … … 289 293 addis sp, sp, 0x8000 290 294 rfi 295 296 /* Rest is for stack. */ 297 298 .org ABSOLUTE(0x8000) -
kernel/arch/riscv64/Makefile.inc
rd59718e rcfdeedc 27 27 # 28 28 29 BFD_NAME = elf64-littleriscv30 BFD_ARCH = riscv31 BFD = binary32 29 33 30 COMMON_CFLAGS += -mcmodel=medany -
kernel/arch/riscv64/_link.ld.in
rd59718e rcfdeedc 16 16 kernel_load_address = PA2KA(BOOT_OFFSET); 17 17 18 .image (PA2KA(BOOT_OFFSET) ) : AT (0) {18 .image (PA2KA(BOOT_OFFSET) + SIZEOF_HEADERS) : AT (SIZEOF_HEADERS) { 19 19 ktext_start = .; 20 20 *(K_TEXT_START); -
kernel/arch/sparc64/Makefile.inc
rd59718e rcfdeedc 27 27 # 28 28 29 BFD_NAME = elf64-sparc30 BFD_ARCH = sparc31 BFD = binary32 29 33 30 COMMON_CFLAGS += -m64 -mcpu=ultrasparc -mcmodel=medlow -mno-fpu -
kernel/arch/sparc64/_link.ld.in
rd59718e rcfdeedc 12 12 13 13 SECTIONS { 14 .image VMA: AT (LMA) { 15 kernel_load_address = .; 14 kernel_load_address = VMA; 16 15 16 .image (VMA + SIZEOF_HEADERS): AT (LMA + SIZEOF_HEADERS) { 17 17 ktext_start = .; 18 18 *(K_TEXT_START)
Note:
See TracChangeset
for help on using the changeset viewer.