aboutsummaryrefslogtreecommitdiffstats
path: root/Bootloaders/MassStorage/Lib/VirtualFAT.h
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2013-03-29 10:23:09 +0000
committerDean Camera <dean@fourwalledcubicle.com>2013-03-29 10:23:09 +0000
commit83d5c4729e3cb014d2f75a5ac4132658ad6b7ea8 (patch)
treef03feebdd7163814ef7ed3cbeb3a7643cf105567 /Bootloaders/MassStorage/Lib/VirtualFAT.h
parent148b434228cfa94160cc1dbfafc455fd86825fa1 (diff)
downloadlufa-83d5c4729e3cb014d2f75a5ac4132658ad6b7ea8.tar.gz
lufa-83d5c4729e3cb014d2f75a5ac4132658ad6b7ea8.tar.bz2
lufa-83d5c4729e3cb014d2f75a5ac4132658ad6b7ea8.zip
Update Mass Storage bootloader for Linux compatibility, and to reduce the compiled bootloader size. Linux appears to replace files with a cluster offset on the disk rather than re-using the same disk clusters (unlike Windows) so the file offset needs to be tracked and compensated for.
Diffstat (limited to 'Bootloaders/MassStorage/Lib/VirtualFAT.h')
-rw-r--r--Bootloaders/MassStorage/Lib/VirtualFAT.h29
1 files changed, 23 insertions, 6 deletions
diff --git a/Bootloaders/MassStorage/Lib/VirtualFAT.h b/Bootloaders/MassStorage/Lib/VirtualFAT.h
index 37095eae5..820fe54d5 100644
--- a/Bootloaders/MassStorage/Lib/VirtualFAT.h
+++ b/Bootloaders/MassStorage/Lib/VirtualFAT.h
@@ -121,6 +121,23 @@
#define FAT_ORDINAL_LAST_ENTRY (1 << 6)
//@}
+ /* Enums: */
+ enum
+ {
+ DISK_FILE_ENTRY_VolumeID = 0,
+ DISK_FILE_ENTRY_FirmwareLFN = 1,
+ DISK_FILE_ENTRY_FirmwareMSDOS = 2,
+ };
+
+ enum
+ {
+ DISK_BLOCK_BootBlock = 0,
+ DISK_BLOCK_FATBlock1 = 1,
+ DISK_BLOCK_FATBlock2 = 2,
+ DISK_BLOCK_RootFilesBlock = 3,
+ DISK_BLOCK_DataStartBlock = 4,
+ };
+
/* Type Definitions: */
/** FAT boot block structure definition, used to identify the core
* parameters of a FAT filesystem stored on a disk.
@@ -213,13 +230,13 @@
static void UpdateFAT12ClusterEntry(uint8_t* const FATTable,
const uint16_t Index,
const uint16_t ChainEntry) AUX_BOOT_SECTION;
- static void WriteVirtualBlock(const uint16_t BlockNumber) AUX_BOOT_SECTION;
- static void ReadVirtualBlock(const uint16_t BlockNumber) AUX_BOOT_SECTION;
+
+ static void ReadWriteFirmwareFileBlock(const uint16_t BlockNumber,
+ uint8_t* BlockBuffer,
+ const bool Read) AUX_BOOT_SECTION;
#endif
- void VirtualFAT_WriteBlocks(const uint16_t BlockAddress,
- uint16_t TotalBlocks) AUX_BOOT_SECTION;
+ void VirtualFAT_WriteBlock(const uint16_t BlockNumber) AUX_BOOT_SECTION;
+ void VirtualFAT_ReadBlock(const uint16_t BlockNumber) AUX_BOOT_SECTION;
- void VirtualFAT_ReadBlocks(const uint16_t BlockAddress,
- uint16_t TotalBlocks) AUX_BOOT_SECTION;
#endif