This is the mail archive of the
ecos-devel@sourceware.org
mailing list for the eCos project.
Re: Partition support for FAT file system
Frank Pagliughi <fpagliughi@mindspring.com> writes:
> It appears that the FAT file system in eCos works if the "whole disk"
> is a single partition, meaning that the FAT Boot Sector is written
> into the MBR at sector zero. But if the disk uses a partition table in
> the MBR, then the code doesn't understand it, rejects the disk as
> non-FAT, and fails the mount. This happens even if the disk contains
> only a single partition.
>
> I guess a quick enhancement would be for fatfs_mount() or fatfs_init()
> to check the partition table, see if there's at least one entry, and
> mount the first one it finds. If there are no partition entries,
> *then* check if the MBR is a valid FAT boot sector. This would make
> most disks (and compact flash cards) at least partially useful, rather
> than being rejected out right.
>
> As a longer term enhancement, supporting multiple partitions would be
> nice, but ideas on how to resolve the devs/mtab idea of a disk to
> different partitions would be appreciated.
This is already handled in the io/disk package. You mount /dev/diskN/M
for partition M of disk N and /dev/diskN/0 for the whole disk.
Partitioning is independent of filesystem type, so it must be done at
a lower level that the FATFS.
--
Nick Garnett eCos Kernel Architect
eCosCentric Limited http://www.eCosCentric.com The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK. Tel: +44 1223 245571
Registered in England and Wales: Reg No: 4422071