mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-19 09:35:15 -04:00
Review the build
This commit is contained in:
parent
4dc185d3b7
commit
57af577ba9
15
Makefile
15
Makefile
@ -1,20 +1,23 @@
|
||||
.PHONY: default clean force_look qemu bochs debug
|
||||
.PHONY: default clean force_look qemu bochs debug sectors
|
||||
|
||||
default: thor.flp
|
||||
|
||||
bootloader/bootloader.bin: force_look
|
||||
cd bootloader; $(MAKE)
|
||||
|
||||
micro_kernel/micro_kernel.bin: force_look
|
||||
cd micro_kernel; $(MAKE)
|
||||
|
||||
kernel/kernel.bin: force_look
|
||||
cd kernel; $(MAKE)
|
||||
|
||||
filler.bin: kernel/kernel.bin micro_kernel/micro_kernel.bin bootloader/bootloader.bin
|
||||
filler.bin: kernel/kernel.bin micro_kernel/micro_kernel.bin
|
||||
bash fill.bash
|
||||
|
||||
thor.flp: filler.bin
|
||||
sectors: force_look filler.bin
|
||||
cd bootloader; $(MAKE) sectors
|
||||
|
||||
bootloader/bootloader.bin: force_look sectors
|
||||
cd bootloader; $(MAKE)
|
||||
|
||||
thor.flp: bootloader/bootloader.bin
|
||||
cat bootloader/bootloader.bin > thor.bin
|
||||
cat micro_kernel/micro_kernel.bin >> thor.bin
|
||||
cat kernel/kernel.bin >> thor.bin
|
||||
|
@ -1,9 +1,14 @@
|
||||
default: bootloader.bin
|
||||
|
||||
.PHONY: sectors clean
|
||||
|
||||
sectors:
|
||||
bash compute_sectors.bash
|
||||
|
||||
stage1.bin: stage1.asm
|
||||
nasm -w+all -f bin -o stage1.bin stage1.asm
|
||||
|
||||
stage2.bin: stage2.asm
|
||||
stage2.bin: stage2.asm sectors.asm
|
||||
nasm -w+all -f bin -o stage2.bin stage2.asm
|
||||
|
||||
padding.bin:
|
||||
|
10
bootloader/compute_sectors.bash
Normal file
10
bootloader/compute_sectors.bash
Normal file
@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
|
||||
size_1=`stat -c%s ../kernel/kernel.bin`
|
||||
size_2=`stat -c%s ../micro_kernel/micro_kernel.bin`
|
||||
size_3=`stat -c%s ../filler.bin`
|
||||
|
||||
total_size=$(( $size_1 + $size_2 + $size_3 ))
|
||||
sectors=$(( $total_size / 512 ))
|
||||
|
||||
echo "sectors equ $sectors" > sectors.asm
|
1
bootloader/sectors.asm
Normal file
1
bootloader/sectors.asm
Normal file
@ -0,0 +1 @@
|
||||
sectors equ 79
|
@ -10,9 +10,9 @@
|
||||
jmp second_step
|
||||
|
||||
%include "intel_16.asm"
|
||||
%include "sectors.asm"
|
||||
|
||||
KERNEL_BASE equ 0x100 ; 0x100:0x0 = 0x1000
|
||||
sectors equ 0x52 ; sectors to read
|
||||
bootdev equ 0x0
|
||||
|
||||
; Loaded at 0x90:0x0
|
||||
|
Loading…
x
Reference in New Issue
Block a user