summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2021-12-19 22:41:15 +0000
committerAda Christine <adachristine18@gmail.com>2021-12-19 22:41:15 +0000
commite303a03e7c96bc5bf7fa93f7b46ce63196893d7a (patch)
treef187b374feec85015d6df1f94db618a3f5cc893f
parentbff63a4337eb3388617d230970c5eb2684d6a215 (diff)
moving files around
-rw-r--r--kc/boot/Makefile (renamed from shim/Makefile)10
-rw-r--r--kc/boot/kc_main.c (renamed from shim/kc_main.c)0
-rw-r--r--kc/component.ld (renamed from lib/component.ld)0
-rw-r--r--kc/core/Makefile (renamed from kernel/Makefile)20
-rw-r--r--kc/core/cpu.c (renamed from kernel/cpu.c)0
-rw-r--r--kc/core/cpu.h (renamed from kernel/cpu.h)0
-rw-r--r--kc/core/exceptions.S (renamed from kernel/exceptions.S)0
-rw-r--r--kc/core/exceptions.h (renamed from kernel/exceptions.h)0
-rw-r--r--kc/core/kc_main.c (renamed from kernel/entry.c)0
-rw-r--r--kc/core/kprint.c (renamed from kernel/kprint.c)0
-rw-r--r--kc/core/kprint.h (renamed from kernel/kprint.h)0
-rw-r--r--kc/core/main.c (renamed from kernel/main.c)0
-rw-r--r--kc/core/memory.c (renamed from kernel/memory.c)0
-rw-r--r--kc/core/memory.h (renamed from kernel/memory.h)0
-rw-r--r--kc/core/panic.c (renamed from kernel/panic.c)0
-rw-r--r--kc/core/panic.h (renamed from kernel/panic.h)0
-rw-r--r--kc/core/port.c (renamed from kernel/port.c)0
-rw-r--r--kc/core/port.h (renamed from kernel/port.h)0
-rw-r--r--kc/core/serial.c (renamed from kernel/serial.c)0
-rw-r--r--kc/core/serial.h (renamed from kernel/serial.h)0
-rw-r--r--kc/entry_x86_64.S (renamed from lib/entry_x86_64.S)0
-rw-r--r--kc/reloc_x86_64.c (renamed from lib/reloc_x86_64.c)0
-rw-r--r--kernel/kernel.ld33
23 files changed, 15 insertions, 48 deletions
diff --git a/shim/Makefile b/kc/boot/Makefile
index 7183088..76bd4d4 100644
--- a/shim/Makefile
+++ b/kc/boot/Makefile
@@ -1,6 +1,6 @@
-include ../defaults.mk
+include ../../defaults.mk
-VPATH := ../lib
+VPATH := ../../lib ../
TARGET := efi.os
.DEFAULT: $(TARGET)
@@ -9,12 +9,12 @@ TARGET := efi.os
EFIAPIDIR := /usr/local/include/efi
-CPPFLAGS += -I../api -I$(EFIAPIDIR) -I$(EFIAPIDIR)/$(ARCH) -I$(EFIAPIDIR)/protocol
+CPPFLAGS += -I../../api -I$(EFIAPIDIR) -I$(EFIAPIDIR)/$(ARCH) -I$(EFIAPIDIR)/protocol
CFLAGS += -Wno-unused-const-variable -Wno-unused-function -fvisibility=hidden \
-g -fshort-wchar -mgeneral-regs-only
LIBDIRS += -L$(dir $(shell $(CC) -print-libgcc-file-name))
-LDSCRIPT := ../lib/component.ld
+LDSCRIPT := ../component.ld
LDFLAGS += -z max-page-size=4096 --export-dynamic -pic --no-dynamic-linker
LOADLIBES := -lgcc
@@ -30,7 +30,7 @@ $(TARGET): $(OBJS)
CLEANLIST := $(wildcard $(OBJS) $(TARGET))
DCLEANLIST := $(wildcard $(DEPS))
-include ../rules.mk
+include ../../rules.mk
-include $(DEPS)
.DEFAULT: $(TARGET)
diff --git a/shim/kc_main.c b/kc/boot/kc_main.c
index 1829616..1829616 100644
--- a/shim/kc_main.c
+++ b/kc/boot/kc_main.c
diff --git a/lib/component.ld b/kc/component.ld
index 3a48ae8..3a48ae8 100644
--- a/lib/component.ld
+++ b/kc/component.ld
diff --git a/kernel/Makefile b/kc/core/Makefile
index 407c4bb..2893b42 100644
--- a/kernel/Makefile
+++ b/kc/core/Makefile
@@ -1,27 +1,27 @@
-include ../defaults.mk
+include ../../defaults.mk
-VPATH := ../lib
+VPATH := ../../lib ../
TARGET := kernel.os
.DEFAULT: $(TARGET)
+CPPFLAGS += -I../../api
CFLAGS += -Wno-unused-const-variable -Wno-unused-function -fvisibility=hidden -g
LIBDIRS += -L$(dir $(shell $(CC) -print-libgcc-file-name))
-LDSCRIPT := kernel.ld
-LDFLAGS += -z max-page-size=4096 --export-dynamic
+LDSCRIPT := ../component.ld
+LDFLAGS += -z max-page-size=4096 --export-dynamic -pic --no-dynamic-linker
LOADLIBES := -lgcc
SOBJS :=
-GOBJS := entry.o kprint.o serial.o port.o main.o memory.o \
- memset.o memcpy.o memmove.o memcmp.o cpu.o exceptions.o \
- panic.o
+GOBJS := entry_x86_64.o reloc_x86_64.o kprint.o serial.o port.o \
+ kc_main.o memory.o memset.o memcpy.o memmove.o memcmp.o cpu.o \
+ exceptions.o panic.o
IOBJS :=
-$(SOBJS): CFLAGS += -fPIC
# __attribute__((interrupt)) requires -mgeneral-regs-only
$(IOBJS): CFLAGS += -mgeneral-regs-only
-$(IOBJS) $(GOBJS): CFLAGS += -mcmodel=kernel
+$(IOBJS) $(GOBJS): CFLAGS += -mcmodel=small -fPIC
OBJS := $(SOBJS) $(GOBJS) $(IOBJS)
DEPS := $(patsubst %.o,%.d,$(OBJS))
@@ -32,7 +32,7 @@ $(TARGET): $(OBJS)
CLEANLIST := $(wildcard $(OBJS) $(TARGET))
DCLEANLIST := $(wildcard $(DEPS))
-include ../rules.mk
+include ../../rules.mk
-include $(DEPS)
.DEFAULT: $(TARGET)
diff --git a/kernel/cpu.c b/kc/core/cpu.c
index ed1a04e..ed1a04e 100644
--- a/kernel/cpu.c
+++ b/kc/core/cpu.c
diff --git a/kernel/cpu.h b/kc/core/cpu.h
index 56a4073..56a4073 100644
--- a/kernel/cpu.h
+++ b/kc/core/cpu.h
diff --git a/kernel/exceptions.S b/kc/core/exceptions.S
index 80d49ee..80d49ee 100644
--- a/kernel/exceptions.S
+++ b/kc/core/exceptions.S
diff --git a/kernel/exceptions.h b/kc/core/exceptions.h
index 5d22284..5d22284 100644
--- a/kernel/exceptions.h
+++ b/kc/core/exceptions.h
diff --git a/kernel/entry.c b/kc/core/kc_main.c
index 5eecaf2..5eecaf2 100644
--- a/kernel/entry.c
+++ b/kc/core/kc_main.c
diff --git a/kernel/kprint.c b/kc/core/kprint.c
index 0a15efd..0a15efd 100644
--- a/kernel/kprint.c
+++ b/kc/core/kprint.c
diff --git a/kernel/kprint.h b/kc/core/kprint.h
index 5b307a2..5b307a2 100644
--- a/kernel/kprint.h
+++ b/kc/core/kprint.h
diff --git a/kernel/main.c b/kc/core/main.c
index 2fb2e3e..2fb2e3e 100644
--- a/kernel/main.c
+++ b/kc/core/main.c
diff --git a/kernel/memory.c b/kc/core/memory.c
index 62f3a38..62f3a38 100644
--- a/kernel/memory.c
+++ b/kc/core/memory.c
diff --git a/kernel/memory.h b/kc/core/memory.h
index 67b0648..67b0648 100644
--- a/kernel/memory.h
+++ b/kc/core/memory.h
diff --git a/kernel/panic.c b/kc/core/panic.c
index b0d9daf..b0d9daf 100644
--- a/kernel/panic.c
+++ b/kc/core/panic.c
diff --git a/kernel/panic.h b/kc/core/panic.h
index 0cfd7c2..0cfd7c2 100644
--- a/kernel/panic.h
+++ b/kc/core/panic.h
diff --git a/kernel/port.c b/kc/core/port.c
index 17af396..17af396 100644
--- a/kernel/port.c
+++ b/kc/core/port.c
diff --git a/kernel/port.h b/kc/core/port.h
index cc71973..cc71973 100644
--- a/kernel/port.h
+++ b/kc/core/port.h
diff --git a/kernel/serial.c b/kc/core/serial.c
index 77f453d..77f453d 100644
--- a/kernel/serial.c
+++ b/kc/core/serial.c
diff --git a/kernel/serial.h b/kc/core/serial.h
index 2e22fa6..2e22fa6 100644
--- a/kernel/serial.h
+++ b/kc/core/serial.h
diff --git a/lib/entry_x86_64.S b/kc/entry_x86_64.S
index 231953a..231953a 100644
--- a/lib/entry_x86_64.S
+++ b/kc/entry_x86_64.S
diff --git a/lib/reloc_x86_64.c b/kc/reloc_x86_64.c
index 0204700..0204700 100644
--- a/lib/reloc_x86_64.c
+++ b/kc/reloc_x86_64.c
diff --git a/kernel/kernel.ld b/kernel/kernel.ld
deleted file mode 100644
index 47dcf3b..0000000
--- a/kernel/kernel.ld
+++ /dev/null
@@ -1,33 +0,0 @@
-ENTRY(kernel_entry)
-
-PROVIDE(k_virt_base = 0xffffffff80000000);
-
-SECTIONS
-{
- .text k_virt_base : AT(ADDR(.text) - k_virt_base)
- {
- PROVIDE(k_text_begin = .);
- *(.text)
- . = ALIGN(4K);
- PROVIDE(k_text_end = .);
- } =0xcc
-
- .data ALIGN(4K) : AT(ADDR(.data) - k_virt_base)
- {
- PROVIDE(k_data_begin = .);
- *(.rodata)
- *(.data)
- }
-
- .bss :
- {
- *(.bss)
- PROVIDE(k_data_end = .);
- }
-
- /DISCARD/ :
- {
- *(.eh_frame)
- }
-}
-