From 4af0637c7ff61f1a9fb96ea4f2822ce45a008ec7 Mon Sep 17 00:00:00 2001 From: Elaina Claus Date: Fri, 11 Oct 2024 13:00:45 -0400 Subject: [PATCH] use kmemset to 0 out fat32_state in InitFATDriver --- include/fat32/FAT32_SYS.inc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/include/fat32/FAT32_SYS.inc b/include/fat32/FAT32_SYS.inc index 60f155a..70d91ac 100644 --- a/include/fat32/FAT32_SYS.inc +++ b/include/fat32/FAT32_SYS.inc @@ -28,11 +28,14 @@ ALIGN 4, db 0x90 InitFATDriver: __CDECL16_ENTRY .func: - xor eax, eax - mov dword [fat32_state + FAT32_State_t.active_cluster_32], eax - mov dword [fat32_state + FAT32_State_t.active_FAT_cluster_32], eax - mov dword [fat32_state + FAT32_State_t.first_root_dir_sector_32], eax - mov dword [fat32_state + FAT32_State_t.active_dir_cluster_32], eax + mov ax, fat32_state_SIZE + push ax ; length of fat32_state structure + xor ax, ax + push ax ; init fat32_state with zero + mov ax, fat32_state + push ax ; address of structure + call kmemset + sub sp, 0x6 .calc_active_part: mov bx, [partition_offset_ptr]