This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MBR with FATFS


On 27/02/2010 5:57, Slide wrote:
Does the current FATFS driver support having an MBR at the start of
the "disk"? I have to put a header of sorts at the start of my SD
device that I want to put the FAT file system on to tell my processor
how to boot. I'd like to put that into the 446 byte "executable code"
area of an MBR and then point the driver at the FAT which would occur
at some specific offset on the device. Is this possible with the
current driver? This would allow me to have an area of RAW data and
then have a partition for a file system afterward.

Hello,

We have been busy now for a while with a Compact Flash (CF) card and with MBR and VBR, and below is my conclusion.
(see also an old mail: http://sourceware.org/ml/ecos-discuss/2007-12/msg00151.html)


For a hard drive (or CF), at byte 0 should be the master boot record (MBR), and it contains the 'Table of primary partitions' at address 0x1BE. And there for each partition there is the address of the start of the partition, and the partition starts with the Volume boot record (VBR) (also called FAT boot sector).

However, if a drive has only 1 partition, you could just omit the MBR, and put the VBR at address 0x0. I think this is the old way, before there were partitions.

Now, the eCos fatfs implementation is confusing because it reads both VBR and MBR data at the same location (address 0x0), and prints out the results of that. BUT, it only uses the VBR information, it does not use the MBR information.

Conclusion: the eCos fatfs implementation only supports non-partitioned devices with a VBR at address 0x0 (and no MBR).

Kind regards,
Jürgen

--
Jürgen Lambrecht
R&D Associate
Tel: +32 (0)51 303045    Fax: +32 (0)51 310670
http://www.televic-rail.com
Televic Rail NV - Leo Bekaertlaan 1 - 8870 Izegem - Belgium
Company number 0825.539.581 - RPR Kortrijk



--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]