removed unused macro for calling read_disk_raw
more simplification of push's
This commit is contained in:
@@ -31,29 +31,6 @@ struc LBAPkt_t
|
|||||||
.lower_lba resd 1
|
.lower_lba resd 1
|
||||||
.upper_lba resd 1
|
.upper_lba resd 1
|
||||||
endstruc
|
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)
|
; Wrapper for AH=0x42 INT13h (Extended Read)
|
||||||
;
|
;
|
||||||
@@ -70,7 +47,6 @@ endstruc
|
|||||||
; disk address packet's block count field set to number of blocks
|
; disk address packet's block count field set to number of blocks
|
||||||
; successfully transferred
|
; successfully transferred
|
||||||
;
|
;
|
||||||
;
|
|
||||||
; uint8_t read_stage2_raw(uint16_t buf_segment, uint16_t buf_offset,
|
; uint8_t read_stage2_raw(uint16_t buf_segment, uint16_t buf_offset,
|
||||||
; uint32_t lba,
|
; uint32_t lba,
|
||||||
; uint16_t count, uint8_t drive_num)
|
; uint16_t count, uint8_t drive_num)
|
||||||
@@ -78,13 +54,10 @@ ALIGN 4, db 0x90
|
|||||||
read_disk_raw:
|
read_disk_raw:
|
||||||
__CDECL16_PROC_ENTRY
|
__CDECL16_PROC_ENTRY
|
||||||
.func:
|
.func:
|
||||||
mov ax, LBAPkt_t_size
|
push LBAPkt_t_size ; len
|
||||||
push ax ; len
|
push 0x00 ; val = 0
|
||||||
xor ax, ax
|
push lba_packet ; dest = lba_packet address
|
||||||
push ax ; val = 0
|
call kmemset ; kmemset(dst, val, len)
|
||||||
mov ax, lba_packet
|
|
||||||
push ax ; dest = lba_packet address
|
|
||||||
call kmemset
|
|
||||||
add sp, 0x06
|
add sp, 0x06
|
||||||
|
|
||||||
mov bx, lba_packet
|
mov bx, lba_packet
|
||||||
@@ -97,7 +70,8 @@ read_disk_raw:
|
|||||||
mov dword [bx + LBAPkt_t.lower_lba], eax
|
mov dword [bx + LBAPkt_t.lower_lba], eax
|
||||||
|
|
||||||
; upper_lba is zero from kmemset
|
; 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 ax, [bp + 6]
|
||||||
mov word [bx + LBAPkt_t.offset], ax
|
mov word [bx + LBAPkt_t.offset], ax
|
||||||
|
|||||||
Reference in New Issue
Block a user