summaryrefslogtreecommitdiff
path: root/atos
diff options
context:
space:
mode:
authorIan M. <ian@aptel.org>2026-09-18 02:22:24 +0000
committerIan M. <ian@aptel.org>2026-09-18 02:22:24 +0000
commitb93251d1661fe46fc4c02be7885675eaf3e90858 (patch)
treeb0b4ddfd52408da24c8a9f07aaffb31689ca283a /atos
initial commitmain
Signed-off-by: Ian M. <ian@aptel.org>
Diffstat (limited to 'atos')
-rw-r--r--atos/Makefile15
-rw-r--r--atos/arch/rv64/jh7110/Makefile28
-rw-r--r--atos/arch/rv64/jh7110/dev/link.ld32
-rw-r--r--atos/arch/rv64/jh7110/ke/head.S10
-rw-r--r--atos/boot/rv64/jh7110/Makefile11
5 files changed, 96 insertions, 0 deletions
diff --git a/atos/Makefile b/atos/Makefile
new file mode 100644
index 0000000..eea25c3
--- /dev/null
+++ b/atos/Makefile
@@ -0,0 +1,15 @@
+#
+# Copyright (c) 2026, Apollo Telephone Laboratories.
+# Provided under the BSD-3 clause.
+#
+
+.PHONY: all
+all: boot
+
+.PHONY: boot
+boot: machine
+ cd boot/$(CONFIG_ARCH)/$(CONFIG_CHIP); $(MAKE)
+
+.PHONY: machine
+machine:
+ cd arch/$(CONFIG_ARCH)/$(CONFIG_CHIP); $(MAKE)
diff --git a/atos/arch/rv64/jh7110/Makefile b/atos/arch/rv64/jh7110/Makefile
new file mode 100644
index 0000000..2e9f989
--- /dev/null
+++ b/atos/arch/rv64/jh7110/Makefile
@@ -0,0 +1,28 @@
+#
+# Copyright (c) 2026, Apollo Telephone Laboratories.
+# Provided under the BSD-3 clause.
+#
+
+include ../../../../mk/atos.mk
+
+ASMFILES = $(shell find . -name "*.S")
+ASMOFILES = $(ASMFILES:.S=.S.o)
+MISC_OFILES = $(shell find $(GLOBAL_ROOT)/atos -name "*.o")
+CFLAGS = $(INTERNAL_CFLAGS)
+
+KERNEL_ELF_OUT = $(GLOBAL_ROOT)/out/atos.sys
+KERNEL_BIN_OUT = $(GLOBAL_ROOT)/out/atos.bin
+
+.PHONY: all
+all: $(KERNEL_ELF_OUT)
+ $(PROMPT) "OBJCOPY" $(KERNEL_BIN_OUT)
+ $(OBJCOPY) -O binary $(KERNEL_ELF_OUT) $(KERNEL_BIN_OUT)
+
+.PHONY: $(KERNEL_ELF_OUT)
+$(KERNEL_ELF_OUT): $(ASMOFILES)
+ $(PROMPT) "LD" $(KERNEL_ELF_OUT)
+ $(LD) -Tdev/link.ld $(MISC_OFILES) -o $(KERNEL_ELF_OUT)
+
+%.S.o: %.S
+ $(PROMPT) "CC" $<
+ $(CC) -c $< $(CFLAGS) -o $@
diff --git a/atos/arch/rv64/jh7110/dev/link.ld b/atos/arch/rv64/jh7110/dev/link.ld
new file mode 100644
index 0000000..c425651
--- /dev/null
+++ b/atos/arch/rv64/jh7110/dev/link.ld
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2026, Apollo Telephone Laboratories.
+ * Provided under the BSD-3 clause.
+ */
+
+ENTRY(MdHartEntry)
+
+SECTIONS {
+ . = 0x42200000;
+
+ .text : {
+ *(.text .text.*)
+ }
+
+ . += CONSTANT(MAXPAGESIZE);
+
+ .rodata : {
+ *(.rodata .rodata.*)
+ }
+
+ . += CONSTANT(MAXPAGESIZE);
+
+ .data : {
+ *(.data .data.*)
+ }
+
+ . += CONSTANT(MAXPAGESIZE);
+
+ .bss : {
+ *(.bss .bss.*)
+ }
+}
diff --git a/atos/arch/rv64/jh7110/ke/head.S b/atos/arch/rv64/jh7110/ke/head.S
new file mode 100644
index 0000000..bc4a5ae
--- /dev/null
+++ b/atos/arch/rv64/jh7110/ke/head.S
@@ -0,0 +1,10 @@
+/*
+ * Copyright (c) 2026, Apollo Telephone Laboratories.
+ * Provided under the BSD-3 clause.
+ */
+
+ .text
+ .globl MdHartEntry
+MdHartEntry:
+1: wfi
+ j 1b
diff --git a/atos/boot/rv64/jh7110/Makefile b/atos/boot/rv64/jh7110/Makefile
new file mode 100644
index 0000000..122fdba
--- /dev/null
+++ b/atos/boot/rv64/jh7110/Makefile
@@ -0,0 +1,11 @@
+#
+# Copyright (c) 2026, Apollo Telephone Laboratories.
+# Provided under the BSD-3 clause.
+#
+
+IMG_PATH = $(GLOBAL_ROOT)/out/cirrus.img
+
+.PHONY: all
+all:
+ mkfs.fat -C $(IMG_PATH) 4096
+ mcopy -i $(IMG_PATH) $(GLOBAL_ROOT)/out/atos.bin ::