Commit Graph

15 Commits

Author SHA1 Message Date
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
abe4af093e tty: implement read/write support 2023-06-11 09:23:57 +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
20f77893cf dev: implement bus device enumeration 2023-06-09 21:24:51 +01:00
cb220452db dev: start implementing framebuffer devices 2023-06-06 22:01:17 +01:00
52c17be29d dev: check that driver has a major number before registering device 2023-06-03 21:06:33 +01:00
b7b0691b8f dev: implement driver objects to organise and identify devices 2023-06-02 19:35:07 +01:00
d02d05d922 obj: add read() and write() object callbacks 2023-05-14 21:11:32 +01:00
0238008986 dev: auto-generate device name in device_register if name is unspecified 2023-05-11 21:19:00 +01:00
05395542a8 dev: implement writing/reading input events to/from input devices 2023-05-10 20:33:40 +01:00
1a633eee6b dev: implement object callbacks for devices. add misc device 2023-05-08 18:18:34 +01:00
f52ca2f1e2 obj: object header is no longer allocated automatically 2023-05-06 19:48:14 +01:00
b6f8c1ccaa kernel: don't use typedef for enums or non-opaque structs 2023-04-13 11:40:52 +01:00
5b53168c5f dev: add functions to create device objects 2023-04-03 16:59:14 +01:00