41 lines
762 B
Makefile
41 lines
762 B
Makefile
BUILD=./build
|
|
|
|
# Default rule
|
|
.PHONY: default
|
|
default: all
|
|
|
|
# Remove all build files
|
|
.PHONY: clean
|
|
clean:
|
|
rm -drf $(BUILD)
|
|
cd bootloader; make clean
|
|
|
|
# Make everything
|
|
.PHONY: all
|
|
all: img
|
|
|
|
# Make bios bootloader
|
|
# dd if=./bootloader/build/stage2.bin of=$@ conv=notrunc bs=512 seek=40
|
|
|
|
.PHONY: img
|
|
img: $(BUILD)/disk.img
|
|
$(BUILD)/disk.img:
|
|
mkdir -p $(BUILD)
|
|
cd bootloader; make
|
|
dd if=/dev/zero of=$@ bs=512 count=32
|
|
dd if=./bootloader/build/512.bin of=$@ conv=notrunc bs=512
|
|
dd if=./bootloader/build/stage2.bin of=$@ conv=notrunc seek=5 bs=512
|
|
|
|
qemu: $(BUILD)/disk.img
|
|
qemu-system-i386 \
|
|
-d cpu_reset \
|
|
-no-reboot \
|
|
-smp 1 -m 2048 \
|
|
-machine q35 \
|
|
-net none \
|
|
-serial stdio \
|
|
-fda "$<"
|
|
# -gdb tcp::26000 \
|
|
# -S
|
|
# -enable-kvm \
|
|
# -cpu host \
|