Code: Select all
{
"shell_cmd": ["make"],
"workingDir": "~/Työpöytä/BitOs",
"variants": [
{
"name": "Clean",
"shell_cmd": ["make", "clean"],
"shell": true,
"workingDir": "~/Työpöytä/BitOs"
},
{
"name": "All",
"shell_cmd": ["make", "all"],
"shell": true,
"workingDir": "~/Työpöytä/BitOs"
},
{
"name": "Run",
"shell_cmd": ["make", "run"],
"shell": true,
"workingDir": "~/Työpöytä/BitOs"
}
]
}
Code: Select all
SOURCES=boot.o kernel.o flushes.o gdt.o interrupts.o idt.o
CC=i586-elf-g++
CFLAGS=-ffreestanding -O2 -Wall -Wextra -fno-exceptions -fno-rtti
all: $(SOURCES) link diskimg
link:
i586-elf-gcc -T linker.ld -o myos.bin -ffreestanding -O2 -nostdlib $(SOURCES) -lgcc
clean:
rm *.o myos.bin myos.iso
.s.o:
nasm -felf $< -o $@
.cpp.o:
$(CC) -c $< -o $@ $(CFLAGS)
diskimg:
cp myos.bin isodir/boot/myos.bin
grub-mkrescue -o myos.iso isodir
run:
qemu-system-i386 myos.iso