kernel: First steps of calculating drive tab data from BPB

This commit is contained in:
Nero 2020-08-31 20:11:05 +00:00
parent cc3fe6c4ee
commit 352540bd25
3 changed files with 77 additions and 118 deletions

View file

@ -2,9 +2,28 @@
org 0x500
%include "inc/bpb.asm"
%include "inc/mbr.asm"
%include "inc/dpt.asm"
; drive table entry
struc drive
.biosnum: resb 1
.flag: resb 1
.spc: resw 1
.cylinders: resw 1
.dpt: resb dpt_size
.type: resb 1 ; 12 or 16, depending on FAT type
.fat_offset: resd 1 ; offset of fat table
.fat_num: resw 1 ; number of fat tables
.fat_size: resw 1 ; sectors per fat table
.dir_offset: resd 1 ; offset of root directory
.dir_size: resw 1 ; size of root directory in sectors
.clus_offset: resd 1 ; offset of clusters
.clus_num: resw 1 ; number of clusters
.clus_size: resw 1 ; sectors per cluster
endstruc
; kernel stack size in words
%define stacksize 512
@ -240,6 +259,7 @@ fputc: push ax
iret
%include "kernel/drive.asm"
%include "kernel/fat.asm"
zero: dw 0
@ -252,5 +272,5 @@ vects: dw int20h, int21h, retf, retf
_end: dw 0x55AA, 0x55AA
section .bss
; stack to be used during init and disk i/o
stack: resw stacksize
; stack to be used during init and disk i/o
stack: resw stacksize