...
 
Commits (24)
# 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
"""
[[files]]
path = "/etc/init.d/30_console"
data = """
getty debug: -J
"""
[[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
build/bootloader:
mkdir -p build
touch $@
build/live.o: build/filesystem.bin
export PATH="$(PREFIX_PATH):$$PATH" && \
$(OBJCOPY) -I binary -O elf64-littleaarch64 -B aarch64 $< $@ \
--redefine-sym _binary_build_filesystem_bin_start=__live_start \
--redefine-sym _binary_build_filesystem_bin_end=__live_end \
--redefine-sym _binary_build_filesystem_bin_size=__live_size
ifeq ($(ARCH),)
$(error "FATAL: ARCH variable not set")
endif
ARCH_CONFIG=mk/arch/$(ARCH).mk
ifeq ("$(wildcard $(ARCH_CONFIG))","")
$(error "FATAL: The $(ARCH) architecture is not supported")
endif
include $(ARCH_CONFIG)
build/harddrive.bin: build/filesystem.bin
build/bootloader: bootloader/$(ARCH)/**
mkdir -p build
nasm -f bin -o $@ -D ARCH_$(ARCH) -ibootloader/$(ARCH)/ bootloader/$(ARCH)/disk.asm
build/harddrive.bin: build/filesystem.bin bootloader/$(ARCH)/**
nasm -f bin -o $@ -D ARCH_$(ARCH) -D FILESYSTEM=$< -ibootloader/$(ARCH)/ bootloader/$(ARCH)/disk.asm
build/livedisk.bin: build/kernel_live bootloader/$(ARCH)/**
nasm -f bin -o $@ -D ARCH_$(ARCH) -D KERNEL=$< -ibootloader/$(ARCH)/ bootloader/$(ARCH)/disk.asm
build/live.o: build/filesystem.bin
#TODO: More general use of $(ARCH)
export PATH="$(PREFIX_PATH):$$PATH" && \
$(OBJCOPY) -I binary -O elf64-x86-64 -B i386:x86-64 $< $@ \
--redefine-sym _binary_build_filesystem_bin_start=__live_start \
--redefine-sym _binary_build_filesystem_bin_end=__live_end \
--redefine-sym _binary_build_filesystem_bin_size=__live_size
# Configuration
ARCH?=x86_64
PLATFORM?=pc
INSTALLER_FLAGS?=--cookbook=cookbook
PREFIX_RUSTC?=0
include mk/arch/config.mk
include mk/platform/config.mk
# Per host variables
UNAME := $(shell uname)
ifeq ($(UNAME),Darwin)
......@@ -38,15 +42,24 @@ RANLIB=$(TARGET)-gcc-ranlib
READELF=$(TARGET)-readelf
STRIP=$(TARGET)-strip
# Rust cross compile variables
export AR_$(subst -,_,$(TARGET))=$(TARGET)-ar
export CC_$(subst -,_,$(TARGET))=$(TARGET)-gcc
export CXX_$(subst -,_,$(TARGET))=$(TARGET)-g++
# Kernel variables
KTARGET=$(ARCH)-unknown-none
ifeq ($(ARCH),aarch64)
KTARGET=$(ARCH)-unknown-redox
else
KTARGET=$(ARCH)-unknown-none
endif
KBUILD=build/kernel
# Userspace variables
export TARGET=$(ARCH)-unknown-redox
BUILD=build/userspace
# Rust cross compile variables
export AR_$(subst -,_,$(TARGET))=$(TARGET)-ar
export CC_$(subst -,_,$(TARGET))=$(TARGET)-gcc
export CXX_$(subst -,_,$(TARGET))=$(TARGET)-g++
export AR_$(subst -,_,$(KTARGET))=$(TARGET)-ar
export CC_$(subst -,_,$(KTARGET))=$(TARGET)-gcc
export CXX_$(subst -,_,$(KTARGET))=$(TARGET)-g++
build/bootloader: bootloader/$(ARCH)/**
mkdir -p build
nasm -f bin -o $@ -D ARCH_$(ARCH) -ibootloader/$(ARCH)/ bootloader/$(ARCH)/disk.asm
build/harddrive.bin: build/filesystem.bin bootloader/$(ARCH)/**
nasm -f bin -o $@ -D ARCH_$(ARCH) -D FILESYSTEM=$< -ibootloader/$(ARCH)/ bootloader/$(ARCH)/disk.asm
build/harddrive.bin.gz: build/harddrive.bin
gzip -k -f $<
build/livedisk.bin: build/kernel_live bootloader/$(ARCH)/**
nasm -f bin -o $@ -D ARCH_$(ARCH) -D KERNEL=$< -ibootloader/$(ARCH)/ bootloader/$(ARCH)/disk.asm
build/livedisk.bin.gz: build/livedisk.bin
gzip -k -f $<
......
......@@ -2,7 +2,7 @@ build/libkernel.a: kernel/Cargo.lock kernel/Cargo.toml kernel/src/* kernel/src/*
export PATH="$(PREFIX_PATH):$$PATH" && \
export INITFS_FOLDER=$(ROOT)/build/initfs && \
cd kernel && \
xargo rustc --lib --target $(KTARGET) --release -- -C soft-float -C debuginfo=2 -C lto --emit link=../$@
xargo rustc --lib --target $(KTARGET) --release -- -C soft-float -C debuginfo=2 -C lto -C code-model=kernel --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" && \
......@@ -14,7 +14,7 @@ build/libkernel_live.a: kernel/Cargo.toml kernel/src/* kernel/src/*/* kernel/src
export PATH="$(PREFIX_PATH):$$PATH" && \
export INITFS_FOLDER=$(ROOT)/build/initfs_live && \
cd kernel && \
xargo rustc --lib --target $(KTARGET) --release --features live -- -C soft-float -C debuginfo=2 -C lto --emit link=../$@
xargo rustc --lib --target $(KTARGET) --release --features live -- -C soft-float -C debuginfo=2 -C lto -C code-model=kernel --emit link=../$@
build/kernel: kernel/linkers/$(ARCH).ld build/libkernel.a
export PATH="$(PREFIX_PATH):$$PATH" && \
......@@ -33,11 +33,4 @@ build/kernel_live: kernel/linkers/$(ARCH).ld build/libkernel_live.a build/live.o
$(LD) --gc-sections -z max-page-size=0x1000 -T $< -o $@ build/libkernel_live.a build/live.o && \
$(OBJCOPY) --only-keep-debug $@ $@.sym && \
$(OBJCOPY) --strip-debug $@
build/live.o: build/filesystem.bin
#TODO: More general use of $(ARCH)
export PATH="$(PREFIX_PATH):$$PATH" && \
$(OBJCOPY) -I binary -O elf64-x86-64 -B i386:x86-64 $< $@ \
--redefine-sym _binary_build_filesystem_bin_start=__live_start \
--redefine-sym _binary_build_filesystem_bin_end=__live_end \
--redefine-sym _binary_build_filesystem_bin_size=__live_size
$(MAKE) post_kbuild_platform_hook
ifeq ($(UBOOT),)
$(error "FATAL: Platform $(PLATFORM) requires that UBOOT contain the path to a u-boot binary")
endif
ifeq ("$(wildcard $(UBOOT))","")
$(error "FATAL: Cannot access a u-boot binary at $(UBOOT)")
endif
MKIMAGE := $(shell mkimage -V 2> /dev/null)
ifndef MKIMAGE
$(error "FATAL: Platform $(PLATFORM) needs mkimage in the path (from the u-boot-tools pkg on Debian derived systems)")
endif
QEMU_RAM_SZ=1024
QEMU_MACHINE=virt
PLATFORM_QEMUFLAGS+=-cpu cortex-a57 -bios $(UBOOT) -device loader,file=build/kernel.uimage,addr=0x41000000,force-raw=on
KLOADADDR=0x40000000
KENTRYADDR=0x40001000
build/livedisk.bin: build/kernel_live
cp $< $@
kernel.uimage:
@mkimage -A arm64 -O "linux" -T kernel -C none -a $(KLOADADDR) -e $(KENTRYADDR) -n 'Redox kernel (qemu AArch64 virt)' -d build/kernel_live build/kernel.uimage
bootscript.ram: kernel.uimage
@$(eval UUID := $(shell cargo run --manifest-path redoxfs/Cargo.toml --release --bin redoxfs -- --get-uuid build/filesystem.bin | awk '{print $$NF}'))
@$(eval TMPFILE := $(shell mktemp))
@echo 'setenv bootargs REDOXFS_UUID=$(UUID) ; bootm 41000000 - $${fdtcontroladdr}' > $(TMPFILE)
@mkimage -A arm64 -T script -C none -n 'Redox Bootscript' -d $(TMPFILE) build/kernel_from_ram.bootscript
@rm -rf $(TMPFILE)
post_kbuild_platform_hook: bootscript.ram
ifeq ($(PLATFORM),)
$(error "FATAL: PLATFORM variable not set")
endif
PLATFORM_CONFIG=mk/platform/$(ARCH)/$(PLATFORM).mk
ifeq ("$(wildcard $(PLATFORM_CONFIG))","")
$(error "FATAL: No $(PLATFORM) platform with arch $(ARCH) is supported")
endif
include $(PLATFORM_CONFIG)
QEMU_RAM_SZ=2048
QEMU_MACHINE=q35
post_kbuild_platform_hook: ;
......@@ -76,7 +76,7 @@ $(PREFIX)/rust-freestanding-install: $(ROOT)/rust | $(PREFIX)/gcc-freestanding-i
cp -r "$(PREFIX)/gcc-freestanding-install" "$@"
cd "$(PREFIX)/rust-freestanding-build" && \
export PATH="$@/bin:$$PATH" && \
"$</configure" --prefix="$@" --disable-docs && \
"$</configure" --prefix="$@" --disable-docs --disable-manage-submodules && \
make -j `nproc` && \
make install -j `nproc`
mkdir -p "$@/lib/rustlib/x86_64-unknown-linux-gnu/bin"
......
QEMU=SDL_VIDEO_X11_DGAMOUSE=0 qemu-system-$(ARCH)
QEMUFLAGS=-serial mon:stdio -d cpu_reset -d guest_errors
QEMUFLAGS+=-smp 4 -m 2048
QEMUFLAGS+=-smp 4 -m $(QEMU_RAM_SZ)
QEMUFLAGS+=$(PLATFORM_QEMUFLAGS)
ifeq ($(iommu),yes)
QEMUFLAGS+=-machine q35,iommu=on
QEMUFLAGS+=-machine $(QEMU_MACHINE),iommu=on
else
QEMUFLAGS+=-machine q35
QEMUFLAGS+=-machine $(QEMU_MACHINE)
endif
ifneq ($(audio),no)
QEMUFLAGS+=-device ich9-intel-hda -device hda-duplex
......@@ -15,8 +16,13 @@ else
ifneq ($(bridge),)
QEMUFLAGS+=-netdev bridge,br=$(bridge),id=net0 -device e1000,netdev=net0,id=nic0
else
QEMUFLAGS+=-netdev user,id=net0 -device e1000,netdev=net0 \
-object filter-dump,id=f1,netdev=net0,file=build/network.pcap
ifeq ($(tftp),yes)
QEMUFLAGS+=-netdev user,id=net0,tftp=$(BUILDDIR) -device e1000,netdev=net0 \
-object filter-dump,id=f1,netdev=net0,file=build/network.pcap
else
QEMUFLAGS+=-netdev user,id=net0 -device e1000,netdev=net0 \
-object filter-dump,id=f1,netdev=net0,file=build/network.pcap
endif
endif
ifeq ($(net),redir)
QEMUFLAGS+=-redir tcp:8023::8023 -redir tcp:8080::8080
......@@ -28,8 +34,14 @@ endif
ifneq ($(usb),no)
QEMUFLAGS+=-device nec-usb-xhci,id=xhci -device usb-tablet,bus=xhci.0
endif
ifneq ($(gdb),yes)
ifeq ($(gdb),yes)
QEMUFLAGS+=-s
ifeq ($(gdb_halt),yes)
QEMUFLAGS+=-S
endif
endif
ifeq ($(qemu_logging),yes)
QEMUFLAGS+=-d in_asm -D /tmp/qemu-redox-$(ARCH).log
endif
ifeq ($(UNAME),Linux)
ifneq ($(kvm),no)
......@@ -75,9 +87,7 @@ qemu_nvme_no_build: build/extra.qcow2
-drive file=build/extra.qcow2,if=none,id=drv0 -device nvme,drive=drv0,serial=NVME_SERIAL
qemu_live: build/livedisk.bin build/extra.qcow2
$(QEMU) $(QEMUFLAGS) \
-drive file=build/livedisk.bin,format=raw \
-drive file=build/extra.qcow2
$(QEMU) $(QEMUFLAGS)
qemu_live_no_build: build/extra.qcow2
$(QEMU) $(QEMUFLAGS) \
......