aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/conf
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-01-06 23:39:12 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2022-01-07 14:05:06 +0200
commit9cc125fb3cfdc2c8ae7153b5ae0fe705980835fb (patch)
treea1974f9513458acab0bd8d09758259b24b6d7d8c /arch/riscv/conf
parentf0eba93472e0afecc57180fc0d638eeef8e6f3c6 (diff)
downloadkmi-9cc125fb3cfdc2c8ae7153b5ae0fe705980835fb.tar.gz
kmi-9cc125fb3cfdc2c8ae7153b5ae0fe705980835fb.zip
Allow building with clang
+ Release mode is sort of broken, as lto doesn't work with linker relaxation and turning the relaxation off causes issues with the jump from init to kernel (as I've currently implemented it, could probably be fixed with a manual jump from assembly, I'll add it to my TODO list)
Diffstat (limited to 'arch/riscv/conf')
-rw-r--r--arch/riscv/conf/apos.its48
-rw-r--r--arch/riscv/conf/boot.cmd4
-rwxr-xr-xarch/riscv/conf/initbin968 -> 0 bytes
-rw-r--r--arch/riscv/conf/init-link.S31
-rw-r--r--arch/riscv/conf/initrdbin1536 -> 0 bytes
-rw-r--r--arch/riscv/conf/kernel-link.S26
-rwxr-xr-xarch/riscv/conf/mkimage.sh31
-rwxr-xr-xarch/riscv/conf/rmimage.sh9
-rw-r--r--arch/riscv/conf/rootfs.fd9
-rw-r--r--arch/riscv/conf/s.S4
10 files changed, 0 insertions, 162 deletions
diff --git a/arch/riscv/conf/apos.its b/arch/riscv/conf/apos.its
deleted file mode 100644
index da48860..0000000
--- a/arch/riscv/conf/apos.its
+++ /dev/null
@@ -1,48 +0,0 @@
-/dts-v1/;
-
-/ {
- description = "FUCK";
-#address-cells = <1>;
-
- images {
- kernel {
- description = "Garbaggio";
- data = /incbin/("../../../apos.bin");
- type = "kernel";
- arch = "riscv";
- os = "apos";
- compression = "none";
- load = <0x80080000>;
- entry = <0x80080000>;
- hash-1 {
- algo = "sha1";
- };
- };
-
- initrd {
- description = "Gargabbio initrd";
- data = /incbin/("initrd");
- type = "ramdisk";
- arch = "riscv";
- os = "apos";
- compression = "none";
- load = <0x88300000>;
- hash-1 {
- algo = "sha1";
- };
- };
- };
-
- configurations {
- default = "config";
-
- config {
- description = "Default configuration";
- kernel = "kernel";
- ramdisk = "initrd";
- hash-1 {
- algo = "sha1";
- };
- };
- };
-};
diff --git a/arch/riscv/conf/boot.cmd b/arch/riscv/conf/boot.cmd
deleted file mode 100644
index a7517fd..0000000
--- a/arch/riscv/conf/boot.cmd
+++ /dev/null
@@ -1,4 +0,0 @@
-fdt move ${fdt_addr} ${fdt_addr_r}
-fdt addr ${fdt_addr_r}
-load ${devtype} ${devnum} ${kernel_addr_r} apos.itb
-bootm ${kernel_addr_r} ${kernel_addr_r} ${fdt_addr_r}
diff --git a/arch/riscv/conf/init b/arch/riscv/conf/init
deleted file mode 100755
index f05254f..0000000
--- a/arch/riscv/conf/init
+++ /dev/null
Binary files differ
diff --git a/arch/riscv/conf/init-link.S b/arch/riscv/conf/init-link.S
deleted file mode 100644
index ce53e5e..0000000
--- a/arch/riscv/conf/init-link.S
+++ /dev/null
@@ -1,31 +0,0 @@
-OUTPUT_ARCH(riscv)
-ENTRY(_start)
-
-SECTIONS {
- . = ABSOLUTE(PM_KERN_BASE);
- __init_start = .;
-
- /* objcopy only copies these three sections (as far as I'm aware) into the
- produces binary, so __init_end should point to the correct location in the
- final binary
- */
- .text ALIGN(4K) : AT(0) {
- *(.init.start)
- *(.text*);
- }
-
- .rodata : {
- *(.rodata*)
- }
-
- .data : {
- *(.data*)
- }
-
- .bss : {
- *(.bss*) *(COMMON)
- }
-
- __init_end = . ;
- __kernel_size = <KERNEL_SIZE>;
-}
diff --git a/arch/riscv/conf/initrd b/arch/riscv/conf/initrd
deleted file mode 100644
index 90344c1..0000000
--- a/arch/riscv/conf/initrd
+++ /dev/null
Binary files differ
diff --git a/arch/riscv/conf/kernel-link.S b/arch/riscv/conf/kernel-link.S
deleted file mode 100644
index d3b1223..0000000
--- a/arch/riscv/conf/kernel-link.S
+++ /dev/null
@@ -1,26 +0,0 @@
-OUTPUT_ARCH(riscv)
-ENTRY(main)
-
-SECTIONS {
- . = ABSOLUTE(VM_KERN);
- __kernel_start = .;
-
- .text ALIGN(4K) : AT(0) {
- *(.kernel.start);
- *(.text*);
- }
-
- .rodata : {
- *(.rodata*)
- }
-
- .data : {
- *(.data*)
- }
-
- .bss : {
- *(.bss*) *(COMMON)
- }
-
- __kernel_end = .;
-}
diff --git a/arch/riscv/conf/mkimage.sh b/arch/riscv/conf/mkimage.sh
deleted file mode 100755
index 5a22d01..0000000
--- a/arch/riscv/conf/mkimage.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/sh
-
-if [ ! -e fs ]; then
- mkdir fs
-fi
-
-if [ ! -e rootfs.img ]; then
- virt-make-fs --partition=mbr --type=vfat --size=10M fs rootfs.img
-fi
-
-
-SSIZE=$(fdisk -l rootfs.img | awk '$1=="Units:" {print $8}')
-OFFSET=$(fdisk -l rootfs.img | awk '$1=="rootfs.img1" {print $2}')
-mount -o loop,offset=$((${SSIZE}*${OFFSET})) rootfs.img fs
-
-# not entirely pleased with this solution, although eventually I should probably
-# move `run` out of the kernel repo and into some `aposos` repo with a runtime
-# and proper initrd etc. so this is good enough for now
-../u-boot-apos/tools/mkimage -f arch/riscv/conf/apos.its fs/apos.itb
-../u-boot-apos/tools/mkimage -A riscv -O apos -T script \
- -d arch/riscv/conf/boot.cmd fs/boot.scr
-
-umount -l fs
-
-qemu-system-riscv64 -machine virt \
- -kernel ../u-boot-apos/u-boot \
- -bios /usr/lib/riscv64-linux-gnu/opensbi/generic/fw_jump.elf \
- -device virtio-blk-device,drive=hd0 \
- -drive file=rootfs.img,format=raw,id=hd0 \
- -S -s -m 2G \
- -serial stdio
diff --git a/arch/riscv/conf/rmimage.sh b/arch/riscv/conf/rmimage.sh
deleted file mode 100755
index 8d6457f..0000000
--- a/arch/riscv/conf/rmimage.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-if [ -e fs ]; then
- rm -r fs
-fi
-
-if [ -e rootfs.img ]; then
- rm rootfs.img
-fi
diff --git a/arch/riscv/conf/rootfs.fd b/arch/riscv/conf/rootfs.fd
deleted file mode 100644
index 59fb5f8..0000000
--- a/arch/riscv/conf/rootfs.fd
+++ /dev/null
@@ -1,9 +0,0 @@
-label: gpt
-label-id: DBD1F99F-BFA3-D448-828F-0B505DF81F17
-device: rootfs.img
-unit: sectors
-first-lba: 2048
-last-lba: 20446
-sector-size: 512
-
-rootfs.img1 : start= 2048, size= 18399, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=B129DB0D-F225-5C48-AA6D-DD8C049FA72C
diff --git a/arch/riscv/conf/s.S b/arch/riscv/conf/s.S
deleted file mode 100644
index 80a3a11..0000000
--- a/arch/riscv/conf/s.S
+++ /dev/null
@@ -1,4 +0,0 @@
-.text
-.global _start
-_start:
-ecall