removed unused macro for calling read_disk_raw

more simplification of push's
This commit is contained in:
2025-09-11 12:12:48 -04:00
parent ef22bc9cd3
commit f341a50b78

View File

@@ -31,29 +31,6 @@ struc LBAPkt_t
.lower_lba resd 1
.upper_lba resd 1
endstruc
; call_read_disk_raw <word segment> <word offset> <dword lba> <word count> <word drive_num>
%macro call_read_disk_raw 5
movzx ax, %5
push ax ; drive_num
movzx ax, %4
push ax ; count
movzx dword eax, %3
push dword eax ; lba
movzx ax, %2
push ax ; offset
movzx ax, %1
push ax ; segment = 0
; uint8_t read_stage2_raw(uint16_t buf_segment, uint16_t buf_offset,
; uint32_t lba,
; uint16_t count, uint16_t drive_num)
call read_disk_raw
add sp, 0xC
%endmacro
; Wrapper for AH=0x42 INT13h (Extended Read)
;
@@ -70,7 +47,6 @@ endstruc
; disk address packet's block count field set to number of blocks
; successfully transferred
;
;
; uint8_t read_stage2_raw(uint16_t buf_segment, uint16_t buf_offset,
; uint32_t lba,
; uint16_t count, uint8_t drive_num)
@@ -78,13 +54,10 @@ ALIGN 4, db 0x90
read_disk_raw:
__CDECL16_PROC_ENTRY
.func:
mov ax, LBAPkt_t_size
push ax ; len
xor ax, ax
push ax ; val = 0
mov ax, lba_packet
push ax ; dest = lba_packet address
call kmemset
push LBAPkt_t_size ; len
push 0x00 ; val = 0
push lba_packet ; dest = lba_packet address
call kmemset ; kmemset(dst, val, len)
add sp, 0x06
mov bx, lba_packet
@@ -97,7 +70,8 @@ read_disk_raw:
mov dword [bx + LBAPkt_t.lower_lba], eax
; upper_lba is zero from kmemset
; TODO: possiblly support >32bit LBA addresses in the future, this limits us to 4GiB
; TODO: possiblly support >32bit LBA addresses in the future
; this will limit us to (4GiB * sector size) of readable lba's from the disk
mov ax, [bp + 6]
mov word [bx + LBAPkt_t.offset], ax