by Tight Yorky » Fri Jun 20, 2014 10:04 am
Hi,
pcbbc you are correct about the allocation, any cluster can be valid, and may be due to the history of transactions on the disk.
But just to expand on my previous post, that may not be obvious to a reader that has not seen the internal MSD code by MChip. There is no format command in the application, the FAT12 'disk' format is effectively coded in the 'C' file as constant byte arrays. So if the application is adapted for your own use, it is necessary to re-evaluate (all) the relevant sector entries to ensure the format is valid for an operating system to read. If you add or remove a pre-loaded file for example, the root dir, both FAT entries, the data cluster(sectors) have to be altered in the byte arrays.
hoosier, I find it easier to work with FAT12 by remaining in bytes rather than constructing words. Writing the bytes backwards helps interpret the FAT12 clusters (see the attached jpg which is a screen capture of an excel sheet).
You can be prevent Windows formatting your disk by preventing write access to LBA 0 and 1 (MBR/VBR) and returning an invalid command through the SCSI command reply.
Hope this assists.
T Yorky.
(I have posted here as MChip forum would not accept my post after over an hour of trying!)
- Attachments
-
- Post002_FAT.jpg (99.2 KiB) Viewed 6261 times