mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-10 13:04:53 -04:00
Cleanup make files
This commit is contained in:
parent
3664d4f6a0
commit
68c26a741b
15
Makefile
15
Makefile
@ -1,20 +1,17 @@
|
|||||||
.PHONY: default clean force_look qemu bochs debug sectors
|
.PHONY: default clean force_look qemu bochs debug
|
||||||
|
|
||||||
default: thor.flp
|
default: thor.flp
|
||||||
|
|
||||||
kernel/kernel.bin: force_look
|
kernel/kernel.bin: force_look
|
||||||
cd kernel; $(MAKE)
|
cd kernel; $(MAKE)
|
||||||
|
|
||||||
filler.bin: kernel/kernel.bin
|
bootloader/stage1.bin: force_look
|
||||||
bash fill.bash
|
cd bootloader; $(MAKE) stage1.bin
|
||||||
|
|
||||||
sectors: force_look filler.bin
|
bootloader/stage2.bin: force_look
|
||||||
cd bootloader; $(MAKE) sectors
|
cd bootloader; $(MAKE) stage2.bin
|
||||||
|
|
||||||
bootloader/bootloader.bin: force_look sectors
|
thor.flp: bootloader/stage1.bin bootloader/stage2.bin kernel/kernel.bin
|
||||||
cd bootloader; $(MAKE)
|
|
||||||
|
|
||||||
thor.flp: bootloader/bootloader.bin
|
|
||||||
dd if=bootloader/stage1.bin of=hdd.img conv=notrunc
|
dd if=bootloader/stage1.bin of=hdd.img conv=notrunc
|
||||||
dd if=bootloader/stage2.bin of=hdd.img seek=1 conv=notrunc
|
dd if=bootloader/stage2.bin of=hdd.img seek=1 conv=notrunc
|
||||||
sudo /sbin/losetup -o1048576 /dev/loop0 hdd.img
|
sudo /sbin/losetup -o1048576 /dev/loop0 hdd.img
|
||||||
|
@ -1,23 +1,14 @@
|
|||||||
default: bootloader.bin
|
default: all
|
||||||
|
|
||||||
.PHONY: sectors clean
|
.PHONY: all clean
|
||||||
|
|
||||||
sectors:
|
|
||||||
bash compute_sectors.bash
|
|
||||||
|
|
||||||
stage1.bin: stage1.asm
|
stage1.bin: stage1.asm
|
||||||
nasm -w+all -f bin -o stage1.bin stage1.asm
|
nasm -w+all -f bin -o stage1.bin stage1.asm
|
||||||
|
|
||||||
stage2.bin: stage2.asm sectors.asm
|
stage2.bin: stage2.asm
|
||||||
nasm -w+all -f bin -o stage2.bin stage2.asm
|
nasm -w+all -f bin -o stage2.bin stage2.asm
|
||||||
|
|
||||||
#padding.bin:
|
all: stage1.bin stage2.bin
|
||||||
# dd if=/dev/zero of=padding.bin bs=512 count=34
|
|
||||||
|
|
||||||
bootloader.bin: stage1.bin stage2.bin
|
|
||||||
cat stage1.bin > bootloader.bin
|
|
||||||
cat stage2.bin >> bootloader.bin
|
|
||||||
# cat padding.bin >> bootloader.bin
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f stage1.bin
|
rm -f stage1.bin
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
size_1=`stat -c%s ../kernel/kernel.bin`
|
|
||||||
size_2=`stat -c%s ../filler.bin`
|
|
||||||
|
|
||||||
total_size=$(( $size_1 + $size_2 ))
|
|
||||||
sectors=$(( $total_size / 512 ))
|
|
||||||
|
|
||||||
echo "sectors equ $sectors" > sectors.asm
|
|
Loading…
x
Reference in New Issue
Block a user