Added code + tooling to build os.
This commit is contained in:
parent
3da4d3538d
commit
d4d57c8053
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1,3 @@
|
||||
nimcache/
|
||||
isodir/
|
||||
myos.iso
|
||||
|
6
builddisc.sh
Executable file
6
builddisc.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
rm -r isodir
|
||||
mkdir -p isodir/boot/grub
|
||||
cp kernel isodir/boot/kernel
|
||||
cp grub.cfg isodir/boot/grub/grub.cfg
|
||||
grub-mkrescue -o myos.iso isodir
|
6
checkmultiboot.sh
Executable file
6
checkmultiboot.sh
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
if grub-file --is-x86-multiboot kernel; then
|
||||
echo multiboot confirmed
|
||||
else
|
||||
echo the file is not multiboot
|
||||
fi
|
10
makefile
Normal file
10
makefile
Normal file
@ -0,0 +1,10 @@
|
||||
all: kernel
|
||||
|
||||
kernel: bootloader
|
||||
nim cc --cc:clang --clang.linkerexe=ld.lld --gc:none --deadCodeElim:on --cpu:i386 --os:standalone --passC:"-ffreestanding -nostdlib --target=i686-pc-none-elf -march=i686" --passL:"-m elf_i386 boot.o" kernel.nim
|
||||
|
||||
bootloader:
|
||||
nasm -felf32 boot.s -o boot.o
|
||||
|
||||
clean:
|
||||
rm -r kernel nimcache/ boot.o
|
2
panicoverride.nim
Normal file
2
panicoverride.nim
Normal file
@ -0,0 +1,2 @@
|
||||
proc rawoutput(s: string) = discard
|
||||
proc panic(s: string) = discard
|
Loading…
Reference in New Issue
Block a user