-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (28 loc) · 924 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## tools
TARGET=i686-elf
CC=${TARGET}-gcc
CXX=${TARGET}-g++
ASM=yasm
export CC
export CXX
export ASM
all:
$(MAKE) -C ./kernel
os.img: all
@echo "Writing files to disk image..."
test -s os.img || ./scripts/mkimg.sh
sudo mount -o loop,offset=1048576 ./os.img /mnt/loop
sudo cp ./kernel/kernel /mnt/loop/boot/
sudo umount /mnt/loop
.PHONY: run rungdb runbochs
run: os.img
-qemu-system-x86_64 -d cpu_reset -m 512 -drive file=os.img,if=none,id=disk -device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0
rungdb: os.img
-qemu-system-x86_64 -d cpu_reset -m 512 -s -S -drive file=os.img,if=none,id=disk -device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0 & (sleep 0.1; gdb kernel/kernel -ex 'symbol-file kernel/kernel.sym' -ex 'target remote localhost:1234')
runbochs: os.img
-bochs -f scripts/bochsrc
.PHONY: clean cleandep
clean:
$(MAKE) -C ./kernel clean
cleandep:
$(MAKE) -C ./kernel cleandep