Simple Startup
This commit is contained in:
5
LICENSE
Normal file
5
LICENSE
Normal file
@@ -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.
|
||||||
17
hello.s
Normal file
17
hello.s
Normal file
@@ -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"
|
||||||
7
justfile
Normal file
7
justfile
Normal file
@@ -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
|
||||||
18
setup_bash.sh
Normal file
18
setup_bash.sh
Normal file
@@ -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."
|
||||||
28
setup_zsh.sh
Normal file
28
setup_zsh.sh
Normal file
@@ -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."
|
||||||
Reference in New Issue
Block a user