some debuging text for fat32 stuff

This commit is contained in:
2024-10-15 20:37:49 -04:00
parent f1842d0cbc
commit 38bcd93ced
2 changed files with 15 additions and 4 deletions

View File

@@ -90,6 +90,8 @@ ALIGN 4, db 0x90
SearchFATDIR:
__CDECL16_ENTRY
.file_lookup:
print_string SearchFATDIR_INFO_cstr
.load_first_dir:
mov eax, dword [fat32_state + FAT32_State_t.active_dir_cluster_32]
push dword eax ; cluster
@@ -156,6 +158,7 @@ SearchFATDIR:
jmp SearchFATDIR.empty_dir_entry
.parse_dir:
print_string MaybeFound_Boot_INFO_cstr
.lfn_check:
; check for ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_VOLUME_ID (0x0F) in offset 11
; TODO: going to skip LFN for now, since all valid volumes will have SFN's
@@ -182,8 +185,8 @@ SearchFATDIR:
.endp:
__CDECL16_EXIT
ret
; BUG: this function needs review
;
; bp - 2 - byte boot_drive
; uint32_t NextCluster(uint32_t active_cluster);
; if eax >= 0x0FFFFFF8 then there are no more clusters (end of chain)
@@ -192,6 +195,8 @@ ALIGN 4, db 0x90
NextCluster:
__CDECL16_ENTRY
.func:
print_string NextFATCluster_INFO_cstr
mov bx, [boot_drive_ptr]
movzx ax, byte [ds:bx]
mov byte [bp - 2], al ; save boot drive as a local for easy access
@@ -202,8 +207,8 @@ NextCluster:
.calc_offset:
; fat_offset = active_cluster * 4
mov eax, 4
mul edx
mov dword [si + FAT32_NextClusterData_t.fat_offset], eax
mul edx ; BUG: should check for carry here
mov dword [si + FAT32_NextClusterData_t.fat_offset], eax ; move lower 32 bits to fat offset
.calc_fat_sector:
; fat_sector = first_fat_sector + (fat_offset / sector_size)
@@ -282,6 +287,8 @@ ALIGN 4, db 0x90
ReadFATCluster:
__CDECL16_ENTRY
.func:
print_string ReadFATCluster_INFO_cstr
mov bx, [boot_drive_ptr]
movzx ax, byte [ds:bx]
mov byte [bp - 2], al ; save boot drive as a local for easy access

View File

@@ -400,8 +400,12 @@ define_cstr MemoryMap_OK, "Memory map OK"
define_cstr UnrealMode_OK, "Unreal mode OK"
define_cstr FileFound_OK, "Found SFN entry for bootable binary, first cluster -> "
define_cstr InitFATSYS_OK, "FAT32 Driver Init..."
define_cstr NewLine, ""
define_cstr SearchFATDIR_INFO, "Searching FAT DIR for bootable file..."
define_cstr NextFATCluster_INFO, "Attempting to find next FAT cluster..."
define_cstr ReadFATCluster_INFO, "Attempting to load next FAT"
define_cstr MaybeFound_Boot_INFO, "Maybe found a file...checking..."
define_cstr NewLine, ""
define_str BootTarget, "BOOT BIN"