4cc8bb5ec7
Barebones kernel that can print to a "tty". Has some basic functions like memcpy, strlen, etc. A GDT is also present, however it has not yet been properly tested. The folder structure is currently not optimal or well organized.
25 lines
645 B
Makefile
25 lines
645 B
Makefile
CC=i686-elf-gcc
|
|
|
|
.PHONY: iso run clean
|
|
|
|
%.o: %.c
|
|
$(CC) -c $< -o $@ -std=gnu99 -ffreestanding -O2 -Wall -Wextra -pedantic -I.
|
|
|
|
bootstrap.o: bootstrap.s
|
|
i686-elf-as bootstrap.s -o bootstrap.o
|
|
|
|
kernel.bin: bootstrap.o kernel.o vga.o std/std.o
|
|
$(CC) -T linker.ld -o kernel.bin -ffreestanding -O2 -nostdlib bootstrap.o kernel.o vga.o std/std.o -lgcc
|
|
|
|
iso: kernel.bin
|
|
mkdir -p isodir/boot/grub
|
|
cp kernel.bin isodir/boot/kernel.bin
|
|
cp extra/grub.cfg isodir/boot/grub/grub.cfg
|
|
grub-mkrescue -o generated-iso.iso isodir
|
|
|
|
run: iso
|
|
qemu-system-i386 -cdrom generated-iso.iso
|
|
|
|
clean:
|
|
rm -rf kernel.o bootstrap.o kernel.bin isodir generated-iso.iso
|
|
|