Changeset 63f5cd6 in mainline
- Timestamp:
- 2006-04-22T22:34:46Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 271fcaf
- Parents:
- ab4ac14
- Location:
- arch/ppc32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
arch/ppc32/Makefile.inc
rab4ac14 r63f5cd6 29 29 build: image.boot 30 30 31 image.boot: kernel 32 make -C arch/$(ARCH)/loader COMPILER=$(COMPILER) KERNEL=../../../$(KERNELDIR)/kernel.bin 31 image.boot: kernel uspace 32 make -C arch/$(ARCH)/loader COMPILER=$(COMPILER) KERNEL=../../../$(KERNELDIR)/kernel.bin INIT=../../../$(USPACEDIR)/init/init 33 33 cp arch/$(ARCH)/loader/image.boot image.boot 34 34 35 clean: clean_kernel 35 clean: clean_kernel clean_uspace 36 36 make -C arch/$(ARCH)/loader clean 37 37 -rm -f image.boot 38 38 39 arch_distclean: distclean_kernel 39 arch_distclean: distclean_kernel distclean_uspace -
arch/ppc32/loader/Makefile
rab4ac14 r63f5cd6 65 65 -include Makefile.depend 66 66 67 image.boot: depend $(OBJECTS) kernel.o 68 $(LD) -no-check-sections -N -T _link.ld $(OBJECTS) kernel.o -o $@67 image.boot: depend $(OBJECTS) kernel.o init.o 68 $(LD) -no-check-sections -N -T _link.ld $(OBJECTS) kernel.o init.o -o $@ 69 69 70 70 depend: … … 72 72 73 73 clean: 74 -rm -f $(OBJECTS) image.boot kernel.o Makefile.depend74 -rm -f $(OBJECTS) image.boot kernel.o init.o Makefile.depend 75 75 76 76 kernel.o: $(KERNEL) 77 $(OBJCOPY) -I binary -O elf32-powerpc -B powerpc:common --rename-section .data=.image $(KERNEL) $@ 77 $(OBJCOPY) -I binary -O elf32-powerpc -B powerpc:common --rename-section .data=.kernel_image $(KERNEL) $@ 78 79 init.o: $(INIT) 80 $(OBJCOPY) -I binary -O elf32-powerpc -B powerpc:common --rename-section .data=.init_image $(INIT) $@ 78 81 79 82 %.o: %.S -
arch/ppc32/loader/_link.ld
rab4ac14 r63f5cd6 24 24 25 25 . = ALIGN(4096); 26 *(.image); 26 *(.kernel_image); 27 28 . = ALIGN(4096); 29 *(.init_image); 27 30 } 28 31 } -
arch/ppc32/loader/main.c
rab4ac14 r63f5cd6 34 34 #define KERNEL_END ((void *) &_binary_____________kernel_kernel_bin_end) 35 35 #define KERNEL_SIZE ((unsigned int) KERNEL_END - (unsigned int) KERNEL_START) 36 37 #define INIT_START ((void *) &_binary_____________uspace_init_init_start) 38 #define INIT_END ((void *) &_binary_____________uspace_init_init_end) 39 #define INIT_SIZE ((unsigned int) INIT_END - (unsigned int) INIT_START) 36 40 37 41 #define HEAP_GAP 1024000 … … 80 84 81 85 check_align(KERNEL_START, "Kernel image"); 86 check_align(INIT_START, "Init image"); 82 87 check_align(&real_mode, "Bootstrap trampoline"); 83 88 check_align(&trans, "Translation table"); … … 108 113 printf("\nMemory statistics (total %d MB)\n", bootinfo.memmap.total >> 20); 109 114 printf(" kernel image at %L (size %d bytes)\n", KERNEL_START, KERNEL_SIZE); 110 printf(" boot info at %L (physical %L)\n", &bootinfo, bootinfo_pa); 115 printf(" init image at %L (size %d bytes)\n", INIT_START, INIT_SIZE); 116 printf(" boot info structure at %L (physical %L)\n", &bootinfo, bootinfo_pa); 111 117 printf(" bootstrap trampoline at %L (physical %L)\n", &real_mode, real_mode_pa); 112 118 printf(" translation table at %L (physical %L)\n", &trans, trans_pa); 113 119 114 unsigned int top = ALIGN_UP(KERNEL_SIZE, PAGE_SIZE); 115 unsigned int addr; 116 for (addr = 0; addr < KERNEL_SIZE; addr += PAGE_SIZE) { 117 void *pa = ofw_translate(KERNEL_START + addr); 118 fix_overlap(KERNEL_START + addr, &pa, "Kernel image", &top); 119 trans[addr >> PAGE_WIDTH] = pa; 120 unsigned int top = ALIGN_UP(KERNEL_SIZE, PAGE_SIZE) + ALIGN_UP(INIT_SIZE, PAGE_SIZE); 121 unsigned int kernel_pages = ALIGN_UP(KERNEL_SIZE, PAGE_SIZE) >> PAGE_WIDTH; 122 unsigned int init_pages = ALIGN_UP(INIT_SIZE, PAGE_SIZE) >> PAGE_WIDTH; 123 124 unsigned int i; 125 126 for (i = 0; i < kernel_pages; i++) { 127 void *pa = ofw_translate(KERNEL_START + (i << PAGE_WIDTH)); 128 fix_overlap(KERNEL_START + (i << PAGE_WIDTH), &pa, "Kernel image", &top); 129 trans[i] = pa; 130 } 131 132 for (i = 0; i < init_pages; i++) { 133 void *pa = ofw_translate(INIT_START + (i << PAGE_WIDTH)); 134 fix_overlap(INIT_START + (i << PAGE_WIDTH), &pa, "Init image", &top); 135 trans[kernel_pages + i] = pa; 136 if (i == 0) { 137 bootinfo.init.addr = (void *) ((kernel_pages + i) << PAGE_WIDTH); 138 bootinfo.init.size = INIT_SIZE; 139 } 120 140 } 121 141 … … 125 145 126 146 printf("\nBooting the kernel...\n"); 127 jump_to_kernel(bootinfo_pa, sizeof(bootinfo), trans_pa, KERNEL_SIZE, fb, real_mode_pa);147 jump_to_kernel(bootinfo_pa, sizeof(bootinfo), trans_pa, (kernel_pages + init_pages) << PAGE_WIDTH, fb, real_mode_pa); 128 148 } -
arch/ppc32/loader/main.h
rab4ac14 r63f5cd6 40 40 41 41 typedef struct { 42 void *addr; 43 unsigned int size; 44 } utask_t; 45 46 typedef struct { 47 utask_t init; 42 48 memmap_t memmap; 43 49 screen_t screen; … … 46 52 extern int _binary_____________kernel_kernel_bin_start; 47 53 extern int _binary_____________kernel_kernel_bin_end; 54 55 extern int _binary_____________uspace_init_init_start; 56 extern int _binary_____________uspace_init_init_end; 57 48 58 extern void start(void); 49 59 extern void bootstrap(void);
Note:
See TracChangeset
for help on using the changeset viewer.