Compare commits

...

32 Commits

Author SHA1 Message Date
Ehmry - c6f3dfc3ec Add some ANSI C procedures to base-common
This is for the convenience of language runtimes.
2020-02-15 16:02:30 +01:00
Ehmry - 11ff9a1dc5 Add base-hw Tup rules 2020-02-13 12:13:16 +01:00
Ehmry - e0b84beafa Tup: LLVM adjustments 2020-02-13 12:13:16 +01:00
Ehmry - da0c9da996 Minor code adjustments for LLVM 2020-02-11 13:47:26 +01:00
Ehmry - fa5b9a9002 Tup: create ld.lib.so libraries when in a Nix build 2020-01-29 21:35:18 +01:00
Ehmry - 71e1a286e5 Nix: update flake 2020-01-29 18:45:57 +01:00
Ehmry - 196c340aa9 Tup: build more of gems 2020-01-29 16:26:29 +01:00
Ehmry - 200d82b4f5 core: simplify unprefixed LOG service
The special "platform" label is now "unlabeled".
2020-01-29 12:29:36 +01:00
Ehmry - 5d4e72c874 core: add platform logging service
If the root child requests a LOG service with the label "platform" then
return a LOG session that logs messages directly to kernel. This is to
allow a remote test controller to recognize messages produced by an
privileged local test harness.
2020-01-22 17:26:28 +01:00
Norman Feske 7c4568fb5a core: avoid use of C array as buffer in Log_root 2020-01-22 17:10:03 +01:00
Ehmry - b20ca5f254 Revert "Core: exit with child exit value"
Not actually useful, and causes a null deference on NOVA.
2020-01-22 17:10:03 +01:00
Ehmry - 4287419392 Add Nix flake for dev-shell 2020-01-21 13:36:05 +01:00
Ehmry - 42f93ce3da Move Nix expressions to genodepkgs 2020-01-17 17:17:34 +01:00
Ehmry - 59caa85840 Tup: mv ld-lova.lib.so from out/bin to out/lib 2020-01-17 17:17:21 +01:00
Ehmry - f902a21213 Remove NOVA submodule 2020-01-17 17:17:21 +01:00
Ehmry - ee7773567a Nix apps moved to genodepkgs 2020-01-17 17:17:21 +01:00
Ehmry - a1e84f0485 Convert README to Markdown 2020-01-17 13:54:46 +01:00
Ehmry - 9e1e1186dc Synchronize NOVA revision with genodelabs/staging
Also make the "makeFlags" attr compatible with dev-shell.
2020-01-16 13:09:56 +01:00
Ehmry - 292bd3f579 Nix: Add nova-image app 2020-01-15 16:42:10 +01:00
Ehmry - 18c0e21996 Remove version information from builds
This causes spurious rebuilds.
2020-01-15 16:42:10 +01:00
Ehmry - e45088704c Restore base tests 2020-01-15 16:42:10 +01:00
Ehmry - 8c8606b375 Skip strip in nova-iso, explicit mkisofs 2020-01-14 15:12:53 +01:00
Ehmry - c812fdf629 Add component exit to tests
This makes it possible to detect successful test runs in a general way.
2020-01-14 11:43:38 +01:00
Ehmry - 6463f84741 Nix flake: use Github url for Nixpkgs 2020-01-14 11:43:38 +01:00
Ehmry - b8e25c82da Nix: source code filtering 2020-01-14 11:43:26 +01:00
Ehmry - 955e95272c Tup: fix base-nova build 2020-01-14 11:33:00 +01:00
Ehmry - 4235b5ab9b Nix app for building NOVA ISOs 2020-01-14 11:33:00 +01:00
Ehmry - 97e01182ca Nix: package NOVA kernel
This package moved here from Genodepkgs.
2020-01-14 11:31:23 +01:00
Ehmry - 90c4d291b4 Nix flake: build packages at Hydra 2020-01-08 14:50:49 +01:00
Ehmry - d8074773d1 Add missing os test Tupfiles 2020-01-08 09:55:01 +01:00
Ehmry - 3fb87d9ea0 base-linux: use pkg-config for libraries from base repo
Tup output groups must not be used across the repositories, they will come
up empty in Nix builds, and libraries will not be fully linked.
2020-01-07 18:19:02 +01:00
Ehmry - 969180525f Use patched binary toolchain from Genode Labs
- Fetch and patch GCC distribution
 - Pass Tup config as a file
 - Fold out and dev outputs
 - Remove shellHook code for compatibility with dev-shell
 - Tweak Tup Nix conditionals
 - Add Tupfile.ini
 - Remove custom setup-hook
2020-01-05 20:32:08 +01:00
127 changed files with 1373 additions and 573 deletions

7
.gitignore vendored
View File

@ -13,3 +13,10 @@ result-*
/.tup
/build-*
/configs
##### TUP GITIGNORE #####
##### Lines below automatically generated by Tup.
##### Do not edit.
.tup
/.gitignore
/dev
/out

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "repos/base-nova/src/NOVA"]
path = repos/base-nova/src/NOVA
url = git://depot.h4ck.me/srv/git/NOVA

View File

@ -1,16 +1,29 @@
**FORK AHEAD**
=================================
Genode Operating System Framework
=================================
This a fork of the Genode OS reference implementation with a replacement
build system that is humane and interoperable.
Changes against [Genode Labs](https://genode-labs.com/) master may be
reviewed with the following commands:
```sh
git remote add genodelabs https://github.com/genodelabs/genode.git
git fetch genodelabs
git diff genodelabs/master
```
---
# Genode Operating System Framework
This is the source tree of the reference implementation of the Genode OS
architecture. For a general overview about the architecture, please refer to
the project's official website:
:Official project website for the Genode OS Framework:
### Official project website for the Genode OS Framework
https://genode.org/documentation/general-overview
[https://genode.org/documentation/general-overview]
The current implementation can be compiled for 8 different kernels: Linux,
L4ka::Pistachio, L4/Fiasco, OKL4, NOVA, Fiasco.OC, seL4, and a custom
@ -33,15 +46,14 @@ the kernel that fits best with the requirements at hand for the particular
usage scenario.
Documentation
#############
## Documentation
The primary documentation is the book "Genode Foundations", which is available
on the front page of Genode website:
:Download the book "Genode Foundations":
### Download the book "Genode Foundations"
[https://genode.org]
https://genode.org
The book describes Genode in a holistic and comprehensive way. It equips you
with a thorough understanding of the architecture, assists developers with the
@ -53,79 +65,75 @@ The project has a quarterly release cycle. Each version is accompanied with
detailed release documentation, which is available at the documentation
section of the project website:
:Release documentation:
### Release documentation
[https://genode.org/documentation/release-notes/]
https://genode.org/documentation/release-notes/
Directory overview
##################
## Directory overview
The source tree is composed of the following subdirectories:
:'doc':
### 'doc'
This directory contains general documentation. Please consider the following
document for a quick guide to get started with the framework:
! doc/getting_started.txt
[doc/getting_started.txt](doc/getting_started.txt)
If you are curious about the ready-to-use components that come with the
framework, please review the components overview:
! doc/components.txt
[doc/components.txt](doc/components.txt)
:'repos':
### 'repos':
This directory contains the so-called source-code repositories of Genode.
Please refer to the README file in the 'repos' directory to learn more
about the roles of the individual repositories.
:'tool':
### 'tool'
Source-code management tools and scripts. Please refer to the README file
contained in the directory.
:'depot' and 'public':
### 'depot' and 'public'
Local depot and public archive of Genode packages. Please refer to
! doc/depot.txt
[doc/depot.txt](doc/depot.txt)
for more details.
Additional community-maintained components
##########################################
## Additional community-maintained components
The components found within the main source tree are complemented by a growing
library of additional software, which can be seamlessly integrated into Genode
system scenarios.
:Genode-world repository:
### Genode-world repository
[https://github.com/genodelabs/genode-world]
https://github.com/genodelabs/genode-world
Contact
#######
## Contact
The best way to get in touch with Genode developers and users is the project's
mailing list. Please feel welcome to join in!
:Genode Mailing Lists:
### Genode Mailing Lists
[https://genode.org/community/mailing-lists]
https://genode.org/community/mailing-lists
Commercial support
##################
## Commercial support
The driving force behind the Genode OS Framework is the German company Genode
Labs. The company offers commercial licensing, trainings, support, and
contracted development work:
:Genode Labs website:
### Genode Labs website
[https://www.genode-labs.com]
https://www.genode-labs.com

0
Tupfile.ini Normal file
View File

46
Tuprules.gcc Normal file
View File

@ -0,0 +1,46 @@
TOOLCHAIN_CONFIGURED=$(TOOLCHAIN_CONFIGURED)X
ifeq (@(TUP_ARCH),i386)
CC_MARCH = -march=i686 -m32
LD_MARCH = -melf_i386
AS_MARCH = -march=i686 --32
endif
ifeq (@(TUP_ARCH),x86_64)
CC_MARCH = -m64 -mcmodel=large
LD_MARCH = -melf_x86_64
endif
ifeq (@(TUP_ARCH),arm_v8)
CC_MARCH = -march=armv8-a
endif
ifdef CXXFLAGS
CXXFLAGS = @(CXXFLAGS)
endif
CXXFLAGS += -Wno-error=implicit-fallthrough
CXXFLAGS += -Wno-error=unknown-pragmas
CXXFLAGS += -Wextra
CXXFLAGS += -Weffc++
CXXFLAGS += -Werror
CXXFLAGS += -Wsuggest-override
CXXFLAGS += -Wno-unknown-pragmas
LIBGCC = `$(CXX) $(CC_MARCH) -print-libgcc-file-name`
!ir = | $(DEV_DIR)/<pkg-config> |> clang $(OLEVEL) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(CPPFLAGS) -S -emit-llvm %f |> %B.ll
!asm = |> ^ CC %b^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -D__ASSEMBLY__ $(CPPFLAGS) -c %f -o %o |> %B.o
!cc = | $(DEV_DIR)/<pkg-config> |> ^o CC %f^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) $(CPPFLAGS) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` -c -fPIC %f -o %o |> %B.o
!cxx = | $(DEV_DIR)/<pkg-config> |> ^o CXX %b^ @(CC_WRAPPER) $(CXX) $(OLEVEL) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) $(CPPFLAGS) `$(PKG_CONFIG) --cflags $(LIBS)` -c -fPIC %f -o %o |> %B.o
!ld = | $(DEV_DIR)/<lib> $(DEV_DIR)/<pkg-config> |> ^o LD %o^ $(LD) -o %o $(LDFLAGS) `$(PKG_CONFIG) --libs $(LIBS)` %f |>
!incbin = |> ^ incbin %f^ \
export SYM=_binary_`echo %b | sed 's/\./_/g'`; \
echo ".global ${SYM}_start, ${SYM}_end; .data; .align 4; ${SYM}_start:; .incbin \"%f\"; ${SYM}_end:" \
| x86_64-unknown-genode-as $(AS_MARCH) -o %o - \
|> binary_%b.o

40
Tuprules.llvm Normal file
View File

@ -0,0 +1,40 @@
TOOLCHAIN_CONFIGURED=$(TOOLCHAIN_CONFIGURED)X
ifeq (@(TUP_ARCH),i386)
CC_MARCH = -march=i686 -m32
LD_MARCH = -melf_i386
AS_MARCH = -march=i686 --32
endif
ifeq (@(TUP_ARCH),x86_64)
CC_MARCH = -m64 -mcmodel=large
LD_MARCH = -melf_x86_64
endif
ifeq (@(TUP_ARCH),arm_v8)
CC_MARCH = -march=armv8-a
endif
ifdef CXXFLAGS
CXXFLAGS = @(CXXFLAGS)
endif
CXXFLAGS += -Wno-undefined-bool-conversion -Wno-unknown-attributes -Wsystem-headers -Werror -Wno-uninitialized -Wno-mismatched-tags
LIBGCC = `$(CC) $(CC_MARCH) -print-libgcc-file-name`
!ir = | $(DEV_DIR)/<pkg-config> |> clang $(OLEVEL) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(CPPFLAGS) -S -emit-llvm %f |> %B.ll
!asm = |> ^ CC %b^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -D__ASSEMBLY__ $(CPPFLAGS) -c %f -o %o |> %B.o
!cc = | $(DEV_DIR)/<pkg-config> |> ^o CC %f^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) $(CPPFLAGS) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` -c -fPIC %f -o %o |> %B.o
!cxx = | $(DEV_DIR)/<pkg-config> |> ^o CXX %b^ @(CC_WRAPPER) $(CXX) $(OLEVEL) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) $(CPPFLAGS) `$(PKG_CONFIG) --cflags $(LIBS)` -c -fPIC %f -o %o |> %B.o
!ld = | $(DEV_DIR)/<lib> $(DEV_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LDFLAGS) `$(PKG_CONFIG) --libs $(LIBS)` --whole-archive --start-group %f --no-whole-archive --end-group -o %o |>
!incbin = |> ^ incbin %f^ \
export SYM=_binary_`echo %b | sed 's/\./_/g'`; \
echo ".global ${SYM}_start, ${SYM}_end; .data; .align 4; ${SYM}_start:; .incbin \"%f\"; ${SYM}_end:" \
| llvm-mc -filetype=obj - > %o \
|> binary_%b.o

View File

@ -1,44 +1,50 @@
.gitignore
AR = @(AR)
AS = @(AS)
CC = @(CC)
CXX = @(CXX)
LD= @(LD)
OBJCOPY = @(OBJCOPY)
STRIP = @(STRIP)
OUT_DIR=$(TUP_CWD)/out
DEV_DIR = $(TUP_CWD)/dev
DEV_LIB_DIR = $(DEV_DIR)/lib
ifdef IS_GCC
include Tuprules.gcc
endif
ifdef IS_LLVM
include Tuprules.llvm
endif
ifeq ($(TOOLCHAIN_CONFIGURED),)
error no toolchain configuration is active
endif
ifneq ($(TOOLCHAIN_CONFIGURED),X)
error "multiple toolchain configurations are active "
endif
ifeq (@(TUP_ARCH),i386)
X86 = y
CC_MARCH = -march=i686 -m32
LD_MARCH = -melf_i386
AS_MARCH = -march=i686 --32
endif
ifeq (@(TUP_ARCH),x86_64)
X86 = y
TOOL_CHAIN_PREFIX=genode-x86-
CC_MARCH = -m64 -mcmodel=large
LD_MARCH = -melf_x86_64
endif
ifeq (@(TUP_ARCH),arm_v8)
CC_MARCH = -march=armv8-a
endif
GENODE_DIR = $(TUP_CWD)
!prg = | $(DEV_DIR)/<lib> $(DEV_DIR)/<pkg-config> \
|> ^o LD %o^ \
$(LD) $(LD_MARCH) $(LDFLAGS) \
-L$(DEV_LIB_DIR) \
`$(PKG_CONFIG) --libs $(LIBS) genode-prg` \
%f \
$(LIBGCC) \
-o %o \
|> %d
|> ^o LD %o^ $(LD) -o %o $(LD_MARCH) $(LDFLAGS) -L$(DEV_LIB_DIR) %f `$(PKG_CONFIG) --libs $(LIBS) genode-prg` $(LIBGCC) |> %d
!lib = | $(DEV_DIR)/<lib> $(DEV_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LD_MARCH) %f $(LDFLAGS) `$(PKG_CONFIG) --libs genode-lib $(LIBS)` -L$(DEV_LIB_DIR) -o %o |> %d.lib.so
!collect_bin = |> ^ COLLECT %b^ \
$STRIP -o %o %f \
$(STRIP) -o %o %f \
|> $(OUT_DIR)/bin/%b $(OUT_DIR)/<bin>
!collect_shared = |> ^ COLLECT %b^ \
@ -50,26 +56,14 @@ GENODE_DIR = $(TUP_CWD)
|> $(DEV_LIB_DIR)/%b \
$(DEV_DIR)/<lib> \
export CC
export CXX
export LD
CC = $CC
CXX = $CXX
LD= $LD
OBJCOPY = $OBJCOPY
ifdef CXXFLAGS
CXXFLAGS = @(CXXFLAGS)
endif
CXXFLAGS += -Wno-undefined-bool-conversion -Wno-unknown-attributes -Wsystem-headers -Werror -Wno-uninitialized -Wno-mismatched-tags
LIBGCC = `$(CC) $(CC_MARCH) -print-libgcc-file-name`
export PKG_CONFIG_PATH
PKG_CONFIG_DIR = $(DEV_DIR)/lib/pkgconfig
PKG_CONFIG = PKG_CONFIG_PATH=$(PKG_CONFIG_DIR):$PKG_CONFIG_PATH pkg-config
ifdef NIX_OUTPUTS_DEV
export PKG_CONFIG_PATH
PKG_CONFIG = PKG_CONFIG_PATH=$(PKG_CONFIG_DIR):$PKG_CONFIG_PATH @(PKGCONFIG)
else
PKG_CONFIG = PKG_CONFIG_PATH=$(PKG_CONFIG_DIR) @(PKGCONFIG)
endif
CFLAGS += -g
CXXFLAGS += -g
@ -80,29 +74,11 @@ else
OLEVEL = -O2
endif
!ir = | $(DEV_DIR)/<pkg-config> |> clang $(OLEVEL) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(CPPFLAGS) -S -emit-llvm %f |> %B.ll
!asm = |> ^ CC %b^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -D__ASSEMBLY__ $(CPPFLAGS) -c %f -o %o |> %B.o
!cc = | $(DEV_DIR)/<pkg-config> |> ^o CC %f^ @(CC_WRAPPER) $(CC) $(OLEVEL) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) $(CPPFLAGS) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` -c -fPIC %f -o %o |> %B.o
!cxx = | $(DEV_DIR)/<pkg-config> |> ^o CXX %b^ @(CC_WRAPPER) $(CXX) $(OLEVEL) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) $(CPPFLAGS) `$(PKG_CONFIG) --cflags $(LIBS)` -c -fPIC %f -o %o |> %B.o
!ld = | $(DEV_DIR)/<lib> $(DEV_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LDFLAGS) `$(PKG_CONFIG) --libs $(LIBS)` --whole-archive --start-group %f --no-whole-archive --end-group -o %o |>
export STRIP
!strip = |> $STRIP -o %o %f |>
!strip = |> $(STRIP) -o %o %f |>
!ln = |> ln -s %f %o |>
!incbin = |> ^ incbin %f^ \
export SYM=_binary_`echo %f | sed 's/\./_/g'`; \
echo ".global ${SYM}_start, ${SYM}_end; .data; .align 4; ${SYM}_start:; .incbin \"%f\"; ${SYM}_end:" \
| llvm-mc -filetype=obj - > %o \
|> binary_%b.o
export AR
!ar = |> $AR -rcs %o %f |> %d.a
!ar = |> $(AR) -rcs %o %f |> %d.a
GIT_VERSION = `git describe || echo @(VERSION)`
@ -110,12 +86,12 @@ SED_PKGCONFIG_FLAGS += -e "s|@VERSION@|$(GIT_VERSION)|"
!sed_pkgconfig_file = |> ^o SED %B^ \
sed $(SED_PKGCONFIG_FLAGS) $(SED_FLAGS) < %f > %o; \
pkg-config --validate %o; \
$(PKG_CONFIG) --validate %o; \
|> $(PKG_CONFIG_DIR)/%B $(DEV_DIR)/<pkg-config>
!sed_pkgconfig_flags = |> ^o SED %d.pc^ \
sed $(SED_PKGCONFIG_FLAGS) $(SED_FLAGS) > %o; \
pkg-config --validate %o; \
$(PKG_CONFIG) --validate %o; \
|> $(PKG_CONFIG_DIR)/%d.pc $(DEV_DIR)/<pkg-config>
!emit_lib_pkg_config = |> ^ emit %d.a pkg-config^ \
@ -123,5 +99,5 @@ SED_PKGCONFIG_FLAGS += -e "s|@VERSION@|$(GIT_VERSION)|"
echo Description: Genode %d library >> %o; \
echo Version: $(GIT_VERSION) >> %o; \
echo Libs: -l:%d.a >> %o; \
pkg-config --validate %o; \
$(PKG_CONFIG) --validate %o; \
|> $(PKG_CONFIG_DIR)/%d.pc $(DEV_DIR)/<pkg-config>

View File

@ -1,187 +0,0 @@
{ localSystem ? "x86_64-linux", crossSystem ? "x86_64-genode", self ? { }, ...
}@args:
let
pinnedNixpkgs = import (builtins.fetchGit {
url = "https://gitea.c3d2.de/ehmry/nixpkgs.git";
ref = "genode";
});
nixpkgs =
args.nixpkgs or (pinnedNixpkgs { inherit localSystem crossSystem; });
inherit (nixpkgs) stdenv buildPackages llvmPackages;
src = self.outPath or (builtins.fetchGit ./.);
version = self.lastModified or "unstable";
inherit (stdenv) lib targetPlatform;
specs = with targetPlatform;
[ ]
++ lib.optional is32bit "32bit"
++ lib.optional is64bit "64bit"
++ lib.optional isAarch32 "arm"
++ lib.optional isAarch64 "arm_64"
++ lib.optional isRiscV "riscv"
++ lib.optional isx86 "x86"
++ lib.optional isx86_32 "x86_32"
++ lib.optional isx86_64 "x86_64";
buildRepo = { repo, repoInputs }:
let
tupArch = with stdenv.targetPlatform;
if isAarch32 then
"arm"
else
if isAarch64 then
"arm64"
else
if isx86_32 then
"i386"
else
if isx86_64 then
"x86_64"
else
abort "unhandled targetPlatform";
toTupConfig = attrs:
with builtins;
let op = config: name: "${config}CONFIG_${name}=${getAttr name attrs} ";
in foldl' op "" (attrNames attrs);
in stdenv.mkDerivation {
name = "genode-${repo}-${version}";
outputs = [ "out" "dev" ];
inherit src repo specs version;
setupHook = ./setup-hooks.sh;
nativeBuildInputs = repoInputs;
# This is wrong, why does pkg-config not collect buildInputs?
propagatedNativeBuildInputs = repoInputs;
depsBuildBuild = with buildPackages; [ llvm pkgconfig tup ];
tupConfig = toTupConfig {
LIBCXX = llvmPackages.libcxx;
LIBCXXABI = llvmPackages.libcxxabi;
LIBUNWIND = llvmPackages.libunwind;
LIBUNWIND_BAREMETAL =
llvmPackages.libunwind.override { isBaremetal = true; };
LINUX_HEADERS = buildPackages.glibc.dev;
OLEVEL = "-O2";
TUP_ARCH = tupArch;
VERSION = version;
};
configurePhase = ''
# Configure Tup
echo $tupConfig | tr ' CONFIG_' '\nCONFIG_' > tup.config
echo CONFIG_NIX_OUTPUTS_OUT=$out >> tup.config
echo CONFIG_NIX_OUTPUTS_DEV=$dev >> tup.config
# Disable other repos
for R in repos/*; do
[ "$R" != "repos/$repo" ] && find $R -name Tupfile -delete
done
# Scan repository and generate script
tup init
tup generate buildPhase.sh
# Redirect artifacts to Nix store
mkdir -p $out/lib $dev/include
ln -s $out out
ln -s $dev dev
'';
buildPhase = ''
test -d repos/$repo/src/ld && cp -rv repos/$repo/src/ld $dev/
pushd .
set -v
source buildPhase.sh
set +v
popd
'';
installPhase = ''
# Populate the "dev" headers
if [ -d "repos/$repo/include" ]; then
for DIR in repos/$repo/include; do
for SPEC in $specs; do
if [ -d $DIR/spec/$SPEC ]; then
cp -r $DIR/spec/$SPEC/* $dev/include
rm -r $DIR/spec/$SPEC
fi
done
rm -rf $DIR/spec
cp -r $DIR $dev/
done
fi
touch $dev/.genode
for pc in $dev/lib/pkgconfig/*.pc; do
sed -e "s|^Libs: |Libs: -L$dev/lib |" -i $pc
done
'';
meta = with stdenv.lib; {
description =
"The Genode operation system framework (${repo} repository).";
homepage = "https://genode.org/";
license = licenses.agpl3;
maintainers = [ maintainers.ehmry ];
};
shellHook = ''
export PROMPT_DIRTRIM=2
export PS1="\[\033[1;30m\]Genode-dev [\[\033[1;37m\]\w\[\033[1;30m\]] $\[\033[0m\] "
export PS2="\[\033[1;30m\]>\[\033[0m\] "
if [ -e "configs/.gitignore" ]; then
local CFG=configs/${targetPlatform.config}.config
echo $tupConfig | tr ' CONFIG_' '\nCONFIG_' > $CFG
tup variant $CFG
fi
'';
};
in rec {
base = buildRepo {
repo = "base";
repoInputs = [ ];
};
base-linux = buildRepo {
repo = "base-linux";
repoInputs = [ base ];
};
base-nova = buildRepo {
repo = "base-nova";
repoInputs = [ base ];
};
os = buildRepo {
repo = "os";
repoInputs = [ base ];
};
gems = buildRepo {
repo = "gems";
repoInputs = [ os ];
};
}

View File

@ -1,10 +1,55 @@
{
"inputs": {
"genodepkgs": {
"inputs": {
"dhall-haskell": {
"inputs": {
"nixpkgs": {
"inputs": {},
"narHash": "sha256-wJg4DA700SoQbEz61448sR6BgxRa1R92K3vvCV1g+HY=",
"originalUrl": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148",
"url": "git+https://github.com/nixos/nixpkgs.git?ref=18.09-beta&rev=1d4de0d552ae9aa66a5b8dee5fb0650a4372d148"
},
"nixpkgsStaticLinux": {
"inputs": {},
"narHash": "sha256-famU3pJZ4vkElV9qc71HmyRVSvcrAhfMZ0UJKpmmKP8=",
"originalUrl": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working",
"url": "git+https://github.com/nh2/nixpkgs.git?ref=static-haskell-nix-stack-dhall-working&rev=925aac04f4ca58aceb83beef18cb7dae0715421b"
}
},
"narHash": "sha256-KJl9ZLcMcEsLSPcwcWoc0Ac74/6HKC9LkVMeLwhyhlg=",
"originalUrl": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake",
"url": "git+https://github.com/dhall-lang/dhall-haskell?ref=flake&rev=aea28adf3d10ff1982aa4ddd176d1476251b932f"
},
"genode-depot": {
"inputs": {
"nixpkgs": {
"inputs": {},
"narHash": "sha256-NB+H7zK3BB//zM127FqgbG4iAfY+nS/IOyO+uGWA5Ho=",
"originalUrl": "nixpkgs",
"url": "github:edolstra/nixpkgs/7845bf5f4b3013df1cf036e9c9c3a55a30331db9"
}
},
"narHash": "sha256-7eL2MfGgeEaIwJXPc4LQ7pBa4JeGicm9th7onjKgzsE=",
"originalUrl": "git+https://gitea.c3d2.de/ehmry/genode-depot.git",
"url": "git+https://gitea.c3d2.de/ehmry/genode-depot.git?ref=master&rev=8c2aafed45b4075e37f1cd93de0ebf93f38c83c3"
},
"nixpkgs": {
"inputs": {},
"narHash": "sha256-EqxCk6ORqq4fkewWttpvks0VycBec9X9spAZ+Pq/CEI=",
"originalUrl": "github:ehmry/nixpkgs",
"url": "github:ehmry/nixpkgs/cf50f3b8bdc28832249afab6bca68acad832e011"
}
},
"narHash": "sha256-78eloDNkEjWAckNLbfNait0zb6QBG4QxltX6FyV1vAk=",
"originalUrl": "git+https://git.sr.ht/~ehmry/genodepkgs",
"url": "git+https://git.sr.ht/~ehmry/genodepkgs?ref=master&rev=dad28cc17b17542ada59ba2005fbf1af5d5f8209"
},
"nixpkgs": {
"inputs": {},
"narHash": "sha256-/9hMb9pgV8awDYYchUueplyKF6bz23b7z5gqQ999nro=",
"originalUrl": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode",
"url": "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode&rev=d63ee96d86672a9cb23d83d50ee02687eded2818"
"narHash": "sha256-NB+H7zK3BB//zM127FqgbG4iAfY+nS/IOyO+uGWA5Ho=",
"originalUrl": "nixpkgs",
"url": "github:edolstra/nixpkgs/7845bf5f4b3013df1cf036e9c9c3a55a30331db9"
}
},
"version": 3

View File

@ -1,57 +1,14 @@
{
description = "Genode development flake";
edition = 201909;
description = "Genode system flake";
inputs.genodepkgs.uri = "git+https://git.sr.ht/~ehmry/genodepkgs";
inputs.nixpkgs.uri = "git+https://gitea.c3d2.de/ehmry/nixpkgs.git?ref=genode";
outputs = { self, nixpkgs, genodepkgs }: {
outputs = { self, nixpkgs }:
let
mkOutput = { system, localSystem, crossSystem }: rec {
packages = import ./default.nix {
inherit localSystem crossSystem self;
nixpkgs = builtins.getAttr system nixpkgs.legacyPackages;
};
defaultPackage = packages.base-linux;
};
localSystems = [ "x86_64-linux" ];
crossSystems = [ "x86_64-genode" ];
forAllCrossSystems = f:
with builtins;
let
f' = localSystem: crossSystem:
let system = localSystem + "-" + crossSystem;
in {
name = system;
value = f { inherit system localSystem crossSystem; };
};
list = nixpkgs.lib.lists.crossLists f' [ localSystems crossSystems ];
attrSet = listToAttrs list;
in attrSet;
finalize = outputs:
with builtins;
let
outputs' = outputs // {
x86_64-linux = getAttr "x86_64-linux-x86_64-genode" outputs;
};
systems = attrNames outputs';
outputAttrs = attrNames (head (attrValues outputs'));
list = map (attr: {
name = attr;
value = listToAttrs (map (system: {
name = system;
value = getAttr attr (getAttr system outputs');
}) systems);
}) outputAttrs;
in listToAttrs list;
final = finalize (forAllCrossSystems mkOutput);
in final;
devShell.x86_64-linux =
genodepkgs.packages.x86_64-linux-x86_64-genode.genode.base;
};
}

View File

@ -18,14 +18,33 @@ endif
-e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%%function; \1:/" \
-e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%%object; .size \1,\2; \1:/" \
-e "s/^\(\w\+\) U/.text; .global \1; $(ASM_SYM_DEPENDENCY)/" \
%f \
| $(CC) -x assembler -c - -o tmp.o; \
%f > stub.s; \
$(CC) $(CC_MARCH) -x assembler -c stub.s; \
$(LD) -o %o \
-shared \
-T &(LD_SCRIPT_SO) \
tmp.o; \
rm tmp.o; \
stub.o; \
rm -v stub.o stub.s; \
|> $(DEV_LIB_DIR)/%B.lib.so $(DEV_DIR)/<lib>
BASE_DIR = $(GENODE_DIR)/repos/base
&BASE_DIR = base
ifeq (@(TUP_ARCH),i386)
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86_32
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86
CPPFLAGS += -I$(BASE_DIR)/include/spec/32bit
endif
ifeq (@(TUP_ARCH),x86_64)
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86_64
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86
CPPFLAGS += -I$(BASE_DIR)/include/spec/64bit
endif
ifeq (@(TUP_ARCH),arm64)
CPPFLAGS += -I$(BASE_DIR)/include/spec/arm_64
CPPFLAGS += -I$(BASE_DIR)/include/spec/64bit
endif
CPPFLAGS += -I$(BASE_DIR)/include

View File

@ -167,7 +167,7 @@ namespace Genode {
size_t max_caps() const override { return Capability_space::max_caps(); }
void wait_for_exit(int const &) override;
void wait_for_exit() override;
};
}

View File

@ -483,7 +483,7 @@ Platform::Platform() :
** Generic platform interface **
********************************/
void Platform::wait_for_exit(int const &)
void Platform::wait_for_exit()
{
/*
* On Fiasco, Core never exits. So let us sleep forever.

View File

@ -183,7 +183,7 @@ namespace Genode {
Cap_id_allocator &cap_id_alloc() { return _cap_id_alloc; }
void wait_for_exit(int const &) override;
void wait_for_exit() override;
};
}

View File

@ -582,7 +582,7 @@ Platform::Platform() :
** Generic platform interface **
********************************/
void Platform::wait_for_exit(int const &)
void Platform::wait_for_exit()
{
/*
* On Fiasco, Core never exits. So let us sleep forever.

View File

@ -0,0 +1,8 @@
ifeq (@(TUP_ARCH),x86_64)
CPPFLAGS += -I$(TUP_CWD)/include/spec/x86_64
endif
CPPFLAGS += -I$(TUP_CWD)/include
include &(BASE_DIR)/Tuprules.tup
REP_DIR = $(TUP_CWD)

View File

@ -0,0 +1,2 @@
CPPFLAGS += -I$(TUP_CWD)/include
CPPFLAGS += -I$(BASE_DIR)/src/include

View File

@ -0,0 +1,71 @@
ifeq (@(TUP_ARCH),x86_64)
CPPFLAGS += -I$(TUP_CWD)/spec/x86_64
NR_OF_CPUS = 32
CPPFLAGS += -DNR_OF_CPUS=$(NR_OF_CPUS)
LDFLAGS += --defsym NR_OF_CPUS=$(NR_OF_CPUS)
endif
GEN_CORE_DIR = $(BASE_DIR)/src/core
# add include paths
CPPFLAGS += -I$(BASE_DIR)/../base-hw/src/core
CPPFLAGS += -I$(GEN_CORE_DIR)/include
CPPFLAGS += -I$(BASE_DIR)/../base-hw/src/include
CPPFLAGS += -I$(BASE_DIR)/src/include
# add C++ sources
SRC_CC += $(GEN_CORE_DIR)/core_log.cc
SRC_CC += $(GEN_CORE_DIR)/core_mem_alloc.cc
SRC_CC += $(GEN_CORE_DIR)/core_rpc_cap_alloc.cc
SRC_CC += $(GEN_CORE_DIR)/cpu_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/cpu_thread_component.cc
SRC_CC += $(GEN_CORE_DIR)/dataspace_component.cc
SRC_CC += $(GEN_CORE_DIR)/default_log.cc
SRC_CC += $(GEN_CORE_DIR)/dump_alloc.cc
SRC_CC += $(GEN_CORE_DIR)/heartbeat.cc
SRC_CC += $(GEN_CORE_DIR)/io_mem_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/main.cc
SRC_CC += $(GEN_CORE_DIR)/pd_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/pd_session_support.cc
SRC_CC += $(GEN_CORE_DIR)/platform_rom_modules.cc
SRC_CC += $(GEN_CORE_DIR)/ram_dataspace_factory.cc
SRC_CC += $(GEN_CORE_DIR)/region_map_component.cc
SRC_CC += $(GEN_CORE_DIR)/rom_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/signal_receiver.cc
SRC_CC += $(GEN_CORE_DIR)/signal_transmitter_noinit.cc
SRC_CC += $(GEN_CORE_DIR)/stack_area.cc
SRC_CC += $(GEN_CORE_DIR)/trace_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/version.cc
CXXFLAGS_$(GEN_CORE_DIR)/version.cc += -DGENODE_VERSION=\"`git describe`\"
SRC_CC += $(TUP_CWD)/capability.cc
SRC_CC += $(TUP_CWD)/core_log_out.cc
SRC_CC += $(TUP_CWD)/core_region_map.cc
SRC_CC += $(TUP_CWD)/cpu_session_support.cc
SRC_CC += $(TUP_CWD)/env.cc
SRC_CC += $(TUP_CWD)/io_mem_session_support.cc
SRC_CC += $(TUP_CWD)/irq_session_component.cc
SRC_CC += $(TUP_CWD)/kernel_log.cc
SRC_CC += $(TUP_CWD)/native_pd_component.cc
SRC_CC += $(TUP_CWD)/native_utcb.cc
SRC_CC += $(TUP_CWD)/pager.cc
SRC_CC += $(TUP_CWD)/platform.cc
SRC_CC += $(TUP_CWD)/platform_pd.cc
SRC_CC += $(TUP_CWD)/platform_thread.cc
SRC_CC += $(TUP_CWD)/ram_dataspace_support.cc
SRC_CC += $(TUP_CWD)/region_map_support.cc
SRC_CC += $(TUP_CWD)/stack_area_addr.cc
SRC_CC += $(TUP_CWD)/thread_start.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/cpu.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/cpu_scheduler.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/double_list.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/init.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/ipc_node.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/irq.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/kernel.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/object.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/signal_receiver.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/thread.cc
SRC_CC_KERNEL += $(TUP_CWD)/kernel/timer.cc

View File

@ -51,7 +51,7 @@ class Kernel::Ipc_node : private Ipc_node_queue::Element
private:
friend class Core_thread;
friend struct Core_thread;
friend class Genode::Fifo<Ipc_node>;
State _state = INACTIVE;

View File

@ -50,7 +50,7 @@ namespace Genode
class Kernel::Irq : Genode::Avl_node<Irq>
{
friend class Genode::Avl_tree<Irq>;
friend class Genode::Avl_node<Irq>;
friend struct Genode::Avl_node<Irq>;
public:

View File

@ -32,7 +32,7 @@ namespace Kernel
/**
* Base class of all Kernel objects
*/
class Object;
struct Object;
/**
* An object identity helps to distinguish different capability owners

View File

@ -29,7 +29,7 @@ namespace Kernel
{
struct Thread_fault;
class Thread;
class Core_thread;
struct Core_thread;
}

View File

@ -0,0 +1,37 @@
ifeq (@(TUP_ARCH),x86_64)
include_rules
GEN_CORE_DIR = $(BASE_DIR)/src/core
# add C++ sources
SRC_CC += $(REP_DIR)/src/lib/hw/spec/64bit/memory_map.cc
SRC_CC += ../kernel/cpu_mp.cc
SRC_CC += ../kernel/lock.cc
SRC_CC += ../kernel/vm_thread_off.cc
SRC_CC += $(GEN_CORE_DIR)/spec/x86/io_port_session_component.cc
SRC_CC += $(GEN_CORE_DIR)/spec/x86/io_port_session_support.cc
SRC_CC += $(GEN_CORE_DIR)/spec/x86/platform_services.cc
SRC_CC += ../spec/x86_64/bios_data_area.cc
SRC_CC += ../spec/x86_64/cpu.cc
SRC_CC += ../spec/x86_64/pic.cc
SRC_CC += ../spec/x86_64/pit.cc
SRC_CC += ../spec/x86_64/platform_support.cc
SRC_CC += ../spec/x86_64/platform_support_common.cc
: foreach $(SRC_S) |> !asm |> {obj}
: foreach $(SRC_CC) |> !cxx |> {obj}
: foreach $(SRC_CC_KERNEL) |> !cxx |> ../kernel/%B.o {obj}
: {obj} | \
$(DEV_DIR)/<lib> \
$(DEV_DIR)/<pkg-config> \
$(BASE_DIR)/<base-libs> \
$(REP_DIR)/<base-common> \
$(REP_DIR)/<core-obj> \
|> $(LD) $(LDFLAGS) -u _start -r \
--whole-archive --start-group %f %<core-obj> %<base-libs> %<base-common> $(PKG_LIBS) --no-whole-archive --end-group -o %o \
|> core.a $(REP_DIR)/<core> {core}
: {core} |> cp %f %o |> $(OUT_DIR)/lib/core-hw-pc.a
endif

View File

@ -24,8 +24,8 @@
namespace Genode {
class Signal_context_component;
class Signal_source_component;
struct Signal_context_component;
struct Signal_source_component;
typedef Object_pool<Signal_context_component> Signal_context_pool;
typedef Object_pool<Signal_source_component> Signal_source_pool;
@ -50,7 +50,7 @@ struct Genode::Signal_source_component : private Kernel_object<Kernel::Signal_re
public Signal_source_pool::Entry
{
friend class Object_pool<Signal_source_component>;
friend class Signal_context_component;
friend struct Signal_context_component;
using Signal_source_pool::Entry::cap;

View File

@ -0,0 +1,6 @@
ifeq (@(TUP_ARCH),x86_64)
include_rules
: foreach *.s |> !asm |> | $(REP_DIR)/<core-obj>
endif

View File

@ -0,0 +1,6 @@
ifeq (@(TUP_ARCH),x86_64)
include_rules
: foreach *.cc |> !cxx |> | $(REP_DIR)/<core-obj>
endif

View File

@ -13,8 +13,8 @@
*/
/* core includes */
#include "../../kernel/cpu.h"
#include "../../kernel/kernel.h"
#include "../../../kernel/cpu.h"
#include "../../../kernel/kernel.h"
void Kernel::Cpu::_arch_init()
{

View File

@ -11,8 +11,8 @@
* under the terms of the GNU Affero General Public License version 3.
*/
#include "../../kernel/cpu.h"
#include "../../kernel/pd.h"
#include "../../../kernel/cpu.h"
#include "../../../kernel/pd.h"
bool Kernel::Pd::invalidate_tlb(Cpu & cpu, addr_t, size_t)

View File

@ -14,9 +14,9 @@
*/
/* core includes */
#include "../../kernel/cpu.h"
#include "../../kernel/thread.h"
#include "../../kernel/pd.h"
#include "../../../kernel/cpu.h"
#include "../../../kernel/thread.h"
#include "../../../kernel/pd.h"
void Kernel::Thread::Tlb_invalidation::execute()
{

View File

@ -14,8 +14,8 @@
*/
/* core includes */
#include "../../kernel/cpu.h"
#include "../../kernel/thread.h"
#include "../../../kernel/cpu.h"
#include "../../../kernel/thread.h"
using namespace Kernel;

View File

@ -23,7 +23,7 @@
#include <port_io.h>
#include <board.h>
namespace Board { class Timer; }
namespace Board { struct Timer; }
/**
* LAPIC-based timer driver for core

View File

@ -28,8 +28,8 @@
#include <kernel/interface.h>
namespace Genode {
struct Native_utcb;
class Native_utcb;
/**
* The main thread's UTCB, used during bootstrap of the main thread before it

View File

@ -37,7 +37,7 @@
#include <board.h>
namespace Genode {
class Address_space;
struct Address_space;
class Platform;
};
@ -128,7 +128,7 @@ class Genode::Platform : public Genode::Platform_generic
size_t vm_size() const override { return Hw::Mm::user().size; }
Rom_fs &rom_fs() override { return _rom_fs; }
void wait_for_exit(int const &) override {
void wait_for_exit() override {
while (1) { Kernel::stop_thread(); } };
bool supports_direct_unmap() const override { return true; }

View File

@ -50,7 +50,7 @@ namespace Genode
/**
* Platform specific part of Core's protection domain
*/
class Core_platform_pd;
struct Core_platform_pd;
using Hw::Page_flags;
}

View File

@ -34,7 +34,7 @@
namespace Genode {
class Pager_object;
class Thread_state;
struct Thread_state;
class Rm_client;
class Platform_thread;
class Platform_pd;

View File

@ -0,0 +1,46 @@
include_rules
BASE_COMMON_DIR = $(BASE_DIR)/src/lib/base-common
include $(BASE_COMMON_DIR)/Tupfile.inc
SRC_CC += $(BASE_COMMON_DIR)/ansi_c.cc
SRC_CC += $(BASE_COMMON_DIR)/allocator_avl.cc
SRC_CC += $(BASE_COMMON_DIR)/avl_tree.cc
SRC_CC += $(BASE_COMMON_DIR)/child.cc
SRC_CC += $(BASE_COMMON_DIR)/child_process.cc
SRC_CC += $(BASE_COMMON_DIR)/component.cc
SRC_CC += $(BASE_COMMON_DIR)/console.cc
SRC_CC += $(BASE_COMMON_DIR)/elf_binary.cc
SRC_CC += $(BASE_COMMON_DIR)/entrypoint.cc
SRC_CC += $(BASE_COMMON_DIR)/env_session_id_space.cc
SRC_CC += $(BASE_COMMON_DIR)/heap.cc
SRC_CC += $(BASE_COMMON_DIR)/lock.cc
SRC_CC += $(BASE_COMMON_DIR)/log.cc
SRC_CC += $(BASE_COMMON_DIR)/output.cc
SRC_CC += $(BASE_COMMON_DIR)/raw_output.cc
SRC_CC += $(BASE_COMMON_DIR)/region_map_client.cc
SRC_CC += $(BASE_COMMON_DIR)/registry.cc
SRC_CC += $(BASE_COMMON_DIR)/rm_session_client.cc
SRC_CC += $(BASE_COMMON_DIR)/root_proxy.cc
SRC_CC += $(BASE_COMMON_DIR)/rpc_dispatch_loop.cc
SRC_CC += $(BASE_COMMON_DIR)/rpc_entrypoint.cc
SRC_CC += $(BASE_COMMON_DIR)/session_state.cc
SRC_CC += $(BASE_COMMON_DIR)/signal_common.cc
SRC_CC += $(BASE_COMMON_DIR)/slab.cc
SRC_CC += $(BASE_COMMON_DIR)/sleep.cc
SRC_CC += $(BASE_COMMON_DIR)/sliced_heap.cc
SRC_CC += $(BASE_COMMON_DIR)/stack_allocator.cc
SRC_CC += $(BASE_COMMON_DIR)/stack_protector.cc
SRC_CC += $(BASE_COMMON_DIR)/thread.cc
SRC_CC += $(BASE_COMMON_DIR)/thread_myself.cc
SRC_CC += $(BASE_COMMON_DIR)/trace.cc
SRC_CC += $(BASE_COMMON_DIR)/vm_session.cc
SRC_CC += ipc.cc
SRC_CC += signal_transmitter.cc
SRC_CC += thread_bootstrap.cc
: foreach $(SRC_CC) |> !cxx |> {obj}
: foreach $(SRC_S) |> !asm |> {obj}
: {obj} |> !ar |> base-hw-common.lib.a | $(REP_DIR)/<base-hw-common>

View File

@ -0,0 +1,22 @@
include_rules
BASE_LIB_DIR = $(BASE_DIR)/src/lib/base
SRC_CC += $(BASE_LIB_DIR)/default_log.cc
SRC_CC += $(BASE_LIB_DIR)/env_reinit.cc
SRC_CC += $(BASE_LIB_DIR)/heartbeat.cc
SRC_CC += $(BASE_LIB_DIR)/main_thread_cap.cc
SRC_CC += $(BASE_LIB_DIR)/rpc_cap_alloc.cc
SRC_CC += $(BASE_LIB_DIR)/stack_area.cc
SRC_CC += $(BASE_LIB_DIR)/stack_area_addr.cc
SRC_CC += cache.cc
SRC_CC += capability.cc
SRC_CC += env_deprecated.cc
SRC_CC += native_utcb.cc
SRC_CC += raw_write_string.cc
SRC_CC += signal_receiver.cc
SRC_CC += thread_start.cc
: foreach $(SRC_CC) |> !cxx |> {base-obj}
: {base-obj} |> !ar |> base-hw.lib.a | $(REP_DIR)/<base-hw>

View File

@ -0,0 +1,46 @@
include_rules
include $(BASE_DIR)/src/lib/ldso/Tuprules.tup
: foreach $(LDSO_DIR)/*.cc |> !cxx |> {obj}
: foreach $(LDSO_SPEC_DIR)/*.s |> !asm |> {obj}
LDFLAGS += -shared --eh-frame-hdr
: $(BASE_DIR)/lib/symbols/ld \
|> \
echo -e '{\n\tglobal:' >> %o; \
sed -n "s/^\(\w\+\) .*/\t\t\1;/p" %f >> %o; \
echo -e "\tlocal: *;\n};" >> %o; \
|> symbol.map
LDFLAGS += -Bsymbolic-functions --version-script=symbol.map
ifeq (@(TUP_ARCH),i386)
LDFLAGS += -T$(LDSO_DIR)/linux-32.ld
else
LDFLAGS += -T$(LDSO_DIR)/linker.ld
LDFLAGS += --entry=_start
endif
LDFLAGS += -z max-page-size=0x1000
LDFLAGS += -T$(BASE_DIR)/src/ld/genode_rel.ld
PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs alarm cxx ldso-startup timeout`
OUTPUT = ld-hw.lib.so
ifdef NIX_OUTPUTS_DEV
OUTPUT = ld.lib.so
endif
: {obj} | \
$(DEV_DIR)/<lib> \
$(DEV_DIR)/<pkg-config> \
$(REP_DIR)/<base-common> \
$(REP_DIR)/<base-hw> \
$(REP_DIR)/<startup> \
symbol.map \
|> $(LD) -o %o $(LD_MARCH) $(LDFLAGS) --whole-archive --start-group $(PKG_LIBS) %<base-common> %<base-hw> %<startup> %f --end-group --no-whole-archive $(LIBGCC) \
|> $(OUTPUT) $(REP_DIR)/<ld> {lib}
: foreach {lib} |> !collect_shared |>

View File

@ -0,0 +1,2 @@
include_rules
include &(BASE_DIR)/src/lib/startup/Tupfile.inc

View File

@ -0,0 +1,21 @@
include_rules
ifeq (@(TUP_ARCH),arm)
SRC_CC += ../base-common/arm/kernel/*.cc
endif
ifeq (@(TUP_ARCH),aarch64)
SRC_CC += ../base-common/arm_64/kernel/*.cc
endif
ifeq (@(TUP_ARCH),riscv)
SRC_CC += ../base-common/riscv/kernel/*.cc
endif
ifeq (@(TUP_ARCH),x86_64)
SRC_CC += ../base-common/x86_64/kernel/*.cc
endif
: foreach $(SRC_CC) |> !cxx |> {obj}
: {obj} |> !ar |> syscall-hw.lib.a | $(REP_DIR)/<syscall-hw>

View File

@ -0,0 +1,12 @@
LIBS += genode-base
include_rules
BASE_TIMER_DIR = $(BASE_DIR)/src/timer
CPPFLAGS += -I$(BASE_TIMER_DIR)/include
CPPFLAGS += -I.
#TODO: ^ FAIL
: foreach *.cc $(BASE_TIMER_DIR)/*.cc |> !cxx |> %B.hw.o {obj}
: {obj} | $(REP_DIR)/<syscall-hw> |> !prg %<syscall-hw> |> hw_timer_drv {bin}
: {bin} |> !collect_bin |>

View File

@ -41,7 +41,11 @@ LDFLAGS += -Ttext=0x01000000
LDFLAGS += -T$(BASE_DIR)/src/ld/genode.ld
LDFLAGS += -T$(REP_DIR)/src/ld/stack_area.ld
LDFLAGS += -L$(DEV_LIB_DIR) `$(PKG_CONFIG) --libs cxx-baremetal`
ifdef IS_LLVM
PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs cxx-baremetal`
else
PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs cxx`
endif
: {obj} | \
$(DEV_DIR)/<lib> \
@ -49,7 +53,7 @@ LDFLAGS += -L$(DEV_LIB_DIR) `$(PKG_CONFIG) --libs cxx-baremetal`
$(REP_DIR)/<base-common> \
$(REP_DIR)/<startup> \
$(REP_DIR)/<syscall> \
|> !ld %<base-common> %<startup> %<syscall> \
|> $(LD) -o %o $(LD_MARCH) $(LDFLAGS) --start-group %f %<base-common> %<startup> %<syscall> $(PKG_LIBS) -end-group $(LIBGCC) \
|> core-linux $(REP_DIR)/<core> {bin}
: {bin} |> !collect_bin |>

View File

@ -129,9 +129,7 @@ namespace Genode {
*/
size_t max_caps() const override { return 10000; }
void wait_for_exit(int const &) override;
void child_exit() override;
void wait_for_exit() override;
};
}

View File

@ -113,7 +113,7 @@ Platform::Platform()
}
void Platform::wait_for_exit(int const &exit_value)
void Platform::wait_for_exit()
{
for (;;) {
@ -145,11 +145,9 @@ void Platform::wait_for_exit(int const &exit_value)
Platform_thread::submit_exception(pid);
}
}
lx_exit_group(exit_value);
lx_exit_group(0);
}
void Platform::child_exit() { sigint_handler(0); }
/*****************************
** Support for IPC library **

View File

@ -1,6 +1,8 @@
include_rules
GENERIC_DIR = $(BASE_DIR)/src/lib/base-common
include $(GENERIC_DIR)/Tupfile.inc
GENERIC_SRC_CC += \
$(GENERIC_DIR)/ansi_c.cc \
$(GENERIC_DIR)/allocator_avl.cc \
$(GENERIC_DIR)/avl_tree.cc \
$(GENERIC_DIR)/capability.cc \
@ -30,8 +32,7 @@ GENERIC_SRC_CC += \
$(GENERIC_DIR)/thread_myself.cc \
$(GENERIC_DIR)/trace.cc \
#CXXFLAGS += -mllvm -opt-bisect-limit=1
: foreach $(GENERIC_SRC_CC) |> !cxx |> {obj}
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !ar |> | $(REP_DIR)/<base-common>
: foreach $(SRC_S) |> !asm |> {obj}
: {obj} |> !ar |> base-linux-common.lib.a | $(REP_DIR)/<base-common>

View File

@ -1,17 +1,6 @@
include_rules
ifeq (@(TUP_ARCH),x86_64)
CPPFLAGS += -I$(BASE_DIR)/src/lib/ldso/spec/x86_64
endif
LDSO_DIR = $(BASE_DIR)/src/lib/ldso
ifeq (@(TUP_ARCH),x86_64)
LDSO_SPEC_DIR = $(LDSO_DIR)/spec/x86_64
endif
CPPFLAGS += -I$(LDSO_SPEC_DIR)
CPPFLAGS = -I$(LDSO_DIR)/include $(CPPFLAGS)
include $(BASE_DIR)/src/lib/ldso/Tuprules.tup
: foreach $(LDSO_DIR)/*.cc |> !cxx |> {obj}
: foreach $(LDSO_SPEC_DIR)/*.s |> !asm |> {obj}
@ -32,22 +21,22 @@ LDFLAGS += -T$(REP_DIR)/src/ld/stack_area.ld
LDFLAGS += -T$(BASE_DIR)/src/ld/genode_rel.ld
LDFLAGS += --entry=_start_initial_stack
BASE_LIBS += \
$(REP_DIR)/src/lib/base/base-linux.lib.a \
BASE_LIBS += $(REP_DIR)/src/lib/base/base-linux.lib.a
BASE_PKGS += alarm cxx ldso-startup startup timeout
PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs alarm cxx ldso-startup timeout`
LDFLAGS += -L$(DEV_LIB_DIR) `$(PKG_CONFIG) --static --libs $(BASE_PKGS)`
OUTPUT = ld-linux.lib.so
ifdef NIX_OUTPUTS_DEV
OUTPUT = ld.lib.so
endif
: $(BASE_LIBS) {obj} | \
symbol.map \
$(DEV_DIR)/<lib> \
$(DEV_DIR)/<pkg-config> \
$(REP_DIR)/<base-common> \
$(REP_DIR)/<startup> \
$(REP_DIR)/<syscall> \
|> \
$(LD) $(LDFLAGS) %<base-common> %<syscall> %f -o %o; \
printf "\x02" | dd of=%o bs=1 seek=16 count=1 conv=notrunc; \
|> ld-linux.lib.so $(REP_DIR)/<ld> {bin}
|> $(LD) -o %o $(LD_MARCH) $(LDFLAGS) --whole-archive --start-group %<base-common> %<startup> %<syscall> %f $(PKG_LIBS) --end-group --no-whole-archive $(LIBGCC); printf "\x02" | dd of=%o bs=1 seek=16 count=1 conv=notrunc; |> $(OUTPUT) $(REP_DIR)/<ld> {bin}
: {bin} |> !collect_bin |>

View File

@ -19,4 +19,4 @@ ifeq ($(SPEC_DIR),)
endif
: foreach $(SPEC_DIR)/*.S |> !asm |> {obj}
: {obj} |> !ar |> | $(REP_DIR)/<syscall>
: {obj} |> !ar |> syscall-linux.lib.a | $(REP_DIR)/<syscall>

View File

@ -6,6 +6,10 @@ ifeq (@(TUP_ARCH),x86_64)
CPPFLAGS += -I$(TUP_CWD)/include/spec/64bit
endif
ifdef IS_GCC
CXXFLAGS += -Wno-attributes
endif
CPPFLAGS += -I$(TUP_CWD)/include
include &(BASE_DIR)/Tuprules.tup

@ -1 +0,0 @@
Subproject commit fbb002d4d6e2b6eddae4d1f0990fe71307e8c7ca

View File

@ -45,15 +45,15 @@ CXXFLAGS_$(GEN_CORE_DIR)/version.cc += -DGENODE_VERSION=\"`git describe`\"
: foreach $(SRC_CC) |> !cxx |> {obj}
LDFLAGS += -L$(DEV_LIB_DIR) `$(PKG_CONFIG) --libs cxx-baremetal`
PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs cxx`
: {obj} | \
$(DEV_DIR)/<lib> \
$(DEV_DIR)/<pkg-config> \
$(BASE_DIR)/<base-libs> \
$(REP_DIR)/<startup> \
$(REP_DIR)/<base-common> \
$(REP_DIR)/<startup> \
|> $(LD) $(LDFLAGS) -u _start -r \
%<base-libs> %<base-common> %<startup> %f -o %o \
--whole-archive --start-group %f %<base-libs> %<base-common> %<startup> $(PKG_LIBS) --no-whole-archive --end-group -o %o \
|> core.o $(REP_DIR)/<core> {core}
: {core} |> cp %f %o |> $(OUT_DIR)/lib/core-nova.o

View File

@ -82,7 +82,7 @@ namespace Genode {
size_t vm_size() const override { return _vm_size; }
Rom_fs &rom_fs() override { return _rom_fs; }
size_t max_caps() const override { return _max_caps; }
void wait_for_exit(int const &) override;
void wait_for_exit() override;
bool supports_direct_unmap() const override { return true; }

View File

@ -990,5 +990,5 @@ bool Mapped_mem_allocator::_unmap_local(addr_t virt_addr, addr_t, unsigned size)
** Generic platform interface **
********************************/
void Platform::wait_for_exit(int const &) { sleep_forever(); }
void Platform::wait_for_exit() { sleep_forever(); }

View File

@ -1,8 +1,10 @@
include_rules
GENERIC_DIR = $(BASE_DIR)/src/lib/base-common
include $(GENERIC_DIR)/Tupfile.inc
GENERIC_SRC_CC += \
$(GENERIC_DIR)/ansi_c.cc \
$(GENERIC_DIR)/allocator_avl.cc \
$(GENERIC_DIR)/avl_tree.cc \
$(GENERIC_DIR)/child.cc \
@ -33,5 +35,7 @@ GENERIC_SRC_CC += \
$(GENERIC_DIR)/trace.cc \
$(GENERIC_DIR)/vm_session.cc \
: foreach $(GENERIC_SRC_CC) |> !cxx |> %B.base.o $(REP_DIR)/<base-common> {obj}
: foreach *.cc |> !cxx |> %B.nova.o $(REP_DIR)/<base-common> {obj}
: foreach $(GENERIC_SRC_CC) |> !cxx |> %B.o {obj}
: foreach $(SRC_S) |> !asm |> {obj}
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !ar |> base-nova-common.lib.a | $(REP_DIR)/<base-common>

View File

@ -16,4 +16,4 @@ SRC_CC += \
: foreach $(SRC_CC) |> !cxx |> {base-obj}
: {base-obj} |> !ar |> base-nova.lib.a
: {base-obj} |> !ar |> base-nova.lib.a | $(REP_DIR)/<base-nova>

View File

@ -1,13 +1,6 @@
include_rules
LDSO_DIR = $(BASE_DIR)/src/lib/ldso
ifeq (@(TUP_ARCH),x86_64)
LDSO_SPEC_DIR = $(LDSO_DIR)/spec/x86_64
endif
CPPFLAGS += -I$(LDSO_SPEC_DIR)
CPPFLAGS += -I$(LDSO_DIR)/include
include $(BASE_DIR)/src/lib/ldso/Tuprules.tup
: foreach $(LDSO_DIR)/*.cc |> !cxx |> {obj}
: foreach $(LDSO_SPEC_DIR)/*.s |> !asm |> {obj}
@ -23,7 +16,7 @@ LDFLAGS += -shared --eh-frame-hdr
LDFLAGS += -Bsymbolic-functions --version-script=symbol.map
ifeq (@(TUP_ARCH),x86_32)
ifeq (@(TUP_ARCH),i386)
LDFLAGS += -T$(LDSO_DIR)/linux-32.ld
else
LDFLAGS += -T$(LDSO_DIR)/linker.ld
@ -33,25 +26,21 @@ endif
LDFLAGS += -z max-page-size=0x1000
LDFLAGS += -T$(BASE_DIR)/src/ld/genode_rel.ld
BASE_LIBS += $(REP_DIR)/src/lib/base/base-nova.lib.a
PKG_LIBS = -L$(DEV_DIR)/lib `$(PKG_CONFIG) --libs alarm cxx ldso-startup timeout`
LDFLAGS += -L$(DEV_LIB_DIR) `$(PKG_CONFIG) --static --libs $(BASE_PKGS)`
OUTPUT = ld-nova.lib.so
ifdef NIX_OUTPUTS_DEV
OUTPUT = ld.lib.so
endif
: {obj} | \
$(DEV_DIR)/<lib> \
$(DEV_DIR)/<pkg-config> \
$(REP_DIR)/<base-common> \
$(REP_DIR)/<base-nova> \
$(REP_DIR)/<startup> \
symbol.map \
|> \
$(LD) -o %o \
$(LD_MARCH) $(LDFLAGS) \
--whole-archive --start-group \
%<base-common> \
%<startup> \
%f \
--end-group --no-whole-archive \
$(LIBGCC) \
|> ld-nova.lib.so $(REP_DIR)/<ld> {bin}
|> $(LD) -o %o $(LD_MARCH) $(LDFLAGS) --whole-archive --start-group $(PKG_LIBS) %<base-common> %<base-nova> %<startup> %f --end-group --no-whole-archive $(LIBGCC) \
|> $(OUTPUT) $(REP_DIR)/<ld> {lib}
: {bin} |> !collect_bin |>
: foreach {lib} |> !collect_shared |>

View File

@ -139,7 +139,7 @@ namespace Genode {
Rom_fs &rom_fs() override { return _rom_fs; }
size_t max_caps() const override { return Capability_space::max_caps(); }
void wait_for_exit(int const &) override;
void wait_for_exit() override;
bool supports_direct_unmap() const override { return true; }

View File

@ -215,7 +215,7 @@ Platform::Platform()
** Generic platform interface **
********************************/
void Platform::wait_for_exit(int const &)
void Platform::wait_for_exit()
{
/*
* On OKL4, core never exits. So let us sleep forever.

View File

@ -153,7 +153,7 @@ namespace Genode {
Rom_fs &rom_fs() override { return _rom_fs; }
size_t max_caps() const override { return Capability_space::max_caps(); }
void wait_for_exit(int const &) override;
void wait_for_exit() override;
Affinity::Space affinity_space() const override
{

View File

@ -640,7 +640,7 @@ Platform::Platform()
** Generic platform interface **
********************************/
void Platform::wait_for_exit(int const &)
void Platform::wait_for_exit()
{
/*
* On Pistachio, core never exits. So let us sleep forever.

View File

@ -274,7 +274,7 @@ class Genode::Platform : public Platform_generic
Cap_sel asid_pool() const { return _asid_pool_sel; }
void wait_for_exit(int const &) override;
void wait_for_exit() override;
/**
* Determine size of a core local mapping required for a

View File

@ -661,7 +661,7 @@ void Platform::reset_sel(unsigned sel)
}
void Platform::wait_for_exit(int const &)
void Platform::wait_for_exit()
{
sleep_forever();
}

View File

@ -3,12 +3,23 @@ include_rules
ifdef NIX_OUTPUTS_DEV
SED_FLAGS += -e "s|@includedir@|@(NIX_OUTPUTS_DEV)/include|"
SED_FLAGS += -e "s|@lddir@|@(NIX_OUTPUTS_DEV)/ld|"
else
SED_FLAGS += -e "s|@includedir@|`nix-store --add $(REP_DIR)/include`|"
SED_FLAGS += -e "s|@lddir@|`nix-store --add $(REP_DIR)/src/ld`|"
ifeq (@(TUP_ARCH),i386)
SED_FLAGS += -e "s|@includes@|-I\${includedir}/spec/x86_32 -I\${includedir}/spec/x86 -I\${includedir}/spec/32bit -I\${includedir}|"
endif
ifeq (@(TUP_ARCH),x86_64)
SED_FLAGS += -e "s|@includes@|-I\${includedir}/spec/x86_64 -I\${includedir}/spec/x86 -I\${includedir}/spec/64bit -I\${includedir}|"
endif
else
SED_FLAGS += -e "s|@includes@||"
SED_FLAGS += -e "s|@includedir@|`nix-store --add $(REP_DIR)/include`|"
SED_FLAGS += -e "s|@lddir@|`nix-store --add $(REP_DIR)/src/ld`|"
endif
SED_FLAGS += -e "s|@toolchainincludedir@|`$(CC) $(CC_MARCH) -print-file-name=include`|"
SED_FLAGS += -e "s|@libgcc@||"
SED_FLAGS += -e "s|@cc@|$(CC)|"

View File

@ -1,30 +1,10 @@
REP_DIR = $(TUP_CWD)
ifeq (@(TUP_ARCH),i386)
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86_32
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86
CPPFLAGS += -I$(BASE_DIR)/include/spec/32bit
endif
ifeq (@(TUP_ARCH),x86_64)
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86_64
CPPFLAGS += -I$(BASE_DIR)/include/spec/x86
CPPFLAGS += -I$(BASE_DIR)/include/spec/64bit
endif
ifeq (@(TUP_ARCH),arm64)
CPPFLAGS += -I$(BASE_DIR)/include/spec/arm_64
CPPFLAGS += -I$(BASE_DIR)/include/spec/64bit
endif
CPPFLAGS += -I$(BASE_DIR)/include
# Override base macros to bypass pkg-config
CXXFLAGS += \
-ffunction-sections \
-fno-strict-aliasing \
-nostdinc \
-Wall \
-std=gnu++17 \
@ -44,5 +24,4 @@ GCC_INCLUDE = -I`$(CC) -print-file-name=include`
-c %f -o %o \
|> %B.o
!ld = |> ^ MERGE %o^ $(LD) \
$(LDFLAGS) --whole-archive --start-group %f --end-group --no-whole-archive -o %o |>
!ld = |> ^ MERGE %o^ $(LD) -o %o $(LDFLAGS) %f |>

View File

@ -9,4 +9,4 @@ Name: base
Description: Genode base repository
URL: https://genode.org/
Version: @VERSION@
Cflags: -I${includedir} -I@toolchainincludedir@
Cflags: @includes@

View File

@ -23,7 +23,7 @@
#include <base/capability.h>
/* only needed for base-hw */
namespace Kernel { struct Signal_receiver; }
namespace Kernel { class Signal_receiver; }
namespace Genode {
@ -97,7 +97,7 @@ class Genode::Signal
*/
Signal(Data data);
friend struct Kernel::Signal_receiver;
friend class Kernel::Signal_receiver;
friend class Signal_receiver;
friend class Signal_context;

View File

@ -649,9 +649,14 @@ dl_unwind_find_exidx T
genode_argc D 4
genode_argv D 8
genode_envp B 8
longjmp W
lx_environ B 8
memcmp W
memcpy W
memmove W
memset W
setjmp W
stdout_reconnect T
strcmp W
strlen W
wait_for_continue T

View File

@ -30,12 +30,7 @@ namespace Genode {
*/
Log_session_component *_create_session(const char *args) override
{
char label_buf[Log_session_component::LABEL_LEN];
Arg label_arg = Arg_string::find_arg(args, "label");
label_arg.string(label_buf, sizeof(label_buf), "");
return new (md_alloc()) Log_session_component(label_buf);
return new (md_alloc()) Log_session_component(label_from_args(args));
}
public:

View File

@ -17,27 +17,32 @@
#include <util/string.h>
#include <base/log.h>
#include <base/rpc_server.h>
#include <base/session_label.h>
#include <log_session/log_session.h>
namespace Genode {
class Log_session_component : public Rpc_object<Log_session>
{
public:
enum { LABEL_LEN = 128 };
private:
char _label[LABEL_LEN];
Session_label const _label;
static Session_label _expand_label(Session_label const &label)
{
if (label == "init -> unlabeled")
return "";
else
return Session_label("[", label, "] ");
}
public:
/**
* Constructor
*/
Log_session_component(const char *label) {
strncpy(_label, label, sizeof(_label)); }
Log_session_component(Session_label const &label)
: _label(_expand_label(label)) { }
/*****************
@ -54,21 +59,18 @@ namespace Genode {
char const *string = string_buf.string();
size_t len = strlen(string);
char buf[string_buf.MAX_SIZE];
unsigned from_i = 0;
for (unsigned i = 0; i < len; i++) {
if (string[i] == '\n') {
memcpy(buf, string + from_i, i - from_i);
buf[i - from_i] = 0;
log("[", Cstring(_label), "] ", Cstring(buf));
log(_label, Cstring(string + from_i, i - from_i));
from_i = i + 1;
}
}
/* if last character of string was not a line break, add one */
if (from_i < len)
log("[", Cstring(_label), "] ", Cstring(string + from_i));
log(_label, Cstring(string + from_i));
return len;
}

View File

@ -29,14 +29,16 @@ namespace Genode {
}
struct Genode::Native_cpu_component
class Genode::Native_cpu_component
{
Native_cpu_component(Cpu_session_component &, char const *) { }
public:
Capability<Cpu_session::Native_cpu> cap()
{
return Capability<Cpu_session::Native_cpu>();
}
Native_cpu_component(Cpu_session_component &, char const *) { }
Capability<Cpu_session::Native_cpu> cap()
{
return Capability<Cpu_session::Native_cpu>();
}
};
#endif /* _CORE__INCLUDE__NATIVE_CPU_COMPONENT_H_ */

View File

@ -77,12 +77,7 @@ namespace Genode {
/**
* Wait for exit condition
*/
virtual void wait_for_exit(int const &exit_value) = 0;
/**
* Handle exit of child
*/
virtual void child_exit() { };
virtual void wait_for_exit() = 0;
/**
* Return true if platform supports direct unmap (no mapping db)

View File

@ -119,8 +119,6 @@ class Core_child : public Child_policy
Child _child;
int &_exit_value;
public:
/**
@ -130,16 +128,14 @@ class Core_child : public Child_policy
Pd_session &core_pd, Capability<Pd_session> core_pd_cap,
Cpu_session &core_cpu, Capability<Cpu_session> core_cpu_cap,
Cap_quota cap_quota, Ram_quota ram_quota,
Rpc_entrypoint &ep,
int &exit_value)
Rpc_entrypoint &ep)
:
_services(services),
_core_pd_cap (core_pd_cap), _core_pd (core_pd),
_core_cpu_cap(core_cpu_cap), _core_cpu(core_cpu),
_cap_quota(Child::effective_quota(cap_quota)),
_ram_quota(Child::effective_quota(ram_quota)),
_child(local_rm, ep, *this),
_exit_value(exit_value)
_child(local_rm, ep, *this)
{ }
@ -178,13 +174,6 @@ class Core_child : public Child_policy
_core_cpu.transfer_quota(cap, Cpu_session::quota_lim_upscale(100, 100));
}
void exit(int exit_value) override
{
_exit_value = exit_value;
Child_policy::exit(exit_value);
platform().child_exit();
}
Pd_session &ref_pd() override { return _core_pd; }
Pd_session_capability ref_pd_cap() const override { return _core_pd_cap; }
@ -232,8 +221,6 @@ namespace Genode {
int main()
{
static int exit_value { 0 };
/**
* Disable tracing within core because it is currently not fully implemented.
*/
@ -322,10 +309,10 @@ int main()
static Reconstructible<Core_child>
init(services, local_rm, core_pd, core_pd_cap, core_cpu, core_cpu_cap,
init_cap_quota, init_ram_quota, ep, exit_value);
init_cap_quota, init_ram_quota, ep);
platform().wait_for_exit(exit_value);
platform().wait_for_exit();
init.destruct();
return exit_value;
return 0;
}

View File

@ -1,5 +1,5 @@
include_rules
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !ar |> {bin}
: {obj} |> !ar |> | $(BASE_DIR)/<alarm> {bin}
: foreach {bin} |> !collect_static |>
: |> !emit_lib_pkg_config |>

View File

@ -0,0 +1,15 @@
ifeq (@(TUP_ARCH),arm)
SRC_S += $(BASE_DIR)/src/lib/base-common/arm/*.S
endif
ifeq (@(TUP_ARCH),arm64)
SRC_S += $(BASE_DIR)/src/lib/base-common/arm_64/*.S
endif
ifeq (@(TUP_ARCH),i386)
SRC_S += $(BASE_DIR)/src/lib/base-common/x86_32/*.S
endif
ifeq (@(TUP_ARCH),x86_64)
SRC_S += $(BASE_DIR)/src/lib/base-common/x86_64/*.S
endif

View File

@ -0,0 +1,28 @@
/*
* \brief Implementation of basic C utilities
* \author Emery Hemingway
* \date 2020-01-14
*/
/*
* Copyright (C) 2020 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU Affero General Public License version 3.
*/
#include <util/string.h>
using namespace Genode;
extern "C" __attribute__((weak))
int memcmp(const void *p0, const void *p1, size_t size)
{
return Genode::memcmp(p0, p1, size);
}
extern "C" __attribute__((weak))
size_t strlen(const char *s)
{
return Genode::strlen(s);
}

View File

@ -0,0 +1,120 @@
/* $NetBSD: setjmp.S,v 1.5 2003/04/05 23:08:51 bjh21 Exp $ */
/*
* Copyright (c) 1997 Mark Brinicombe
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Mark Brinicombe
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* needed parts from <machine/asm.h> */
#define __FBSDID(x)
#define ENTRY(x) .text; .align 0; .globl x; .type x,#function; x:;
#define WEAK_ALIAS(x,y)
#define RET mov pc, lr
#define _JB_MAGIC__SETJMP 0x4278f500
#define __SOFTFP__ 1
#define _STANDALONE
/* end of <machine/asm.h> */
__FBSDID("$FreeBSD: release/8.2.0/lib/libc/arm/gen/setjmp.S 193145 2009-05-31 02:03:40Z marcel $");
/*
* C library -- setjmp, longjmp
*
* longjmp(a,v)
* will generate a "return(v)" from the last call to
* setjmp(a)
* by restoring registers from the stack.
* The previous signal state is NOT restored.
*
* Note: r0 is the return value
* r1-r3 are scratch registers in functions
*/
ENTRY(setjmp)
ldr r1, .Lsetjmp_magic
str r1, [r0], #4
#ifdef __SOFTFP__
add r0, r0, #52
#else
/* Store fp registers */
sfm f4, 4, [r0], #48
/* Store fpsr */
rfs r1
str r1, [r0], #0x0004
#endif /* __SOFTFP__ */
/* Store integer registers */
stmia r0, {r4-r14}
mov r0, #0x00000000
RET
.Lsetjmp_magic:
.word _JB_MAGIC__SETJMP
WEAK_ALIAS(__longjmp, longjmp)
ENTRY(longjmp)
ldr r2, .Lsetjmp_magic
ldr r3, [r0], #4
teq r2, r3
bne botch
#ifdef __SOFTFP__
add r0, r0, #52
#else
/* Restore fp registers */
lfm f4, 4, [r0], #48
/* Restore fpsr */
ldr r4, [r0], #0x0004
wfs r4
#endif /* __SOFTFP__ */
/* Restore integer registers */
ldmia r0, {r4-r14}
/* Validate sp and r14 */
teq sp, #0
teqne r14, #0
beq botch
/* Set return value */
mov r0, r1
teq r0, #0x00000000
moveq r0, #0x00000001
RET
/* validation failed, die die die. */
botch:
#if !defined(_STANDALONE)
bl PIC_SYM(_C_LABEL(longjmperror), PLT)
bl PIC_SYM(_C_LABEL(abort), PLT)
b . - 8 /* Cannot get here */
#else
b .
#endif

View File

@ -0,0 +1,108 @@
/*-
* Copyright (c) 2014 Andrew Turner
* Copyright (c) 2014 The FreeBSD Foundation
* All rights reserved.
*
* Portions of this software were developed by Andrew Turner
* under sponsorship from the FreeBSD Foundation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
*/
/* needed parts from <machine/asm.h> */
#define __FBSDID(x)
#define ENTRY(sym) .text; .globl sym; .align 2; .type sym,#function; sym:
#define END(sym) .size sym, . - sym
/* end of <machine/asm.h> */
__FBSDID("$FreeBSD: releng/12.0/lib/libc/aarch64/gen/setjmp.S 313146 2017-02-03 11:51:06Z andrew $");
/* needed parts from <machine/setjmp.h> */
#define _JB_SIGMASK 22
#define _JB_MAGIC__SETJMP 0xfb5d25837d7ff700
/* end of <machine/asm.h> */
ENTRY(setjmp)
/* Store the magic value and stack pointer */
ldr x8, .Lmagic
mov x9, sp
stp x8, x9, [x0], #16
/* Store the general purpose registers and lr */
stp x19, x20, [x0], #16
stp x21, x22, [x0], #16
stp x23, x24, [x0], #16
stp x25, x26, [x0], #16
stp x27, x28, [x0], #16
stp x29, lr, [x0], #16
#ifndef _STANDALONE
/* Store the vfp registers */
stp d8, d9, [x0], #16
stp d10, d11, [x0], #16
stp d12, d13, [x0], #16
stp d14, d15, [x0]
#endif
/* Return value */
mov x0, #0
ret
.align 3
.Lmagic:
.quad _JB_MAGIC__SETJMP
END(setjmp)
ENTRY(longjmp)
/* Check the magic value */
ldr x8, [x0], #8
ldr x9, .Lmagic
cmp x8, x9
b.ne botch
/* Restore the stack pointer */
ldr x8, [x0], #8
mov sp, x8
/* Restore the general purpose registers and lr */
ldp x19, x20, [x0], #16
ldp x21, x22, [x0], #16
ldp x23, x24, [x0], #16
ldp x25, x26, [x0], #16
ldp x27, x28, [x0], #16
ldp x29, lr, [x0], #16
#ifndef _STANDALONE
/* Restore the vfp registers */
ldp d8, d9, [x0], #16
ldp d10, d11, [x0], #16
ldp d12, d13, [x0], #16
ldp d14, d15, [x0]
#endif
/* Load the return value */
mov x0, x1
ret
botch:
b botch
END(longjmp)

View File

@ -0,0 +1,79 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
.asciz "@(#)setjmp.s 5.1 (Berkeley) 4/23/90"
#endif /* LIBC_SCCS and not lint */
//#include <machine/asm.h>
/*
* C library -- setjmp, longjmp
*
* longjmp(a,v)
* will generate a "return(v)" from the last call to
* setjmp(a)
* by restoring registers from the environment 'a'.
* The previous signal state is NOT restored.
*/
.text; .p2align 2,0x90
.globl setjmp; .type setjmp,@function; setjmp:
movl 4(%esp),%eax
movl 0(%esp),%edx
movl %edx, 0(%eax) /* rta */
movl %ebx, 4(%eax)
movl %esp, 8(%eax)
movl %ebp,12(%eax)
movl %esi,16(%eax)
movl %edi,20(%eax)
fnstcw 24(%eax)
xorl %eax,%eax
ret
.size setjmp, . - setjmp
.text; .p2align 2,0x90
.globl longjmp; .type longjmp,@function; longjmp:
movl 4(%esp),%edx
movl 8(%esp),%eax
movl 0(%edx),%ecx
movl 4(%edx),%ebx
movl 8(%edx),%esp
movl 12(%edx),%ebp
movl 16(%edx),%esi
movl 20(%edx),%edi
fldcw 24(%edx)
testl %eax,%eax
jnz 1f
incl %eax
1: movl %ecx,0(%esp)
ret
.size longjmp, . - longjmp

View File

@ -0,0 +1,93 @@
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined(LIBC_SCCS) && !defined(lint)
.asciz "@(#)setjmp.s 5.1 (Berkeley) 4/23/90"
#endif /* LIBC_SCCS and not lint */
//#include <machine/asm.h>
/*
* C library -- setjmp, longjmp
*
* longjmp(a,v)
* will generate a "return(v)" from the last call to
* setjmp(a)
* by restoring registers from the environment 'a'.
* The previous signal state is NOT restored.
*/
.text; .p2align 4,0x90
.globl setjmp; .type setjmp,@function; setjmp:
movq %rdi,%rax
movq 0(%rsp),%rdx /* retval */
movq %rdx, 0(%rax) /* 0; retval */
movq %rbx, 8(%rax) /* 1; rbx */
movq %rsp,16(%rax) /* 2; rsp */
movq %rbp,24(%rax) /* 3; rbp */
movq %r12,32(%rax) /* 4; r12 */
movq %r13,40(%rax) /* 5; r13 */
movq %r14,48(%rax) /* 6; r14 */
movq %r15,56(%rax) /* 7; r15 */
fnstcw 64(%rax) /* 8; fpu cw */
stmxcsr 68(%rax) /* and mxcsr */
xorq %rax,%rax
ret
.size setjmp, . - setjmp
.text; .p2align 4,0x90
.globl longjmp; .type longjmp,@function; longjmp:
movq %rdi,%rdx
/* Restore the mxcsr, but leave exception flags intact. */
stmxcsr -4(%rsp)
movl 68(%rdx),%eax
andl $0xffffffc0,%eax
movl -4(%rsp),%edi
andl $0x3f,%edi
xorl %eax,%edi
movl %edi,-4(%rsp)
ldmxcsr -4(%rsp)
movq %rsi,%rax /* retval */
movq 0(%rdx),%rcx
movq 8(%rdx),%rbx
movq 16(%rdx),%rsp
movq 24(%rdx),%rbp
movq 32(%rdx),%r12
movq 40(%rdx),%r13
movq 48(%rdx),%r14
movq 56(%rdx),%r15
fldcw 64(%rdx)
testq %rax,%rax
jnz 1f
incq %rax
1: movq %rcx,0(%rsp)
ret
.size longjmp, . - longjmp

View File

@ -1,19 +1,3 @@
ifndef LIBCXX
error LIBCXX not configured
endif
ifndef LIBCXXABI
error LIBCXXABI not configured
endif
ifndef LIBUNWIND_BAREMETAL
error LIBUNWIND_BAREMETAL not configured
endif
ifndef LIBUNWIND
error LIBUNWIND not configured
endif
include_rules
COMMON_FLAGS = -ffunction-sections -fno-strict-aliasing
@ -21,13 +5,6 @@ COMMON_FLAGS = -ffunction-sections -fno-strict-aliasing
CFLAGS += $(COMMON_FLAGS)
CXXFLAGS += $(COMMON_FLAGS)
CPPFLAGS += -I@(LIBCXX)/include/c++/v1
CPPFLAGS += -I@(LIBCXXABI)/include
LLVM_LIBS += @(LIBCXXABI)/lib/libc++abi.a
: foreach *.cc |> !cxx |> {obj}
#
# Prevent symbols of the gcc support libs from being discarded during 'ld -r'
#
@ -75,33 +52,76 @@ LOCAL_SYMBOLS = \
#
# Symbols we wrap (see unwind.c)
#
EH_SYMBOLS = \
_Unwind_Complete \
_Unwind_DeleteException \
EH_SYMBOLS += _Unwind_Complete
EH_SYMBOLS += _Unwind_DeleteException
EH_SYMBOLS += _Unwind_Resume
#
# Additional functions for ARM
#
EH_SYMBOLS += \
__aeabi_unwind_cpp_pr0 \
__aeabi_unwind_cpp_pr1 \
EH_SYMBOLS += __aeabi_unwind_cpp_pr0
EH_SYMBOLS += __aeabi_unwind_cpp_pr1
ifdef IS_LLVM
ifndef LIBCXX
error LIBCXX not configured
endif
ifndef LIBCXXABI
error LIBCXXABI not configured
endif
ifndef LIBUNWIND_BAREMETAL
error LIBUNWIND_BAREMETAL not configured
endif
ifndef LIBUNWIND
error LIBUNWIND not configured
endif
CPPFLAGS += -I@(LIBCXX)/include/c++/v1
CPPFLAGS += -I@(LIBCXXABI)/include
LLVM_LIBS += @(LIBCXXABI)/lib/libc++abi.a
endif
: foreach *.cc |> !cxx |> {obj}
REDEF_SYMBOLS = `echo $(EH_SYMBOLS) | awk -v RS=' ' '{ print "--redefine-sym "$1"=_cxx_"$1 }'`
: foreach *.c |> !cc |>
ifdef IS_LLVM
: {obj} |> \
$(LD) $(LD_MARCH) $(KEEP_SYMBOLS) -r %f $(LLVM_LIBS) @(LIBUNWIND)/lib/libunwind.a -o %o |> supc++.tmp
: {obj} |> \
$(LD) $(LD_MARCH) $(KEEP_SYMBOLS) -r %f $(LLVM_LIBS) @(LIBUNWIND_BAREMETAL)/lib/libunwind.a -o %o |> supc++-baremetal.tmp
: foreach *.c |> !cc |> {obj}
: supc++.tmp |> @(OBJCOPY) $(LOCAL_SYMBOLS) $(REDEF_SYMBOLS) %f %o |> supc++.o
: supc++-baremetal.tmp |> @(OBJCOPY) $(LOCAL_SYMBOLS) $(REDEF_SYMBOLS) %f %o |> supc++-baremetal.o
export OBJCOPY
: supc++.tmp |> $OBJCOPY $(LOCAL_SYMBOLS) $(REDEF_SYMBOLS) %f %o |> supc++.o
: supc++-baremetal.tmp |> $OBJCOPY $(LOCAL_SYMBOLS) $(REDEF_SYMBOLS) %f %o |> supc++-baremetal.o
#
: supc++.o |> !ar |> cxx.a {bin}
: supc++-baremetal.o |> !ar |> cxx-baremetal.a {bin}
: supc++.o unwind.o |> !ar |> cxx.a {bin}
: supc++-baremetal.o unwind.o |> !ar |> cxx-baremetal.a {bin}
: foreach {bin} |> !collect_static |>
: |> !emit_lib_pkg_config |>
endif
ifdef IS_GCC
LIBCXX_GCC += `$(CXX) $(CC_MARCH) -print-file-name=libsupc++.a`
LIBCXX_GCC += `$(CXX) $(CC_MARCH) -print-file-name=libgcc_eh.a`
: {obj} |> $(LD) $(LD_MARCH) $(KEEP_SYMBOLS) -r %f $(LIBCXX_GCC) -o %o |> supc++.tmp
: supc++.tmp |> @(OBJCOPY) $(LOCAL_SYMBOLS) $(REDEF_SYMBOLS) %f %o |> supc++.o
: supc++.o unwind.o |> !ar |> | $(BASE_DIR)/<cxx> {bin}
: foreach {bin} |> !collect_static |>
: |> !emit_lib_pkg_config |>
endif

View File

@ -1,3 +1,21 @@
include_rules
: $(REP_DIR)/lib/symbols/ld |> !abi_stub |>
SED_EXPR += -e "s/^\(\w\+\) D \(\w\+\)\$/.data; .global \1; .type \1,%object; .size \1,\2; \1: .skip 1/"
SED_EXPR += -e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%object; \1: .skip 1/"
SED_EXPR += -e "s/^\(\w\+\) T/.text; .global \1; .type \1,%function; \1:/"
SED_EXPR += -e "s/^\(\w\+\) R \(\w\+\)\$/.section .rodata; .global \1; .type \1,%object; .size \1,\2; \1:/"
SED_EXPR += -e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%function; \1:/"
SED_EXPR += -e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%object; .size \1,\2; \1:/"
SED_EXPR += -e "s/^\(\w\+\) U/.text; .global \1; movq \1@GOTPCREL(%rip), %rax/"
: |> sed $(SED_EXPR) < $(REP_DIR)/lib/symbols/%d > %o |> %d.symbols.s {asm}
: foreach {asm} |> !cc |> %d.symbols.o {obj}
LDFLAGS += -shared --eh-frame-hdr
LDFLAGS += -z max-page-size=0x1000
LDFLAGS += -T$(BASE_DIR)/src/lib/ldso/linker.ld
LDFLAGS += -T$(BASE_DIR)/src/ld/genode_rel.ld
: {obj} |> !ld |> $(DEV_LIB_DIR)/%d.lib.so $(DEV_DIR)/<lib>
: foreach *.pc.in |> !sed_pkgconfig_file |>

View File

@ -2,6 +2,6 @@ LIBS += base
include_rules
: foreach startup.cc |> !cxx |> %B.o {obj}
: {obj} | |> !ar |> {bin}
: {obj} |> !ar |> | $(BASE_DIR)/<ldso-startup> {bin}
: foreach {bin} |> !collect_static |>
: |> !emit_lib_pkg_config |>

View File

@ -0,0 +1,26 @@
LDSO_DIR = $(BASE_DIR)/src/lib/ldso
ifeq (@(TUP_ARCH),i386)
LDSO_SPEC_DIR = $(LDSO_DIR)/spec/x86_64
CPPFLAGS = -I$(LDSO_SPEC_DIR) -I$(LDSO_DIR)/include $(CPPFLAGS)
endif
ifeq (@(TUP_ARCH),x86_64)
LDSO_SPEC_DIR = $(LDSO_DIR)/spec/x86_64
CPPFLAGS = -I$(LDSO_SPEC_DIR) -I$(LDSO_DIR)/include $(CPPFLAGS)
endif
ifeq (@(TUP_ARCH),arm)
LDSO_SPEC_DIR = $(LDSO_DIR)/spec/arm
CPPFLAGS = -I$(LDSO_SPEC_DIR) -I$(LDSO_DIR)/include $(CPPFLAGS)
endif
ifeq (@(TUP_ARCH),arm64)
LDSO_SPEC_DIR = $(LDSO_DIR)/spec/arm_64
CPPFLAGS = -I$(LDSO_SPEC_DIR) -I$(LDSO_DIR)/include $(CPPFLAGS)
endif
ifeq (@(TUP_ARCH),riscv)
LDSO_SPEC_DIR = $(LDSO_DIR)/spec/riscv
CPPFLAGS = -I$(LDSO_SPEC_DIR) -I$(LDSO_DIR)/include $(CPPFLAGS)
endif

View File

@ -19,6 +19,7 @@
#include <util/string.h>
#include <base/thread.h>
#include <base/heap.h>
#include <base/sleep.h>
/* base-internal includes */
#include <base/internal/unmanaged_singleton.h>
@ -775,3 +776,11 @@ void Component::construct(Genode::Env &env)
/* start binary */
binary_ptr->call_entry_point(env);
}
extern "C" int main(int, char **, char **)
{
Genode::error("LD: dummy \"main\" procedure invoked!");
Genode::sleep_forever();
return ~0;
}

View File

@ -14,6 +14,6 @@ else
endif
: foreach $(SRC_CC) |> !cxx |> {obj}
: {obj} |> !ar |> {bin}
: {obj} |> !ar |> | $(BASE_DIR)/<timeout> {bin}
: foreach {bin} |> !collect_static |>
: |> !emit_lib_pkg_config |>

View File

@ -83,7 +83,7 @@ struct Main
void call_const_method(Compound const &compound) {
compound.member->reference.const_method(); }
Main(Env &)
Main(Env &env)
{
log("--- Reconstructible utility test ---");
{
@ -132,6 +132,7 @@ struct Main
log("got exception, as expected"); }
log("--- Reconstructible utility test finished ---");
env.parent().exit(0);
}
};

View File

@ -41,12 +41,13 @@ struct Main
Adder adder { };
Synced_interface<Adder, Pseudo_lock> synced_adder { lock, &adder };
Main(Env &)
Main(Env &env)
{
log("--- Synced interface test ---");
int const res = synced_adder()->add(13, 14);
log("result is ", res);
log("--- Synced interface test finished ---");
env.parent().exit(0);
}
};

View File

@ -1 +1,9 @@
REP_DIR = $(TUP_CWD)
CPPFLAGS += -I$(REP_DIR)/include
LIBS += genode-os
ifndef NIX_OUTPUTS_DEV
include ../os/Tuprules.tup
endif

View File

@ -12,7 +12,7 @@
*/
#ifndef _INCLUDE__NANO3D__SQRT_H_
#define _INCLUDE__NANO3D__SQRT_H__
#define _INCLUDE__NANO3D__SQRT_H_
namespace Nano3d {
@ -38,4 +38,4 @@ namespace Nano3d {
}
}
#endif /* _INCLUDE__NANO3D__SQRT_H__ */
#endif /* _INCLUDE__NANO3D__SQRT_H_ */

View File

@ -0,0 +1,4 @@
include_rules
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>

View File

@ -0,0 +1,8 @@
include_rules
CPPFLAGS += -I. -I$(REP_DIR)/../demo/include
SRC_BIN += $(REP_DIR)/../demo/src/app/scout/data/droidsansb10.tff
SRC_BIN += closer.rgba maximize.rgba minimize.rgba windowed.rgba
: foreach *.cc |> !cxx |> {obj}
: foreach $(SRC_BIN) |> !incbin |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>

View File

@ -0,0 +1,5 @@
include_rules
CPPFLAGS += -I.
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>

View File

@ -0,0 +1,4 @@
include_rules
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>

View File

@ -0,0 +1,4 @@
include_rules
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>

View File

@ -0,0 +1,5 @@
include_rules
LIBS += vfs
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>

View File

@ -0,0 +1,8 @@
include_rules
ifneq ($(X86),)
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>
endif

View File

@ -0,0 +1,5 @@
include_rules
LIBS += vfs
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>

View File

@ -0,0 +1,5 @@
include_rules
LIBS += vfs
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>

View File

@ -0,0 +1,5 @@
include_rules
CPPFLAGS += -I.
: foreach *.cc |> !cxx |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>

View File

@ -0,0 +1,5 @@
include_rules
CPPFLAGS += -I. -I../depot_deploy
: foreach *.cc view/*.cc |> !cxx |> {obj}
: {obj} |> !prg |> {bin}
: {bin} |> !collect_bin |>

Some files were not shown because too many files have changed in this diff Show More