From 93a9c3d5e9ba566585fa4c082696422454491d78 Mon Sep 17 00:00:00 2001 From: Ain <41307858+nero@users.noreply.github.com> Date: Thu, 19 Sep 2019 20:12:35 +0000 Subject: [PATCH] Make drive table data offsets available via defines --- kernel/drive.asm | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/kernel/drive.asm b/kernel/drive.asm index 9f0b714..243b8e0 100644 --- a/kernel/drive.asm +++ b/kernel/drive.asm @@ -1,24 +1,23 @@ -%define drive_struct_len 0x0C +; drive table +%define drivetab_type 0x00 ; BYTE 0=unassigned, 1=BIOS/CHS, 2=BIOS/LBA +%define drivetab_num 0x01 ; BYTE DL number +%define drivetab_heads 0x02 ; CHS heads +%define drivetab_spt 0x03 ; CHS sectors per track +%define drivetab_sectors 0x04 ; total number of sectors +%define drivetab_offset 0x08 ; partition offset +%define drivetab_size 0x0C drive_table: dw 0 .count: dw 4 -; Drive table -; 00 BYTE DL number -; 01 BYTE file system type -; 02 BYTE CHS heads (ignored if LBA) -; 03 BYTE CHS sectors per track (ignored if LBA) -; 04 DWORD total number of sectors -; 08 DWORD partition offset - ; DI is incremented for the space taken ; IN ES:DI drive_setup: xor cx, cx mov [drive_table], di - mov al, drive_struct_len + mov al, drivetab_size mov ah, BYTE [drive_table.count] mul ah xchg cx, ax @@ -39,7 +38,7 @@ drive_load: mov si, [drive_table] push ax - mov al, drive_struct_len + mov al, drivetab_size mul dl add si, ax pop ax