Difference between revisions of "Flash driver"
(moved Flash driver to Talk:Flash driver/Original: Archived original flash driver page) |
(Created a stub for new Flash driver page) |
||
Line 1: | Line 1: | ||
− | + | [[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 <code>open()</code>, <code>close()</code>, <code>read()</code>, <code>write()</code>, <code>control()</code>, and <code>seek()</code>. | ||
+ | |||
+ | === <code>read()</code> and <code>write()</code> === | ||
+ | |||
+ | Both <code>read()</code> and <code>write()</code> take three parameters (<code>device_id</code>, <code>buffer</code>, and <code>block_number</code>). 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. | ||
+ | |||
+ | === Intel === | ||
+ | |||
+ | Provides an interface for working with the Intel Standard Command Set. | ||
+ | |||
+ | === AMD/Samsung === | ||
+ | |||
+ | Provides an interface for working with the AMD/Samsung Standard Command Set. | ||
+ | |||
+ | == NVRAM == | ||
+ | |||
+ | Since [[Flash memory#NVRAM|NVRAM]] settings are part of Flash memory, the code to modify them is closely related to the Flash driver. |
Revision as of 18:53, 29 July 2009
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.
Contents
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.
Intel
Provides an interface for working with the Intel Standard Command Set.
AMD/Samsung
Provides an interface for working with the AMD/Samsung Standard Command Set.
NVRAM
Since NVRAM settings are part of Flash memory, the code to modify them is closely related to the Flash driver.