diff options
| author | Ada Christine <adachristine18@gmail.com> | 2022-02-24 01:58:07 +0000 |
|---|---|---|
| committer | Ada Christine <adachristine18@gmail.com> | 2022-02-24 01:58:07 +0000 |
| commit | 1923e47fd296399180eaf19b990d5e951d71ccd2 (patch) | |
| tree | 2c61fa3d29321c3cf8e31a6ca1b1edcc053cb8f1 /api | |
| parent | 4fa48a2a7814c2f7d3992533313df283c3aa2652 (diff) | |
many changes
- boot time memory allocation has changed. the fractal page map has been
replaced by a single self-mapped page giving 2MiB of ready virtual
space to play with without needing a fully-initialized memory manager. this
scheme may be repeated for other purposes
- the page stack has now been totally overhauled to make use of sparse
allocation and all of the ugly init_*() procedures are gone. long live
the new interface. also reference counting is a thing now. sort of.
- found a bug in vmt_init_node where insertion did not use the root node as
the parent in the case of no predecessor node. whoops.
Diffstat (limited to 'api')
| -rw-r--r-- | api/kernel/entry.h | 69 | ||||
| -rw-r--r-- | api/kernel/memory/range.h | 6 |
2 files changed, 51 insertions, 24 deletions
diff --git a/api/kernel/entry.h b/api/kernel/entry.h index eb7043c..460b677 100644 --- a/api/kernel/entry.h +++ b/api/kernel/entry.h @@ -3,33 +3,56 @@ #include <stddef.h> #include <kernel/memory/range.h> +enum video_pixel_format +{ + NO_VIDEO_FORMAT, + RGBA32BPP_VIDEO_FORMAT, + BGRA32BPP_VIDEO_FORMAT +}; + +enum acpi_version +{ + ACPI_LEGACY, + ACPI_CURRENT +}; + +struct kc_boot_data_buffer +{ + unsigned char *base; + unsigned char *current; + size_t max_size; + size_t available_size; +}; + +struct kc_boot_memory_data +{ + struct memory_range *entries; + size_t count; +}; + +struct kc_boot_video_data +{ + struct memory_range framebuffer; + uint16_t width; + uint16_t height; + size_t pitch; + enum video_pixel_format format; +}; + +struct kc_boot_acpi_data +{ + void *rsdp; + enum acpi_version version; +}; + typedef int (*kc_entry_func)(void *parameters); struct kc_boot_data { - struct - { - void *base; - size_t size; - } object_space; - struct - { - struct memory_range *base; - size_t entries; - } phys_memory_map; - struct - { - struct memory_range range; - size_t pitch; // line stride in bytes - uint16_t width; // width in pixels - uint16_t height; // height in pixels - uint8_t format; // pixel format - } framebuffer_info; - struct - { - void *rsdp; - uint8_t version; - } acpi_info; + struct kc_boot_data_buffer buffer; + struct kc_boot_memory_data memory; + struct kc_boot_video_data video; + struct kc_boot_acpi_data acpi; }; struct kc_boot_data *get_boot_data(void); diff --git a/api/kernel/memory/range.h b/api/kernel/memory/range.h index 90b3354..0084bbb 100644 --- a/api/kernel/memory/range.h +++ b/api/kernel/memory/range.h @@ -7,10 +7,14 @@ typedef uintptr_t phys_addr_t; enum memory_range_type { - UNUSABLE_MEMORY, + // types for physical pages RESERVED_MEMORY, SYSTEM_MEMORY, AVAILABLE_MEMORY, + // types for firmware pages with unknown backing + FIRMWARE_MEMORY, + // types for other addresses that are not physical + MMIO_MEMORY, INVALID_MEMORY = 0xff }; |
