-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
47 lines (39 loc) · 1.62 KB
/
makefile
File metadata and controls
47 lines (39 loc) · 1.62 KB
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
38
39
40
41
42
43
44
45
46
47
AS = nasm
ASFLAGS = -f bin
TERM = alacritty
TERMFLAGS = -e
DBG = gdb
DBGFLAGS = -ex
all: assemble mkimg clean
assemble:
$(AS) $(ASFLAGS) boot.asm -o boot.bin # Bootloader
$(AS) $(ASFLAGS) ilinas/ilinas.asm -o ilinas.bin # Kernel
$(AS) $(ASFLAGS) shell/shell.asm -o shell.bin # Shell
$(AS) $(ASFLAGS) apps/appdir.asm -o appdir.bin # App directory
$(AS) $(ASFLAGS) apps/ver/ver.asm -o ver.bin # VER
$(AS) $(ASFLAGS) apps/third/third.asm -o third.bin # Third
$(AS) $(ASFLAGS) apps/err/err.asm -o errapp.bin # Err tester
$(AS) $(ASFLAGS) apps/memedit/memedit.asm -o memedit.bin # memEdit
$(AS) $(ASFLAGS) apps/int/int.asm -o int.bin # int
$(AS) $(ASFLAGS) apps/rfd/rfd.asm -o rfd.bin # Read from disk
mkimg:
dd if=/dev/zero of=disk.img bs=1M count=7 conv=notrunc
dd if=boot.bin of=disk.img bs=512 seek=0 conv=notrunc
dd if=ilinas.bin of=disk.img bs=512 seek=1 conv=notrunc
dd if=appdir.bin of=disk.img bs=512 seek=10 conv=notrunc
dd if=third.bin of=disk.img bs=512 seek=9 conv=notrunc
dd if=shell.bin of=disk.img bs=512 seek=11 conv=notrunc
dd if=ver.bin of=disk.img bs=512 seek=13 conv=notrunc
dd if=errapp.bin of=disk.img bs=512 seek=14 conv=notrunc
dd if=memedit.bin of=disk.img bs=512 seek=15 conv=notrunc
dd if=int.bin of=disk.img bs=512 seek=19 conv=notrunc
dd if=rfd.bin of=disk.img bs=512 seek=20 conv=notrunc
clean:
rm *.bin
run:
qemu-system-i386 -drive format=raw,file=disk.img,if=ide -monitor stdio
rundbg:
qemu-system-i386 -drive format=raw,file=disk.img,if=ide -s -S -monitor stdio
debug: opengdb rundbg
opengdb:
$(TERM) $(TERMFLAGS) $(DBG) $(DBGFLAGS) "target remote localhost:1234" &