2006-06-15 18:02:20 +02:00
|
|
|
OBJS = main.o console.o string.o kalloc.o proc.o trapasm.o trap.o vectors.o \
|
2006-06-27 16:35:53 +02:00
|
|
|
syscall.o ide.o picirq.o mp.o spinlock.o fd.o pipe.o
|
2006-06-12 17:22:12 +02:00
|
|
|
|
|
|
|
CC = i386-jos-elf-gcc
|
|
|
|
LD = i386-jos-elf-ld
|
|
|
|
OBJCOPY = i386-jos-elf-objcopy
|
|
|
|
OBJDUMP = i386-jos-elf-objdump
|
2006-06-15 21:58:01 +02:00
|
|
|
CFLAGS = -nostdinc -I. -O -Wall -MD
|
2006-06-12 17:22:12 +02:00
|
|
|
|
|
|
|
xv6.img : bootblock kernel
|
|
|
|
dd if=/dev/zero of=xv6.img count=10000
|
|
|
|
dd if=bootblock of=xv6.img conv=notrunc
|
|
|
|
dd if=kernel of=xv6.img seek=1 conv=notrunc
|
|
|
|
|
|
|
|
bootblock : bootasm.S bootmain.c
|
|
|
|
$(CC) -O -nostdinc -I. -c bootmain.c
|
|
|
|
$(CC) -nostdinc -I. -c bootasm.S
|
|
|
|
$(LD) -N -e start -Ttext 0x7C00 -o bootblock.o bootasm.o bootmain.o
|
|
|
|
$(OBJDUMP) -S bootblock.o > bootblock.asm
|
|
|
|
$(OBJCOPY) -S -O binary bootblock.o bootblock
|
|
|
|
./sign.pl bootblock
|
|
|
|
|
2006-06-27 16:35:53 +02:00
|
|
|
kernel : $(OBJS) bootother.S user1 usertests
|
2006-06-22 03:28:57 +02:00
|
|
|
$(CC) -nostdinc -I. -c bootother.S
|
|
|
|
$(LD) -N -e start -Ttext 0x7000 -o bootother.out bootother.o
|
|
|
|
$(OBJCOPY) -S -O binary bootother.out bootother
|
|
|
|
$(OBJDUMP) -S bootother.o > bootother.asm
|
2006-06-27 16:35:53 +02:00
|
|
|
$(LD) -Ttext 0x100000 -e main -o kernel $(OBJS) -b binary bootother user1 usertests
|
2006-06-12 17:22:12 +02:00
|
|
|
$(OBJDUMP) -S kernel > kernel.asm
|
|
|
|
|
2006-06-13 17:50:06 +02:00
|
|
|
vectors.S : vectors.pl
|
|
|
|
perl vectors.pl > vectors.S
|
|
|
|
|
2006-06-27 16:35:53 +02:00
|
|
|
user1 : user1.c ulib.o
|
2006-06-22 22:47:23 +02:00
|
|
|
$(CC) -nostdinc -I. -c user1.c
|
2006-06-27 16:35:53 +02:00
|
|
|
$(LD) -N -e main -Ttext 0 -o user1 user1.o ulib.o
|
2006-06-26 17:11:19 +02:00
|
|
|
$(OBJDUMP) -S user1 > user1.asm
|
2006-06-22 22:47:23 +02:00
|
|
|
|
2006-06-27 16:35:53 +02:00
|
|
|
usertests : usertests.c ulib.o
|
|
|
|
$(CC) -nostdinc -I. -c usertests.c
|
|
|
|
$(LD) -N -e main -Ttext 0 -o usertests usertests.o ulib.o
|
|
|
|
$(OBJDUMP) -S usertests > usertests.asm
|
|
|
|
|
|
|
|
ulib.o : ulib.c
|
|
|
|
$(CC) -nostdinc -I. -c ulib.c
|
|
|
|
|
2006-06-15 21:58:01 +02:00
|
|
|
-include *.d
|
|
|
|
|
2006-06-12 17:22:12 +02:00
|
|
|
clean :
|
2006-06-22 22:47:23 +02:00
|
|
|
rm -f *.o bootblock kernel kernel.asm xv6.img *.d user1
|