HomeCore 0.1.3 (07b5544)
Bare-metal personal computer firmware for Cortex-M
Loading...
Searching...
No Matches
Block devices

Storage read and written in fixed-size sectors, such as a ramdisk. More...

Collaboration diagram for Block devices:

Data Structures

struct  block_ops_t
 Operations a block driver provides; every one is required. More...
 
struct  block_device_t
 A block device: driver operations bound to one device instance. More...
 

Macros

#define BLOCK_SECTOR_SIZE   512U
 Sector size of every block device, in bytes.
 

Detailed Description

Storage read and written in fixed-size sectors, such as a ramdisk.

Block devices have no VFS node. The device description's mounts section attaches a filesystem to one; the generated code builds the block_device_t from the driver's <driver>_block_ops and device instance. Operations return 0 on success and -1 with errno set on failure, and are called only from thread context, never from interrupt handlers.

A block driver sets block: true in its binding. Transfers are whole BLOCK_SECTOR_SIZE sectors; a sector range outside the device fails with EIO. There is no erase operation: current devices overwrite in place.

Driver Compatible Backing store
Ramdisk homecore,ramdisk A .bss buffer sized by the size property; lost on reset
See also
Files and storage for how Filesystems use Block devices devices.
Block devices for the Drivers, their configuration, and tests.