mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-09 12:41:19 +00:00
Replace libc_pipe plugin by VFS pipe plugin
This commit is contained in:
parent
9b6cc75f1c
commit
de7d4a5523
@ -66,8 +66,9 @@ set config {
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
<dir name="socket"> <lwip dhcp="yes"/> </dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" socket="/socket"/>
|
||||
<libc stdout="/dev/log" socket="/socket" pipe="/pipe"/>
|
||||
</config>
|
||||
<route>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
@ -93,7 +94,7 @@ install_config $config
|
||||
# generic modules
|
||||
set boot_modules {
|
||||
core ld.lib.so init timer usb_drv
|
||||
libc.lib.so vfs.lib.so libc_pipe.lib.so lwip_legacy.lib.so
|
||||
libc.lib.so vfs.lib.so lwip_legacy.lib.so
|
||||
tcp_terminal
|
||||
test-terminal_echo
|
||||
vfs_lwip.lib.so
|
||||
|
@ -44,14 +44,14 @@ append config {
|
||||
<provides> <service name="Terminal"/> </provides>
|
||||
<config ld_verbose="yes">
|
||||
<policy label="test-terminal_echo" port="8888"/>
|
||||
<libc stdout="/dev/log" socket="/socket"/>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
<dir name="socket">
|
||||
<lxip ip_addr="10.0.2.55" netmask="255.255.255.0" gateway="10.0.2.1"/>
|
||||
</dir>
|
||||
</vfs>
|
||||
</libc>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
<dir name="socket">
|
||||
<lxip ip_addr="10.0.2.55" netmask="255.255.255.0" gateway="10.0.2.1"/>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" socket="/socket" pipe="/pipe"/>
|
||||
</config>
|
||||
</start>
|
||||
-->
|
||||
@ -65,7 +65,7 @@ append config {
|
||||
<lxip ip_addr="10.0.2.55" netmask="255.255.255.0" gateway="10.0.2.1" nameserver="8.8.8.8"/>
|
||||
</dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"/>
|
||||
</config>
|
||||
</start>
|
||||
<!--
|
||||
@ -80,7 +80,7 @@ install_config $config
|
||||
|
||||
append boot_modules {
|
||||
core init timer linux_nic_drv
|
||||
ld.lib.so libc.lib.so vfs.lib.so libc_pipe.lib.so posix.lib.so
|
||||
ld.lib.so libc.lib.so vfs.lib.so posix.lib.so
|
||||
libm.lib.so
|
||||
vfs_lxip.lib.so lxip.lib.so
|
||||
tcp_terminal
|
||||
|
@ -1,10 +1,6 @@
|
||||
SRC_DIR := src/server/ssh_terminal
|
||||
include $(GENODE_DIR)/repos/base/recipes/src/content.inc
|
||||
|
||||
MIRROR_FROM_LIBPORTS := lib/mk/libc_pipe.mk \
|
||||
src/lib/libc_pipe \
|
||||
include/libc-plugin
|
||||
|
||||
content: $(MIRROR_FROM_LIBPORTS)
|
||||
|
||||
$(MIRROR_FROM_LIBPORTS):
|
||||
|
@ -61,14 +61,14 @@ append config {
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Gui"> <child name="wm"/> </service>
|
||||
|
@ -39,6 +39,7 @@ import_from_depot [depot_user]/src/[base_src] \
|
||||
[depot_user]/src/vfs \
|
||||
[depot_user]/src/vfs_jitterentropy \
|
||||
[depot_user]/src/vfs_lxip \
|
||||
[depot_user]/src/vfs_pipe \
|
||||
[depot_user]/src/vim-minimal \
|
||||
[depot_user]/src/zlib
|
||||
|
||||
@ -109,7 +110,7 @@ set config {
|
||||
<policy label_prefix="dynamic" user="noux" password="xuon" multi_login="yes" request_terminal="yes"/>
|
||||
<policy label_prefix="always-running-noux" user="charlie" password="xuon"/>
|
||||
|
||||
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
@ -124,6 +125,7 @@ set config {
|
||||
</dir>
|
||||
</dir>
|
||||
<dir name="socket"> <lxip dhcp="yes"/> </dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
</config>
|
||||
<route>
|
||||
|
@ -21,6 +21,7 @@ set build_components {
|
||||
server/vfs
|
||||
lib/vfs/jitterentropy
|
||||
lib/vfs/lxip
|
||||
lib/vfs/pipe
|
||||
test/libports/ncurses
|
||||
test/terminal_echo
|
||||
noux-pkg/bash
|
||||
@ -93,8 +94,9 @@ set config {
|
||||
</dir>
|
||||
</dir>
|
||||
<dir name="socket"> <lxip dhcp="yes"/> </dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket" rtc="/dev/rtc">
|
||||
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket" pipe="/pipe" rtc="/dev/rtc">
|
||||
</libc>
|
||||
</config>
|
||||
<route>
|
||||
@ -172,9 +174,9 @@ set boot_modules {
|
||||
test-terminal_echo
|
||||
|
||||
libc.lib.so libm.lib.so vfs.lib.so
|
||||
vfs_lxip.lib.so lxip.lib.so libc_pipe.lib.so
|
||||
vfs_lxip.lib.so lxip.lib.so
|
||||
posix.lib.so libcrypto.lib.so libssh.lib.so zlib.lib.so ncurses.lib.so
|
||||
vfs_jitterentropy.lib.so ssh_terminal
|
||||
vfs_jitterentropy.lib.so vfs_pipe.lib.so ssh_terminal
|
||||
|
||||
bash.tar ed25519_key
|
||||
}
|
||||
|
@ -18,7 +18,8 @@ import_from_depot [depot_user]/src/[base_src] \
|
||||
[depot_user]/src/init \
|
||||
[depot_user]/src/libc \
|
||||
[depot_user]/src/vfs \
|
||||
[depot_user]/src/vfs_lwip
|
||||
[depot_user]/src/vfs_lwip \
|
||||
[depot_user]/src/vfs_pipe
|
||||
|
||||
build { server/tcp_terminal test/terminal_echo }
|
||||
|
||||
@ -60,8 +61,9 @@ install_config {
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
<dir name="socket"> <lwip dhcp="yes"/> </dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" socket="/socket"/>
|
||||
<libc stdout="/dev/log" socket="/socket" pipe="/pipe"/>
|
||||
</config>
|
||||
</start>
|
||||
<start name="test-terminal_echo">
|
||||
@ -70,7 +72,7 @@ install_config {
|
||||
</config>
|
||||
}
|
||||
|
||||
build_boot_image { tcp_terminal test-terminal_echo libc_pipe.lib.so }
|
||||
build_boot_image { tcp_terminal test-terminal_echo }
|
||||
|
||||
|
||||
# qemu config
|
||||
|
@ -109,13 +109,13 @@ append config {
|
||||
<start name="test-tiled_wm-panel" caps="250">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<config>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="fs"> <ram/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
@ -135,13 +135,13 @@ append config {
|
||||
<start name="test-tiled_wm-overlay" caps="250">
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<config>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="fs"> <ram/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
@ -158,13 +158,13 @@ append config {
|
||||
<binary name="test-tiled_wm-app"/>
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<config name="app1">
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="fs"> <ram/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
@ -181,13 +181,13 @@ append config {
|
||||
<binary name="test-tiled_wm-app"/>
|
||||
<resource name="RAM" quantum="32M"/>
|
||||
<config name="app2">
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="fs"> <ram/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
@ -203,13 +203,13 @@ append config {
|
||||
<start name="textedit" caps="250">
|
||||
<resource name="RAM" quantum="70M"/>
|
||||
<config>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="fs"> <ram/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
|
@ -3,6 +3,6 @@ SRC_CC = main.cc
|
||||
SRC_CC += server.cc
|
||||
SRC_CC += ssh_callbacks.cc
|
||||
SRC_CC += util.cc
|
||||
LIBS = base libc libssh libc_pipe
|
||||
LIBS = base libc libssh
|
||||
|
||||
CC_CXX_WARN_STRICT =
|
||||
|
@ -1,5 +1,5 @@
|
||||
TARGET = tcp_terminal
|
||||
SRC_CC = main.cc
|
||||
LIBS = libc libc_pipe
|
||||
LIBS = libc
|
||||
|
||||
CC_CXX_WARN_STRICT =
|
||||
|
@ -1,8 +0,0 @@
|
||||
SRC_CC = plugin.cc
|
||||
LIBS += libc
|
||||
|
||||
vpath %.cc $(REP_DIR)/src/lib/libc_pipe
|
||||
|
||||
SHARED_LIB = yes
|
||||
|
||||
CC_CXX_WARN_STRICT =
|
@ -1,5 +1,5 @@
|
||||
LIBUSB_DIR := $(call select_from_ports,libusb)/src/lib/libusb
|
||||
LIBS += libc libc_pipe
|
||||
LIBS += libc
|
||||
|
||||
# find 'config.h'
|
||||
INC_DIR += $(REP_DIR)/src/lib/libusb
|
||||
|
@ -1 +1 @@
|
||||
Test for using the libc_pipe plugin.
|
||||
Test for using the libc with the VFS pipe plugin.
|
||||
|
@ -48,11 +48,11 @@
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe"/>
|
||||
</config>
|
||||
</start>
|
||||
<start name="libc_pipe_remote">
|
||||
@ -60,11 +60,11 @@
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <fs/> </dir>
|
||||
<log/>
|
||||
</dir>
|
||||
<dir name="pipe"> <fs/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
|
@ -1,13 +1,13 @@
|
||||
<config clipboard="yes">
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="edit"> <fs label="rw"/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
</config>
|
||||
|
@ -21,7 +21,7 @@ include/libc-plugin include/libc/sys/ucontext.h:
|
||||
|
||||
lib/mk:
|
||||
mkdir -p $@
|
||||
cp $(addprefix $(REP_DIR)/$@/,libc_* libc.mk libc-* libm.inc) $@
|
||||
cp $(addprefix $(REP_DIR)/$@/,libc.mk libc-* libm.inc) $@
|
||||
for spec in x86_32 x86_64 arm arm_64; do \
|
||||
mkdir -p $@/spec/$$spec; \
|
||||
cp $(addprefix $(REP_DIR)/$@/spec/$$spec/,libc-* libc.mk libm.mk) $@/spec/$$spec/; done
|
||||
|
@ -1,6 +1,7 @@
|
||||
set build_components {
|
||||
core init timer server/terminal_crosslink
|
||||
test/libc_select test/libc_counter
|
||||
lib/vfs/pipe
|
||||
}
|
||||
|
||||
build $build_components
|
||||
@ -56,8 +57,9 @@ set config {
|
||||
<dir name="dev">
|
||||
<log/> <null/> <zero/> <terminal/>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<libc stdin="/dev/null" stdout="/dev/log" stderr="/dev/log"/>
|
||||
<libc stdin="/dev/null" stdout="/dev/log" stderr="/dev/log" pipe="/pipe"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
@ -69,7 +71,7 @@ set boot_modules {
|
||||
core init timer terminal_crosslink
|
||||
test-libc_counter-source test-libc_select
|
||||
ld.lib.so libc.lib.so vfs.lib.so libm.lib.so stdcxx.lib.so
|
||||
libc_pipe.lib.so posix.lib.so
|
||||
vfs_pipe.lib.so posix.lib.so
|
||||
}
|
||||
|
||||
build_boot_image $boot_modules
|
||||
|
@ -1,6 +1,7 @@
|
||||
set build_components {
|
||||
core init timer server/terminal_crosslink server/vfs
|
||||
test/libc_select test/libc_counter
|
||||
lib/vfs/pipe
|
||||
}
|
||||
|
||||
build $build_components
|
||||
@ -38,6 +39,7 @@ set config {
|
||||
<config>
|
||||
<vfs>
|
||||
<terminal/>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<default-policy root="/" writeable="yes"/>
|
||||
</config>
|
||||
@ -66,7 +68,7 @@ set config {
|
||||
<dir name="dev"> <log/> <null/> <zero/> </dir>
|
||||
<dir name="vfs"> <fs/> </dir>
|
||||
</vfs>
|
||||
<libc stdin="/dev/null" stdout="/dev/log" stderr="/dev/log"/>
|
||||
<libc stdin="/dev/null" stdout="/dev/log" stderr="/dev/log" pipe="/vfs/pipe"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
@ -78,7 +80,7 @@ set boot_modules {
|
||||
core init timer terminal_crosslink vfs
|
||||
test-libc_counter-source test-libc_select
|
||||
ld.lib.so libc.lib.so vfs.lib.so libm.lib.so stdcxx.lib.so
|
||||
libc_pipe.lib.so posix.lib.so
|
||||
vfs_pipe.lib.so posix.lib.so
|
||||
}
|
||||
|
||||
build_boot_image $boot_modules
|
||||
|
@ -26,25 +26,25 @@ append config {
|
||||
<start name="qt_launchpad" caps="600">
|
||||
<resource name="RAM" quantum="80M"/>
|
||||
<config>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
</vfs>
|
||||
<launcher name="calculatorform" ram_quota="30M" caps="200">
|
||||
<config>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
</vfs>
|
||||
@ -52,13 +52,13 @@ append config {
|
||||
</launcher>
|
||||
<launcher name="tetrix" ram_quota="40M" caps="200">
|
||||
<config>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
</vfs>
|
||||
|
@ -26,14 +26,14 @@ append config {
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Gui"> <child name="wm"/> </service>
|
||||
|
@ -34,14 +34,14 @@ append config {
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
|
@ -57,10 +57,10 @@ append config {
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="qt">
|
||||
<dir name="plugins">
|
||||
<dir name="qpluginwidget">
|
||||
@ -71,7 +71,7 @@ append config {
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Gui"> <child name="wm"/> </service>
|
||||
|
@ -27,15 +27,15 @@ append config {
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<tar name="qt5_declarative_qml.tar"/>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Gui"> <child name="wm"/> </service>
|
||||
|
@ -28,17 +28,17 @@ append config {
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<tar name="qt5_declarative_qml.tar"/>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqjpeg.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
<tar name="qt5_samegame.tar"/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Gui"> <child name="wm"/> </service>
|
||||
|
@ -26,14 +26,14 @@ append config {
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Gui"> <child name="wm"/> </service>
|
||||
|
@ -26,14 +26,14 @@ append config {
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Gui"> <child name="wm"/> </service>
|
||||
|
@ -40,13 +40,13 @@ append config {
|
||||
<start name="textedit" caps="300">
|
||||
<resource name="RAM" quantum="70M"/>
|
||||
<config>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="fs"> <fs/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
@ -63,13 +63,13 @@ append config {
|
||||
<binary name="textedit" />
|
||||
<resource name="RAM" quantum="70M"/>
|
||||
<config>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="fs"> <fs/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
|
@ -30,10 +30,10 @@ append config {
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<log/>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<tar name="qt5_dejavusans.tar"/>
|
||||
<tar name="qt5_declarative_qml.tar"/>
|
||||
<tar name="qt5_libqgenode.tar"/>
|
||||
@ -42,7 +42,7 @@ append config {
|
||||
<tar name="qt5_quickcontrols2_qml.tar"/>
|
||||
<tar name="qt5_virtualkeyboard_qml.tar"/>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/dev/pipe" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Gui"> <child name="wm"/> </service>
|
||||
|
@ -26,6 +26,7 @@ set build_components {
|
||||
core init timer
|
||||
drivers/usb
|
||||
test/smartcard
|
||||
lib/vfs/pipe
|
||||
}
|
||||
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
@ -92,13 +93,14 @@ append config {
|
||||
<config>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> <inline name="rtc">2018-01-01 00:01</inline> </dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="ifd-ccid.bundle">
|
||||
<dir name="Contents">
|
||||
<rom name="Info.plist"/>
|
||||
</dir>
|
||||
</dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" pipe="/pipe"/>
|
||||
<env key="LIBUSB_DEBUG" value="1"/> <!-- log libusb errors -->
|
||||
</config>
|
||||
</start>
|
||||
@ -114,8 +116,8 @@ install_config $config
|
||||
set boot_modules {
|
||||
core init timer usb_drv test-smartcard
|
||||
ld.lib.so pcsc-lite.lib.so ccid.lib.so libusb.lib.so
|
||||
libc.lib.so vfs.lib.so libm.lib.so libc_pipe.lib.so posix.lib.so
|
||||
Info.plist
|
||||
libc.lib.so vfs.lib.so libm.lib.so posix.lib.so
|
||||
Info.plist vfs_pipe.lib.so
|
||||
}
|
||||
|
||||
append_platform_drv_boot_modules
|
||||
|
@ -1,476 +0,0 @@
|
||||
/*
|
||||
* \brief Pipe plugin implementation
|
||||
* \author Christian Prochaska
|
||||
* \date 2014-07-11
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2014-2017 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.
|
||||
*/
|
||||
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/env.h>
|
||||
#include <base/heap.h>
|
||||
#include <base/log.h>
|
||||
#include <os/ring_buffer.h>
|
||||
#include <util/misc_math.h>
|
||||
|
||||
/* libc includes */
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/* libc plugin interface */
|
||||
#include <libc-plugin/fd_alloc.h>
|
||||
#include <libc-plugin/plugin_registry.h>
|
||||
#include <libc-plugin/plugin.h>
|
||||
|
||||
|
||||
/* function to notify libc about a socket event */
|
||||
extern void (*libc_select_notify)();
|
||||
|
||||
|
||||
namespace Libc_pipe {
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
enum Type { READ_END, WRITE_END };
|
||||
enum { PIPE_BUF_SIZE = 4096 };
|
||||
|
||||
typedef Ring_buffer<unsigned char, PIPE_BUF_SIZE+1> Pipe_buffer;
|
||||
|
||||
class Plugin_context : public Libc::Plugin_context
|
||||
{
|
||||
private:
|
||||
|
||||
Type _type;
|
||||
|
||||
Libc::File_descriptor *_partner;
|
||||
|
||||
Genode::Allocator &_alloc;
|
||||
|
||||
Pipe_buffer *_buffer;
|
||||
|
||||
Genode::Semaphore *_write_avail_sem;
|
||||
|
||||
bool _nonblock = false;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* \param type information if the file descriptor belongs to the
|
||||
* read end or to the write end of the pipe
|
||||
*
|
||||
* \param partner the other pipe end
|
||||
*/
|
||||
Plugin_context(Type type, Libc::File_descriptor *partner,
|
||||
Genode::Allocator &alloc);
|
||||
|
||||
~Plugin_context();
|
||||
|
||||
Type type() const { return _type; }
|
||||
Pipe_buffer *buffer() const { return _buffer; }
|
||||
Libc::File_descriptor *partner() const { return _partner; }
|
||||
Genode::Semaphore *write_avail_sem() const { return _write_avail_sem; }
|
||||
bool nonblock() const { return _nonblock; }
|
||||
|
||||
void set_partner(Libc::File_descriptor *partner) { _partner = partner; }
|
||||
void set_nonblock(bool nonblock) { _nonblock = nonblock; }
|
||||
};
|
||||
|
||||
|
||||
class Plugin : public Libc::Plugin
|
||||
{
|
||||
private:
|
||||
|
||||
Genode::Constructible<Genode::Heap> _heap;
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
Plugin();
|
||||
|
||||
void init(Genode::Env &env) override;
|
||||
|
||||
bool supports_pipe() override;
|
||||
bool supports_poll() override;
|
||||
bool supports_select(int nfds,
|
||||
fd_set *readfds,
|
||||
fd_set *writefds,
|
||||
fd_set *exceptfds,
|
||||
struct timeval *timeout) override;
|
||||
|
||||
int close(Libc::File_descriptor *pipefdo) override;
|
||||
int fcntl(Libc::File_descriptor *pipefdo, int cmd, long arg) override;
|
||||
int pipe(Libc::File_descriptor *pipefdo[2]) override;
|
||||
bool poll(Libc::File_descriptor &, struct pollfd &) override;
|
||||
ssize_t read(Libc::File_descriptor *pipefdo, void *buf,
|
||||
::size_t count) override;
|
||||
int select(int nfds, fd_set *readfds, fd_set *writefds,
|
||||
fd_set *exceptfds, struct timeval *timeout) override;
|
||||
ssize_t write(Libc::File_descriptor *pipefdo, const void *buf,
|
||||
::size_t count) override;
|
||||
};
|
||||
|
||||
|
||||
/***************
|
||||
** Utilities **
|
||||
***************/
|
||||
|
||||
Plugin_context *context(Libc::File_descriptor *fd)
|
||||
{
|
||||
return static_cast<Plugin_context *>(fd->context);
|
||||
}
|
||||
|
||||
|
||||
static inline bool read_end(Libc::File_descriptor *fdo)
|
||||
{
|
||||
return (context(fdo)->type() == READ_END);
|
||||
}
|
||||
|
||||
|
||||
static inline bool write_end(Libc::File_descriptor *fdo)
|
||||
{
|
||||
return (context(fdo)->type() == WRITE_END);
|
||||
}
|
||||
|
||||
|
||||
/********************
|
||||
** Plugin_context **
|
||||
********************/
|
||||
|
||||
Plugin_context::Plugin_context(Type type, Libc::File_descriptor *partner,
|
||||
Genode::Allocator &alloc)
|
||||
: _type(type), _partner(partner), _alloc(alloc)
|
||||
{
|
||||
if (!_partner) {
|
||||
|
||||
/* allocate shared resources */
|
||||
|
||||
_buffer = new (_alloc) Pipe_buffer;
|
||||
_write_avail_sem = new (_alloc) Genode::Semaphore(PIPE_BUF_SIZE);
|
||||
|
||||
} else {
|
||||
|
||||
/* get shared resource pointers from partner */
|
||||
|
||||
_buffer = context(_partner)->buffer();
|
||||
_write_avail_sem = context(_partner)->write_avail_sem();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Plugin_context::~Plugin_context()
|
||||
{
|
||||
if (_partner) {
|
||||
|
||||
/* remove the fd this context belongs to from the partner's context */
|
||||
context(_partner)->set_partner(0);
|
||||
|
||||
} else {
|
||||
|
||||
/* partner fd is already destroyed -> free shared resources */
|
||||
destroy(_alloc, _buffer);
|
||||
destroy(_alloc, _write_avail_sem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************
|
||||
** Plugin **
|
||||
************/
|
||||
|
||||
Plugin::Plugin()
|
||||
{
|
||||
Genode::log("using the pipe libc plugin");
|
||||
}
|
||||
|
||||
|
||||
void Plugin::init(Genode::Env &env)
|
||||
{
|
||||
_heap.construct(env.ram(), env.rm());
|
||||
}
|
||||
|
||||
|
||||
bool Plugin::supports_pipe()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Plugin::supports_poll()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool Plugin::supports_select(int nfds,
|
||||
fd_set *readfds,
|
||||
fd_set *writefds,
|
||||
fd_set *exceptfds,
|
||||
struct timeval *timeout)
|
||||
{
|
||||
/*
|
||||
* Return true if any file descriptor which is marked set in one of
|
||||
* the sets belongs to this plugin
|
||||
*/
|
||||
for (int libc_fd = 0; libc_fd < nfds; libc_fd++) {
|
||||
|
||||
if (FD_ISSET(libc_fd, readfds) ||
|
||||
FD_ISSET(libc_fd, writefds) ||
|
||||
FD_ISSET(libc_fd, exceptfds)) {
|
||||
|
||||
Libc::File_descriptor *fdo =
|
||||
Libc::file_descriptor_allocator()->find_by_libc_fd(libc_fd);
|
||||
|
||||
if (fdo && (fdo->plugin == this))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int Plugin::close(Libc::File_descriptor *pipefdo)
|
||||
{
|
||||
Genode::destroy(*_heap, context(pipefdo));
|
||||
Libc::file_descriptor_allocator()->free(pipefdo);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int Plugin::fcntl(Libc::File_descriptor *pipefdo, int cmd, long arg)
|
||||
{
|
||||
switch (cmd) {
|
||||
|
||||
case F_SETFD:
|
||||
{
|
||||
const long supported_flags = FD_CLOEXEC;
|
||||
/* if unsupported flags are used, fall through with error */
|
||||
if (!(arg & ~supported_flags)) {
|
||||
/* close fd if exec is called - no exec support -> ignore */
|
||||
if (arg & FD_CLOEXEC)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
case F_GETFL:
|
||||
|
||||
if (write_end(pipefdo))
|
||||
return O_WRONLY;
|
||||
else
|
||||
return O_RDONLY;
|
||||
|
||||
case F_SETFL:
|
||||
{
|
||||
/*
|
||||
* O_RDONLY, O_WRONLY, O_RDWR, O_CREAT, O_TRUNC, O_EXCL
|
||||
* are ignored
|
||||
*/
|
||||
constexpr long supported_flags = O_NONBLOCK
|
||||
| O_RDONLY | O_WRONLY | O_RDWR
|
||||
| O_CREAT | O_TRUNC | O_EXCL;
|
||||
|
||||
context(pipefdo)->set_nonblock(arg & O_NONBLOCK);
|
||||
|
||||
if ((arg & ~supported_flags) == 0)
|
||||
return 0;
|
||||
|
||||
/* unsupported flags present */
|
||||
|
||||
Genode::error(__PRETTY_FUNCTION__, ": "
|
||||
"command F_SETFL arg ", arg, " not fully supported");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
default:
|
||||
|
||||
Genode::error(__PRETTY_FUNCTION__, "s: command ", cmd, " "
|
||||
"arg ", arg, " not supported");
|
||||
return -1;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
int Plugin::pipe(Libc::File_descriptor *pipefdo[2])
|
||||
{
|
||||
pipefdo[0] = Libc::file_descriptor_allocator()->alloc(this,
|
||||
new (*_heap) Plugin_context(READ_END, 0, *_heap));
|
||||
pipefdo[1] = Libc::file_descriptor_allocator()->alloc(this,
|
||||
new (*_heap) Plugin_context(WRITE_END, pipefdo[0], *_heap));
|
||||
static_cast<Plugin_context *>(pipefdo[0]->context)->set_partner(pipefdo[1]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
bool Plugin::poll(Libc::File_descriptor &fdo, struct pollfd &pfd)
|
||||
{
|
||||
if (fdo.plugin != this) return false;
|
||||
|
||||
enum {
|
||||
POLLIN_MASK = POLLIN | POLLRDNORM | POLLRDBAND | POLLPRI,
|
||||
POLLOUT_MASK = POLLOUT | POLLWRNORM | POLLWRBAND,
|
||||
};
|
||||
|
||||
bool res { false };
|
||||
|
||||
if ((pfd.events & POLLIN_MASK)
|
||||
&& read_end(&fdo)
|
||||
&& !context(&fdo)->buffer()->empty())
|
||||
{
|
||||
pfd.revents |= pfd.events & POLLIN_MASK;
|
||||
res = true;
|
||||
}
|
||||
|
||||
if ((pfd.events & POLLOUT_MASK)
|
||||
&& write_end(&fdo)
|
||||
&& (context(&fdo)->buffer()->avail_capacity() > 0))
|
||||
{
|
||||
pfd.revents |= pfd.events & POLLOUT_MASK;
|
||||
res = true;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
ssize_t Plugin::read(Libc::File_descriptor *fdo, void *buf, ::size_t count)
|
||||
{
|
||||
if (!read_end(fdo)) {
|
||||
Genode::error("cannot read from write end of pipe");
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!context(fdo)->partner())
|
||||
return 0;
|
||||
|
||||
if (context(fdo)->nonblock() && context(fdo)->buffer()->empty()) {
|
||||
errno = EAGAIN;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* blocking mode, read at least one byte */
|
||||
|
||||
ssize_t num_bytes_read = 0;
|
||||
|
||||
do {
|
||||
|
||||
((unsigned char*)buf)[num_bytes_read] =
|
||||
context(fdo)->buffer()->get();
|
||||
|
||||
num_bytes_read++;
|
||||
|
||||
context(fdo)->write_avail_sem()->up();
|
||||
|
||||
} while ((num_bytes_read < (ssize_t)count) &&
|
||||
!context(fdo)->buffer()->empty());
|
||||
|
||||
return num_bytes_read;
|
||||
}
|
||||
|
||||
|
||||
/* no support for execptfds right now */
|
||||
|
||||
int Plugin::select(int nfds,
|
||||
fd_set *readfds,
|
||||
fd_set *writefds,
|
||||
fd_set *exceptfds,
|
||||
struct timeval *timeout)
|
||||
{
|
||||
int nready = 0;
|
||||
Libc::File_descriptor *fdo;
|
||||
fd_set in_readfds, in_writefds;
|
||||
|
||||
in_readfds = *readfds;
|
||||
FD_ZERO(readfds);
|
||||
in_writefds = *writefds;
|
||||
FD_ZERO(writefds);
|
||||
FD_ZERO(exceptfds);
|
||||
|
||||
for (int libc_fd = 0; libc_fd < nfds; libc_fd++) {
|
||||
|
||||
fdo = Libc::file_descriptor_allocator()->find_by_libc_fd(libc_fd);
|
||||
|
||||
/* handle only libc_fds that belong to this plugin */
|
||||
if (!fdo || (fdo->plugin != this))
|
||||
continue;
|
||||
|
||||
if (FD_ISSET(libc_fd, &in_readfds) &&
|
||||
read_end(fdo) &&
|
||||
!context(fdo)->buffer()->empty()) {
|
||||
FD_SET(libc_fd, readfds);
|
||||
nready++;
|
||||
}
|
||||
|
||||
if (FD_ISSET(libc_fd, &in_writefds) &&
|
||||
write_end(fdo) &&
|
||||
(context(fdo)->buffer()->avail_capacity() > 0)) {
|
||||
FD_SET(libc_fd, writefds);
|
||||
nready++;
|
||||
}
|
||||
}
|
||||
return nready;
|
||||
}
|
||||
|
||||
|
||||
ssize_t Plugin::write(Libc::File_descriptor *fdo, const void *buf,
|
||||
::size_t count)
|
||||
{
|
||||
if (!write_end(fdo)) {
|
||||
Genode::error("cannot write into read end of pipe");
|
||||
errno = EBADF;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (context(fdo)->nonblock() &&
|
||||
(context(fdo)->buffer()->avail_capacity() == 0)) {
|
||||
errno = EAGAIN;
|
||||
return -1;
|
||||
}
|
||||
|
||||
::size_t num_bytes_written = 0;
|
||||
while (num_bytes_written < count) {
|
||||
|
||||
if (context(fdo)->buffer()->avail_capacity() == 0) {
|
||||
|
||||
if (context(fdo)->nonblock())
|
||||
return num_bytes_written;
|
||||
|
||||
if (libc_select_notify)
|
||||
libc_select_notify();
|
||||
Plugin::resume_all();
|
||||
}
|
||||
|
||||
context(fdo)->write_avail_sem()->down();
|
||||
|
||||
context(fdo)->buffer()->add(((unsigned char*)buf)[num_bytes_written]);
|
||||
num_bytes_written++;
|
||||
}
|
||||
|
||||
if (libc_select_notify)
|
||||
libc_select_notify();
|
||||
Plugin::resume_all();
|
||||
|
||||
return num_bytes_written;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void __attribute__((constructor)) init_libc_pipe()
|
||||
{
|
||||
static Libc_pipe::Plugin plugin;
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* \brief libc_pipe test
|
||||
* \brief Test for using libc with VFS pipe plugin
|
||||
* \author Christian Prochaska
|
||||
* \date 2016-04-24
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
TARGET = test-libc_select
|
||||
SRC_CC = main.cc
|
||||
LIBS = posix stdcxx libc_pipe
|
||||
LIBS = posix stdcxx
|
||||
|
||||
CC_CXX_WARN_STRICT =
|
||||
|
@ -224,11 +224,10 @@ driver ('pci_drv'). For an example of integrating TCP terminal into a Genode
|
||||
scenario, please refer to the 'tcp_terminal.run' script proved at 'gems/run/'.
|
||||
|
||||
GDB monitor is built upon the libc and a few custom libc plugins, each coming
|
||||
in the form of a separate shared library. Please make sure to integrate those
|
||||
shared libraries along with the dynamic linker (ld.lib.so) in your boot image.
|
||||
They are 'libc.lib.so' (the libc), and 'libc_pipe.lib.so' (used for synchronizing
|
||||
threads via 'select' and 'pipe'). For using the TCP terminal, 'lwip.lib.so' (TCP/IP
|
||||
stack) is needed as well.
|
||||
in the form of a separate shared library. Please make sure to integrate the
|
||||
shared C library (libc.lib.so) along with the dynamic linker (ld.lib.so) in
|
||||
your boot image. For using the TCP terminal, 'lwip.lib.so' (TCP/IP stack) is
|
||||
needed as well.
|
||||
|
||||
|
||||
Examples
|
||||
|
@ -32,8 +32,8 @@
|
||||
<tar name="coreutils.tar" />
|
||||
<dir name="dev">
|
||||
<zero/> <null/> <log/> <rtc/>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="rw"> <fs label="target"/> </dir>
|
||||
<dir name="report"> <fs label="report"/> </dir>
|
||||
<dir name="tmp"> <ram /> </dir>
|
||||
@ -72,7 +72,7 @@
|
||||
<exit propagate="yes"/>
|
||||
<config>
|
||||
<libc stdin="/dev/null" stdout="/dev/null"
|
||||
stderr="/dev/log" rtc="/dev/rtc" pipe="/dev/pipe"/>
|
||||
stderr="/dev/log" rtc="/dev/rtc" pipe="/pipe"/>
|
||||
<vfs> <fs/> </vfs>
|
||||
<arg value="bash"/>
|
||||
<arg value="--login"/>
|
||||
|
@ -23,7 +23,6 @@
|
||||
<rom label="timer"/>
|
||||
<rom label="virtualbox5-nova"/>
|
||||
<rom label="libc.lib.so"/>
|
||||
<rom label="libc_pipe.lib.so"/>
|
||||
<rom label="libm.lib.so"/>
|
||||
<rom label="libiconv.lib.so"/>
|
||||
<rom label="qemu-usb.lib.so"/>
|
||||
|
@ -78,7 +78,6 @@
|
||||
<rom label="init"/>
|
||||
<rom label="virtualbox5"/>
|
||||
<rom label="libc.lib.so"/>
|
||||
<rom label="libc_pipe.lib.so"/>
|
||||
<rom label="libm.lib.so"/>
|
||||
<rom label="libiconv.lib.so"/>
|
||||
<rom label="qemu-usb.lib.so"/>
|
||||
|
@ -49,9 +49,9 @@
|
||||
<tar name="vim-minimal.tar" />
|
||||
<dir name="dev">
|
||||
<zero/> <null/> <terminal/>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="rw"> <fs label="target"/> </dir>
|
||||
<dir name="report"> <fs label="report"/> </dir>
|
||||
<dir name="config"> <fs label="config"/> </dir>
|
||||
@ -90,7 +90,7 @@
|
||||
<exit propagate="yes"/>
|
||||
<config>
|
||||
<libc stdin="/dev/terminal" stdout="/dev/terminal"
|
||||
stderr="/dev/terminal" rtc="/dev/rtc" pipe="/dev/pipe"/>
|
||||
stderr="/dev/terminal" rtc="/dev/rtc" pipe="/pipe"/>
|
||||
<vfs> <fs/> </vfs>
|
||||
<arg value="bash"/>
|
||||
<env key="TERM" value="screen"/>
|
||||
|
@ -33,9 +33,7 @@ $(MIRROR_FROM_PORT_DIR):
|
||||
mkdir -p $(dir $@)
|
||||
cp -r $(PORT_DIR)/$@ $(dir $@)
|
||||
|
||||
MIRROR_FROM_LIBPORTS := lib/mk/libc_pipe.mk \
|
||||
src/lib/libc_pipe \
|
||||
lib/mk/libc-mem.mk \
|
||||
MIRROR_FROM_LIBPORTS := lib/mk/libc-mem.mk \
|
||||
lib/mk/libc-common.inc \
|
||||
src/lib/libc/internal/init.h \
|
||||
src/lib/libc/internal/mem_alloc.h \
|
||||
|
@ -34,9 +34,7 @@ $(MIRROR_FROM_PORT_DIR):
|
||||
mkdir -p $(dir $@)
|
||||
cp -r $(PORT_DIR)/$@ $(dir $@)
|
||||
|
||||
MIRROR_FROM_LIBPORTS := lib/mk/libc_pipe.mk \
|
||||
src/lib/libc_pipe \
|
||||
lib/mk/libc-mem.mk \
|
||||
MIRROR_FROM_LIBPORTS := lib/mk/libc-mem.mk \
|
||||
lib/mk/libc-common.inc \
|
||||
src/lib/libc/internal/init.h \
|
||||
src/lib/libc/internal/mem_alloc.h \
|
||||
|
@ -111,9 +111,9 @@ install_config {
|
||||
<dir name="tmp"> <ram/> </dir>
|
||||
<dir name="dev">
|
||||
<zero/> <null/> <terminal/>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
|
||||
<policy label_prefix="vfs_rom" root="/"/>
|
||||
@ -136,7 +136,7 @@ install_config {
|
||||
<resource name="RAM" quantum="30M" />
|
||||
<config ld_verbose="yes">
|
||||
<libc stdin="/dev/terminal" stdout="/dev/terminal"
|
||||
stderr="/dev/terminal" rtc="/dev/rtc" pipe="/dev/pipe"/>
|
||||
stderr="/dev/terminal" rtc="/dev/rtc" pipe="/pipe"/>
|
||||
<vfs> <fs/> </vfs>
|
||||
<arg value="bash"/>
|
||||
<env key="TERM" value="screen"/>
|
||||
|
@ -22,7 +22,8 @@ import_from_depot [depot_user]/src/[base_src] \
|
||||
[depot_user]/pkg/[drivers_interactive_pkg] \
|
||||
[depot_user]/src/nitpicker \
|
||||
[depot_user]/src/demo \
|
||||
[depot_user]/src/init
|
||||
[depot_user]/src/init \
|
||||
[depot_user]/src/vfs_pipe
|
||||
|
||||
set build_components {
|
||||
drivers/uart
|
||||
@ -93,8 +94,11 @@ install_config {
|
||||
</config>
|
||||
</target>
|
||||
<preserve name="RAM" quantum="2M"/>
|
||||
<vfs> <dir name="dev"> <log/> <terminal/> </dir> </vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log"/>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> <terminal/> </dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe"/>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
@ -115,7 +119,7 @@ proc binary_name_gdbserver_platform_lib_so { } {
|
||||
|
||||
# generic modules
|
||||
build_boot_image {
|
||||
stdcxx.lib.so libc.lib.so libm.lib.so vfs.lib.so libc_pipe.lib.so
|
||||
stdcxx.lib.so libc.lib.so libm.lib.so vfs.lib.so
|
||||
pc_uart_drv
|
||||
gdb_monitor gdbserver_platform.lib.so
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ set build_components {
|
||||
drivers/uart
|
||||
app/gdb_monitor
|
||||
test/gdb_monitor
|
||||
lib/vfs/pipe
|
||||
}
|
||||
|
||||
lappend build_components "lib/gdbserver_platform-$::env(KERNEL)"
|
||||
@ -75,8 +76,11 @@ set config {
|
||||
</config>
|
||||
</target>
|
||||
<preserve name="RAM" quantum="5M"/>
|
||||
<vfs> <dir name="dev"> <log/> <terminal/> </dir> </vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log"/>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> <terminal/> </dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
@ -96,8 +100,8 @@ proc binary_name_gdbserver_platform_lib_so { } {
|
||||
# generic modules
|
||||
set boot_modules {
|
||||
core init timer
|
||||
ld.lib.so libc.lib.so vfs.lib.so libm.lib.so libc_pipe.lib.so
|
||||
pc_uart_drv posix.lib.so stdcxx.lib.so
|
||||
ld.lib.so libc.lib.so vfs.lib.so libm.lib.so
|
||||
pc_uart_drv posix.lib.so stdcxx.lib.so vfs_pipe.lib.so
|
||||
gdb_monitor gdbserver_platform.lib.so test-gdb_monitor
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@ set build_components {
|
||||
drivers/uart
|
||||
app/gdb_monitor
|
||||
test/gdb_monitor
|
||||
lib/vfs/pipe
|
||||
}
|
||||
|
||||
lappend build_components "lib/gdbserver_platform-$::env(KERNEL)"
|
||||
@ -53,7 +54,10 @@ set config {
|
||||
</start>
|
||||
<start name="pc_uart_drv">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
<provides> <service name="Terminal"/> </provides>
|
||||
<provides>
|
||||
<service name="Terminal"/>
|
||||
<service name="Uart"/>
|
||||
</provides>
|
||||
<config>
|
||||
<policy label_prefix="gdb_monitor" uart="1"/>
|
||||
</config>
|
||||
@ -68,8 +72,11 @@ set config {
|
||||
</config>
|
||||
</target>
|
||||
<preserve name="RAM" quantum="4M"/>
|
||||
<vfs> <dir name="dev"> <log/> <terminal/> </dir> </vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log"/>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> <terminal/> </dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
@ -88,8 +95,9 @@ proc binary_name_gdbserver_platform_lib_so { } {
|
||||
|
||||
# generic modules
|
||||
set boot_modules {
|
||||
libc_pipe.lib.so
|
||||
pc_uart_drv
|
||||
core init timer
|
||||
ld.lib.so libc.lib.so libm.lib.so vfs.lib.so stdcxx.lib.so
|
||||
pc_uart_drv vfs_pipe.lib.so
|
||||
gdb_monitor gdbserver_platform.lib.so test-gdb_monitor
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@ set build_components {
|
||||
drivers/uart
|
||||
app/gdb_monitor
|
||||
test/gdb_monitor_target_config
|
||||
lib/vfs/pipe
|
||||
}
|
||||
|
||||
lappend build_components "lib/gdbserver_platform-$::env(KERNEL)"
|
||||
@ -52,7 +53,10 @@ set config {
|
||||
</start>
|
||||
<start name="pc_uart_drv">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides> <service name="Terminal"/> </provides>
|
||||
<provides>
|
||||
<service name="Terminal"/>
|
||||
<service name="Uart"/>
|
||||
</provides>
|
||||
<config>
|
||||
<policy label_prefix="gdb_monitor" uart="1"/>
|
||||
</config>
|
||||
@ -68,8 +72,11 @@ set config {
|
||||
</config>
|
||||
</target>
|
||||
<preserve name="RAM" quantum="3M"/>
|
||||
<vfs> <dir name="dev"> <log/> <terminal/> </dir> </vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log"/>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> <terminal/> </dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe"/>
|
||||
</config>
|
||||
</start>
|
||||
</config>
|
||||
@ -89,8 +96,8 @@ proc binary_name_gdbserver_platform_lib_so { } {
|
||||
# generic modules
|
||||
set boot_modules {
|
||||
core init timer
|
||||
ld.lib.so libc.lib.so libm.lib.so vfs.lib.so libc_pipe.lib.so stdcxx.lib.so
|
||||
pc_uart_drv
|
||||
ld.lib.so libc.lib.so libm.lib.so vfs.lib.so stdcxx.lib.so
|
||||
pc_uart_drv vfs_pipe.lib.so
|
||||
gdb_monitor gdbserver_platform.lib.so test-gdb_monitor_target_config
|
||||
}
|
||||
|
||||
|
@ -168,9 +168,9 @@ install_config {
|
||||
<dir name="dev">
|
||||
<zero/>
|
||||
<log/>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<inline name="rtc">2030-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<dir name="home">
|
||||
<ram/>
|
||||
<rom name=".bash_profile" label="bash_profile" binary="no"/>
|
||||
@ -210,7 +210,7 @@ install_config {
|
||||
<resource name="RAM" quantum="300M" />
|
||||
<config ld_verbose="yes">
|
||||
<libc stdin="/dev/null" stdout="/dev/log" stderr="/dev/log"
|
||||
rtc="/dev/rtc" pipe="/dev/pipe"/>
|
||||
rtc="/dev/rtc" pipe="/pipe"/>
|
||||
<vfs>
|
||||
<fs buffer_size="2M"/>
|
||||
<dir name="dev"> <null/> </dir>
|
||||
|
@ -38,7 +38,8 @@ create_boot_directory
|
||||
|
||||
import_from_depot [depot_user]/src/[base_src] \
|
||||
[depot_user]/src/init \
|
||||
[depot_user]/src/nitpicker
|
||||
[depot_user]/src/nitpicker \
|
||||
[depot_user]/src/vfs_pipe
|
||||
|
||||
|
||||
set config {
|
||||
@ -207,10 +208,11 @@ append config {
|
||||
<config vbox_file="vm_genode_usb_hid.vbox" vm_name="TestVM" xhci="yes">
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> <terminal/> </dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<rom name="vm_genode_usb_hid.vbox" />
|
||||
<rom name="usb_hid.iso" />
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" stderr="/dev/log"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe"/>
|
||||
</config>
|
||||
<route>
|
||||
<service name="Report"><child name="report_rom" /></service>
|
||||
@ -257,7 +259,7 @@ set boot_modules {
|
||||
virtualbox5-nova
|
||||
usb_hid.iso
|
||||
vm_genode_usb_hid.vbox
|
||||
ld.lib.so libc.lib.so libm.lib.so libc_pipe.lib.so
|
||||
ld.lib.so libc.lib.so libm.lib.so
|
||||
libiconv.lib.so stdcxx.lib.so
|
||||
qemu-usb.lib.so
|
||||
}
|
||||
|
@ -139,8 +139,9 @@ set config_of_app {
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> </dir>
|
||||
<dir name="socket"> <lwip dhcp="yes"/> </dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
<libc stdout="/dev/log" socket="/socket" />
|
||||
<libc stdout="/dev/log" socket="/socket" pipe="/pipe"/>
|
||||
</config>
|
||||
</start>
|
||||
|
||||
@ -184,9 +185,9 @@ set config_of_app {
|
||||
<dir name="tmp"> <ram/> </dir>
|
||||
<dir name="dev">
|
||||
<zero/> <null/> <terminal/>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<inline name="rtc">2018-01-01 00:01</inline>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</vfs>
|
||||
|
||||
<policy label_prefix="vfs_rom" root="/"/>
|
||||
@ -218,7 +219,7 @@ set config_of_app {
|
||||
<resource name="RAM" quantum="30M" />
|
||||
<config ld_verbose="yes">
|
||||
<libc stdin="/dev/terminal" stdout="/dev/terminal"
|
||||
stderr="/dev/terminal" rtc="/dev/rtc" pipe="/dev/pipe"/>
|
||||
stderr="/dev/terminal" rtc="/dev/rtc" pipe="/pipe"/>
|
||||
<vfs> <fs/> </vfs>
|
||||
<arg value="bash"/>
|
||||
<env key="TERM" value="screen"/>
|
||||
@ -316,9 +317,12 @@ append_if [expr $use_vbox5] config_of_app "
|
||||
append config_of_app {
|
||||
<resource name="RAM" quantum="1280M"/>
|
||||
<config vbox_file="} $vbox_file {" vm_name="AutoDisk">
|
||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" pipe="/pipe"/>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> <rtc/> </dir>
|
||||
<dir name="dev">
|
||||
<log/> <rtc/>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<rom name="} $vbox_file {"/>}
|
||||
|
||||
append_if [expr $use_ram_fs] config_of_app {
|
||||
|
@ -239,7 +239,7 @@ for { set i 1} { $i <= $use_vms } { incr i} {
|
||||
<config ld_verbose=\"yes\" vbox_file=\"${vbox_file}\" vm_name=\"${flavor}\" xhci=\"no\" capslock=\"NOROM\">"
|
||||
}
|
||||
append config_of_app {
|
||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" pipe="/pipe"/>
|
||||
<vfs>
|
||||
<dir name="dev">
|
||||
<log/> <rtc/>}
|
||||
@ -249,7 +249,8 @@ for { set i 1} { $i <= $use_vms } { incr i} {
|
||||
append_if [expr !$use_rumpfs] config_of_app {
|
||||
<block name="sda3" label="raw" block_buffer_count="128" />}
|
||||
append config_of_app {
|
||||
</dir>}
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>}
|
||||
|
||||
append_if [expr $use_ram_fs] config_of_app {
|
||||
<dir name="ram"> <fs label="from_ram_fs"/> </dir>}
|
||||
|
@ -28,7 +28,8 @@ create_boot_directory
|
||||
|
||||
import_from_depot [depot_user]/src/[base_src] \
|
||||
[depot_user]/src/init \
|
||||
[depot_user]/src/nitpicker
|
||||
[depot_user]/src/nitpicker \
|
||||
[depot_user]/src/vfs_pipe
|
||||
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
# override defaults of platform_drv.inc
|
||||
@ -102,7 +103,7 @@ append_if [expr $use_usb] config {
|
||||
append_if [have_spec framebuffer] config {
|
||||
<start name="fb_drv" priority="-1" caps="150">
|
||||
<binary name="vesa_fb_drv"/>
|
||||
<resource name="RAM" quantum="8M"/>}
|
||||
<resource name="RAM" quantum="12M"/>}
|
||||
append_if [expr [have_spec framebuffer] && [have_include power_on/qemu]] config {
|
||||
<config width="1280" height="1024" buffered="yes"/>}
|
||||
append_if [expr [have_spec framebuffer] && [have_include power_on/qemu]] config {
|
||||
@ -207,9 +208,12 @@ append_if [expr $use_gui] config {
|
||||
<binary name="} $virtualbox_binary {"/>
|
||||
<resource name="RAM" quantum="448M"/>
|
||||
<config vbox_file="test.vbox" vm_name="TestVM">
|
||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> <rtc/> </dir>
|
||||
<dir name="dev">
|
||||
<log/> <rtc/>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
<rom name="test.vbox" />
|
||||
<rom name="test.iso" />
|
||||
</vfs>
|
||||
@ -229,9 +233,12 @@ append config {
|
||||
<binary name="} $virtualbox_binary {"/>
|
||||
<resource name="RAM" quantum="448M"/>
|
||||
<config vbox_file="test.vbox" vm_name="TestVM">
|
||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
|
||||
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> <rtc/> </dir>}
|
||||
<dir name="dev">
|
||||
<log/> <rtc/>
|
||||
</dir>
|
||||
<dir name="pipe"> <pipe/> </dir>}
|
||||
|
||||
append_if [expr $use_serial] config {
|
||||
<dir name="dev"> <terminal/> </dir>}
|
||||
@ -275,7 +282,7 @@ lappend_if [expr $use_top] boot_modules top
|
||||
lappend_if [expr $use_gui] boot_modules report_rom
|
||||
|
||||
append boot_modules {
|
||||
libc.lib.so vfs.lib.so libm.lib.so libc_pipe.lib.so
|
||||
libc.lib.so vfs.lib.so libm.lib.so
|
||||
libiconv.lib.so stdcxx.lib.so
|
||||
qemu-usb.lib.so
|
||||
}
|
||||
|
@ -23,7 +23,8 @@ create_boot_directory
|
||||
|
||||
import_from_depot [depot_user]/src/[base_src] \
|
||||
[depot_user]/src/init \
|
||||
[depot_user]/src/nitpicker
|
||||
[depot_user]/src/nitpicker \
|
||||
[depot_user]/src/vfs_pipe
|
||||
|
||||
if {$use_vms > 1} {
|
||||
import_from_depot [depot_user]/pkg/themed_wm
|
||||
@ -382,7 +383,6 @@ install_config $config
|
||||
append boot_modules {
|
||||
part_block ahci_drv fs_rom vfs
|
||||
libc.lib.so vfs.lib.so libm.lib.so
|
||||
libc_pipe.lib.so
|
||||
libiconv.lib.so stdcxx.lib.so
|
||||
qemu-usb.lib.so
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ append build_components { drivers/rtc }
|
||||
append build_components { drivers/usb }
|
||||
append build_components { drivers/nic }
|
||||
append build_components { server/input_filter }
|
||||
append build_components { lib/vfs/pipe }
|
||||
|
||||
append_platform_drv_build_components
|
||||
|
||||
@ -338,8 +339,11 @@ append config {
|
||||
<config vbox_file="virtualbox_nic_router.vbox" vm_name="TestVM">
|
||||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/>
|
||||
<vfs>
|
||||
<dir name="dev"> <log/> <rtc/> </dir>
|
||||
<dir name="dev"> <terminal/> </dir>
|
||||
<dir name="dev">
|
||||
<log/> <rtc/>
|
||||
<terminal/>
|
||||
<dir name="pipe"> <pipe/> </dir>
|
||||
</dir>
|
||||
<rom name="virtualbox_nic_router.vbox" />
|
||||
<rom name="test.iso" />
|
||||
</vfs>
|
||||
@ -384,7 +388,6 @@ append boot_modules { virtualbox_nic_router.vbox }
|
||||
append boot_modules { ld.lib.so }
|
||||
append boot_modules { libc.lib.so }
|
||||
append boot_modules { libm.lib.so }
|
||||
append boot_modules { libc_pipe.lib.so }
|
||||
append boot_modules { libiconv.lib.so }
|
||||
append boot_modules { stdcxx.lib.so }
|
||||
append boot_modules { qemu-usb.lib.so }
|
||||
@ -397,6 +400,7 @@ append boot_modules { vfs.lib.so }
|
||||
append boot_modules { ipxe_nic_drv }
|
||||
append boot_modules { input_filter }
|
||||
append boot_modules { log_terminal }
|
||||
append boot_modules { vfs_pipe.lib.so }
|
||||
append_platform_drv_boot_modules
|
||||
|
||||
build_boot_image $boot_modules
|
||||
|
@ -12,7 +12,7 @@ INC_DIR += $(GDB_CONTRIB_DIR)/include \
|
||||
$(PRG_DIR)/gdbserver \
|
||||
$(PRG_DIR)
|
||||
|
||||
LIBS = stdcxx libc libc_pipe \
|
||||
LIBS = stdcxx libc \
|
||||
gdbserver_platform gdbserver_libc_support
|
||||
|
||||
# libiberty
|
||||
|
@ -20,7 +20,7 @@ LIBS += virtualbox5-bios virtualbox5-recompiler virtualbox5-runtime \
|
||||
virtualbox5-xml virtualbox5-main virtualbox5-apiwrap \
|
||||
virtualbox5-dis
|
||||
|
||||
LIBS += libc_pipe libiconv
|
||||
LIBS += libiconv
|
||||
|
||||
LIBS += qemu-usb
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user