# "-m elf_i386": Output 32-bit code for the i386 in elf format. 
# "-Ttext 0": Code should be loaded\aligned at 0. 
# "-e startup_32": startup_32 is the entry point.

# Makefile for the simple example kernel.
# dd bs=512 if=system of=Image skip=2 seek=1
AS86	=as86 -0 -a
LD86	=ld86 -0
AS	=as
LD	=ld
LDFLAGS	=-m elf_i386 -Ttext 0 -e startup_32 #-s -x -M

all:	Image

Image: boot system                              
	dd bs=32 if=boot of=Image skip=1
	dd bs=512 if=system of=Image skip=2 seek=1
	sync

disk: Image
	dd bs=8192 if=Image of=12.img
	sync;sync;sync

head.o: head.s	
system:head.o 
	$(LD) $(LDFLAGS) head.o  -o system > System.map

boot:	boot.s
	$(AS86) -o boot.o boot.s
	$(LD86) -s -o boot boot.o

clean:
	rm -f Image System.map core boot *.o system 12.img Image
