From feba4522d1ac41cd04083fe05410b6e90b54bda2 Mon Sep 17 00:00:00 2001 From: Jon Santmyer Date: Fri, 11 Sep 2026 11:39:21 -0400 Subject: begin adding uacpi - working build target --- .gitmodules | 3 +++ Makefile | 6 +++++- arch/x86_64/hal/obj.h | 2 +- arch/x86_64/hal/serial_com.c | 4 ++-- uacpi | 1 + uacpi.a | Bin 0 -> 1305080 bytes uacpi.mk | 20 ++++++++++++++++++++ 7 files changed, 32 insertions(+), 4 deletions(-) create mode 100644 .gitmodules create mode 160000 uacpi create mode 100644 uacpi.a create mode 100644 uacpi.mk diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..5a019d9 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "uacpi"] + path = uacpi + url = https://github.com/uACPI/uACPI diff --git a/Makefile b/Makefile index 76c913b..3950cb3 100644 --- a/Makefile +++ b/Makefile @@ -16,14 +16,18 @@ SFILES += $(foreach dir, $(CDIRS), $(wildcard arch/$(TARGET_MACHINE)/$(dir)/*.s) OBJFILES := $(patsubst %.c,%.o,$(CFILES)) OBJFILES += $(patsubst %.s,%.o,$(SFILES)) +OBJFILES += uacpi.a DEPFILES := $(patsubst %.c,%.d,$(CFILES)) +CLEAN_DEPENDS = BIN := jove.elf INCDIR := $(OUT)/usr/include/kernel all: $(BIN) +include uacpi.mk + headers: mkdir -p $(INCDIR) -$(foreach dir,$(CDIRS),$$(mkdir -p $(INCDIR)/$(dir) $(INCDIR)/arch/$(dir)/)) @@ -32,7 +36,7 @@ headers: -$(foreach dir,$(CDIRS),$$(cp arch/$(TARGET_MACHINE)/$(dir)/*.h $(INCDIR)/arch/$(dir)/)) .PHONY: clean -clean: +clean: $(CLEAN_DEPENDS) -rm $(OBJFILES) -rm $(DEPFILES) -rm $(BIN) diff --git a/arch/x86_64/hal/obj.h b/arch/x86_64/hal/obj.h index fcb7506..51f2d6a 100644 --- a/arch/x86_64/hal/obj.h +++ b/arch/x86_64/hal/obj.h @@ -7,7 +7,7 @@ enum { - JOVE_OBJ_SERIAL_COM = 0x40, + JOVE_OBJ_SERIAL_COM = 0x80, }; /*Represents a locked kernel object pointer inside of a object directory.*/ diff --git a/arch/x86_64/hal/serial_com.c b/arch/x86_64/hal/serial_com.c index 22682fd..5d7de24 100644 --- a/arch/x86_64/hal/serial_com.c +++ b/arch/x86_64/hal/serial_com.c @@ -82,11 +82,11 @@ serial_com_write( jove_owned_obj_t *obj, const char *s, size_t len) { - if(obj->type != JOVE_OBJ_SERIAL_COM) { + if(obj_gettype(obj) != JOVE_OBJ_SERIAL_COM) { reterr(EBADOBJ); } for(size_t i = 0; i < len; i++) { - serial_com_putc((uint16_t)obj->value, s[i]); + serial_com_putc((uint16_t)obj_getvalue(obj), s[i]); } return len; } diff --git a/uacpi b/uacpi new file mode 160000 index 0000000..f5f6cc2 --- /dev/null +++ b/uacpi @@ -0,0 +1 @@ +Subproject commit f5f6cc29f85dd5db0dd79c47700c8f3ebce18be4 diff --git a/uacpi.a b/uacpi.a new file mode 100644 index 0000000..32212ea Binary files /dev/null and b/uacpi.a differ diff --git a/uacpi.mk b/uacpi.mk new file mode 100644 index 0000000..58e08c6 --- /dev/null +++ b/uacpi.mk @@ -0,0 +1,20 @@ +UACPI_DIR := uacpi +UACPI_CDIR := $(UACPI_DIR)/source +UACPI_IDIR := $(UACPI_DIR)/include + +UACPI_CFILES := $(wildcard $(UACPI_CDIR)/*.c) +UACPI_OFILES := $(patsubst %.c,%.o,$(UACPI_CFILES)) + +CFLAGS += -I$(UACPI_IDIR) + +DEPFILES += $(patsubst %.c,%.d,$(UACPI_CFILES)) +CLEAN_DEPENDS += uacpi_clean + +uacpi.a: ${UACPI_OFILES} + ar rcs $@ $^ + +.PHONY: uacpi_clean +uacpi_clean: + -rm $(UACPI_OFILES) + + -- cgit v1.2.3