summaryrefslogtreecommitdiffstats
path: root/sos-code-article4/Makefile
diff options
context:
space:
mode:
authorAlex AUVOLAT <alex.auvolat@ens.fr>2014-03-28 09:16:34 +0100
committerAlex AUVOLAT <alex.auvolat@ens.fr>2014-03-28 09:16:34 +0100
commita21f6c328a4f18e1fa744e40e4c26fa512c90bf7 (patch)
treeec6219229f4211549d31de1a5dc0c67ac0cd3c24 /sos-code-article4/Makefile
parent60d21b86051a9960f8e87fb10e19f63f2bbc6de2 (diff)
downloadSOS-a21f6c328a4f18e1fa744e40e4c26fa512c90bf7.tar.gz
SOS-a21f6c328a4f18e1fa744e40e4c26fa512c90bf7.zip
Added text for articles ; compile article4
Diffstat (limited to 'sos-code-article4/Makefile')
-rw-r--r--sos-code-article4/Makefile21
1 files changed, 17 insertions, 4 deletions
diff --git a/sos-code-article4/Makefile b/sos-code-article4/Makefile
index 3a2282a..3bca9d6 100644
--- a/sos-code-article4/Makefile
+++ b/sos-code-article4/Makefile
@@ -1,4 +1,5 @@
-CC=gcc
+CC=i586-elf-gcc
+LD=i586-elf-ld
CFLAGS = -Wall -nostdlib -nostdinc -ffreestanding -DKERNEL_SOS
LDFLAGS = --warn-common
OBJECTS = bootstrap/multiboot.o \
@@ -10,14 +11,26 @@ OBJECTS = bootstrap/multiboot.o \
sos/physmem.o sos/klibc.o sos/main.o
KERNEL_OBJ = sos.elf
-MULTIBOOT_IMAGE = fd.img
+MULTIBOOT_IMAGE = sos.iso
PWD := $(shell pwd)
# Main target
all: $(MULTIBOOT_IMAGE)
$(MULTIBOOT_IMAGE): $(KERNEL_OBJ)
- ./support/build_image.sh $@ $<
+ # ./support/build_image.sh $@ $<
+ if [ ! -e cdrom/boot/grub/stage2_eltorito ]; then \
+ mkdir -p cdrom/boot/grub; \
+ echo "Please copy grub's stage2_eltorito to cdrom/boot/grub."; \
+ exit -1; \
+ fi
+ cp $(KERNEL_OBJ) cdrom
+ echo timeout 0 > cdrom/boot/grub/menu.lst
+ echo title Simple OS >> cdrom/boot/grub/menu.lst
+ echo kernel /$(KERNEL_OBJ) >> cdrom/boot/grub/menu.lst
+ genisoimage -R -b boot/grub/stage2_eltorito -no-emul-boot -boot-load-size 4 \
+ -boot-info-table -input-charset ascii -A SOS -o $(MULTIBOOT_IMAGE) cdrom
+
$(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds
$(LD) $(LDFLAGS) -T ./support/sos.lds -o $@ $(OBJECTS)
@@ -35,7 +48,7 @@ $(KERNEL_OBJ): $(OBJECTS) ./support/sos.lds
# Clean directory
clean:
- $(RM) *.img *.o mtoolsrc *~ menu.txt *.img *.elf *.bin *.map
+ $(RM) *.iso *.o mtoolsrc *~ menu.txt *.img *.elf *.bin *.map
$(RM) *.log *.out bochs*
$(RM) bootstrap/*.o bootstrap/*~
$(RM) drivers/*.o drivers/*~