Embedded Xinu Operating System
An ongoing research project and educational operating system.
|
#include <flash.h>
Functions | |
devcall | physicalRead (struct flash *flash, struct flash_block *block) |
devcall | physicalWrite (struct flash *flash, struct flash_block *block) |
devcall | physicalErase (struct flash *flash, struct flash_block *block) |
devcall | physicalControl (struct flash *flash, struct flash_block *block, uchar func, ulong arg) |
A function from this file calls the proper function of the specific command set if it is supported.
Functions in this file communicate directly with the hardware to achieve their goals. This file acts like the BIOS in older computers (by providing calls to to the physical work to the O/S).
devcall physicalControl | ( | struct flash * | flash, |
struct flash_block * | block, | ||
uchar | func, | ||
ulong | arg | ||
) |
*flash | flash device to use |
*block | block to perform operations on |
func | see include/flash.h for functions |
arg | argument (if needed) |
devcall physicalErase | ( | struct flash * | flash, |
struct flash_block * | block | ||
) |
Erase an erase-block from Flash memory. Flash memory can only change a binary 1 to a binary 0, not the other way around. In order to write new data to the device we must tell flash to change all 0s to 1s.
*flash | flash device to perform operations on |
*block | block to erase |
devcall physicalRead | ( | struct flash * | flash, |
struct flash_block * | block | ||
) |
Physically read from the flash device. Passed in block must contain the start_pos for the reading and the size of the block located at start_pos.
*flash | flash device used for data. |
*block | flash_block to store data in. |
devcall physicalWrite | ( | struct flash * | flash, |
struct flash_block * | block | ||
) |
Physically write to the flash device. This will write a stored block to memory if the state if FLASH_BLOCK_DIRTY (data within the block has changed). If it is not in the FLASH_BLOCK_DIRTY state that means the block is either FREE (nothing is stored) or CLEAN (hasn't changed since it was read).
*flash | flash device used for data. |
*block | flash_block to store data in. |