diff options
Diffstat (limited to 'arch/riscv')
| -rw-r--r-- | arch/riscv/conf/apos.its (renamed from arch/riscv/conf/kernel.its) | 9 | ||||
| -rw-r--r-- | arch/riscv/conf/boot.cmd | 2 | ||||
| -rwxr-xr-x | arch/riscv/conf/mkimage.sh | 28 | ||||
| -rwxr-xr-x | arch/riscv/conf/rmimage.sh | 9 | ||||
| -rw-r--r-- | arch/riscv/conf/rootfs.fd | 9 | ||||
| -rw-r--r-- | arch/riscv/source.mk | 4 |
6 files changed, 55 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 diff --git a/arch/riscv/source.mk b/arch/riscv/source.mk index 626ecd2..fb645f7 100644 --- a/arch/riscv/source.mk +++ b/arch/riscv/source.mk @@ -3,3 +3,7 @@ KERNEL_SOURCES += $(KERNEL_LOCAL) INIT_LOCAL != echo arch/riscv/init/*.[cS] INIT_SOURCES += $(INIT_LOCAL) + +CLEANUP_CMD := ./arch/riscv/conf/rmimage.sh +run: + ./arch/riscv/conf/mkimage.sh |
