aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-17 19:34:03 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-17 19:34:03 +0300
commit83f8e82c421fa9013ac813b1560abf1c749822ca (patch)
tree5fefb1b90896af039274ce6184efdb741f6679ad
parentbe82edec47b20164c0e8a9917fa2c9b8b9999fdf (diff)
downloadkmi-83f8e82c421fa9013ac813b1560abf1c749822ca.tar.gz
kmi-83f8e82c421fa9013ac813b1560abf1c749822ca.zip
cleanup riscv64/conf
-rw-r--r--arch/riscv64/conf/boot.cmd13
-rw-r--r--arch/riscv64/conf/kmi.its48
-rwxr-xr-xarch/riscv64/conf/mkimage.sh38
-rwxr-xr-xarch/riscv64/conf/rmimage.sh9
-rw-r--r--arch/riscv64/conf/rootfs.fd9
-rw-r--r--arch/riscv64/conf/s.S56
-rw-r--r--arch/riscv64/source.mk6
7 files changed, 0 insertions, 179 deletions
diff --git a/arch/riscv64/conf/boot.cmd b/arch/riscv64/conf/boot.cmd
deleted file mode 100644
index 6c06200..0000000
--- a/arch/riscv64/conf/boot.cmd
+++ /dev/null
@@ -1,13 +0,0 @@
-fdt move ${fdt_addr} ${fdt_addr_r}
-fdt addr ${fdt_addr_r}
-load ${devtype} ${devnum} ${kernel_addr_r} kmi.itb
-bootm ${kernel_addr_r} ${kernel_addr_r} ${fdt_addr_r}
-
-# the above works for qemu, visionfive2 looks more like
-#
-# fdt move ${fdt_addr} ${fdt_addr_r}
-# fdt addr ${fdt_addr_r}
-# load virtio 0:1 0x80260000 kmi.bin
-# load virtio 0:1 0x88300000 initrd
-# fdt chosen 0x88300000 0x1000
-# go 0x80260000 ${fdt_addr_r}
diff --git a/arch/riscv64/conf/kmi.its b/arch/riscv64/conf/kmi.its
deleted file mode 100644
index be49033..0000000
--- a/arch/riscv64/conf/kmi.its
+++ /dev/null
@@ -1,48 +0,0 @@
-/dts-v1/;
-
-/ {
- description = "FUCK";
-#address-cells = <1>;
-
- images {
- kernel {
- description = "Garbaggio";
- data = /incbin/("../../../kmi.bin");
- type = "kernel";
- arch = "riscv";
- os = "kmi";
- compression = "none";
- load = <0x80200000>;
- entry = <0x80200000>;
- hash-1 {
- algo = "sha1";
- };
- };
-
- initrd {
- description = "Gargabbio initrd";
- data = /incbin/("initrd");
- type = "ramdisk";
- arch = "riscv";
- os = "kmi";
- 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/riscv64/conf/mkimage.sh b/arch/riscv64/conf/mkimage.sh
deleted file mode 100755
index fbad869..0000000
--- a/arch/riscv64/conf/mkimage.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/sh
-
-XLEN=$(echo "$1" | cut -c '6-7')
-
-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
-
-# copy over files outside the .itb to mess around with manual booting
-cp kmi.bin fs
-cp arch/riscv64/conf/initrd fs
-
-# not entirely pleased with this solution, although eventually I should probably
-# move `run` out of the kernel repo and into some `kmios` repo with a runtime
-# and proper initrd etc. so this is good enough for now
-../rv${XLEN}/u-boot-kmi/tools/mkimage -f arch/riscv${XLEN}/conf/kmi.its fs/kmi.itb
-../rv${XLEN}/u-boot-kmi/tools/mkimage -A riscv -O kmi -T script \
- -d arch/riscv64/conf/boot.cmd fs/boot.scr
-
-umount -l fs
-
-qemu-system-riscv${XLEN} \
- -machine virt \
- -kernel ../rv${XLEN}/u-boot-kmi/u-boot \
- -bios ../rv${XLEN}/opensbi/build/platform/generic/firmware/fw_jump.elf \
- -device virtio-blk-device,drive=hd0 \
- -drive file=rootfs.img,format=raw,id=hd0 \
- -S -s -m 2G \
- -smp 2 \
- -serial stdio
diff --git a/arch/riscv64/conf/rmimage.sh b/arch/riscv64/conf/rmimage.sh
deleted file mode 100755
index 8d6457f..0000000
--- a/arch/riscv64/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/riscv64/conf/rootfs.fd b/arch/riscv64/conf/rootfs.fd
deleted file mode 100644
index 59fb5f8..0000000
--- a/arch/riscv64/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/riscv64/conf/s.S b/arch/riscv64/conf/s.S
deleted file mode 100644
index aff9b40..0000000
--- a/arch/riscv64/conf/s.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* SPDX-License-Identifier: copyleft-next-0.3.1 */
-/* Copyright 2021 - 2022, Kim Kuparinen < kimi.h.kuparinen@gmail.com > */
-
-.text
-.global _start
-_start:
-li a0, 0 /* 0 should be NOOP */
-li a1, 1
-li a2, 2
-li a3, 3
-li a4, 4
-ecall
-
-/* "print" hello world */
-li a0, 1
-li a1, 'H'
-ecall
-li a0, 1
-li a1, 'e'
-ecall
-li a0, 1
-li a1, 'l'
-ecall
-li a0, 1
-li a1, 'l'
-ecall
-li a0, 1
-li a1, 'o'
-ecall
-li a0, 1
-li a1, ','
-ecall
-li a0, 1
-li a1, ' '
-ecall
-li a0, 1
-li a1, 'w'
-ecall
-li a0, 1
-li a1, 'o'
-ecall
-li a0, 1
-li a1, 'r'
-ecall
-li a0, 1
-li a1, 'l'
-ecall
-li a0, 1
-li a1, 'd'
-ecall
-li a0, 1
-li a1, '!'
-ecall
-li a0, 1
-li a1, '\n'
-ecall
diff --git a/arch/riscv64/source.mk b/arch/riscv64/source.mk
index 0c10bbc..f849432 100644
--- a/arch/riscv64/source.mk
+++ b/arch/riscv64/source.mk
@@ -4,13 +4,7 @@ KERNEL_SOURCES := $(KERNEL_SOURCES) $(KERNEL_LOCAL)
# this doesn't work for rv32, but fine for now */
ARCH_CFLAGS := $(ARCH_CFLAGS) -mcmodel=medany
-run:
- $(ARCH_SOURCE)/conf/mkimage.sh $(ARCH)
-
include $(ARCH_SOURCE)/asm/source.mk
# dependecy generation
$(ARCH_KERN_BUILD)/kernel/entry.o: $(ARCH_SOURCE)/kernel/gen/asm-offsets.h
-
-# full cleanup
-CLEANUP_CMD := $(ARCH_SOURCE)/conf/rmimage.sh