Add a fat12-enabled boot sector

This commit is contained in:
2025-09-24 00:49:54 +02:00
parent bdb2fce4db
commit 3c90dd8b3d
4 changed files with 136 additions and 7 deletions

29
bootsect.S Normal file
View File

@@ -0,0 +1,29 @@
.arch i8086,jumps
.code16
.section .init
.global _start
_start:
#ifndef NOBPB
jmp l0
nop
.ascii "IBM 3.1"
bpb_bytespersect: .word 512
bpb_sectspercluster: .byte 2
bpb_reservedsects: .word 1
bbp_fats: .byte 2
bpb_rootentries: .word 112
bpb_localsectors: .word 720
bpb_mediadescr: .byte 0xfd
bpb_sectsperfat: .word 2
l0:
#endif // NOBPB
cli
xor %ax, %ax
mov %ax, %ds
mov %ax, %ss
mov $0x7c00, %sp
sti
jmp main