Main
Contact
Comments
Intro
Hardware
Software
FAT32
Photos
ASP.NET
ASP
Perl/CGI
NAS Sys
Libraries
Utilities
Projects DB
Parts Source
MP3Car
YAMMP
Oxygen MP3
PJRC
Z Player
PRUK2000
DSP MP3
Add a link
FAT32 Basic Disc Access Library


This page is dedicated to the design of code that allows access to an IDE Hard Disc which is formatted with the FAT32 file system. The code was designed to run on an Atmega AVR MCU but will probably port to others easily as it is written in standard C. This library will allow files and directories to be accessed, and builds upon the IDE Device Driver.

FAT32 Interface Layer Block Diagram

The FAT32 global structure is used to store global variables which relate to the location of FAT32 partition, also contains the LFN text buffer. The FAT32 definitions are used where constants are needed to refer to either types of files, and file structures.
The FAT32_Base functions provide need interaction with the lower IDE Device Driver layer, and perform tasks such as File Allocation Table traversing, LBA to Cluster number conversion, etc.
The FAT32_Access library is used by higher level routines such as directory browsing, file reading, and FAT32 initialisation. There should be no need for other functions outside the FAT32_Access library to directly use the FAT32_Base rountines.

Example

byte ReadData(UI32 startcluster, UI32 bytenum)
{
// Convert bytenum into a sector to read
sector = bytenum / 512;
// Convert bytenum and sector into an offset in current sector buffer
offset = bytenum - (sector*512);
// Read file sector
FAT32_SectorReader(startcluster, sector);
// Extract byte from sector read
bytedata = IDE_SectorByte(offset);
// Return data found
return bytedata;
}

Downloads and Links

Source_FAT32Basic.zip - Includes the FAT32 disc access and the IDERawRead functions...
IDE Raw Disc IO Page
- The source library containing only these functions, to allow accessing of 'raw' IDE sectors.
FAT32 File IO Library Page - The source library for my advanced FAT32 file access code which include fopen(), fgetc(), fscanf(), etc..
Advertiser Links

ASP.NET Digital Sales IPN
Digital sales ecommerce system for PayPal's IPN.
Start making money from only $14.99.


ASP User Membership
User signup & login authentication system
Low cost ASP script from only $4.99...

ASP.NET User Management
ASP.NET members area system, protect your website from only $5.99...

.NET Download Protection
ASP.NET download link protection/anti-leach system.
Low cost ASP.NET module for $3.99...

.NET Email Validation
Email address verification module
Low cost ASP.NET script only $3.99...

Advertise here!
(c) R. Riglar 2003-2006
Disclaimer