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
write() take three parameters (
block_number). This is unlike other device calls where the final parameter is the size of the buffer.
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.
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.