Compare commits

...

26 Commits

Author SHA1 Message Date
Ehmry - c32dde2dc6 !WiP new audio sessions 2019-07-04 18:43:14 +02:00
Ehmry - d7e545ac13 Reasonable installPhase for preparePort 2019-07-04 15:19:10 +02:00
Ehmry - df3e9c32e5 19.07 compatibility 2019-07-04 14:45:54 +02:00
Ehmry - 487207e150 Remove dead SDK references 2019-07-04 10:18:42 +02:00
Ehmry - af0be3f093 Update Nim submodules 2019-07-04 10:04:16 +02:00
Ehmry - b754139ffc Move stub library generation to top-level Tuprules 2019-07-03 22:30:53 +02:00
Ehmry - cd81f893f2 Update Libretro submodules 2019-07-03 22:30:53 +02:00
Ehmry - b37b36731f Add Nix port tooling 2019-07-03 22:30:53 +02:00
Ehmry - 990692a9c1 Tidy ARMv8 config 2019-07-03 22:30:31 +02:00
Ehmry - 3444468641 Add Yabause submodule 2019-07-03 22:30:31 +02:00
Ehmry - b38e499ebf Build variants 2019-07-03 22:30:31 +02:00
Ehmry - 5306a4f385 Update Libretro submodules 2019-07-03 22:30:31 +02:00
Ehmry - 1ca3fd65c2 Tup refactor 2019-07-03 22:30:31 +02:00
Ehmry - 9a8eb788d7 README.md
http://textfiles.com/underconstruction/
2019-07-03 10:44:25 +02:00
Ehmry - 0c0c60f14f Script for collecting Tup stats into RRDtool 2019-06-27 23:30:14 +02:00
Ehmry - e4d5d57571 Tweak ISO test 2019-06-27 13:35:46 +02:00
Ehmry - 2841227ce2 Change *_rules variable type 2019-06-27 11:48:32 +02:00
Ehmry - 549e7df89b WiP! absorb Genode upstream 2019-06-27 11:37:22 +02:00
Ehmry - e1172fac40 Update SDK rules 2019-06-27 11:34:34 +02:00
Ehmry - 3d8ab16763 Update 2048 submodule 2019-06-22 20:19:22 +02:00
Ehmry - 1e201abced Update Nim submodules 2019-06-22 20:16:27 +02:00
Ehmry - 6c1403860f Trim SDK 2019-06-21 18:02:22 +02:00
Ehmry - 090225b5d3 Import SDK Tup rules 2019-06-21 17:29:07 +02:00
Ehmry - 6feaa1860c Gitignore update 2019-06-21 13:58:26 +02:00
Ehmry - 616fabfc84 Absorb upstream Genode repository 2019-06-21 11:42:58 +02:00
Ehmry - f35e62c9ce Manage tooling with Nix
Enter managed environment by invoking 'nix-shell' at the root of
the repository.
2019-06-21 11:40:24 +02:00
115 changed files with 3070 additions and 197 deletions

7
.gitignore vendored
View File

@ -1,3 +1,6 @@
/toolchain-*
/sdk-*
/build-*
##### TUP GITIGNORE #####
##### Lines below automatically generated by Tup.
##### Do not edit.
.tup
/.gitignore

35
.gitmodules vendored
View File

@ -15,7 +15,7 @@
url = git://depot.h4ck.me/srv/git/blobsets
[submodule "nimble/ninep"]
path = nim/ninep
url = git://depot.h4ck.me/srv/git/ehmry/ninep
url = git://depot.h4ck.me/srv/git/ninep
[submodule "libretro/libretro-common"]
path = libretro/libretro-common
url = https://github.com/libretro/libretro-common.git
@ -27,22 +27,22 @@
url = https://github.com/libretro/libretro-2048
[submodule "libretro/cores/4do/core"]
path = libretro/cores/4do/upstream
url = https://github.com/libretro/4do-libretro
url = https://github.com/libretro/4do-libretro.git
[submodule "libretro/cores/fceumm/core"]
path = libretro/cores/fceumm/upstream
url = https://github.com/libretro/libretro-fceumm
url = https://github.com/libretro/libretro-fceumm.git
[submodule "libretro/cores/mgba/core"]
path = libretro/cores/mgba/upstream
url = https://github.com/libretro/mgba
url = https://github.com/libretro/mgba.git
[submodule "libretro/cores/nxengine/core"]
path = libretro/cores/nxengine/upstream
url = git://depot.h4ck.me/srv/git/nxengine
[submodule "libretro/cores/oberon/core"]
path = libretro/cores/oberon/upstream
url = https://github.com/pdewacht/oberon-risc-emu.git
url = git@github.com:ehmry/oberon-risc-libretro.git
[submodule "libretro/cores/snes9x/core"]
path = libretro/cores/snes9x/upstream
url = https://github.com/libretro/snes9x
url = https://github.com/libretro/snes9x.git
[submodule "libretro/cores/tyrquake/core"]
path = libretro/cores/tyrquake/upstream
url = https://github.com/libretro/tyrquake
@ -54,10 +54,10 @@
url = https://github.com/libretro/dosbox-libretro
[submodule "libretro/cores/mrboom/core"]
path = libretro/cores/mrboom/upstream
url = https://github.com/libretro/mrboom-libretro.git
url = git@github.com:ehmry/mrboom-libretro.git
[submodule "libretro/cores/gambatte/core"]
path = libretro/cores/gambatte/upstream
url = https://github.com/libretro/gambatte-libretro
url = git@github.com:github.com/ehmry/gambatte-libretro.git
[submodule "libretro/cores/dinothawr/core"]
path = libretro/cores/dinothawr/core
url = https://github.com/libretro/Dinothawr
@ -69,16 +69,16 @@
url = https://github.com/libretro/scummvm.git
[submodule "libretro/cores/lutro/upstream"]
path = libretro/cores/lutro/upstream
url = https://github.com/libretro/libretro-lutro.git
url = git@github.com:ehmry/libretro-lutro.git
[submodule "libretro/cores/bluemsx/upstream"]
path = libretro/cores/bluemsx/upstream
url = https://github.com/libretro/blueMSX-libretro.git
url = git@github.com:ehmry/blueMSX-libretro.git
[submodule "nimble/fetch_and_copy"]
path = nim/fetch_and_copy
url = git@github.com:ehmry/fetch_and_copy.git
url = git://depot.h4ck.me/srv/git/fetch_and_copy.
[submodule "nimble/nim"]
path = nim/nim
url = https://github.com/nim-lang/nim.git
url = https://github.com/ehmry/nim.git
[submodule "nimble/spry_genode"]
path = nim/spry_genode
url = git@github.com:ehmry/spry_genode.git
@ -93,7 +93,16 @@
url = https://github.com/meepingsnesroms/Mu.git
[submodule "libretro/cores/dosbox-svn/upstream"]
path = libretro/cores/dosbox-svn/upstream
url = https://github.com/fr500/dosbox-svn
url = https://github.com/libretro/dosbox-svn.git
[submodule "nim/xspf_view"]
path = nim/xspf_view
url = git://depot.h4ck.me/srv/git/xspf_view
[submodule "upstream"]
path = upstream
url = git@github.com:ehmry/genode.git
[submodule "nim/blobbot"]
path = nim/blobbot
url = git://depot.h4ck.me/srv/git/blobbot
[submodule "libretro/cores/yabause/upstream"]
path = libretro/cores/yabause/upstream
url = https://github.com/libretro/yabause.git

BIN
.underconstruction.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1,3 +1,5 @@
![UNDER CONSTRUCTION](.underconstruction.gif)
This is a super-repository containing an experimental [Tup](http://gittup.org/tup) build
system and submodules containing Genode components and runtime metadata.

View File

@ -49,7 +49,7 @@ SHORT_SUM = b2sum -l24
awk -F '/' -f errata/raw.mk.awk $f >> %o; done; \
for f in %<bin-archives>; do \
awk -F '/' -f errata/bin.mk.awk $f >> %o; done; \
awk -F '/' -f errata/pkg.mk.awk $(PKG_SED_FILE) >> %o; done \
awk -F '/' -f errata/pkg.mk.awk $(PKG_SED_FILE) >> %o; \
|> Makefile
# Generate the makefile for creating signed package tarballs

View File

@ -1,5 +1,45 @@
.gitignore
ifndef TOOL_CHAIN_PREFIX
error TOOL_CHAIN_PREFIX not configured, missing variant?
endif
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
GENODE_DIR = $(TUP_CWD)/upstream
&STUB_DIR = stub
STUB_DIR = $(TUP_CWD)/stub
export NIX_PATH
NIX_BUILD = nix-build --option substitute false
LIBGCC = `$(CC) $(CC_MARCH) -print-libgcc-file-name`
!prg = | $(GENODE_DIR)/<stub> $(GENODE_DIR)/<pkg-config> \
|> ^o LD %o^ \
$(LD) $(LD_MARCH) $(LDFLAGS) \
-L&(STUB_DIR) \
`$(PKG_CONFIG) --libs $(LIBS) genode-prg` \
%f \
$(LIBGCC) \
-o %o \
|> %d
!lib = | $(GENODE_DIR)/<stub> $(GENODE_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LD_MARCH) %f $(LDFLAGS) `$(PKG_CONFIG) --libs genode-lib $(LIBS)` -L&(STUB_DIR) -o %o |>
ifeq ($(RAW_NAME),)
RAW_NAME = $(TARGET_NAME)
endif
@ -22,7 +62,7 @@ endif
DEPOT_DIR = $(TUP_CWD)/depot
DEPOT_RAW_DIR = $(DEPOT_DIR)/raw
DEPOT_BIN_DIR = $(DEPOT_DIR)/bin/@(TUP_ARCH)
DEPOT_BIN_DIR = $(DEPOT_DIR)/bin
DEPOT_PKG_DIR = $(DEPOT_DIR)/pkg
PUBLIC_DIR = $(TUP_CWD)/public
@ -39,21 +79,21 @@ BIN_DIR = $(DEPOT_BIN_DIR)/$(BIN_NAME)/current
PKG_DIR = $(DEPOT_BIN_DIR)/$(BIN_NAME)/current
# Destination for locally defined runtime package
!raw = |> ^ COLLECT %o^ \
!raw = |> ^ generate raw metadata^ \
echo $(RAW_DEPENDS) local/raw/$(RAW_NAME)/$(RAW_VERSION) | tr ' ' '\n' > %o; \
echo local/raw/$(RAW_NAME)/$(RAW_VERSION) > %o \
|> $(RAW_DIR)/.ARCHIVES $(DEPOT_DIR)/<raw-archives>
!bin = |> ^ COLLECT %o^ \
!bin = |> ^ generate bin metadata^ \
echo $(BIN_DEPENDS) local/src/$(BIN_NAME)/$(BIN_VERSION) | tr ' ' '\n' > %o; \
|> $(BIN_DIR)/.ARCHIVES $(DEPOT_DIR)/<bin-archives>
# Macro invoked in BIN_RULES
RAW_RULES = $(TUP_CWD)/errata/raw.tup
&RAW_RULES = errata/raw.tup
# Rules for finalizing a locally defined raw package
BIN_RULES = $(TUP_CWD)/errata/bin.tup
&BIN_RULES = errata/bin.tup
# Rules for finalizing a locally defined binary package
PKG_RULES = $(TUP_CWD)/errata/pkg.tup
&PKG_RULES = errata/pkg.tup
# Rules for finalizing a locally defined runtime package
AWK_LOCAL_ARCHIVES = awk -F '/' \
@ -62,12 +102,12 @@ AWK_LOCAL_ARCHIVES = awk -F '/' \
!pkg = |> |>
!collect_raw = |> ^ COLLECT %o^ \
!collect_raw = |> ^ COLLECT %b^ \
cp %f %o \
|> $(RAW_DIR)/%b
!collect_bin = |> ^ COLLECT %o^ \
strip -o %o %f \
!collect_bin = |> ^ COLLECT %b^ \
@(TOOL_CHAIN_PREFIX)strip -o %o %f \
|> $(DEPOT_BIN_DIR)/$(BIN_NAME)/current/%b
!collect_pkg_runtime = | $(VERSIONS_SED_FILE) |> ^ package %f^ \
@ -79,12 +119,12 @@ AWK_LOCAL_ARCHIVES = awk -F '/' \
sed -f $(VERSIONS_SED_FILE) $(DEPOT_PKG_DIR)/$(PKG_NAME)/current/archives \
> $(DEPOT_PKG_DIR)/$(PKG_NAME)/current/.ARCHIVES; \
|> \
$(DEPOT_PKG_DIR)/$(PKG_NAME)/current/runtime \
$(DEPOT_PKG_DIR)/$(PKG_NAME)/current/archives \
$(DEPOT_PKG_DIR)/$(PKG_NAME)/current/.ARCHIVES \
$(DEPOT_PKG_DIR)/$(PKG_NAME)/current/runtime \
$(DEPOT_DIR)/<packages>
!collect_pkg = |> ^ COLLECT %o^ cp %f %o \
!collect_pkg = |> ^ COLLECT %b^ cp %f %o \
|> $(DEPOT_PKG_DIR)/$(PKG_NAME)/current/%b \
$(DEPOT_DIR)/<packages>
@ -99,13 +139,62 @@ SDK_INCLUDE = $(TUP_CWD)/sdk.tup
ERRATA_DIR = $(TUP_CWD)/errata
PKG_CONFIG = PKG_CONFIG_PATH=@(PKG_CONFIG_PATH) pkg-config
export PKG_CONFIG_PATH
PKG_CONFIG = PKG_CONFIG_PATH=$(GENODE_DIR)/upstream:pkg-config:$PKG_CONFIG_PATH pkg-config
CC = @(CC_WRAPPER) `$(PKG_CONFIG) genode-base --variable cc`
CXX = @(CXX_WRAPPER) `$(PKG_CONFIG) genode-base --variable cxx`
LD = `$(PKG_CONFIG) genode-base --variable ld`
AR = `$(PKG_CONFIG) genode-base --variable ar`
CC = @(TOOL_CHAIN_PREFIX)gcc
CXX = @(TOOL_CHAIN_PREFIX)g++
LD= @(TOOL_CHAIN_PREFIX)ld
AR = @(TOOL_CHAIN_PREFIX)ar
AS = @(TOOL_CHAIN_PREFIX)as
OBJCOPY = @(TOOL_CHAIN_PREFIX)objcopy
!cc = |> ^ CC %f^ $(CC) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -c %f -o %o |>
!cxx = |> ^ CC %f^ $(CC) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) -c %f -o %o |>
!ld = |> ^ LD %o^ $(LD) $(LDFLAGS) %f -o %o |>
AS_OPT += $(AS_MARCH)
LIBGCC = `$(CC) $(CC_MARCH) -print-libgcc-file-name`
PKG_CONFIG_DIR = $(TUP_CWD)/pkg-config
&PKG_CONFIG_DIR = pkg-config
PKG_CONFIG_PATH = $(PKG_CONFIG_DIR)
PKG_CONFIG = PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config
!asm = |> ^ CC %b^ @(CC_WRAPPER) $(CC) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) -D__ASSEMBLY__ $(INCLUDES) -c %f -o %o |> %B.o
!cc = | $(GENODE_DIR)/<pkg-config> |> ^o CC %f^ @(CC_WRAPPER) $(CC) $(DEFINES) $(CFLAGS) $(CFLAGS_%e) $(CFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` $(INCLUDES) -c %f -o %o |> %B.o
!cc_port = | $(GENODE_DIR)/<pkg-config> |> ^o CC %o^ @(CC_WRAPPER) $(CC) -c -fPIC $(DEFINES) $(CFLAGS) $(CFLAGS_%o) $(INCLUDES) `$(PKG_CONFIG) --cflags $(LIBS) $(LIBS_CFLAGS)` -o %o |> %B.o
!cxx = | $(GENODE_DIR)/<pkg-config> |> ^o CXX %b^ @(CC_WRAPPER) $(CXX) $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%e) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(INCLUDES) -c %f -o %o |> %B.o
!cxx_port = | $(GENODE_DIR)/<pkg-config> |> ^o CXX %o^ @(CC_WRAPPER) $(CXX) -c $(DEFINES) $(CXXFLAGS) $(CXXFLAGS_%f) `$(PKG_CONFIG) --cflags $(LIBS)` $(INCLUDES) -o %o |> %B.o
!ld = | $(GENODE_DIR)/<lib> $(GENODE_DIR)/<pkg-config> |> ^o LD %o^ $(LD) $(LDFLAGS) `$(PKG_CONFIG) --libs $(LIBS)` %f -o %o |>
!strip = |> strip -o %o %f |>
&LD_SCRIPT_SO = upstream/repos/base/src/ld/genode_rel.ld
ifeq (@(TUP_ARCH),x86_64)
ASM_SYM_DEPENDENCY = movq \1@GOTPCREL(%rip), %rax
else
ASM_SYM_DEPENDENCY = .long \1
endif
!abi_stub = |> ^ STUB %o^\
sed \
-e "s/^\(\w\+\) D \(\w\+\)\$/.data; .global \1; .type \1,%%object; .size \1,\2; \1:/p" \
-e "s/^\(\w\+\) V/.data; .weak \1; .type \1,%%object; \1:/p" \
-e "s/^\(\w\+\) T/.text; .global \1; .type \1,%%function; \1:/p" \
-e "s/^\(\w\+\) R \(\w\+\)\$/.section .rodata; .global \1; .type \1,%%object; .size \1,\2; \1:/p" \
-e "s/^\(\w\+\) W/.text; .weak \1; .type \1,%%function; \1:/p" \
-e "s/^\(\w\+\) B \(\w\+\)\$/.bss; .global \1; .type \1,%%object; .size \1,\2; \1:/p" \
-e "s/^\(\w\+\) U/.text; .global \1; $(ASM_SYM_DEPENDENCY)/p" \
%f \
| $(CC) -x assembler -c - -o tmp.o; \
$(LD) -o %o \
-shared \
-T &(LD_SCRIPT_SO) \
tmp.o; \
rm tmp.o; \
|> $(STUB_DIR)/%B.lib.so $(GENODE_DIR)/<stub>

View File

@ -1,12 +0,0 @@
/.gitignore
/public
##### TUP GITIGNORE #####
##### Lines below automatically generated by Tup.
##### Do not edit.
/.gitignore
/Makefile
/bin-list
/depot
/pkg.sed
/raw-list
/versions.sed

12
configs/arm_v8.config Normal file
View File

@ -0,0 +1,12 @@
CONFIG_TUP_ARCH=arm64
CONFIG_TOOL_CHAIN_PREFIX=genode-aarch64-
CONFIG_CC_WRAPPER=ccache
CONFIG_CXX_WRAPPER=ccache
CONFIG_OFFLINE=
CONFIG_NO_NETWORK=
CONFIG_SCULPT_VERSION=19.07
CONFIG_PUBLIC_USER=ehmry
CONFIG_PUBLIC_KEY=6E10414EE7160781F5FEE8FFB14D043A26B3D2C7

15
configs/i386.config Normal file
View File

@ -0,0 +1,15 @@
CONFIG_TUP_ARCH=x86_64
CONFIG_x86=
CONFIG_TOOL_CHAIN_PREFIX=genode-x86-
CONFIG_CC_WRAPPER=ccache
CONFIG_CXX_WRAPPER=ccache
CONFIG_OFFLINE=
CONFIG_NO_NETWORK=
CONFIG_BUILD_NOVA=y
CONFIG_SCULPT_VERSION=19.07
CONFIG_PUBLIC_USER=ehmry
CONFIG_PUBLIC_KEY=6E10414EE7160781F5FEE8FFB14D043A26B3D2C7

View File

@ -1,15 +1,15 @@
CONFIG_TUP_ARCH=x86_64
CONFIG_SCULPT_VERSION=19.05
CONFIG_PKG_CONFIG_PATH=/opt/genode/sdk-19.05/pkgconfig/x86_64
CONFIG_TOOLCHAIN_PATH=/opt/genode/toolchain-19.05/bin
CONFIG_x86=
CONFIG_TOOL_CHAIN_PREFIX=genode-x86-
CONFIG_CC_WRAPPER=ccache
CONFIG_CXX_WRAPPER=ccache
#CONFIG_NO_NETWORK=
CONFIG_SKIP_INCOMPATIBLE=
CONFIG_OFFLINE=
CONFIG_BUILD_NOVA=y
CONFIG_SCULPT_VERSION=19.07
CONFIG_PUBLIC_USER=ehmry
CONFIG_PUBLIC_KEY=6E10414EE7160781F5FEE8FFB14D043A26B3D2C7
@ -19,15 +19,15 @@ CONFIG_PUBLIC_PKG_BACKDROP=ehmry/pkg/backdrop/2019-05-24
CONFIG_PUBLIC_PKG_NOUX_SYSTEM=ehmry/pkg/noux-system/2019-05-24
CONFIG_PUBLIC_PKG_PDF_VIEW=ehmry/pkg/pdf_view/2019-05-17
CONFIG_PUBLIC_SRC_BASE_NOVA=genodelabs/src/base-nova/2019-03-17
CONFIG_PUBLIC_SRC_BASE_NOVA=genodelabs/src/base-nova/2019-05-26
CONFIG_PUBLIC_SRC_BLOCK_SHRED=ehmry/src/block_shred/2019-03-31
CONFIG_PUBLIC_SRC_CHROOT=ehmry/src/chroot/2019-05-24
CONFIG_PUBLIC_SRC_CHROOT=_/src/chroot
CONFIG_PUBLIC_SRC_EXPAT=nfeske/src/expat/2019-02-19
CONFIG_PUBLIC_SRC_FS_LOG=ehmry/src/fs_log/2019-04-01
CONFIG_PUBLIC_SRC_INIT=ehmry/src/init/2019-05-24
CONFIG_PUBLIC_SRC_LIBC=ehmry/src/libc/2019-05-24
CONFIG_PUBLIC_SRC_FS_LOG=_/src/fs_log
CONFIG_PUBLIC_SRC_INIT=_/src/init
CONFIG_PUBLIC_SRC_LIBC=nfeske/src/libc/2019-06-24
CONFIG_PUBLIC_SRC_LIBCRYPTO=ehmry/src/libcrypto/2019-05-24
CONFIG_PUBLIC_SRC_LIBICONV=genodelabs/src/libiconv/2019-02-25
CONFIG_PUBLIC_SRC_LIBICONV=genodelabs/src/libiconv/2019-05-26
CONFIG_PUBLIC_SRC_LIBMPG123=ehmry/src/libmpg123/2019-05-24
CONFIG_PUBLIC_SRC_LIBPNG=ehmry/src/libpng/2019-05-24
CONFIG_PUBLIC_SRC_LIBSSH=ehmry/src/libssh/2019-05-24
@ -40,23 +40,23 @@ CONFIG_PUBLIC_SRC_NIC_BRIDGE=ehmry/src/nic_bridge/2019-05-24
CONFIG_PUBLIC_SRC_NIT_FB=ehmry/src/nit_fb/2019-05-24
CONFIG_PUBLIC_SRC_NOUX=ehmry/src/noux/2019-05-24
CONFIG_PUBLIC_SRC_NCURSES=ehmry/src/ncurses/2019-05-24
CONFIG_PUBLIC_SRC_POSIX=ehmry/src/posix/2019-05-24
CONFIG_PUBLIC_SRC_POSIX=_/src/posix
CONFIG_PUBLIC_SRC_RAM_BLOCK=alex-ab/src/ram_block/2019-02-25
CONFIG_PUBLIC_SRC_REPORT_ROM=ehmry/src/report_rom/2019-05-24
CONFIG_PUBLIC_SRC_REPORT_ROM=_/src/report_rom
CONFIG_PUBLIC_SRC_ROM_BLOCK=ehmry/src/rom_block/2019-04-05-a
CONFIG_PUBLIC_SRC_SDL=ehmry/src/sdl/2019-05-24
CONFIG_PUBLIC_SRC_SEOUL_NOVA=ehmry/src/seoul-nova/2019-05-01-a
CONFIG_PUBLIC_SRC_SHOW_INPUT=ehmry/src/show_input/2019-05-24
CONFIG_PUBLIC_SRC_SSH_CLIENT=ehmry/src/ssh_client/2019-05-24
CONFIG_PUBLIC_SRC_STDCXX=ehmry/src/stdcxx/2019-05-24
CONFIG_PUBLIC_SRC_STDCXX=genodelabs/src/stdcxx/2019-05-27
CONFIG_PUBLIC_SRC_TERMINAL=ehmry/src/terminal/2019-05-24-a
CONFIG_PUBLIC_SRC_VBOX_NOVA=genodelabs/src/vbox5-nova/2019-03-17
CONFIG_PUBLIC_SRC_VBOX_NOVA=genodelabs/src/vbox5-nova/2019-05-28
CONFIG_PUBLIC_SRC_VFS_AUDIT=ehmry/src/vfs_audit/2019-04-20
CONFIG_PUBLIC_SRC_VFS=ehmry/src/vfs/2019-05-24
CONFIG_PUBLIC_SRC_VFS=_/src/vfs
CONFIG_PUBLIC_SRC_VFS_JITTERENTROPY=ehmry/src/vfs_jitterentropy/2019-05-24
CONFIG_PUBLIC_SRC_VFS_LWIP=ehmry/src/vfs_lwip/2019-05-24
CONFIG_PUBLIC_SRC_VFS_LXIP=ehmry/src/vfs_lxip/2019-05-24
CONFIG_PUBLIC_SRC_VFS_TTF=ehmry/src/vfs_ttf/2019-05-24
CONFIG_PUBLIC_SRC_VFS_TTF=nfeske/src/vfs_ttf/2019-06-20
CONFIG_PUBLIC_SRC_WINDOW_LAYOUTER=ehmry/src/window_layouter/2019-05-24
CONFIG_PUBLIC_SRC_WM=ehmry/src/wm/2019-05-24
CONFIG_PUBLIC_SRC_ZLIB=ehmry/src/zlib/2019-05-24
CONFIG_PUBLIC_SRC_ZLIB=genodelabs/src/zlib/2019-05-26

58
default.nix Normal file
View File

@ -0,0 +1,58 @@
{ pkgs ? import <nixpkgs> {} }: with pkgs;
let
lddir = ./upstream/repos/base/src/ld;
toolchain = import ./errata/toolchain.nix { inherit pkgs; };
in
pkgs.mkShell {
name = "genode-dev-env";
nativeBuildInputs =
[ toolchain
stdenv.glibc.dev
git tup
ccache
tcl
gnumake
which
findutils
autoconf264
autogen
cdrtools
expect libxml2 syslinux qemu xorriso
# libc
flex bison
# virtualbox
yasm libxslt iasl
# qt5
gperf
qt5.full
# ncurses
mawk
# fb_sdl
pkgconfig
SDL.dev
alsaLib.dev
# ncurses port needs infocmp
ncurses
];
passthru = { inherit lddir toolchain; };
shellHook =
''
export LD_DIR=${lddir}
export TOOLCHAIN_DIR=${toolchain}
export SYSLINUX=${syslinux}
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\] "
'';
# Setup a prompt with a distinct appearance
}

View File

@ -19,6 +19,7 @@
<xs:element name="log" type="template_service"/>
<xs:element name="nic" type="template_service"/>
<xs:element name="nitpicker" type="template_service"/>
<xs:element name="platform" type="template_service"/>
<xs:element name="report" type="template_service"/>
<xs:element name="rm" type="template_service"/>
<xs:element name="rom" type="template_service"/>

68
errata/toolchain.nix Normal file
View File

@ -0,0 +1,68 @@
{ pkgs ? import <nixpkgs> {} }: with pkgs;
let
genodeVersion = "19.05";
glibcVersion = (builtins.parseDrvName stdenv.glibc.name).version;
in
stdenv.mkDerivation rec {
name = "genode-toolchain-${genodeVersion}";
version = genodeVersion;
src =
if stdenv.isx86_64 then
fetchurl {
url = "https://downloads.sourceforge.net/project/genode/genode-toolchain/${genodeVersion}/genode-toolchain-${genodeVersion}-x86_64.tar.xz";
sha256 = "036czy21zk7fvz1y1p67q3d5hgg8rb8grwabgrvzgdsqcv2ls6l9";
}
else abort "no toolchain for ${stdenv.system}";
buildInputs = [ patchelf ];
dontPatchELF = true;
# installPhase is disabled for now
phases = "unpackPhase fixupPhase";
unpackPhase = ''
mkdir -p $out
echo "unpacking $src..."
tar xf $src --strip-components=5 -C $out
'';
installPhase = ''
cd $out/bin
for platform in arm x86 ; do
dest="$"$platform"/bin"
eval dest=$"$dest"
mkdir -p $dest
for b in genode-$platform-* ; do
eval ln -s $b $dest/$\{b#genode-$platform-\}
done
done
cd -
'';
fixupPhase = ''
interp=${stdenv.glibc.out}/lib/ld-${glibcVersion}.so
if [ ! -f "$interp" ] ; then
echo new interpreter $interp does not exist,
echo cannot patch binaries
exit 1
fi
for f in $(find $out); do
if [ -f "$f" ] && patchelf "$f" 2> /dev/null; then
patchelf --set-interpreter $interp \
--set-rpath $out/lib:${stdenv.glibc.out}/lib:${zlib.out}/lib \
"$f" || true
fi
done
'';
passthru = { libc = stdenv.glibc; };
}

View File

@ -1,5 +1,16 @@
<index>
<index name="Audio">
<pkg path="_/pkg/mixer" info="Mixer component"/>
<pkg path="_/pkg/bsd_audio_drv" info="OpenBSD audio driver (mixer client)"/>
<pkg path="ehmry/pkg/audio_player/2019-05-24" info="Cnuke's audio player"/>
<index name="Radio streams">
<pkg path="_/pkg/ifm1" info="Intergalactic FM 1"/>
<pkg path="_/pkg/ifm2" info="Intergalactic FM 2"/>
<pkg path="_/pkg/ifm3" info="Intergalactic FM 3"/>
</index>
</index>
<index name="Emulators and game engines">
<pkg path="_/pkg/dosbox" info="Experimental Libretro port of DOSBox"/>
<pkg path="_/pkg/fceumm" info="NES"/>
@ -60,10 +71,6 @@
</index>
<index name="Utility">
<index name="Audio">
<pkg path="ehmry/pkg/bsd_audio_drv/2019-05-24" info="Cnuke's audio driver"/>
<pkg path="ehmry/pkg/audio_player/2019-05-24" info="Cnuke's audio player"/>
</index>
<index name="Graphic">
<!-- <pkg path="ehmry/pkg/flif_capture/2019-03-22" info="Screen capture utility"/> -->
@ -80,6 +87,7 @@
<pkg path="_/pkg/ninep" info="9P server"/>
<pkg path="_/pkg/ssh_client" info="SSH client"/>
<pkg path="_/pkg/test-lwip_node" info="Standalone lwIP IPv6 node"/>
<pkg path="_/pkg/kiosk" info="Kiosk-style web browser"/>
</index>
<index name="UI">
@ -95,6 +103,7 @@
<!-- <pkg path="ehmry/pkg/jitter_sponge/2019-03-31" info="Entropy source"/> -->
<!-- <pkg path="ehmry/pkg/noux-build-x86/2019-03-20" info="Noux build environment"/> -->
<pkg path="_/pkg/noux-system" info="Noux administration environment"/>
<pkg path="_/pkg/show_input" info="Nitpicker input event debugger"/>
</index>
</index>
@ -104,16 +113,14 @@
<pkg path="_/pkg/musicbrainz_playlist_generator" info="XSPF playlist generator"/>
<pkg path="_/pkg/xspf_view" info="XSPF playlist viewer"/>
</index>
<pkg path="_/pkg/4do"/>
<pkg path="_/pkg/4do" "3DO emulator"/>
<pkg path="ehmry/pkg/avplay/2019-05-24"/>
<pkg path="_/pkg/bluemsx"/>
<pkg path="_/pkg/cruzes" info="An unfinished Picross Libretro core"/>
<pkg path="_/pkg/ifm1"/>
<pkg path="_/pkg/ifm2"/>
<pkg path="_/pkg/ifm3"/>
<pkg path="_/pkg/monero_vanity"/>
<pkg path="_/pkg/mu"/>
<pkg path="_/pkg/testgl"/>
<pkg path="_/pkg/yabause" info="Sega Saturn emulator/>
</index>
<pkg path="ehmry/pkg/fonts_fs/2019-05-24" info="Fonts provider"/>

@ -1 +1 @@
Subproject commit 039966ca2d9fe48ddd98c8d2fe0136f3c8724296
Subproject commit b8d222ace1bf1962423111e395e01d4674776270

View File

@ -8,7 +8,6 @@
</requires>
<content>
<rom label="ld.lib.so"/>
<rom label="libc.lib.so"/>
<rom label="libm.lib.so"/>
<rom label="libretro.so"/>

@ -1 +1 @@
Subproject commit 714a81b5c7c05dc2e2c5956efe04698e1c723056
Subproject commit 8c2b1cf0ccd8ea8a36ae1ed7aa09ae7c2b3dc1cd

View File

@ -1,11 +1,11 @@
# Implicit dependencies
PKG_DEPENDS += \
@(PUBLIC_SRC_VFS) \
_/src/vfs \
@(PUBLIC_SRC_LIBC) \
_/src/$(BIN_NAME) \
_/src/retro_frontend \
!libretro_cc = |> ^ CC %f^ \
!libretro_cc = | $(GENODE_DIR)/<pkg-config> |> ^ CC %f^ \
$(CC) \
$(DEFINES) \
`$(PKG_CONFIG) --cflags $(CORE_PKGS)` \
@ -14,7 +14,7 @@ PKG_DEPENDS += \
-c %f -o %o \
|> %f.$(TARGET_NAME).o
!libretro_cxx = |> ^ CXX %f^ \
!libretro_cxx = | $(GENODE_DIR)/<pkg-config> |> ^ CXX %f^ \
$(CXX) \
$(DEFINES) \
`$(PKG_CONFIG) --cflags $(CORE_PKGS)` \
@ -23,15 +23,16 @@ PKG_DEPENDS += \
-c %f -o %o \
|> %f.$(TARGET_NAME).o
!libretro_core_link = |> ^o LD %d^ \
!libretro_core_link = | $(GENODE_DIR)/<pkg-config> $(GENODE_DIR)/<stub> |> ^o LD %d^ \
$(LD) %f -o %o \
-shared --version-script=$(LINK_T) $(NO_UNDEFINED) \
$(LDFLAGS) \
`$(PKG_CONFIG) --libs $(CORE_PKGS)` \
`$(PKG_CONFIG) --libs genode-lib` \
-L$(STUB_DIR) \
|> libretro.so
LINK_T = $(TUP_CWD)/link.T
DEFINES += -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565
DEFINES += -fPIC -D__LIBRETRO__ -DFRONTEND_SUPPORTS_RGB565
DEFINES += -DGIT_VERSION=\"$(GIT_VERSION)\"
NO_UNDEFINED = --no-undefined

View File

@ -10,7 +10,6 @@
<content>
<rom label="blueMSX.tar"/>
<rom label="ld.lib.so"/>
<rom label="libc.lib.so"/>
<rom label="libm.lib.so"/>
<rom label="libretro.so"/>

View File

@ -8,7 +8,6 @@
</requires>
<content>
<rom label="ld.lib.so"/>
<rom label="libc.lib.so"/>
<rom label="libm.lib.so"/>
<rom label="libretro.so"/>

@ -1 +1 @@
Subproject commit 386d7d9114234475221e72d2cdfdb8ee74d987eb
Subproject commit 4e1bdaaed021b0f6587c61f18de081bc3876f887

View File

@ -8,7 +8,6 @@
</requires>
<content>
<rom label="ld.lib.so"/>
<rom label="libc.lib.so"/>
<rom label="libm.lib.so"/>
<rom label="libretro.so"/>

@ -1 +1 @@
Subproject commit 9f88b26c77c93e4f2f0254ec6d20b29b4c49610e
Subproject commit 5fd9a1fb1dc2ae259f9f0edd7fce1549465f4fe9

@ -1 +1 @@
Subproject commit a9ed4a40cfe0b607f753d444fa633240b716c886
Subproject commit ceab569d88da6846bc632a79961fb30b1aa8c186

View File

@ -8,7 +8,6 @@
</requires>
<content>
<rom label="ld.lib.so"/>
<rom label="libc.lib.so"/>
<rom label="libm.lib.so"/>
<rom label="libretro.so"/>

@ -1 +1 @@
Subproject commit 03c7fac5b733d5eb7f2de59929b840333a4c553c
Subproject commit 22c7ae749b9b46fb0343d8f25238db62ca6156ef

@ -1 +1 @@
Subproject commit 5dfb5f2a2d1a56c6240dfdc60212be479b9ce5c3
Subproject commit 148b9f7301db2aebfc3b9190526ebde43eba170b

View File

@ -8,7 +8,6 @@
</requires>
<content>
<rom label="ld.lib.so"/>
<rom label="libc.lib.so"/>
<rom label="libm.lib.so"/>
<rom label="libretro.so"/>

@ -1 +1 @@
Subproject commit 94909c68720719f87fdd68fa02df3c72c2a8b179
Subproject commit 41aa3d5ecaab3c4dc68be3857af89c36053b02c6

View File

@ -84,7 +84,7 @@ endif
ifeq ($(TARGET_NAME),testgl_compute_shaders)
CORE_PKGS += mesa
CFLAGS += -Igl -DNDEBUG -fPIC -DHAVE_ZIP_DEFLATE
CFLAGS += -Igl -DNDEBUG -DHAVE_ZIP_DEFLATE
SOURCES_CXX += libretro/libretro.cpp
SOURCES_CXX += gl/*.cpp
SOURCES_CXX += app/boxes.cpp

View File

@ -4,6 +4,7 @@
<audio_out/>
<file_system/>
<nitpicker/>
<rm/>
</requires>
<content>

@ -1 +1 @@
Subproject commit fd6547e86fae1bd35606f19ddc8caa00596d509d
Subproject commit 32aa98eeaad66cc3318d6e821a7a83de75603831

View File

@ -8,7 +8,6 @@
</requires>
<content>
<rom label="ld.lib.so"/>
<rom label="libc.lib.so"/>
<rom label="libm.lib.so"/>
<rom label="libretro.so"/>

@ -1 +1 @@
Subproject commit a07fbf660e29be2db9f6f9b051514dfd546cef26
Subproject commit 121576eb06ec7f1381881710d0ddd013355cd9de

@ -1 +1 @@
Subproject commit 627c96be59e4abc9f26bfd0e65a18a973205f886
Subproject commit d058fb7e58137d92f148f1b81a8b2eb147090aab

View File

@ -0,0 +1,30 @@
CORE_PKGS += libc libm
# TODO: enable dynamic recompiler
include upstream/libretro/Makefile.common
: foreach $(C68KEXEC_SOURCE) |> !libretro_cc -O0 -DNDEBUG |> %B.o {obj}
CFLAGS += $(INCFLAGS)
CFLAGS += -DSIZEOF_DOUBLE=8
CFLAGS += -DUSE_16BPP=1
CFLAGS += -DUSE_RGB_565=1
CFLAGS += -DUSE_SCSP2=1
CFLAGS += -DNO_CLI
CFLAGS += -DHAVE_SYS_TIME_H
CFLAGS += -DHAVE_GETTIMEOFDAY
CFLAGS += -DVERSION=\"0.9.12\"
CFLAGS += -DHAVE_STRCASECMP
CFLAGS += -DINLINE="inline"
CFLAGS += -O3 -DNDEBUG
: foreach $(SOURCES_C) |> !libretro_cc |> {obj}
: {obj} |> !libretro_core_link |> {core}
: {core} |> !collect_bin |>
: |> !bin |>
: $(TUP_CWD)/runtime |> !collect_pkg_runtime |>
: |> !pkg |>

View File

@ -0,0 +1,44 @@
<runtime ram="64M" caps="128" binary="retro_frontend">
<requires>
<audio_out/>
<file_system/>
<nitpicker/>
<rm/>
</requires>
<content>
<rom label="libc.lib.so"/>
<rom label="libm.lib.so"/>
<rom label="libretro.so"/>
<rom label="retro_frontend"/>
<rom label="vfs.lib.so"/>
</content>
<config>
<libc stdout="/dev/log" stderr="/dev/log"/>
<game/>
<vfs>
<fs/>
<dir name="dev"> <log label="core"/> </dir>
</vfs>
<default-controller port="0" device="1">
<map from="KEY_LEFT" to="LEFT"/>
<map from="KEY_RIGHT" to="RIGHT"/>
<map from="KEY_UP" to="UP"/>
<map from="KEY_DOWN" to="DOWN"/>
<map from="KEY_Z" to="Y"/>
<map from="KEY_X" to="B"/>
<map from="KEY_C" to="A"/>
<map from="KEY_A" to="X"/>
<map from="KEY_S" to="L"/>
<map from="KEY_D" to="R"/>
<map from="KEY_ENTER" to="START"/>
<map from="KEY_RIGHTSHIFT" to="SELECT"/>
</default-controller>
</config>
</runtime>

@ -0,0 +1 @@
Subproject commit 7bb35b865af74282d69f4ecc35ce3a1e0f2d0099

View File

@ -12,10 +12,10 @@ DOPA_FILES = \
pak0.pak \
: dopa.rar |> unrar x %f $(DOPA_FILES); tar cf %o $(DOPA_FILES); rm $(DOPA_FILES) |> $(RAW_DIR)/quake_dopa.tar
include $(RAW_RULES)
include &(RAW_RULES)
PKG_DEPENDS += \
@(PUBLIC_SRC_VFS) \
_/src/vfs \
@(PUBLIC_SRC_LIBC) \
_/src/tyrquake \
_/src/retro_frontend \
@ -23,6 +23,6 @@ PKG_DEPENDS += \
_/raw/$(RAW_NAME) \
: runtime |> !collect_pkg_runtime |>
include $(PKG_RULES)
include &(PKG_RULES)
endif

View File

@ -20,6 +20,6 @@ PKG_DEPENDS += \
: runtime |> !collect_pkg_runtime |>
include $(RAW_RULES)
include &(RAW_RULES)
endif

@ -1 +1 @@
Subproject commit 855c69a8917e9ea0013819dbaee8ac0d12b5a469
Subproject commit 7437ccc0fb92c8177a980b8b45e2a3e995f98f8c

@ -1 +1 @@
Subproject commit 8cff8361ac42b15a93be2c6d97d01c05be8d6f74
Subproject commit 90e1d41b851cb812ab841344a21c4e61f5ff4232

View File

@ -9,7 +9,7 @@ include_rules
|> $(RAW_DIR)/240pSuite.sfc $(RAW_DIR)/README.TXT {unzipped}
PKG_DEPENDS += \
@(PUBLIC_SRC_VFS) \
_/src/vfs \
@(PUBLIC_SRC_LIBC) \
@(PUBLIC_SRC_STDCXX) \
_/src/snes9x \
@ -17,4 +17,4 @@ PKG_DEPENDS += \
_/raw/$(TARGET_NAME) \
: runtime |> !collect_pkg_runtime |>
include $(RAW_RULES)
include &(RAW_RULES)

View File

@ -9,7 +9,7 @@ include_rules
|> $(RAW_DIR)/240pee.nes $(RAW_DIR)/240pee-bnrom.nes $(RAW_DIR)/README.md {unzipped}
PKG_DEPENDS += \
@(PUBLIC_SRC_VFS) \
_/src/vfs \
@(PUBLIC_SRC_LIBC) \
_/src/fceumm \
_/src/retro_frontend \
@ -17,5 +17,5 @@ PKG_DEPENDS += \
: runtime |> !collect_pkg_runtime |>
include $(RAW_RULES)
include $(PKG_RULES)
include &(RAW_RULES)
include &(PKG_RULES)

View File

@ -11,6 +11,6 @@ include_rules
RAW_VERSION = 0.38.h
: {tar} |> !collect_raw |>
include $(RAW_RULES)
include &(RAW_RULES)
endif

View File

@ -4,6 +4,6 @@ the repository contains an `*,nimble`, an `archives`, and a `runtime` file.
```tup
include_rules
include $(NIMBLE_BINARIES_INCLUDE)
include $(NIMBLE_PACKAGE_INCLUDE)
include &(NIMBLE_BINARIES_INCLUDE)
include &(NIMBLE_PACKAGE_INCLUDE)
```

View File

@ -1,5 +1,15 @@
# Nim default variables
ifeq (@(TUP_ARCH),arm64)
NIM_CPU = arm64
endif
ifeq (@(TUP_ARCH),i386)
NIM_CPU = i386
endif
ifeq (@(TUP_ARCH),x86_64)
NIM_CPU = amd64
endif
NIM_RELEASE_FLAG = -d:release
# Drop the relase flag with the line "NIM_RELEASE_FLAG="
@ -9,5 +19,15 @@ NIM_SRC_DIR = src
BIN_VERSION = $(GIT_VERSION)
# Use the git version as the binary package version
NIMBLE_BINARIES_INCLUDE = $(TUP_CWD)/binaries.tup
NIMBLE_PACKAGE_INCLUDE = $(TUP_CWD)/package.tup
&NIMBLE_BINARIES_INCLUDE = binaries.tup
&NIMBLE_PACKAGE_INCLUDE = package.tup
!nim_build = | $(GENODE_DIR)/<pkg-config> $(GENODE_DIR)/<stub> \
|> ^o Nimble %B^ \
PKG_CONFIG_PATH=`pwd`/$(PKG_CONFIG_DIR) \
nimble cpp $(NIM_RELEASE_FLAG) $(NIM_FLAGS) \
--cpu:$(NIM_CPU) --os:genode -d:posix \
--parallelBuild:1 --passL:-L`pwd`/$(STUB_DIR) -o:%B %f \
|> %B ./<binaries>
# Nim may invoke the C++ compiler at an arbitrary location,
# thus the relative $(PKG_CONFIG_DIR) is prepended with `pwd`

View File

@ -1,17 +1,3 @@
ifeq (@(TUP_ARCH),arm64)
CPU = arm64
endif
ifeq (@(TUP_ARCH),i386)
CPU = i386
endif
ifeq (@(TUP_ARCH),x86_64)
CPU = amd64
endif
!nim_build = |> ^o Nimble %B^ \
PKG_CONFIG_PATH=@(PKG_CONFIG_PATH) PATH=$PATH:@(TOOLCHAIN_PATH) nimble cpp $(NIM_RELEASE_FLAG) $(NIM_FLAGS) --cpu:$(CPU) --os:genode -d:posix --parallelBuild:1 -o:%B %f \
|> %B ./<binaries>
: foreach $(NIM_SRC_DIR)/*.nim |> !nim_build |> {binary}
: foreach {binary} |> !collect_bin |>
: |> !bin |>

1
nim/blobbot Submodule

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

@ -1 +1 @@
Subproject commit 7a583a4783fbb90900cd048958188a3d5e38a75a
Subproject commit aaa61aebd895e60de28936711b6231d9e555888a

@ -1 +1 @@
Subproject commit 75cf89f0abe715074b959b737e14bdb20c4ea412
Subproject commit 48b29f8d699571eb79ac73e248754e464f6b9bc7

@ -1 +1 @@
Subproject commit b435efd9befcb1cf12bc7aa5ad5a71e759c6b8f1
Subproject commit 80a63d06a41230f98a44b09c8167d14275efee7c

@ -1 +1 @@
Subproject commit 9d59f400f2a2c98be84c0598847dec9244b78cf3
Subproject commit c16dd1b093dface9bb8be00da5edbc4b790363cc

@ -1 +1 @@
Subproject commit bb47512970e1f7bdc453d5687a1239d203efb788
Subproject commit e8abc833f3522794ea691e36f561fe8bf2481af4

@ -1 +1 @@
Subproject commit 3961d2ee7000236f9a35ac878d81643e0eb29d48
Subproject commit 84c694a34b489157ce222de1b77d67f0775f9993

@ -1 +1 @@
Subproject commit cd6b947b208f5818414ed5e160076e47b3b4e620
Subproject commit e7471cebae2a404f3e4239f199f5a0c422484aac

@ -1 +1 @@
Subproject commit e100bf80fbef15aa0b741bb1f58a976054142a02
Subproject commit 1d58fcff44e4ad94a5fd5983e64989ba312f7d70

@ -1 +1 @@
Subproject commit 4388541b967a5ceefadc098988c7fa2160ef1b8b
Subproject commit a50208a35aec3031c81f5b4d6141498465ebcf90

@ -1 +1 @@
Subproject commit 7889d655acdff0fcab8c939e93f7700ff6ea0d36
Subproject commit 739918bcd740f1c3447d3fe54ff275919762c5fe

@ -1 +1 @@
Subproject commit cb4d64fa73a989898af855f3c78e314b928137d9
Subproject commit 8f71f727c13b5cafebc3cc91ccfc9709ef287248

@ -1 +1 @@
Subproject commit 40ae6930ebc57cae6b1161344d10c899c6bfa6bd
Subproject commit 066b2c3fb9c005e1f29ee9a7c1b0431882790116

0
pkg-config/.keep Normal file
View File

22
ports/default.nix Normal file
View File

@ -0,0 +1,22 @@
{ tool ? import ../tool { } }:
let
importPort = path:
let f = (import path);
in f (builtins.intersectAttrs (builtins.functionArgs f) (tool.nixpkgs // tool) );
dir = builtins.readDir ../ports;
in
builtins.listToAttrs (
builtins.filter
(x: x != null)
(map
(name:
if (builtins.getAttr name dir) != "directory" then null else
{ inherit name;
value = importPort (../ports + "/${name}");
}
)
(builtins.attrNames dir)
)
)

35
ports/mpg123/Tupfile Normal file
View File

@ -0,0 +1,35 @@
TARGET_NAME = mpg123
LIBS += libc
include_rules
SOURCE_LINK = port-source
API_LINK = port-api
: |> $(NIX_BUILD) .. --out-link port \
--attr %d.source --attr %d.api |> $(SOURCE_LINK) $(API_LINK) {port}
: $(API_LINK) |> cp %f/pkg-config/%d.pc %o \
|> $(PKG_CONFIG_DIR)/%d.pc $(GENODE_DIR)/<pkg-config>
: mpg123.symbols |> !abi_stub |>
INCLUDES += -I.
INCLUDES += -I$(SOURCE_LINK)/src/libmpg123
INCLUDES += -I$(SOURCE_LINK)/src/compat
INCLUDES += -I$(SOURCE_LINK)/src
INCLUDES += -I$(API_LINK)/include
ifeq (@(TUP_ARCH),x86_64)
DEFINES += -DOPT_X86_64
run ./port_rules.sh $(SOURCE_LINK) common.files x86_64.files
endif
ifeq (@(TUP_ARCH),arm)
DEFINES += -DOPT_ARM
run ./port_rules.sh $(SOURCE_LINK) common.files arm.files
endif
: {obj} |> !lib |> %d.lib.so {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

1
ports/mpg123/arm.files Normal file
View File

@ -0,0 +1 @@
src/libmpg123/synth_arm.S

38
ports/mpg123/common.files Normal file
View File

@ -0,0 +1,38 @@
src/compat/compat.c
src/compat/compat_str.c
src/libmpg123/parse.c
src/libmpg123/layer1.c
src/libmpg123/synth_stereo_avx.S
src/libmpg123/feature.c
src/libmpg123/lfs_alias.c
src/libmpg123/synth_s32.c
src/libmpg123/dct64_avx.S
src/libmpg123/tabinit.c
src/libmpg123/dct64_i386.c
src/libmpg123/format.c
src/libmpg123/dct64_avx_float.S
src/libmpg123/dither.c
src/libmpg123/synth.c
src/libmpg123/synth_8bit.c
src/libmpg123/layer3.c
src/libmpg123/dct64.c
src/libmpg123/synth_stereo_avx_accurate.S
src/libmpg123/mpg123.h.in
src/libmpg123/icy.c
src/libmpg123/index.c
src/libmpg123/equalizer.c
src/libmpg123/readers.c
src/libmpg123/icy2utf8.c
src/libmpg123/stringbuf.c
src/libmpg123/synth_real.c
src/libmpg123/dct36_avx.S
src/libmpg123/testcpu.c
src/libmpg123/frame.c
src/libmpg123/id3.c
src/libmpg123/Makemodule.am
src/libmpg123/ntom.c
src/libmpg123/synth_stereo_avx_float.S
src/libmpg123/libmpg123.c
src/libmpg123/synth_stereo_avx_s32.S
src/libmpg123/layer2.c
src/libmpg123/optimize.c

48
ports/mpg123/config.h Normal file
View File

@ -0,0 +1,48 @@
#define ASMALIGN_BALIGN 1
#define CCALIGN 1
#define DYNAMIC_BUILD 1
#define FRAME_INDEX 1
#define GAPLESS 1
#define HAVE_ATOLL 1
#define HAVE_DIRENT_H 1
#define HAVE_DLCLOSE 1
#define HAVE_DLFCN_H 1
#define HAVE_DLOPEN 1
#define HAVE_DLSYM 1
#define HAVE_GETPAGESIZE 1
#define HAVE_GETUID 1
#define HAVE_INTTYPES_H 1
#define HAVE_LIBM 1
#define HAVE_LIMITS_H 1
#define HAVE_MEMORY_H 1
#define HAVE_RANDOM 1
#define HAVE_STDINT_H 1
#define HAVE_STDIO_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRERROR 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_SYS_IOCTL_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_RESOURCE_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_SIGNAL_H 1
#define HAVE_SYS_SOUNDCARD_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_SYS_TIME_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_WAIT_H 1
#define HAVE_TERMIOS 1
#define HAVE_UNISTD_H 1
#define IEEE_FLOAT 1
#define INDEX_SIZE 1000
#define LFS_ALIAS_BITS 64
#define SIZEOF_INT32_T 4
#define SIZEOF_LONG 8
#define SIZEOF_OFF_T 8
#define SIZEOF_SIZE_T 8
#define SIZEOF_SSIZE_T 8
#define STDC_HEADERS 1
#define USE_MODULES 1
#define USE_NEW_HUFFTABLE 1
#define lfs_alias_t off_t

27
ports/mpg123/default.nix Normal file
View File

@ -0,0 +1,27 @@
{ preparePort, mpg123 }:
let
apiVersion = 44; # found in configure.ac
in
preparePort rec {
inherit (mpg123) name src;
outputs = [ "source" "api" ];
buildPhase =
''
mkdir -p $api/include $api/pkg-config
sed \
-e 's/@API_VERSION@/$(API_VERSION)/' \
-e '/@.*@/d' \
src/libmpg123/mpg123.h.in > $api/include/mpg123.h
cp src/libmpg123/fmt123.h $api/include
sed \
-e "s|@includedir@|$api/include|" \
-e 's/@PACKAGE_VERSION@/${(builtins.parseDrvName name).version}/' \
-e 's/^Libs:.*/Libs: -l:mpg123.lib.so/' \
-e '/@/d' \
< libmpg123.pc.in > $api/pkg-config/mpg123.pc
'';
}

115
ports/mpg123/mpg123.symbols Normal file
View File

@ -0,0 +1,115 @@
mpg123_add_string T
mpg123_add_substring T
mpg123_chomp_string T
mpg123_clip T
mpg123_close T
mpg123_copy_string T
mpg123_current_decoder T
mpg123_decode T
mpg123_decode_frame T
mpg123_decode_frame_64 T
mpg123_decoder T
mpg123_decoders T
mpg123_delete T
mpg123_delete_pars T
mpg123_enc_from_id3 T
mpg123_encodings T
mpg123_encsize T
mpg123_eq T
mpg123_errcode T
mpg123_exit T
mpg123_feature T
mpg123_feed T
mpg123_feedseek T
mpg123_feedseek_64 T
mpg123_fmt T
mpg123_fmt_all T
mpg123_fmt_none T
mpg123_fmt_support T
mpg123_format T
mpg123_format_all T
mpg123_format_none T
mpg123_format_support T
mpg123_framebyframe_decode T
mpg123_framebyframe_decode_64 T
mpg123_framebyframe_next T
mpg123_framedata T
mpg123_framelength T
mpg123_framelength_64 T
mpg123_framepos T
mpg123_framepos_64 T
mpg123_free_string T
mpg123_geteq T
mpg123_getformat T
mpg123_getformat2 T
mpg123_getpar T
mpg123_getparam T
mpg123_getstate T
mpg123_getvolume T
mpg123_grow_string T
mpg123_icy T
mpg123_icy2utf8 T
mpg123_id3 T
mpg123_index T
mpg123_index_64 T
mpg123_info T
mpg123_init T
mpg123_init_string T
mpg123_length T
mpg123_length_64 T
mpg123_meta_check T
mpg123_meta_free T
mpg123_new T
mpg123_new_pars T
mpg123_noise T
mpg123_open T
mpg123_open_64 T
mpg123_open_fd T
mpg123_open_fd_64 T
mpg123_open_feed T
mpg123_open_handle T
mpg123_open_handle_64 T
mpg123_outblock T
mpg123_par T
mpg123_param T
mpg123_parnew T
mpg123_plain_strerror T
mpg123_position T
mpg123_position_64 T
mpg123_rates T
mpg123_read T
mpg123_replace_buffer T
mpg123_replace_reader T
mpg123_replace_reader_64 T
mpg123_replace_reader_handle T
mpg123_replace_reader_handle_64 T
mpg123_reset_eq T
mpg123_resize_string T
mpg123_safe_buffer T
mpg123_scan T
mpg123_seek T
mpg123_seek_64 T
mpg123_seek_frame T
mpg123_seek_frame_64 T
mpg123_set_filesize T
mpg123_set_filesize_64 T
mpg123_set_index T
mpg123_set_index_64 T
mpg123_set_string T
mpg123_set_substring T
mpg123_spf T
mpg123_store_utf8 T
mpg123_strerror T
mpg123_strlen T
mpg123_supported_decoders T
mpg123_tell T
mpg123_tell_64 T
mpg123_tell_stream T
mpg123_tell_stream_64 T
mpg123_tellframe T
mpg123_tellframe_64 T
mpg123_timeframe T
mpg123_timeframe_64 T
mpg123_tpf T
mpg123_volume T
mpg123_volume_change T

16
ports/mpg123/port_rules.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/sh
LINK=$1
shift
for LIST in $@
do
grep '\.c$' ${LIST} | while read f
do
echo ": {port} |> !cc_port ${LINK}/${f} |> ${f}.o {obj}"
done
grep '\.S$' ${LIST} | while read f
do
echo ": {port} |> !cc_port ${LINK}/${f} |> ${f}.o {obj}"
done
done

View File

@ -0,0 +1,5 @@
src/libmpg123/getcpuflags_x86_64.S
src/libmpg123/dct64_x86_64.S
src/libmpg123/synth_stereo_x86_64.S
src/libmpg123/synth_x86_64.S
src/libmpg123/dct36_x86_64.S

2
rrd/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.rrd
*.png

31
rrd/collect.sh Executable file
View File

@ -0,0 +1,31 @@
#!/usr/bin/env bash
SQL_FILE=../.tup/db
RRD_FILE=.rrd
[ -e "$RRD_FILE" ] || rrdtool create "$RRD_FILE" \
--step 1h \
DS:node:GAUGE:2d:1000:1000000 \
DS:normal_link:GAUGE:2d:1000:1000000 \
DS:sticky_link:GAUGE:2d:1000:1000000 \
DS:group_link:GAUGE:2d:1000:1000000 \
DS:var:GAUGE:2d:1000:1000000 \
RRA:AVERAGE:0.5:1h:72h \
RRA:AVERAGE:0.5:1d:4y \
QUERY="select COUNT(*) from node; select COUNT(*) from normal_link; select COUNT(*) from sticky_link; select COUNT(*) from group_link; select COUNT(*) from var;"
LINES=`sqlite3 $SQL_FILE -readonly "$QUERY" `
RECORDS=`echo $LINES | tr ' ' ':' `
rrdtool update ${RRD_FILE} N:$RECORDS
rrdtool graph chart.png \
--start 1561669840 \
--logarithmic \
DEF:nodes="$RRD_FILE":node:AVERAGE LINE2:nodes#000000:nodes \
DEF:normal_link="$RRD_FILE":normal_link:AVERAGE LINE2:normal_link#0000FF:"normal links" \
DEF:sticky_link="$RRD_FILE":sticky_link:AVERAGE LINE2:sticky_link#0080FF:"sticky links" \
DEF:group_link="$RRD_FILE":group_link:AVERAGE LINE2:group_link#8000FF:"group links" \
DEF:var="$RRD_FILE":var:AVERAGE LINE2:var#FF0000:variables \

View File

@ -37,4 +37,4 @@ PKG_DEPENDS += \
include_rules
: runtime |> !collect_pkg_runtime |>
include $(PKG_RULES)
include &(PKG_RULES)

View File

@ -6,4 +6,4 @@ PKG_DEPENDS += \
include_rules
: runtime |> !collect_pkg_runtime |>
include $(PKG_RULES)
include &(PKG_RULES)

View File

@ -6,4 +6,4 @@ PKG_DEPENDS += \
include_rules
: runtime |> !collect_pkg_runtime |>
include $(PKG_RULES)
include &(PKG_RULES)

View File

@ -9,5 +9,5 @@ include_rules
: backdrop.png |> !collect_raw |>
: runtime |> !collect_pkg_runtime |>
include $(RAW_RULES)
include $(PKG_RULES)
include &(RAW_RULES)
include &(PKG_RULES)

View File

@ -1,4 +1,4 @@
ifndef CONFIG_NO_NETWORK
ifndef CONFIG_OFFLINE
TARGET_NAME = cave_story-en
@ -14,6 +14,6 @@ include_rules
RAW_VERSION = 2004.12
: {tar} |> !collect_raw |>
include $(RAW_RULES)
include &(RAW_RULES)
endif

View File

@ -1,9 +1,9 @@
TARGET_NAME = depot_9P
PKG_DEPENDS += \
@(PUBLIC_SRC_VFS) \
@(PUBLIC_SRC_LIBC) \
@(PUBLIC_SRC_VFS_LWIP) \
_/src/vfs \
_/src/ninep \
include_rules

View File

@ -1,11 +1,11 @@
PKG_DEPENDS += \
@(PUBLIC_SRC_INIT) \
@(PUBLIC_SRC_LIBC) \
@(PUBLIC_SRC_VFS) \
@(PUBLIC_SRC_LIBMPG123) \
@(PUBLIC_SRC_MP3_AUDIO_SINK) \
@(PUBLIC_SRC_VFS_LWIP) \
@(PUBLIC_SRC_ZLIB) \
_/src/init \
_/src/vfs \
_/src/icy_client \
: ../runtime.in |> sed 's|@STREAM_URL@|$(STREAM_URL)|' %f > %o |> runtime

View File

@ -1,4 +1,4 @@
ifndef CONFIG_NO_NETWORK
ifndef CONFIG_OFFLINE
TARGET_NAME = soyuz
@ -22,6 +22,6 @@ include_rules
: runtime |> !collect_pkg_runtime |>
: |> !pkg |>
include $(RAW_RULES)
include &(RAW_RULES)
endif

View File

@ -1,20 +0,0 @@
TARGET_NAME = show_input
include_rules
PKG_CONFIGS = vfs genode-gems genode-os genode-prg
CXXFLAGS += `$(PKG_CONFIG) -cflags $(PKG_CONFIGS)`
LDFLAGS += `$(PKG_CONFIG) -libs $(PKG_CONFIGS)`
: foreach *.cc |> !cxx |> %B.o {objs}
: {objs} |> !ld |> %d {binary}
: {binary} |> !collect_bin |>
include $(BIN_RULES)
PKG_DEPENDS += \
@(PUBLIC_SRC_VFS) \
_/src/$(BIN_NAME) \
: runtime |> !collect_pkg_runtime |>
include $(PKG_RULES)

View File

@ -1,4 +1,4 @@
ifndef SKIP_INCOMPATIBLE
ifdef BUILD_BROKEN
TARGET_NAME = fs_block
include_rules
@ -12,6 +12,6 @@ CXXFLAGS += `$(PKG_CONFIG) --cflags $(PKGS)`
$(LD) `$(PKG_CONFIG) --libs $(PKGS)` %f -o %o |> %d {binary}
: {binary} |> !collect_bin |>
include $(BIN_RULES)
include &(BIN_RULES)
endif

View File

@ -0,0 +1,12 @@
TARGET_NAME = mp3_audio_sink
LIBS += mpg123 libc libm genode-gems
include_rules
INCLUDES += -I../cached_fs_rom
: foreach *.cc |> !cxx |> %B.o {obj}
: {obj} | |> !prg |> {bin}
: {bin} |> !collect_bin |>
include &(BIN_RULES)

View File

@ -0,0 +1,317 @@
/*
* \brief MP3 audio decoder
* \author Emery Hemingway
* \date 2018-03-24
*/
/*
* Copyright (C) 2018 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.
*/
/*
* TODO:
* - Metadata report
* - Optimize buffer sizes
*/
/* Genode includes */
#include <gems/magic_ring_buffer.h>
#include <os/static_root.h>
#include <libc/component.h>
#include <audio/source.h>
#include <terminal_session/connection.h>
#include <base/attached_rom_dataspace.h>
#include <base/attached_ram_dataspace.h>
#include <base/sleep.h>
/* Mpg123 includes */
#include <stdlib.h>
#include <sys/types.h>
#include <mpg123.h>
namespace Mp3_audio_sink {
enum { LEFT, RIGHT, NUM_CHANNELS };
enum {
FEED_POOL_SIZE = 2,
CLIENT_BUFFER_SIZE = 1 << 14, /* 16 KiB */
};
enum {
AUDIO_OUT_BUFFER_SIZE = NUM_CHANNELS
* Audio_out::QUEUE_SIZE
* Audio_out::PERIOD
* Audio_out::SAMPLE_SIZE
};
using namespace Genode;
struct Decoder;
class Terminal_component;
struct Main;
}
struct Mp3_audio_sink::Decoder : Audio::Source
{
template <typename FUNC>
static void for_each_channel(FUNC const &func) {
for (int i = 0; i < NUM_CHANNELS; ++i) func(i); }
Genode::Env &_env;
Attached_rom_dataspace _config_rom { _env, "config" };
Audio::Stereo_out _stereo_out { _env, *this };
void die_mpg123(mpg123_handle *mh, char const *msg)
{
int code = mpg123_errcode(mh);
Genode::error(msg, ", ", mpg123_strerror(mh));
mpg123_close(mh);
mpg123_delete(mh);
mpg123_exit();
_env.parent().exit(code);
Genode::sleep_forever();
}
mpg123_handle *create_mpg123_handle()
{
mpg123_handle *mh = NULL;
int err = mpg123_init();
if(err != MPG123_OK || (mh = mpg123_new(NULL, &err)) == NULL)
Genode::error("Mpg123 setup failed, ", mpg123_plain_strerror(err));
mpg123_param(mh, MPG123_FEEDPOOL, FEED_POOL_SIZE, 0);
mpg123_param(mh, MPG123_FEEDBUFFER, CLIENT_BUFFER_SIZE, 0);
/* Set mpg123 output format to match Audio_out exactly */
mpg123_param(mh, MPG123_FORCE_RATE,
Audio_out::SAMPLE_RATE, Audio_out::SAMPLE_RATE);
mpg123_format_none(mh);
if (mpg123_format(mh, Audio_out::SAMPLE_RATE,
MPG123_STEREO, MPG123_ENC_FLOAT_32) != MPG123_OK)
die_mpg123(mh, "Audio_out format is unsupported");
if (mpg123_open_feed(mh) != MPG123_OK)
die_mpg123(mh, "mpg123 feeder mode failed");
return mh;
}
mpg123_handle *_mh = create_mpg123_handle();
/* last error code logged */
int _mh_err = MPG123_OK;
/**
* Use half of the available RAM as buffer
*/
size_t _pcm_buffer_size()
{
size_t n = _env.pd().avail_ram().value / 2;
if (n > (1<<20))
log("internal buffer size is ", n>>20, "MiB");
else if (n > (1<<10))
log("internal buffer size is ", n>>10, "KiB");
else
log("internal buffer size is ", n, " bytes");
return n;
}
Magic_ring_buffer<float> _pcm { _env, _pcm_buffer_size() };
void _log_error()
{
int code = mpg123_errcode(_mh);
if (code != MPG123_OK && _mh_err != code) {
_mh_err = code;
error(mpg123_plain_strerror(code));
}
}
Genode::size_t feedbuffer_size()
{
long value = 0;
double fvalue = 0;
if (mpg123_getparam(_mh, MPG123_FEEDBUFFER, &value, &fvalue))
die_mpg123(_mh, "failed to get feed buffer size");
return value;
}
bool fill(float *left, float *right, Genode::size_t samples) override;
/**
* Process client data, blocks until all data is consumed.
*/
void process(unsigned char const *src, size_t num_bytes)
{
/* TODO: patch mpgg123 not to use stdio for printing errors */
Libc::with_libc([&] () {
/* feed client data into mpg123 buffer */
if (mpg123_feed(_mh, src, num_bytes))
die_mpg123(_mh, "failed to feed");
::off_t num = 0;
unsigned char *audio = nullptr;
size_t bytes = 0;
while (mpg123_decode_frame(_mh, &num, &audio, &bytes) == MPG123_OK) {
Genode::size_t const samples = bytes / Audio_out::SAMPLE_SIZE;
while (_pcm.write_avail() < samples) {
/* submit audio blocks for packet allocation */
_env.ep().wait_and_dispatch_one_io_signal();
}
Genode::memcpy(_pcm.write_addr(), audio, bytes);
_pcm.fill(samples);
}
if (mpg123_errcode(_mh) != MPG123_ERR_READER
|| mpg123_errcode(_mh) != MPG123_OK)
_log_error();
});
}
Signal_handler<Decoder> _config_handler {
_env.ep(), *this, &Decoder::_handle_config };
void _handle_config()
{
_config_rom.update();
Xml_node const config = _config_rom.xml();
enum { EQ_COUNT = 32 };
mpg123_reset_eq(_mh);
config.for_each_sub_node("eq", [&] (Xml_node const &node) {
unsigned band = node.attribute_value("band", 32U);
double value = node.attribute_value("value", 0.0);
if (band < EQ_COUNT && value != 0.0) {
mpg123_eq(_mh, MPG123_LR , band, value);
log("EQ ", band, ": ", mpg123_geteq(_mh, MPG123_LR , band));
}
});
double volume = 0.5;
config.for_each_sub_node("volume", [&] (Xml_node const &node) {
volume = node.attribute_value("linear", volume); });
mpg123_volume(_mh, 0.5);
}
Decoder(Genode::Env &env) : _env(env)
{
_config_rom.sigh(_config_handler);
_handle_config();
}
};
bool Mp3_audio_sink::Decoder::fill(float *left,
float *right,
Genode::size_t samples)
{
using namespace Audio_out;
if (_pcm.read_avail() < samples*2) return false;
float const *buf = _pcm.read_addr();
for (unsigned i = 0; i < samples; ++i) {
left[i] = buf[(i<<1)|0];
right[i] = buf[(i<<1)|1];
}
_pcm.drain(samples*2);
return true;
}
class Mp3_audio_sink::Terminal_component :
public Rpc_object<Terminal::Session, Terminal_component>
{
private:
Decoder &_decoder;
Genode::Attached_ram_dataspace _io_buffer;
public:
Terminal_component(Genode::Env &env, Decoder &decoder)
:
_decoder(decoder),
_io_buffer(env.pd(), env.rm(), _decoder.feedbuffer_size())
{ }
/********************************
** Terminal session interface **
********************************/
Genode::Dataspace_capability _dataspace() {
return _io_buffer.cap(); }
Size size() { return Size(0, 0); }
bool avail() { return false; }
Genode::size_t read(void *, Genode::size_t) { return 0; }
Genode::size_t _read(Genode::size_t dst_len) { return 0; }
Genode::size_t write(void const *, Genode::size_t) { return 0; }
Genode::size_t _write(Genode::size_t num_bytes)
{
/* sanitize argument */
num_bytes = Genode::min(num_bytes, _io_buffer.size());
/* copy to decoder */
_decoder.process(
_io_buffer.local_addr<unsigned char>(), num_bytes);
return num_bytes;
}
void connected_sigh(Genode::Signal_context_capability cap) {
Genode::Signal_transmitter(cap).submit(); }
void read_avail_sigh(Genode::Signal_context_capability) { }
void size_changed_sigh(Genode::Signal_context_capability) { }
};
struct Mp3_audio_sink::Main
{
Genode::Env &_env;
Decoder _decoder { _env };
Terminal_component _terminal { _env, _decoder };
Static_root<Terminal::Session> _terminal_root {
_env.ep().manage(_terminal) };
Main(Libc::Env &env) : _env(env)
{
env.parent().announce(env.ep().manage(_terminal_root));
}
};
/***************
** Component **
***************/
void Libc::Component::construct(Libc::Env &env) {
static Mp3_audio_sink::Main _main(env); }

13
src/nic_bus/Tupfile Normal file
View File

@ -0,0 +1,13 @@
TARGET_NAME = nic_bus
LIBS += genode-os genode-prg
PKG_DEPENDS += _/src/$(TARGET_NAME)
include_rules
: foreach *.cc |> !cxx |> %B.o {objs}
: {objs} |> !prg |> %d {binary}
: {binary} |> !collect_bin |>
: runtime |> !collect_pkg_runtime |>
include &(BIN_RULES)
include &(PKG_RULES)

View File

@ -1,17 +0,0 @@
TARGET_NAME = nic_bus
include_rules
PKGS = genode-os genode-prg
CXXFLAGS += `$(PKG_CONFIG) --cflags $(PKGS)`
: foreach *.cc |> !cxx |> %B.o {objs}
: {objs} |> ^o LD %o^ \
$(LD) `$(PKG_CONFIG) --libs $(PKGS)` %f -o %o |> %d {binary}
: {binary} |> !collect_bin |>
include $(BIN_RULES)
PKG_DEPENDS += _/src/$(TARGET_NAME)
: runtime |> !collect_pkg_runtime |>

20
src/show_input/Tupfile Normal file
View File

@ -0,0 +1,20 @@
TARGET_NAME = show_input
include_rules
LIBS = vfs genode-gems genode-os genode-base genode-prg
CXXFLAGS += `$(PKG_CONFIG) --cflags $(PKG_CONFIGS)`
LDFLAGS += `$(PKG_CONFIG) --libs $(PKG_CONFIGS)`
: foreach *.cc |> !cxx |> %B.o {objs}
: {objs} |> !prg |> %d {binary}
: {binary} |> !collect_bin |>
include &(BIN_RULES)
PKG_DEPENDS += \
_/src/vfs \
_/src/$(BIN_NAME) \
: runtime |> !collect_pkg_runtime |>
include &(PKG_RULES)

0
stub/.keep Normal file
View File

62
tests/iso/Tupfile Normal file
View File

@ -0,0 +1,62 @@
include_rules
export SYSLINUX
BOOT_MODULES = \
config \
$(GENODE_DIR)/repos/os/src/init/init \
$(GENODE_DIR)/repos/base/src/test/log/test-log \
ifeq (@(TUP_ARCH),i386)
ADDR_TYPE = .long
endif
ifeq (@(TUP_ARCH),x86_64)
ADDR_TYPE = .quad
endif
AWK_IT = awk -v RS=" " -v ADDR_TYPE="$(ADDR_TYPE)"
: $(BOOT_MODULES) \
|> \
echo -n %f | $(AWK_IT) -f a.awk >> %o; \
echo -n %f | $(AWK_IT) -f b.awk >> %o; \
echo -n %f | $(AWK_IT) -f c.awk >> %o; \
|> modules.s
: modules.s | $(BOOT_MODULES) |> $(CC) $(CC_MARCH) -c %f -o %o |> boot_modules.o
LINK_ADDRESS = 0x01000000
: boot_modules.o | $(GENODE_DIR)/repos/base-nova/<core> \
|> \
$(CXX) $(CC_MARCH) -nostdlib \
-Wl,-T -Wl,$(GENODE_DIR)/repos/base/src/ld/genode.ld \
-Wl,-z -Wl,max-page-size=0x1000 \
-Wl,-Ttext=$(LINK_ADDRESS) -Wl,-gc-sections \
-Wl,-nostdlib \
-Wl,--whole-archive -Wl,--start-group \
%<core> %f \
-Wl,--no-whole-archive \
-Wl,--end-group \
`$(CXX) $(CC_MARCH) -print-libgcc-file-name` \
-o %o; \
strip %o; \
|> image.elf
: $(GENODE_DIR)/repos/base-nova/src/NOVA/build/hypervisor-x86_64 image.elf |> \
mkdir -p tmp/syslinux; \
cp \
$SYSLINUX/share/syslinux/isolinux.bin \
$SYSLINUX/share/syslinux/ldlinux.c32 \
$SYSLINUX/share/syslinux/libcom32.c32 \
$SYSLINUX/share/syslinux/mboot.c32 \
isolinux.cfg \
tmp/syslinux; \
cp %f tmp; \
chmod -R 777 tmp; \
mkisofs -o %o \
-b syslinux/isolinux.bin -c syslinux/boot.cat \
-no-emul-boot -boot-load-size 4 -boot-info-table \
-iso-level 2 \
tmp; \
rm -r tmp; \
|> output.iso

25
tests/iso/a.awk Normal file
View File

@ -0,0 +1,25 @@
#!/usr/bin/env -S awk -f
BEGIN {
print ".set MIN_PAGE_SIZE_LOG2, 12";
print ".set DATA_ACCESS_ALIGNM_LOG2, 3";
print "";
print ".section .data";
print "";
print ".p2align DATA_ACCESS_ALIGNM_LOG2";
print ".global _boot_modules_headers_begin";
print "_boot_modules_headers_begin:";
print "";
}
{
print ADDR_TYPE" _boot_module_"NR"_name";
print ADDR_TYPE" _boot_module_"NR"_begin";
print ADDR_TYPE" _boot_module_"NR"_end - _boot_module_"NR"_begin";
print "";
}
END {
print ".global _boot_modules_headers_end";
print "_boot_modules_headers_end:";
print "";
}

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