2023-02-10 03:42:53 -06:00
|
|
|
objects = entry.o kernel.o task.o handler.o interrupt.o v86.o print.o tss.o dosfs/dosfs.o gdt.o usermode.o paging.o fault.o tests.o kbd.o helper.o progs.o disk.o hexedit.o
|
2023-02-08 11:38:35 -06:00
|
|
|
CFLAGS = -target "i686-elf" -m32 -mgeneral-regs-only -ffreestanding -march=i686 -fno-stack-protector -Wno-int-conversion -nostdlib -c
|
2022-09-16 15:50:58 -05:00
|
|
|
|
|
|
|
%.o: %.nasm
|
|
|
|
nasm -f elf32 -o $@ $<
|
|
|
|
|
|
|
|
%.o: %.c
|
2022-09-21 17:14:11 -05:00
|
|
|
clang $(CFLAGS) -O2 -o $@ $<
|
2022-09-16 15:50:58 -05:00
|
|
|
|
|
|
|
all: $(objects)
|
2022-09-14 16:50:44 -05:00
|
|
|
nasm boot.nasm -o boot.bin
|
2023-01-31 21:26:43 -06:00
|
|
|
gcc -Tlink.ld -Wl,-M -m32 -ffreestanding -nostartfiles -nostdlib -o kernel.bin\
|
2022-09-16 15:50:58 -05:00
|
|
|
$(objects)
|
2023-02-07 18:52:17 -06:00
|
|
|
dd bs=400 count=1 conv=notrunc if=boot.bin of=virtdisk.bin
|
2022-09-14 16:50:44 -05:00
|
|
|
dd bs=512 seek=1 conv=notrunc if=kernel.bin of=virtdisk.bin
|
|
|
|
virtdisk:
|
|
|
|
dd bs=1M count=32 if=/dev/zero of=virtdisk.bin
|
|
|
|
echo -n -e '\x55\xaa' | dd bs=1 seek=510 conv=notrunc of=virtdisk.bin
|
2022-09-16 15:50:58 -05:00
|
|
|
|
2022-09-21 17:14:11 -05:00
|
|
|
clean:
|
|
|
|
rm $(objects)
|