Commit 0c56ae16 authored by Jeremy Soller's avatar Jeremy Soller

Add support for building as a coreboot payload

parent f482e410
......@@ -34,3 +34,6 @@
path = relibc
url = https://gitlab.redox-os.org/redox-os/relibc.git
branch = master
[submodule "bootloader-coreboot"]
path = bootloader-coreboot
url = https://gitlab.redox-os.org/redox-os/bootloader-coreboot.git
......@@ -3,6 +3,8 @@ include mk/config.mk
all: build/harddrive.bin
coreboot: build/coreboot.elf
live: build/livedisk.bin
iso: build/livedisk.iso
......
Subproject commit f88d1c95e27c4ae6ce5bcc6ffeaf561811c88d47
# 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 = {}
#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 = {}
#newlib = {}
#newlibtest = {}
nulld = {}
#openjazz = {}
#openssl = {}
#openttd = {}
#openttd-opengfx = {}
#openttd-openmsx = {}
#openttd-opensfx = {}
orbdata = {}
orbital = {}
orbterm = {}
orbutils = {}
#osdemo = {}
#pastel = {}
#patch = {}
#pcre = {}
#periodictable = {}
#perl = {}
#pixelcannon = {}
#pixman = {}
#pkgutils = {}
#powerline = {}
#prboom = {}
ptyd = {}
#python = {}
#qemu = {}
randd = {}
#readline = {} # ncurses
#redoxfs = {}
#redox-ssh = {}
#relibc = {}
#ripgrep = {}
#rodioplay = {}
#rs-nes = {}
#rust = {}
#rust64 = {}
#rust-cairo = {}
#rust-cairo-demo = {}
#rustual-boy = {}
#schismtracker = {}
#scummvm = {}
#sdl = {}
#sdl2 = {}
#sdl_gfx = {}
#sdl_image = {}
#sdl_mixer = {}
#sdl_ttf = {}
#sdl-player = {}
#sed = {}
#servo = {}
#shellstorm = {}
#smith = {}
#sodium = {}
#sopwith = {}
#ssh = {}
#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 = """
nulld
zerod
randd
ipcd
#logd
ptyd
#pcid /etc/pcid/filesystem.toml
"""
# [[files]]
# path = "/etc/init.d/10_net"
# data = """
# smolnetd
# dnsd
# dhcpd -b
# """
[[files]]
path = "/etc/init.d/20_orbital"
data = """
#audiod
orbital display:2/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 = "/etc/issue"
data = """
########## Redox OS ##########
# Login with the following: #
# `user` #
# `root`:`password` #
##############################
"""
[[files]]
path = "/etc/motd"
data = """
Welcome to Redox OS!
"""
[[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
# This is the default configuration file
# General settings
[general]
# Do not prompt if settings are not defined
prompt = false
# Package settings
[packages]
drivers = {}
init = {}
redoxfs = {}
[[files]]
path="/etc/init.rc"
data="""
export PATH /bin
export TMPDIR /tmp
vesad T G
stdio display:1
ps2d us
pcid /etc/pcid/initfs.toml
redoxfs disk/live: file
cd file:
export PATH file:/bin
run.d /etc/init.d
"""
......@@ -24,6 +24,12 @@ build/livedisk.iso: build/livedisk.bin.gz
build/iso/
isohybrid $@
bootloader-coreboot/build/bootloader: build/kernel_coreboot
$(MAKE) -C bootloader-coreboot clean build/bootloader KERNEL="$(ROOT)/$<"
build/coreboot.elf: bootloader-coreboot/build/bootloader
cp $< $@
bootloader-efi/build/redox_bootloader/boot.efi:
$(MAKE) -C bootloader-efi build/redox_bootloader/boot.efi
......
......@@ -6,6 +6,14 @@ build/initfs.tag: initfs.toml prefix
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs/
touch $@
build/initfs_coreboot.tag: initfs_coreboot.toml prefix
rm -f build/libkernel_coreboot.a
rm -rf build/initfs_coreboot
mkdir -p build/initfs_coreboot
export PATH="$(PREFIX_PATH):$$PATH" && \
cargo run --manifest-path installer/Cargo.toml -- $(INSTALLER_FLAGS) -c $< build/initfs_coreboot/
touch $@
build/initfs_live.tag: initfs_live.toml prefix
rm -f build/libkernel_live.a
rm -rf build/initfs_live
......
......@@ -4,6 +4,12 @@ build/libkernel.a: kernel/Cargo.lock kernel/Cargo.toml kernel/src/* kernel/src/*
cd kernel && \
xargo rustc --lib --target $(KTARGET) --release -- -C soft-float -C debuginfo=2 --emit link=../$@
build/libkernel_coreboot.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* kernel/src/*/*/*/* build/initfs_coreboot.tag
export PATH="$(PREFIX_PATH):$$PATH" && \
export INITFS_FOLDER=$(ROOT)/build/initfs_coreboot && \
cd kernel && \
xargo rustc --lib --target $(KTARGET) --release --features live -- -C soft-float -C debuginfo=2 --emit link=../$@
build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src/*/*/* kernel/src/*/*/*/* build/initfs_live.tag
export PATH="$(PREFIX_PATH):$$PATH" && \
export INITFS_FOLDER=$(ROOT)/build/initfs_live && \
......@@ -16,6 +22,12 @@ build/kernel: kernel/linkers/$(ARCH).ld build/libkernel.a
$(OBJCOPY) --only-keep-debug $@ $@.sym && \
$(OBJCOPY) --strip-debug $@
build/kernel_coreboot: kernel/linkers/$(ARCH).ld build/libkernel_coreboot.a build/live.o
export PATH="$(PREFIX_PATH):$$PATH" && \
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_coreboot.a build/live.o && \
$(OBJCOPY) --only-keep-debug $@ $@.sym && \
$(OBJCOPY) --strip-debug $@
build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o
export PATH="$(PREFIX_PATH):$$PATH" && \
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_live.a build/live.o && \
......
Markdown is supported
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