Permalink
Browse files

set up makefile and grub menu for multiple kernel support

  • Loading branch information...
jtauber committed Oct 11, 2009
1 parent 1a4e2a2 commit 1c69478d91bc7a5f3ac2de1a02002143c3c4db57
Showing with 13 additions and 29 deletions.
  1. +7 −27 Makefile
  2. +6 −2 boot/grub/menu.lst
View
@@ -1,46 +1,26 @@
.SUFFIXES: .asm
LDSCRIPT = kernel.ld
NASM = nasm -f elf
CC = i386-elf-gcc -Wall -O2 -nostdinc -fno-builtin
LD = i386-elf-ld -T $(LDSCRIPT) -nostdlib
NM = i386-elf-nm
STRIP = i386-elf-strip
OBJS = kstart.o main.o video.o ports.o
all: KERNEL.BIN
images: grub.img cleese.img
clean:
-rm -f *.o grub.img KERNEL.BIN kernel.lst
.asm.o:
$(NASM) -o $@ $<
.c.o:
$(CC) -c -o $@ $<
KERNEL.BIN: $(OBJS) $(LDSCRIPT)
$(LD) -o $@ $(OBJS)
$(NM) $@ | sort > kernel.lst
$(STRIP) $@
-rm -f grub.img cleese.img
grub.img: boot/grub/stage1 boot/grub/stage2
cat boot/grub/stage1 boot/grub/stage2 > grub.img
cleese.img: KERNEL.BIN
cleese.img: hello_world/KERNEL.BIN echo/KERNEL.BIN
hdiutil create -size 5M -fs "MS-DOS" -layout NONE cleese
mv cleese.dmg cleese.img
mkdir -p mnt
mount_msdos -o nosync `hdid -nomount cleese.img` ./mnt
cp -r boot KERNEL.BIN ./mnt
cp -r boot ./mnt
cp hello_world/KERNEL.BIN ./mnt/hello_world.bin
cp echo/KERNEL.BIN ./mnt/echo.bin
umount -f ./mnt
rm -r ./mnt
update-image:
mkdir -p mnt
mount_msdos -o nosync `hdid -nomount cleese.img` ./mnt
cp KERNEL.BIN ./mnt
cp hello_world/KERNEL.BIN ./mnt/hello_world.bin
cp echo/KERNEL.BIN ./mnt/echo.bin
umount -f ./mnt
rm -r ./mnt
View
@@ -1,3 +1,7 @@
title Cleese OS
title Hello World
root (fd0)
kernel /kernel.bin
kernel /hello_world.bin
title Echo
root (fd0)
kernel /echo.bin

0 comments on commit 1c69478

Please sign in to comment.