From 9cc125fb3cfdc2c8ae7153b5ae0fe705980835fb Mon Sep 17 00:00:00 2001 From: Kimplul Date: Thu, 6 Jan 2022 23:39:12 +0200 Subject: 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) --- arch/riscv/conf/apos.its | 48 ------------------------------------------ arch/riscv/conf/boot.cmd | 4 ---- arch/riscv/conf/init | Bin 968 -> 0 bytes arch/riscv/conf/init-link.S | 31 --------------------------- arch/riscv/conf/initrd | Bin 1536 -> 0 bytes arch/riscv/conf/kernel-link.S | 26 ----------------------- arch/riscv/conf/mkimage.sh | 31 --------------------------- arch/riscv/conf/rmimage.sh | 9 -------- arch/riscv/conf/rootfs.fd | 9 -------- arch/riscv/conf/s.S | 4 ---- 10 files changed, 162 deletions(-) delete mode 100644 arch/riscv/conf/apos.its delete mode 100644 arch/riscv/conf/boot.cmd delete mode 100755 arch/riscv/conf/init delete mode 100644 arch/riscv/conf/init-link.S delete mode 100644 arch/riscv/conf/initrd delete mode 100644 arch/riscv/conf/kernel-link.S delete mode 100755 arch/riscv/conf/mkimage.sh delete mode 100755 arch/riscv/conf/rmimage.sh delete mode 100644 arch/riscv/conf/rootfs.fd delete mode 100644 arch/riscv/conf/s.S (limited to 'arch/riscv/conf') 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 Binary files a/arch/riscv/conf/init and /dev/null 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 = ; -} diff --git a/arch/riscv/conf/initrd b/arch/riscv/conf/initrd deleted file mode 100644 index 90344c1..0000000 Binary files a/arch/riscv/conf/initrd and /dev/null 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 -- cgit v1.3