summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordzwdz2021-07-09 16:08:59 +0200
committerdzwdz2021-07-09 16:08:59 +0200
commit9b851331995c84f9548eba05e51b47656cb83deb (patch)
treedab7c1c3af8ba8616c5670b88138e3a07e332c79
parent5ee08673199299769549f996a83c326c833801dc (diff)
support building .iso images
-rw-r--r--.gitignore1
-rw-r--r--Makefile7
-rw-r--r--grub.cfg3
3 files changed, 11 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 98f5968..eb837cc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
*.bin
+boot.iso
*.o
diff --git a/Makefile b/Makefile
index 605b112..57100d4 100644
--- a/Makefile
+++ b/Makefile
@@ -22,6 +22,13 @@ clean:
rm -vf kernel.bin
rm -vf **/*.o
+boot.iso: kernel.bin grub.cfg
+ mkdir iso_tmp
+ mkdir -p iso_tmp/boot/grub
+ cp kernel.bin iso_tmp/boot
+ cp grub.cfg iso_tmp/boot/grub
+ grub-mkrescue -o $@ iso_tmp
+ rm -rv iso_tmp
kernel.bin: $(OBJ)
$(CC) $(LFLAGS) -T linker.ld $^ -o $@
diff --git a/grub.cfg b/grub.cfg
new file mode 100644
index 0000000..ab0a41d
--- /dev/null
+++ b/grub.cfg
@@ -0,0 +1,3 @@
+menuentry "Camellia" {
+ multiboot /boot/kernel.bin
+}