The MPIO mp3 players from digitalw@ys are a series of solid state
music players. They use the
SmartMedia technology
developed by Toshiba
and Samsung. To understand the working of the mp3 player,
one has to understand the functioning of the SmartMedia memory.

SmartMedia cards are available from 1MB to 128MB chips. To keep this
document as simple as possible, we will only consider cards from 16MB
to 128MB.

SmartMedia(tm) is the trademark for the SSFDC "Solid State
Floppy Disc Card which mean that data is logically stored as it would
be on a common floppy disc or a small (<=128MB) hard disc drive. Data
is split up into sectors and are grouped into cluster,

Data on the SmartMedia card is protected by an ECC "Error
checking & correction" alogrithm. To each data sector (512 bytes) a
"Spare Area" (16 bytes) is asigned. This area contains the ECC
informations for this sector. Each sector is devided into two 256
bytes chunks. For every 256 bytes chunk, a 3 Byte ECC checksum is
calculated and stored in the "Spare Area". see
Format Introduction, page 16.

For the physical storage on a SmartMedia card, 32 sectors are grouped
together as a block (32 * 512 bytes = 16KB).
On a logical view of the SSFDC 32 sectors are grouped together as
a cluster (32 * 512 bytes = 16KB). (see Format Introduction, page 6+7)
Therefore logical clusters can be mapped one to one to physical
blocks.

To make the format a little more intersting, high density SmartMedia
cards (32MB and above) have a "Zone-based block management". Which
basically means that the physical blocks are not as continuing as
there logical cluster counterparts. Every zone contains 1024 physical
blocks which in turn only store 1000 logical clusters. While mapping
logical clusters to physical blocks you have to take into account that
there is a 24 block gap after 1000 blocks.

The physical structure of the SmartMedia memory type makes it
necessary that every physical block is erased before it can rewritten!

The MPIO player series have an internal SmartMedia memory and most are
capable of handling an external SmartMedia card. Two points make the support
off the MPIO players difficult

the internal memory may be devided into up to 4 chips (models with
1, 2 and 4 are known)

the internal and external memory are treated totally
different

The external memory is handled as one would it expect it from a
SmartMedia card. (Read Master Boot Sector, Read Partition Boot Sector,
calculate size and offsets of FAT, root directory, file area).
e.g reading of a file:

filename is looked up in root directory

directory entry reveals logical start cluster

repeat until all data from file is read:

find physical block from logical cluster number and spare area block status
informations

reading of physical block

check ECC informations and correct error if possible

next cluster of this file can be looked up in the FAT

A similar way applies for writing a file to SmartMedia card.

mapping logical cluster/blocks physical blocks:

TODO

The internal memory setup is much simpler. There is no Master Boot
Sector, or Partition Boot Sector. The "Spare Area" is used for storing
the FAT informations. There is no ECC storing/checking. The root
directory always starts at physical block/sector 0. [I'm unsure about
the Zone-based management, but I don't believe it is used for intermal
memory. -mager]