-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (35 loc) · 1.3 KB
/
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
38
39
40
41
42
43
44
45
46
47
default:
make img
ipl10.bin : ipl10.nas Makefile
nasm ipl10.nas -o ipl10.bin -l ipl10.lst
asmhead.bin : asmhead.nas Makefile
nasm asmhead.nas -o asmhead.bin -l asmhead.lst
naskfunc.o : naskfunc.nas Makefile
nasm -f elf naskfunc.nas -o naskfunc.o -l naskfunc.lst
bootpack.hrb : naskfunc.o bootpack.c hrb.ld Makefile
# Compile C file using linker script
i386-elf-gcc -march=i486 -m32 -nostdlib -T hrb.ld bootpack.c naskfunc.o -o bootpack.hrb
# ld -m elf_i386 -nostdlib -s -T hrb.ld bootpack.c -o bootpack.hrb
# gcc -march=i486 -m32 -nostdlib -T hrb.ld bootpack.c -o bootpack.hrb
haribote.sys : asmhead.bin bootpack.hrb Makefile
cat asmhead.bin bootpack.hrb > haribote.sys
haribote.img : ipl10.bin haribote.sys Makefile
mformat -f 1440 -C -B ipl10.bin -i haribote.img ::
mcopy -i haribote.img haribote.sys ::
# -f : specifies the size of the DOS file system
# -C : creates the disk image file to install the MS-DOS file system on it.
# -B : Use the boot sector stored in the given file or device, instead of using its own.
# Only the geometry fields are updated to match the target disks parameters.
# asm :
# make -r ipl.bin
img :
make -r haribote.img
run :
make -r img
qemu-system-i386 -drive file=haribote.img,format=raw,if=floppy -boot a
clean:
rm *.bin
rm *.lst
rm *.sys
rm *.hrb
rm *.o