Flash driver

From Embedded Xinu
Revision as of 18:53, 29 July 2009 by Michael (talk | contribs) (Created a stub for new Flash driver page)
Jump to navigation Jump to search

Embedded Xinu uses a multi-layered approach to dealing with Flash memory. This allows the presentation of a simple and consistent interface to user programs, while handling the more complicated hardware interface underneath.

High level API

Like other drivers in Embedded Xinu, the Flash driver provides user level calls to open(), close(), read(), write(), control(), and seek().

read() and write()

Both read() and write() take three parameters (device_id, buffer, and block_number). This is unlike other device calls where the final parameter is the size of the buffer.

Logical Layer

Maps the high level 512 byte block size to the underlying erase block size and location for reading and writing. Loads an entire erase block into RAM and marks it as dirty if modified.

Physical Layer

Handles interfacing with the underlying hardware by erasing the erase blocks when needed.


Provides an interface for working with the Intel Standard Command Set.


Provides an interface for working with the AMD/Samsung Standard Command Set.


Since NVRAM settings are part of Flash memory, the code to modify them is closely related to the Flash driver.