mirror of
https://github.com/fergalmoran/ferglos.git
synced 2025-12-22 09:28:22 +00:00
Initial ISO stuff
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,3 +1,5 @@
|
||||
.vscode
|
||||
*.o
|
||||
*.bin
|
||||
vm/
|
||||
*.iso
|
||||
|
||||
20
Makefile
20
Makefile
@@ -13,5 +13,21 @@ objs = loader.o kernel.o
|
||||
ferglos.bin: linker.ld $(objs)
|
||||
ld $(LDPARAMS) -T $< -o $@ $(objs)
|
||||
|
||||
install: ferglos.bin
|
||||
sudo cp $< /boot/ferglos.bin
|
||||
ferglos.iso: ferglos.bin
|
||||
mkdir -p iso/boot/grub
|
||||
cp ferglos.bin iso/boot/ferglos.bin
|
||||
echo 'set timeout=0' > iso/boot/grub/grub.cfg
|
||||
echo 'set default=0' >> iso/boot/grub/grub.cfg
|
||||
echo '' >> iso/boot/grub/grub.cfg
|
||||
echo 'menuentry "FerglOS" {' >> iso/boot/grub/grub.cfg
|
||||
echo ' multiboot /boot/ferglos.bin' >> iso/boot/grub/grub.cfg
|
||||
echo ' boot' >> iso/boot/grub/grub.cfg
|
||||
echo '}' >> iso/boot/grub/grub.cfg
|
||||
grub-mkrescue --output=ferglos.iso iso
|
||||
rm -rf iso
|
||||
|
||||
run: ferglos.iso
|
||||
/usr/lib/virtualbox/VirtualBoxVM --startvm FerglOS
|
||||
|
||||
clean:
|
||||
rm -rfv iso *.o *.bin
|
||||
|
||||
@@ -9,8 +9,14 @@ void printf(char* str) {
|
||||
}
|
||||
}
|
||||
|
||||
typedef void (*constructor)();
|
||||
extern "C" constructor start_ctors;
|
||||
extern "C" constructor end_ctors;
|
||||
extern "C" void call_constructors() {
|
||||
for (constructor* i = &start_ctors; i != (constructor*)end_ctors; i++) {
|
||||
(*i)();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
take in the multiboot structure and the GRUB magic number
|
||||
|
||||
Reference in New Issue
Block a user