Commit Graph

6 Commits

Author SHA1 Message Date
e9e73bc027 dev: removed internal spinlock from bcache
bcaches must now have an explicit external lock to protect them from
concurrent access (i.e. a lock belonging to their parent block device)
2023-07-11 21:28:02 +01:00
3233169f25 dev: implement reading from block devices
reading from block devices is done using the block cache (bcache).
This cache stores sectors from a block device in pages of memory
marked as 'cached', which will allow them to be reclaimed when
memory pressure is high (TODO).

while block device drivers implement callbacks allowing reading/writing
at block-granularity, the device subsystem uses the block cache to
implement reading/writing at byte-granularity in a driver-agnostic way.

block drivers can disable the block cache for their devices, but this
will require that any clients communicate with the devices at
block-granularity.

also added an offset parameter to device and object read/write functions/callbacks.
2023-07-09 21:58:40 +01:00
d9b9c0d4e7 dev: implement block device registration 2023-07-08 15:55:43 +01:00
c5edce612d dev: implement generic devices
generic devices don't have a type (char, block, etc) and are created
by bus drivers to represent the device until a suitable driver is found.

generic devices are registered by the bus driver. once a more suitable
driver is found, that driver will re-register the device under itself.
2023-06-10 13:21:42 +01:00
b7b0691b8f dev: implement driver objects to organise and identify devices 2023-06-02 19:35:07 +01:00
5b53168c5f dev: add functions to create device objects 2023-04-03 16:59:14 +01:00