commit 86cfe54faad60609e55ec4d1f885e167d70bfbc3 Author: Bytemalte Date: Tue Apr 7 15:12:48 2026 +0200 Simple Startup diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c7ae5e1 --- /dev/null +++ b/LICENSE @@ -0,0 +1,5 @@ +Copyright (C) 2026 Radixura + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/hello b/hello new file mode 100755 index 0000000..ad88983 Binary files /dev/null and b/hello differ diff --git a/hello.o b/hello.o new file mode 100644 index 0000000..361f70a Binary files /dev/null and b/hello.o differ diff --git a/hello.s b/hello.s new file mode 100644 index 0000000..257b44a --- /dev/null +++ b/hello.s @@ -0,0 +1,17 @@ +.section .text +.globl _start + +_start: + li a0, 1 # file descriptor (stdout) + la a1, msg # buffer address + li a2, 14 # message length + li a7, 64 # syscall: write + ecall + + li a0, 0 # exit code + li a7, 93 # syscall: exit + ecall + +.section .rodata +msg: + .ascii "Hello, RISC-V\n" diff --git a/justfile b/justfile new file mode 100644 index 0000000..302d4df --- /dev/null +++ b/justfile @@ -0,0 +1,7 @@ +default: + just --list + +run: + riscv64-linux-gnu-as -o hello.o hello.s + riscv64-linux-gnu-ld -o hello hello.o + qemu-riscv64 ./hello diff --git a/setup_bash.sh b/setup_bash.sh new file mode 100644 index 0000000..ab7ac7a --- /dev/null +++ b/setup_bash.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Identifikation des Paketmanagers +if [ -f /etc/arch-release ]; then + echo "Arch Linux erkannt..." + sudo pacman -Syu --needed riscv64-linux-gnu-binutils qemu-user-static just +elif [ -f /etc/debian_version ]; then + echo "Debian/Ubuntu erkannt..." + sudo apt update && sudo apt install -y binutils-riscv64-linux-gnu qemu-user-static just +elif [ -f /etc/fedora-release ]; then + echo "Fedora erkannt..." + sudo dnf install -y gcc-riscv64-linux-gnu binutils-riscv64-linux-gnu qemu-user-static just +else + echo "Nicht unterstützte Distribution. Bitte installiere binutils-riscv64, qemu-user und just manuell." + exit 1 +fi + +echo "Installation abgeschlossen." diff --git a/setup_zsh.sh b/setup_zsh.sh new file mode 100644 index 0000000..a97febb --- /dev/null +++ b/setup_zsh.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# Universal Dependency Installer for RV64 Development +# Compatible with bash and zsh + +set -e + +echo "Checking system environment..." + +if [ -f /etc/arch-release ]; then + echo "Arch Linux detected. Using pacman..." + sudo pacman -Syu --needed riscv64-linux-gnu-binutils qemu-user-static just + +elif [ -f /etc/debian_version ] || [ -f /etc/lsb-release ]; then + echo "Debian/Ubuntu detected. Using apt..." + sudo apt update + sudo apt install -y binutils-riscv64-linux-gnu qemu-user-static just + +elif [ -f /etc/fedora-release ]; then + echo "Fedora detected. Using dnf..." + sudo dnf install -y binutils-riscv64-linux-gnu qemu-user-static just + +else + echo "Unsupported distribution. Please install 'riscv64-binutils', 'qemu-user', and 'just' manually." + exit 1 +fi + +echo "Setup complete. You can now use 'just run' to assemble and execute your code."