I don't even know what to write at this point

This commit is contained in:
Jozef Nagy 2025-03-10 17:10:35 +01:00
parent df0ebbbbcd
commit 72a46bc7ce
Signed by untrusted user who does not match committer: crz
GPG key ID: 459A4811CEAC7068
12 changed files with 235 additions and 96 deletions

View file

@ -20,6 +20,17 @@
#ifndef _MM_PAGING_H
#define _MM_PAGING_H
#include <stdint.h>
#define PAGE_SIZE 0x1000
#define VMM_PRESENT 1
#define VMM_WRITABLE 2
#define VMM_NX (1ull << 63)
#define VMM_USER 4
typedef struct {
uint64_t entries[512];
} pagetable;
#endif /* _MM_PAGING_H */

View file

@ -20,6 +20,7 @@
#ifndef _LOADER_ELF_H
#define _LOADER_ELF_H
#include <mm/vmm.h>
#include <stdint.h>
//#include <stddef.h>
@ -72,6 +73,6 @@ struct elf_program_header {
#define PF_W 0x2
#define PF_R 0x4
uint64_t elf_load(char *kernel, uintptr_t *pagemap);
uintptr_t elf_load(char *kernel, pagetable *pagemap);
#endif /* _LOADER_ELF_H */

View file

@ -23,13 +23,9 @@
#include <arch/mm/paging.h>
#include <stdint.h>
#define VMM_PRESENT 1
#define VMM_WRITABLE 2
#define VMM_NX (1ull << 63)
#define VMM_USER 4
pagetable *create_pagemap(void);
uintptr_t *create_pagemap(void);
void map_page(uintptr_t *pm, uintptr_t virt, uintptr_t phys, uint64_t flags);
void map_page(pagetable *pm, uintptr_t virt, uintptr_t phys, uint64_t flags);
void map_pages(pagetable *pm, uintptr_t virt, uintptr_t phys, size_t size, uint64_t flags);
#endif /* _MM_VMM_H */

View file

@ -0,0 +1,25 @@
/*********************************************************************************/
/* Module Name: aurix.h */
/* 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. */
/*********************************************************************************/
#ifndef _PROTO_AURIX_H
#define _PROTO_AURIX_H
void aurix_load(char *kernel);
#endif /* _PROTO_AURIX_H */