Added TrueType base and HDA driver

This commit is contained in:
Jozef Nagy 2025-04-20 16:43:59 +02:00
parent aa3f734406
commit 42cc0d9f40
Signed by untrusted user who does not match committer: crz
GPG key ID: 459A4811CEAC7068
30 changed files with 7120 additions and 35 deletions

View file

@ -75,7 +75,7 @@ uintptr_t elf64_load(char *data, pagetable *pagemap)
debug("elf64_load(): phys=0x%llx, virt=0x%llx, size=%lu\n", phys, ph[i].p_vaddr, ph[i].p_filesz);
map_page(pagemap, ph[i].p_vaddr, phys, flags);
memcpy((void*)ph[i].p_vaddr - lowest, data + ph[i].p_offset, ph[i].p_filesz);
memcpy((void*)ph[i].p_vaddr, data + ph[i].p_offset, ph[i].p_filesz);
}
debug("elf64_load(): ELF loaded successfully, entry: 0x%llx\n", header->e_entry);

View file

@ -46,6 +46,7 @@ void aurix_load(char *kernel_path)
}
axboot_memmap *memmap = get_memmap(pm);
(void)memmap;
map_pages(pm, (uintptr_t)pm, (uintptr_t)pm, PAGE_SIZE, VMM_WRITABLE);
map_pages(pm, (uintptr_t)_aurix_handoff_start, (uintptr_t)_aurix_handoff_start, (uint64_t)_aurix_handoff_end - (uint64_t)_aurix_handoff_start, 0);
@ -61,11 +62,12 @@ void aurix_load(char *kernel_path)
void *kernel_entry = (void *)elf_load(kbuf, pm);
if (!kernel_entry) {
debug("aurix_load(): Failed to load '%s'! Halting...\n", kernel_path);
mem_free(kbuf);
while (1);
}
// mem_free(kbuf);
void *parameters = NULL;
(void)parameters;
debug("aurix_load(): Handoff state: pm=0x%llx, stack=0x%llx, kernel_entry=0x%llx\n", pm, stack, kernel_entry);
@ -76,6 +78,6 @@ void aurix_load(char *kernel_path)
__asm__ volatile("movq %[pml4], %%cr3\n"
"movq %[stack], %%rsp\n"
"callq *%[entry]\n"
:: [pml4]"r"(pm), [stack]"r"(stack), [entry]"r"(kernel_entry) : "memory");
:: [pml4]"r"(pm), [stack]"r"(stack + (16 * 1024)), [entry]"r"(kernel_entry) : "memory");
__builtin_unreachable();
}

25
boot/common/ui/font.c Normal file
View file

@ -0,0 +1,25 @@
/*********************************************************************************/
/* Module Name: font.c */
/* Project: AurixOS */
/* */
/* Copyright (c) 2024-2025 Jozef Nagy */
/* */
/* This source is subject to the MIT License. */
/* See License.txt in the root of this repository. */
/* All other rights reserved. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
/* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
/* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
/* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
/* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
/* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
/* SOFTWARE. */
/*********************************************************************************/
#include <mm/mman.h>
//#define STBTT_malloc(x,u) ((void)(u),mem_alloc(x))
//#define STBTT_free(x,u) ((void)(u),mem_free(x))
//#define STB_TRUETYPE_IMPLEMENTATION
//#include <ui/stb_truetype.h>

34
boot/common/ui/ui.c Normal file
View file

@ -0,0 +1,34 @@
/*********************************************************************************/
/* Module Name: gui.c */
/* Project: AurixOS */
/* */
/* Copyright (c) 2024-2025 Jozef Nagy */
/* */
/* This source is subject to the MIT License. */
/* See License.txt in the root of this repository. */
/* All other rights reserved. */
/* */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR */
/* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, */
/* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE */
/* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER */
/* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, */
/* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */
/* SOFTWARE. */
/*********************************************************************************/
#include <stdint.h>
enum framebuffer_type {
FB_ARGB = 0,
FB_RGBA = 1,
};
struct ui_config {
uintptr_t framebuffer;
int framebuffer_type;
};
void init_ui()
{
}