mirror of
https://github.com/genodelabs/genode.git
synced 2025-05-09 12:02:57 +00:00
The new types in base/ram.h model different allocation scenarios and error cases by mere C++ types without using exceptions. They are meant to replace the former 'Ram_allocator' interface. As of now, the 'Unmapped_allocator' closely captures the former 'Ram_allocator' semantics. The 'Constrained_allocator' is currently an alias for 'Unmapped_allocator' but is designated for eventually allocating mapped RAM. In contrast to the 'Ram_allocator' interface, which talked about dataspace capabilites but left the lifetime management of the allocated RAM to the caller, the new API represents an allocation as a guard type 'Allocation', which deallocates on destruction by default. Allocation errors are captured by a 'Result' type that follows the 'Attempt' pattern. As a transitionary feature, the patch largely maintains API compatibility with the original 'Ram_allocator' by providing the original (exception-based) 'Ram_allocator::alloc' and 'Ram_allocator::free' methods as a wrapper around the new 'Ram::Constrained_allocator'. So components can be gradually updated to the new 'Ram::' interface. Issue #5502
This is the generic Genode base system, which consists of two parts: :_Core_: is the root of the Genode component tree. It provides abstractions for the lowest-level hardware resources such as RAM, ROM, CPU, and device access. All generic parts of core can be found here. For kernel-specific parts, refer to the appropriate 'base-<kernel>' directory. :_Base libraries and interfaces: that are used by each Genode component to interact with other components. This is the glue that holds everything together. Depending on the used kernel, core may export information about the hardware platform as a ROM called 'platform_info'. For example, if the ACPI RSDT and XSDT physical pointer are reported by the used kernel and/or bootloader, core provides this information in the ROM as follows. !<platform_info> ! <acpi revision="2" rsdt="0x1fe93074" xsdt="0x1fe930e8"/> ! <boot> ! <framebuffer phys="0x7300000" width="1024" height="768" bpp="32"/> ! </boot> !</platform_info> If the graphics device is initialised and can be directly used by a framebuffer driver, core provides the physical pointer to the framebuffer, the resolution, and color depth in bits.