correct some field sizes

This commit is contained in:
2024-10-18 07:57:42 -04:00
parent 48f0de8f7b
commit 94c2a1626d
2 changed files with 10 additions and 7 deletions

View File

@@ -98,13 +98,16 @@ read_disk_raw:
mov ax, [bp + 12] mov ax, [bp + 12]
mov word [bx + LBAPkt_t.xfer_size], ax mov word [bx + LBAPkt_t.xfer_size], ax
mov eax, [bp + 8] mov eax, dword [bp + 8]
mov dword [bx + LBAPkt_t.lower_lba], eax 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
mov ax, [bp + 6] mov ax, [bp + 6]
mov word [bx + LBAPkt_t.offset], ax mov word [bx + LBAPkt_t.offset], ax
movzx ax, byte [bp + 4] mov ax, [bp + 4]
mov word [bx + LBAPkt_t.segment], ax mov word [bx + LBAPkt_t.segment], ax
xor ax, ax xor ax, ax

View File

@@ -21,18 +21,18 @@
%ifndef __INC_KMEM_FUNC %ifndef __INC_KMEM_FUNC
%include 'cdecl16.inc' %include 'cdecl16.inc'
; uint8_t* kmemset_byte(void* dst, uint8_t val, uint16_t len); ; void* kmemset_byte(void* dst, uint8_t val, uint16_t len);
ALIGN 4, db 0x90 ALIGN 4, db 0x90
kmemset: kmemset:
__CDECL16_ENTRY __CDECL16_ENTRY
.func: .func:
mov cx, [bp + 8] ; size_t len mov cx, [bp + 8] ; uint16_t len
mov al, [bp + 6] ; uint8_t val mov al, byte [bp + 6] ; uint8_t val
mov di, [bp + 4] ; void * dst mov di, [bp + 4] ; void * dst
cld cld
rep stosb rep stosb
mov ax, di ; return pointer to dest mov ax, di ; return pointer to dest + len (last elem of dest)
.endp: .endp:
__CDECL16_EXIT __CDECL16_EXIT
ret ret