Commit Graph

17 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
d96c549f17 vm: allow pages to be mapped as no-cache 2023-07-08 15:53:06 +01:00
9f3c080e41 vm: minimum and maximum zone IDs are now defined in arch/../vm.h 2023-05-07 21:39:31 +01:00
b6f8c1ccaa kernel: don't use typedef for enums or non-opaque structs 2023-04-13 11:40:52 +01:00
cb622f5ad4 vm: add macro for allocating and initialising C++ objects 2023-03-24 14:20:26 +00:00
2bfb6bcd78 kernel: add c++ support 2023-03-20 20:41:39 +00:00
a7d4166c89 vm: implement a sparse memory model 2023-02-08 17:13:01 +00:00
b8eb88627a vm: add huge page order size definitions 2023-02-08 17:11:08 +00:00
4edc7e308e vm: refactor page_array and functions into a separate source file 2023-02-07 21:18:08 +00:00
625eac9ca7 x86_64: implement bootstrap function for pmap interface 2023-02-06 20:50:38 +00:00
0516ef06a3 vm: explicitly initialise kmalloc in vm_bootstrap
if kmalloc is called with count=N before vm_bootstrap is finished,
the request will be fulfilled using memblock_alloc.

if N is a power of 2, the returned pointer will be aligned to
an N-byte boundary.
2023-02-06 20:50:38 +00:00
5c7bde4fdf vm: add alignment parameter to cache allocator
caches with object size N, where N is a power of two, will naturally
align their objects on N-byte boundaries.

all other caches will align to an 8-byte boundary by default.
2023-02-06 20:50:38 +00:00
109616ec30 vm: add memblock support to vm_virt_to_phys, add vm_phys_to_virt 2023-02-06 20:50:38 +00:00
58171df912 vm: move arch-specific definitions to arch/ 2023-02-05 10:28:07 +00:00
40f83922da sandbox: moved all sources to main kernel tree 2023-02-03 20:43:38 +00:00
e714d619ba kernel: remove placeholder vm subsystem 2023-02-03 20:37:45 +00:00
e922a776c3 Added stubs for the kernel memory manager 2022-12-28 23:04:09 +00:00