Makefile
This commit is contained in:
parent
b6a9b2734e
commit
ede430390f
40
Makefile
Normal file
40
Makefile
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
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 \
|
||||||
|
-fda "$<"
|
||||||
|
# -gdb tcp::26000 \
|
||||||
|
# -S
|
||||||
|
# -enable-kvm \
|
||||||
|
# -cpu host \
|
Loading…
x
Reference in New Issue
Block a user