fix build

This commit is contained in:
rsc 2006-09-07 14:10:52 +00:00
parent a64cd81342
commit 7e019461c8
2 changed files with 8 additions and 8 deletions

View file

@ -49,22 +49,22 @@ bootblock : bootasm.S bootmain.c
$(OBJCOPY) -S -O binary bootblock.o bootblock $(OBJCOPY) -S -O binary bootblock.o bootblock
./sign.pl bootblock ./sign.pl bootblock
kernel : $(OBJS) bootother.S init kernel : $(OBJS) bootother.S _init
$(CC) -nostdinc -I. -c bootother.S $(CC) -nostdinc -I. -c bootother.S
$(LD) -N -e start -Ttext 0x7000 -o bootother.out bootother.o $(LD) -N -e start -Ttext 0x7000 -o bootother.out bootother.o
$(OBJCOPY) -S -O binary bootother.out bootother $(OBJCOPY) -S -O binary bootother.out bootother
$(OBJDUMP) -S bootother.o > bootother.asm $(OBJDUMP) -S bootother.o > bootother.asm
$(LD) -Ttext 0x100000 -e main0 -o kernel $(OBJS) -b binary bootother init $(LD) -Ttext 0x100000 -e main0 -o kernel $(OBJS) -b binary bootother _init
$(OBJDUMP) -S kernel > kernel.asm $(OBJDUMP) -S kernel > kernel.asm
tags: $(OBJS) bootother.S init tags: $(OBJS) bootother.S _init
etags *.S *.c etags *.S *.c
PRINT = \ PRINT = \
runoff.list \ runoff.list \
README\ README\
types.h param.h defs.h x86.h asm.h elf.h mmu.h spinlock.h\ types.h param.h defs.h x86.h asm.h elf.h mmu.h spinlock.h\
bootasm.S bootother.S main.c init.c spinlock.c\ bootasm.S bootother.S main.c _init.c spinlock.c\
proc.h proc.c setjmp.S kalloc.c\ proc.h proc.c setjmp.S kalloc.c\
syscall.h trapasm.S traps.h trap.c vectors.pl syscall.c sysproc.c\ syscall.h trapasm.S traps.h trap.c vectors.pl syscall.c sysproc.c\
buf.h dev.h fcntl.h stat.h file.h fs.h fsvar.h fd.c fs.c bio.c ide.c sysfile.c\ buf.h dev.h fcntl.h stat.h file.h fs.h fsvar.h fd.c fs.c bio.c ide.c sysfile.c\

8
main.c
View file

@ -11,7 +11,7 @@
#include "spinlock.h" #include "spinlock.h"
extern char edata[], end[]; extern char edata[], end[];
extern uchar _binary_init_start[], _binary_init_size[]; extern uchar _binary__init_start[], _binary__init_size[];
void process0(); void process0();
@ -140,7 +140,7 @@ process0()
p1 = copyproc(p0); p1 = copyproc(p0);
load_icode(p1, _binary_init_start, (uint) _binary_init_size); load_icode(p1, _binary__init_start, (uint) _binary__init_size);
p1->state = RUNNABLE; p1->state = RUNNABLE;
proc_wait(); proc_wait();
@ -166,9 +166,9 @@ load_icode(struct proc *p, uchar *binary, uint size)
if(ph->type != ELF_PROG_LOAD) if(ph->type != ELF_PROG_LOAD)
continue; continue;
if(ph->va + ph->memsz < ph->va) if(ph->va + ph->memsz < ph->va)
panic("load_icode: overflow in elf header segment"); panic("load_icode: overflow in proghdr");
if(ph->va + ph->memsz >= p->sz) if(ph->va + ph->memsz >= p->sz)
panic("load_icode: icode wants to be above UTOP"); panic("load_icode: icode too large");
// Load/clear the segment // Load/clear the segment
memmove(p->mem + ph->va, binary + ph->offset, ph->filesz); memmove(p->mem + ph->va, binary + ph->offset, ph->filesz);