Verified Commit ba8c2102 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

riscv64 build

parent 91396f45
# This is the default configuration file
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
#acid = {}
# audiod = {}
#autoconf = {}
#automake = {}
#bash = {}
#binutils = {}
ca-certificates = {}
#cairo = {}
#cairodemo = {}
#cargo = {}
#cleye = {}
#cmatrix = {}
# contain = {}
coreutils = {}
#cpal = {}
#curl = {}
dash = {}
#diffutils = {}
#dosbox = {}
# drivers = {}
#drivers-041 = {}
#duktape = {}
#eduke32 = {}
#exampled = {}
#expat = {}
extrautils = {}
#fd = {}
#ffmpeg = {}
# findutils = {}
#freeciv = {}
#freedoom = {}
#freeglut = {}
#freetype = {}
#friar = {} # mio patch
#game-2048 = {}
#games = {}
#gawk = {}
#gcc = {}
# gdbserver = {}
#gears = {}
#generaluser-gs = {}
#gettext = {}
#gigalomania = {}
#git = {}
#glib = {}
#glium = {}
#glutin = {}
#gnu-binutils = {}
#gnu-grep = {}
#gnu-make = {}
#gstreamer = {}
#harfbuzz = {}
#hematite = {}
#init = {}
# installer = {}
ion = {}
ipcd = {}
#jansson = {}
#keyboard-sfx = {}
#lci = {}
#libc-bench = {}
#libffi = {}
#libiconv = {}
#libjpeg = {}
#liborbital = {}
#libpng = {}
#libsodium = {}
#llvm = {}
logd = {}
#lua = {}
#mdp = {}
#mesa = {}
#mesa_glu = {}
#miniserve = {}
#nasm = {}
#ncdu = {}
#ncurses = {}
#ncursesw = {}
# netdb = {}
# netstack = {}
# netsurf = {}
# netutils = {}
#neverball = {}
#newlib = {}
#newlibtest = {}
#nulld = {}
#openjazz = {}
#openssl = {}
#openttd = {}
#openttd-opengfx = {}
#openttd-openmsx = {}
#openttd-opensfx = {}
#orbclient = {}
# orbdata = {}
# orbital = {}
# orbterm = {}
# orbutils = {}
#osdemo = {}
#pastel = {}
#patch = {}
#pciids = {}
#pcre = {}
#periodictable = {}
#perl = {}
#pixelcannon = {}
#pixman = {}
# pkgutils = {}
#powerline = {}
#prboom = {}
ptyd = {}
#python = {}
#qemu = {}
#randd = {}
#readline = {} # ncurses
redoxfs = {}
#redox-fatfs = {}
#redox-ssh = {}
#relibc = {}
#relibc-tests = {}
#ripgrep = {}
#rodioplay = {}
#rs-nes = {}
#rust = {}
#rust64 = {}
#rust-cairo = {}
#rust-cairo-demo = {}
#rustual-boy = {}
#schismtracker = {}
#scummvm = {}
#sdl = {}
#sdl2 = {}
#sdl2_gears = {}
#sdl_gfx = {}
#sdl_image = {}
#sdl_mixer = {}
#sdl_ttf = {}
#sdl-player = {}
#sed = {}
#servo = {}
#shellstorm = {}
# smith = {}
#sodium = {}
#sopwith = {}
#ssh = {}
# strace = {}
#syobonaction = {}
#terminfo = {}
#termplay = {}
#timidity = {}
#ttf-hack = {}
userutils = {}
uutils = {}
#vim = {}
#vttest = {}
#webrender = {}
#winit = {}
#xz = {}
#zerod = {}
#zlib = {}
# User settings
[users.root]
password = "password"
uid = 0
gid = 0
name = "root"
home = "/root"
[users.user]
# Password is unset
password = ""
[[files]]
path = "/etc/init.d/00_base"
data = """
ipcd
logd
dash -c ptyd # CRASHES without dash?
# pcid /etc/pcid.d/
"""
[[files]]
path = "/etc/init.d/10_net"
data = """
# smolnetd
# dnsd
# dhcpd -b
"""
[[files]]
path = "/etc/init.d/20_orbital"
data = """
# audiod
# orbital display:3/activate orblogin launcher
"""
[[files]]
path = "/etc/init.d/30_console"
data = """
# getty display:2
getty debug: -J
"""
[[files]]
path = "/etc/net/dns"
data = """
208.67.222.222
"""
[[files]]
path = "/etc/net/ip"
data = """
10.0.2.15
"""
[[files]]
path = "/etc/net/ip_router"
data = """
10.0.2.2
"""
[[files]]
path = "/etc/net/ip_subnet"
data = """
255.255.255.0
"""
[[files]]
path = "/etc/net/mac"
data = """
54-52-00-ab-cd-ef
"""
[[files]]
path = "/etc/pkg.d/50_redox"
data = "https://static.redox-os.org/pkg"
[[files]]
path = "/etc/group"
data = """
root;0;root
user;1000;user
sudo;1;user
"""
[[files]]
path = "/etc/hostname"
data = """
redox
"""
[[files]]
path = "/usr/bin"
data = "/bin"
symlink = true
[[files]]
path = "/usr/games"
data = "/games"
symlink = true
[[files]]
path = "/usr/include"
data = "/include"
symlink = true
[[files]]
path = "/usr/lib"
data = "/lib"
symlink = true
[[files]]
path = "/usr/share"
data = "/share"
symlink = true
[[files]]
path = "/tmp"
data = ""
directory= true
# 0o1777
mode = 1023
[[files]]
path = "/dev/null"
data = "null:"
symlink = true
[[files]]
path = "/dev/random"
data = "rand:"
symlink = true
[[files]]
path = "/dev/urandom"
data = "rand:"
symlink = true
[[files]]
path = "/dev/zero"
data = "zero:"
symlink = true
config/aarch64.toml
\ No newline at end of file
config/riscv64.toml
\ No newline at end of file
Subproject commit 8130e4752babd24c21abc0bb32b27f9abcad5d28
Subproject commit 6f7749365826aba49e76c31029666281018d07e8
-include .config
# Configuration
## Architecture to build Redox for (aarch64 or x86_64)
ARCH?=aarch64
## Architecture to build Redox for (aarch64, riscv64, or x86_64)
ARCH?=riscv64
## Flags to pass to the installer (empty to download binary packages)
INSTALLER_FLAGS?=--cookbook=cookbook
## Enabled to use binary prefix (much faster)
PREFIX_BINARY?=1
PREFIX_BINARY?=0
## Filesystem size in MB (256 is the default)
FILESYSTEM_SIZE?=48
......
#!/usr/bin/env bash
set -ex
MACHINE=virt
U_BOOT="build/u-boot/${MACHINE}.bin"
IMAGE="build/kernel_live.uimage"
case "${MACHINE}" in
virt)
# UART at 0x9000000
U_BOOT_CONFIG=qemu_riscv64_defconfig
LOAD_ADDR=0x40000000
ENTRY_ADDR=0x40001000
IMAGE_ADDR=0x44000000
QEMU_ARGS=(
-M virt
-m 1G
-bios "${U_BOOT}"
-device "loader,file=${IMAGE},addr=${IMAGE_ADDR},force-raw=on"
-nographic
-serial mon:stdio
-s
)
;;
esac
if [ ! -f "${U_BOOT}" ]
then
make prefix
make -C u-boot distclean
make -C u-boot "${U_BOOT_CONFIG}"
sed -i \
's/^CONFIG_BOOTCOMMAND=.*$/CONFIG_BOOTCOMMAND="bootm '"${IMAGE_ADDR}"' - ${fdtcontroladdr}"/' \
u-boot/.config
TARGET=riscv64-unknown-redox
env CROSS_COMPILE="${TARGET}-" \
PATH="${PWD}/prefix/${TARGET}/relibc-install/bin/:${PATH}" \
make -C u-boot -j "$(nproc)"
mkdir -pv build/u-boot
cp -v u-boot/u-boot.bin "${U_BOOT}"
fi
mkdir -p build
# rm -f build/libkernel.a build/kernel
rm -f build/kernel
touch build/bootloader
touch kernel
make build/kernel
make build/initfs.tag
make build/filesystem.bin
make build/kernel_live
mkimage \
-A riscv \
-O linux \
-T kernel \
-C none \
-a "${LOAD_ADDR}" \
-e "${ENTRY_ADDR}" \
-n "Redox kernel (riscv64 ${MACHINE})" \
-d build/kernel_live \
"${IMAGE}"
if [ -n "${QEMU_ARGS}" ]
then
qemu-system-riscv64 "${QEMU_ARGS[@]}" "$@"
else
sudo cp -v "${IMAGE}" /srv/tftp
fi
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment