flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > fatLX - low level FAT file system driver |
Author |
|
Mike Gonta 18 Mar 2012, 19:48
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 DRIVE_INFO struct. Code: proc get_drive_info, drive_info ; load boot sector and setup some variables proc get_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 proc get_next_directory_entry, drive_info ; return pointer to next directory entry, buffering directory as necessary proc mark_directory, drive_info ; mark directory buffer modified when directory entry changed proc flush_directory, drive_info ; write directory sector to drive proc get_fat_entry, drive_info, fat ; load calculated fat sector (3 if fat12) to fat buffer in drive_info ; return cluster number of fat entry proc put_fat_entry, drive_info, fat, cluster_number ; update fat entry with cluster number ; mark fat buffer as modified proc flush_fat, drive_info ; write fat sector to drive The code will be released as Public Domain. |
|||
18 Mar 2012, 19:48 |
|
GhostXoPCorp 20 Mar 2012, 02:18
Really like it, to be honest the system you have here is similar to the one i have. Either a good idea or everyone does this as well. Better idea to put it into macro form. Keep up the good work
_________________ Oh that divide overflow. Just jumps out of the bushes every time to scare the day lights out of me. |
|||
20 Mar 2012, 02:18 |
|
Mike Gonta 20 Mar 2012, 09:17
GhostXoPCorp wrote: Better idea to put it into macro form. fasmx (operating system independent HLL macros) is the macro form. |
|||
20 Mar 2012, 09:17 |
|
Dex4u 20 Mar 2012, 20:25
Cool, i have had the the same idea, but with something like 'macro basic'
|
|||
20 Mar 2012, 20:25 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.