fatLX - low level FAT file system driver
LX is the Roman numeral (which as a number system is pretty much only used for Super Bowl) for 60
and fat32 + fat16 + fat12 adds up to 60.
For simplicity, the code assumes an unpartitioned USB flash drive with the Volume Boot Record in the first
physical sector and sector size 512 bytes. The code is PM32 and uses the HLL fasmx macros.
The DRIVE_INFO struct currently 3k in size, contains variables and data used in the process.
The high level file sytem routines such as read, write, delete, rename, etc. will first setup drive_info and call
get_drive_info which will load the boot sector and setup some variables. The other routines will access the
; load boot sector and setup some variables
procget_first_directory_entry, drive_info, cluster_number
; load 1st sector of directory in 512 byte buffer in drive_info,
; if cluster_number is 0 use root directory of fat12 or fat16
; return pointer to first directory entry
; return pointer to next directory entry, buffering directory as necessary
; mark directory buffer modified when directory entry changed
; write directory sector to drive
procget_fat_entry, drive_info, fat
; load calculated fat sector (3 if fat12) to fat buffer in drive_info
; return cluster number of fat entry
procput_fat_entry, drive_info, fat, cluster_number
; update fat entry with cluster number
; mark fat buffer as modified
; write fat sector to drive
I've started work on the code. Comments, suggestions and participation are welcome.
The code will be released as Public Domain.
_________________ Mike Gonta
look and see - many look but few see
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum