diff --git a/.gitignore b/.gitignore index 2eb29b5..02dc906 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ nimcache/ isodir/ myos.iso *.o +myos.bin diff --git a/builddisc.sh b/builddisc.sh index c99f4c8..09c39cd 100755 --- a/builddisc.sh +++ b/builddisc.sh @@ -1,6 +1,6 @@ #!/bin/sh rm -r isodir mkdir -p isodir/boot/grub -cp kernel isodir/boot/kernel +cp myos.bin isodir/boot/kernel cp grub.cfg isodir/boot/grub/grub.cfg grub-mkrescue -o myos.iso isodir diff --git a/makefile b/makefile index 601d953..7e25ab5 100644 --- a/makefile +++ b/makefile @@ -1,7 +1,7 @@ all: kernel kernel: bootloader - nim cc --cc:clang --clang.linkerexe=clang --gc:none --deadCodeElim:on -d:StandaloneHeapSize=4096 --cpu:i386 --os:standalone --passC:"-ffreestanding -nostdlib --target=i686-pc-none-elf -march=i686" --passL:"-target i386 -nostdlib -T linker.ld boot.o" kernel.nim + nim cc kernel.nim bootloader: nasm -felf32 boot.s -o boot.o diff --git a/nim.cfg b/nim.cfg new file mode 100644 index 0000000..8c2279a --- /dev/null +++ b/nim.cfg @@ -0,0 +1,9 @@ +--cc:clang +--clang.linkerexe=clang +--gc:none +--deadCodeElim:on +--cpu:i386 +--os:standalone +--passC:"-ffreestanding -nostdlib --target=i686-pc-none-elf -march=i686" +--passL:"-target i386 -nostdlib -T linker.ld boot.o" +-o:myos.bin