Merge pull request #21 from E-Almqvist/dev

Makefile
pull/25/head
Elias Almqvist 3 years ago committed by GitHub
commit 242a58a4b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 25
      Makefile
  2. 5
      src/kernel/kernel_entry.asm

@ -0,0 +1,25 @@
all: os-image
run: all
qemu bin/os-image
os-image: bin/bootloader.bin bin/kernel.bin
cat $^ > bin/os-image
kernel.bin: bin/kernel_entry.o bin/kernel.o
ld -o kernel.bin -Ttext 0x1000 $^ --oformat binary
kernel.o : src/kernel/kernel.c
gcc -ffreestanding -c $< -o $@
kernel_entry.o : src/kernel/kernel_entry.asm
nasm $< -f elf -o $@
bootloader.bin : src/bootloader/bootloader.asm
nasm $< -f bin -o $@
clean:
rm -fr bin/*.bin bin/*.dis bin/*.o bin/os-image bin/*.map
kernel.dis : bin/kernel.bin
ndisasm -b 32 $< > $@

@ -0,0 +1,5 @@
[bits 32]
[extern main]
call main
jmp $
Loading…
Cancel
Save