aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/conf
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2021-08-21 23:23:30 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2021-08-21 23:23:30 +0300
commitf05aaa0561e071a54785ae7dfae3d8a34c9df06a (patch)
tree316a5b1433eaa6d26c0414f8228ed690820682ed /arch/riscv/conf
parent31c3c8dcb5ea281201b9c01140bceeadc80f7686 (diff)
downloadkmi-f05aaa0561e071a54785ae7dfae3d8a34c9df06a.tar.gz
kmi-f05aaa0561e071a54785ae7dfae3d8a34c9df06a.zip
Updated build system with run command
Diffstat (limited to 'arch/riscv/conf')
-rw-r--r--arch/riscv/conf/apos.its (renamed from arch/riscv/conf/kernel.its)9
-rw-r--r--arch/riscv/conf/boot.cmd2
-rwxr-xr-xarch/riscv/conf/mkimage.sh28
-rwxr-xr-xarch/riscv/conf/rmimage.sh9
-rw-r--r--arch/riscv/conf/rootfs.fd9
5 files changed, 51 insertions, 6 deletions
diff --git a/arch/riscv/conf/kernel.its b/arch/riscv/conf/apos.its
index f984d40..c3611dd 100644
--- a/arch/riscv/conf/kernel.its
+++ b/arch/riscv/conf/apos.its
@@ -6,8 +6,8 @@
images {
kernel {
- description = "My default kenel";
- data = /incbin/("kernel.bin");
+ description = "Garbaggio";
+ data = /incbin/("../../../apos.bin");
type = "kernel";
arch = "riscv";
os = "apos";
@@ -15,10 +15,9 @@
load = <0x83800000>;
entry = <0x83800000>;
hash-1 {
- algo = "md5";
+ algo = "sha1";
};
};
-
};
configurations {
@@ -28,7 +27,5 @@
description = "Default configuration";
kernel = "kernel";
};
-
-
};
};
diff --git a/arch/riscv/conf/boot.cmd b/arch/riscv/conf/boot.cmd
new file mode 100644
index 0000000..ddbc319
--- /dev/null
+++ b/arch/riscv/conf/boot.cmd
@@ -0,0 +1,2 @@
+fatload ${devtype} ${devnum} ${kernel_addr_r} apos.itb
+bootm ${kernel_addr_r}
diff --git a/arch/riscv/conf/mkimage.sh b/arch/riscv/conf/mkimage.sh
new file mode 100755
index 0000000..31abb8e
--- /dev/null
+++ b/arch/riscv/conf/mkimage.sh
@@ -0,0 +1,28 @@
+#!/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
+
+../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
new file mode 100755
index 0000000..8d6457f
--- /dev/null
+++ b/arch/riscv/conf/rmimage.sh
@@ -0,0 +1,9 @@
+#!/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
new file mode 100644
index 0000000..59fb5f8
--- /dev/null
+++ b/arch/riscv/conf/rootfs.fd
@@ -0,0 +1,9 @@
+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