This commit is contained in:
Freya Murphy 2024-01-27 02:17:18 -05:00
parent 2747693fdb
commit 451984595e
Signed by: freya
GPG key ID: 744AB800E383AE52
4 changed files with 4 additions and 11 deletions

View file

@ -8,7 +8,7 @@ ISO_NAME=os_image.iso
CC=cc CC=cc
LD=ld LD=ld
CFLAGS=-ffreestanding -g -Wall -Wextra -pedantic -lgcc -isystem $(INCLUDE_DIR) CFLAGS=-std=c2x -ffreestanding -g -Wall -Wextra -pedantic -lgcc -isystem $(INCLUDE_DIR)
C_SRC=$(shell find $(SRC_DIR) -type f -name "*.c") C_SRC=$(shell find $(SRC_DIR) -type f -name "*.c")

View file

@ -1,10 +1,11 @@
#include "arch/amd64/bindings.h"
#include <acpi.h> #include <acpi.h>
#include <lib.h> #include <lib.h>
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include "bindings.h"
/* global state, idk a better way rn */ /* global state, idk a better way rn */
struct acpi_state state; struct acpi_state state;

View file

@ -1,13 +1,5 @@
#include <stdint.h> #include <stdint.h>
#define PG_PRESENT 0x0000'0000'0000'0001
#define PG_READ_WRITE 0x0000'0000'0000'0002
#define PG_USER_SUPERVISE 0x0000'0000'0000'0004
#define PG_WRITE_THROUGH 0x0000'0000'0000'0008
#define PG_CACHE_DISABLE 0x0000'0000'0000'0010
#define PG_ACCESSED 0x0000'0000'0000'0020
#define PG_EXECUTE_DISABLE 0x8000'0000'0000'0000
// PAGE MAP LEVEL 4 ENTRY // PAGE MAP LEVEL 4 ENTRY
struct pml4 { struct pml4 {
uint64_t present : 1; uint64_t present : 1;

View file

@ -1,5 +1,5 @@
void kmain() { void kmain() {
while(1) { while(1) {
asm("cli; hlt"); __asm__("cli; hlt");
} }
} }