diff --git a/base-linux/run/lx_fs.run b/base-linux/run/lx_fs.run
index 5e2f470d9..1f0aed7be 100644
--- a/base-linux/run/lx_fs.run
+++ b/base-linux/run/lx_fs.run
@@ -1,5 +1,5 @@
#
-# \brief Test for using the libc_fs plugin with the Linux file system
+# \brief Test for using the libc_vfs plugin with the Linux file system
# \author Norman Feske
# \author Christian Helmuth
# \date 2013-11-07
@@ -11,7 +11,7 @@ assert_spec linux
# Build
#
-build { core init server/lx_fs test/libc_fs }
+build { core init server/lx_fs test/libc_vfs }
create_boot_directory
@@ -37,10 +37,18 @@ install_config {
-
+
-
+
+
+
+
+
+
+
+
+
}
@@ -49,17 +57,15 @@ install_config {
# Create test-directory structure
#
-exec mkdir -p bin/libc_fs
+exec mkdir -p bin/libc_vfs
#
# Boot modules
#
build_boot_image {
- core init
- ld.lib.so libc.lib.so libc_log.lib.so libc_fs.lib.so
- lx_fs test-libc_fs
- libc_fs
+ core init ld.lib.so libc.lib.so lx_fs test-libc_vfs
+ libc_vfs
}
#
@@ -74,6 +80,6 @@ puts "\ntest succeeded\n"
# Cleanup test-directory structure
#
-exec rm -r bin/libc_fs
+exec rm -r bin/libc_vfs
# vi: set ft=tcl :
diff --git a/base-linux/run/lx_rmap.inc b/base-linux/run/lx_rmap.inc
index de1f29c61..ded0506e8 100644
--- a/base-linux/run/lx_rmap.inc
+++ b/base-linux/run/lx_rmap.inc
@@ -44,7 +44,6 @@ append_if [expr {$test_type eq "static"}] config {
}
append_if [expr {$test_type eq "dynamic"}] config {
}
-
append config {
@@ -61,9 +60,6 @@ set boot_modules { core init}
lappend_if [expr {$test_type eq "static"}] boot_modules test-lx_rmap_static
lappend_if [expr {$test_type eq "dynamic"}] boot_modules test-lx_rmap_dynamic
lappend_if [expr {$test_type eq "dynamic"}] boot_modules ld.lib.so
-lappend_if [expr {$test_type eq "dynamic"}] boot_modules libc.lib.so
-lappend_if [expr {$test_type eq "dynamic"}] boot_modules libc_log.lib.so
-lappend_if [expr {$test_type eq "dynamic"}] boot_modules libm.lib.so
build_boot_image $boot_modules
diff --git a/base-linux/src/test/lx_rmap/dynamic/target.mk b/base-linux/src/test/lx_rmap/dynamic/target.mk
index 4c6aafcef..4cd1bb969 100644
--- a/base-linux/src/test/lx_rmap/dynamic/target.mk
+++ b/base-linux/src/test/lx_rmap/dynamic/target.mk
@@ -5,6 +5,6 @@ endif
TARGET = test-lx_rmap_dynamic
SRC_CC = main.cc
-LIBS = base libc
+LIBS = base ld
vpath main.cc $(PRG_DIR)/..
diff --git a/dde_linux/run/usb_net.run b/dde_linux/run/usb_net.run
index 0db99b8e8..1534743fe 100644
--- a/dde_linux/run/usb_net.run
+++ b/dde_linux/run/usb_net.run
@@ -63,6 +63,11 @@ set config {
+
+
+
+
+
}
append_if [have_spec acpi] config {
@@ -112,7 +117,7 @@ install_config $config
set boot_modules {
core init timer
usb_drv
- ld.lib.so libc.lib.so libc_log.lib.so lwip.lib.so test-lwip_httpsrv
+ ld.lib.so libc.lib.so lwip.lib.so test-lwip_httpsrv
}
lappend_if [have_spec acpi] boot_modules acpi_drv
diff --git a/dde_rump/run/rump_ext2.run b/dde_rump/run/rump_ext2.run
index 9a828906d..4baf9de6e 100644
--- a/dde_rump/run/rump_ext2.run
+++ b/dde_rump/run/rump_ext2.run
@@ -12,7 +12,7 @@ set build_components {
drivers/timer
server/ram_blk
server/rump_fs
- test/libc_fs
+ test/libc_vfs
}
build $build_components
@@ -60,8 +60,16 @@ append config {
-
+
+
+
+
+
+
+
+
+
}
@@ -73,10 +81,9 @@ install_config $config
# generic modules
set boot_modules {
- core init timer test-libc_fs ram_blk
+ core init timer test-libc_vfs ram_blk
rump.lib.so rump_fs.lib.so rump_fs
ld.lib.so ext2.raw libc.lib.so
- libc_fs.lib.so libc_log.lib.so
}
build_boot_image $boot_modules
diff --git a/dde_rump/run/rump_fat.run b/dde_rump/run/rump_fat.run
index 5be533bdf..31b56dbc8 100644
--- a/dde_rump/run/rump_fat.run
+++ b/dde_rump/run/rump_fat.run
@@ -12,7 +12,7 @@ set build_components {
drivers/timer
server/ram_blk
server/rump_fs
- test/libc_fs
+ test/libc_vfs
}
build $build_components
@@ -60,8 +60,16 @@ append config {
-
+
+
+
+
+
+
+
+
+
}
@@ -73,10 +81,9 @@ install_config $config
# generic modules
set boot_modules {
- core init timer test-libc_fs ram_blk
+ core init timer test-libc_vfs ram_blk
rump.lib.so rump_fs.lib.so rump_fs
ld.lib.so fs.raw libc.lib.so
- libc_fs.lib.so libc_log.lib.so
}
build_boot_image $boot_modules
diff --git a/gems/run/http_blk.run b/gems/run/http_blk.run
index 058346991..70b6c42f5 100644
--- a/gems/run/http_blk.run
+++ b/gems/run/http_blk.run
@@ -17,7 +17,6 @@ if {$use_nic_driver} { set network_driver "nic_drv" }
set build_components {
core init
drivers/timer
- server/ram_fs
server/nic_bridge
server/http_blk
app/lighttpd
@@ -126,36 +125,6 @@ append config {
-
-
-
-
-
-
-
-
-
-# lighttpd configuration
-server.port = 80
-server.document-root = "/website"
-server.event-handler = "select"
-server.network-backend = "write"
-index-file.names = (
- "index.xhtml", "index.html", "index.htm"
-)
-mimetype.assign = (
- ".html" => "text/html",
- ".htm" => "text/html"
-)
-
-
-
-
-
-
-
-
-
@@ -178,7 +147,36 @@ mimetype.assign = (
-
+
+
+
+
+
+
+
+
+
+# lighttpd configuration
+server.port = 80
+server.document-root = "/website"
+server.event-handler = "select"
+server.network-backend = "write"
+index-file.names = (
+ "index.xhtml", "index.html", "index.htm"
+)
+mimetype.assign = (
+ ".html" => "text/html",
+ ".htm" => "text/html"
+)
+
+
+
+
+
+
+
+
@@ -197,8 +195,8 @@ catch { exec dd if=/dev/zero of=bin/index.bin bs=512 count=400 }
# generic modules
set boot_modules {
- core init timer ld.lib.so ram_fs
- libc.lib.so libm.lib.so libc_fs.lib.so libc_log.lib.so
+ core init timer ld.lib.so
+ libc.lib.so libm.lib.so
lwip.lib.so zlib.lib.so
lighttpd nic_bridge http_blk index.bin test-rom_blk
}
@@ -221,4 +219,4 @@ append qemu_args " -net user -redir tcp:5555::80 "
append qemu_args " -nographic -serial mon:stdio "
run_genode_until {.*all done, finished!.*} 120
-exec rm -f bin/index.bin
\ No newline at end of file
+exec rm -f bin/index.bin
diff --git a/gems/run/tcp_terminal.run b/gems/run/tcp_terminal.run
index f8d1bef18..d0f589c3e 100644
--- a/gems/run/tcp_terminal.run
+++ b/gems/run/tcp_terminal.run
@@ -59,6 +59,9 @@ set config {
+
+
+
@@ -85,7 +88,7 @@ install_config $config
set boot_modules {
core init timer
nic_drv
- ld.lib.so libc.lib.so lwip.lib.so libc_log.lib.so libc_lock_pipe.lib.so
+ ld.lib.so libc.lib.so lwip.lib.so libc_lock_pipe.lib.so
tcp_terminal
test-terminal_echo
}
diff --git a/gems/src/server/file_terminal/README b/gems/src/server/file_terminal/README
index bd7d9bd81..ed0f19d41 100644
--- a/gems/src/server/file_terminal/README
+++ b/gems/src/server/file_terminal/README
@@ -1,9 +1,15 @@
-File terminal is a service that provides Genode's Terminal_session interface
-for a given file via a File_system_session.
+File terminal is a service that provides a terminal-session interface and
+redirects the terminal input and output to a file.
!
!
! h
+!
+!
+!
+!
+!
+!
!
-To keep things simple a client can only open one file at the moment.
+To keep things simple, a client can only open one file at the moment.
diff --git a/gems/src/server/file_terminal/target.mk b/gems/src/server/file_terminal/target.mk
index 65eeea7a4..16adf9572 100644
--- a/gems/src/server/file_terminal/target.mk
+++ b/gems/src/server/file_terminal/target.mk
@@ -1,3 +1,3 @@
TARGET = file_terminal
SRC_CC = main.cc
-LIBS = libc libc_fs libc_log
+LIBS = libc libc_vfs
diff --git a/gems/src/server/tcp_terminal/target.mk b/gems/src/server/tcp_terminal/target.mk
index 302077dda..18d42ff19 100644
--- a/gems/src/server/tcp_terminal/target.mk
+++ b/gems/src/server/tcp_terminal/target.mk
@@ -1,3 +1,3 @@
TARGET = tcp_terminal
SRC_CC = main.cc
-LIBS = libc libc_lwip_nic_dhcp libc_log libc_lock_pipe
+LIBS = libc libc_lwip_nic_dhcp libc_vfs libc_lock_pipe
diff --git a/libports/lib/mk/libc_block.mk b/libports/lib/mk/libc_block.mk
deleted file mode 100644
index 0c320a173..000000000
--- a/libports/lib/mk/libc_block.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-LIBS = libc
-
-SRC_CC = plugin.cc
-
-vpath %.cc $(REP_DIR)/src/lib/libc_block
-
-SHARED_LIB = yes
diff --git a/libports/lib/mk/libc_fs.mk b/libports/lib/mk/libc_fs.mk
deleted file mode 100644
index c94ce68bc..000000000
--- a/libports/lib/mk/libc_fs.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-SRC_CC = plugin.cc
-LIBS += libc
-INC_DIR += $(REP_DIR)/src/lib/libc
-
-vpath plugin.cc $(REP_DIR)/src/lib/libc_fs
-
-SHARED_LIB = yes
diff --git a/libports/lib/mk/libc_fuse_exfat.mk b/libports/lib/mk/libc_fuse_exfat.mk
index 08cd5f46f..6d7ac68a3 100644
--- a/libports/lib/mk/libc_fuse_exfat.mk
+++ b/libports/lib/mk/libc_fuse_exfat.mk
@@ -4,7 +4,7 @@ EXFAT_DIR = $(REP_DIR)/contrib/$(EXFAT)
SRC_C = $(notdir $(EXFAT_DIR)/fuse/main.c)
SRC_CC = init.cc
-LIBS = libc libc_block libc_fuse libfuse libexfat
+LIBS = libc libc_vfs libc_fuse libfuse libexfat
vpath %.c $(EXFAT_DIR)/fuse
vpath %.cc $(REP_DIR)/src/lib/exfat
diff --git a/libports/lib/mk/libc_fuse_ext2.mk b/libports/lib/mk/libc_fuse_ext2.mk
index a4b1bbc63..0d59b7374 100644
--- a/libports/lib/mk/libc_fuse_ext2.mk
+++ b/libports/lib/mk/libc_fuse_ext2.mk
@@ -5,7 +5,7 @@ FILTER_OUT = fuse-ext2.probe.c fuse-ext2.wait.c
SRC_C = $(filter-out $(FILTER_OUT), $(notdir $(wildcard $(FUSE_EXT2_DIR)/*.c)))
SRC_CC = init.cc
-LIBS = libc libc_block libc_fuse libfuse libext2fs
+LIBS = libc libc_vfs libc_fuse libfuse libext2fs
CC_OPT = -DHAVE_CONFIG_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
diff --git a/libports/lib/mk/libc_fuse_ntfs-3g.mk b/libports/lib/mk/libc_fuse_ntfs-3g.mk
index bd01909e3..ec69a0d87 100644
--- a/libports/lib/mk/libc_fuse_ntfs-3g.mk
+++ b/libports/lib/mk/libc_fuse_ntfs-3g.mk
@@ -4,7 +4,7 @@ NTFS_3G_DIR = $(REP_DIR)/contrib/$(NTFS_3G)
SRC_C = ntfs-3g.c ntfs-3g_common.c
SRC_CC = init.cc
-LIBS = libc libc_block libc_fuse libfuse libntfs-3g
+LIBS = libc libc_vfs libc_fuse libfuse libntfs-3g
CC_OPT = -DHAVE_TIMESPEC -DHAVE_CONFIG_H -DRECORD_LOCKING_NOT_IMPLEMENTED
diff --git a/libports/lib/mk/libc_log.mk b/libports/lib/mk/libc_log.mk
deleted file mode 100644
index 0df2b0729..000000000
--- a/libports/lib/mk/libc_log.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-SRC_CC = plugin.cc
-LIBS += libc
-
-vpath plugin.cc $(REP_DIR)/src/lib/libc_log
-
-SHARED_LIB = yes
diff --git a/libports/lib/mk/libc_rom.mk b/libports/lib/mk/libc_rom.mk
deleted file mode 100644
index ce167c4c9..000000000
--- a/libports/lib/mk/libc_rom.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-SRC_CC = plugin.cc
-LIBS += libc
-
-vpath plugin.cc $(REP_DIR)/src/lib/libc_rom
-
-SHARED_LIB = yes
diff --git a/libports/run/avplay.run b/libports/run/avplay.run
index 6f1419108..cf34acecd 100644
--- a/libports/run/avplay.run
+++ b/libports/run/avplay.run
@@ -95,7 +95,7 @@ append config {
-
+
@@ -108,7 +108,7 @@ append config {
-
+
@@ -118,6 +118,12 @@ append config {
+
+
+
+
+
+
@@ -135,8 +141,8 @@ install_config $config
#
set boot_modules {
- core init timer oss_drv mixer avplay
- ld.lib.so libc.lib.so libc_log.lib.so libc_rom.lib.so libm.lib.so pthread.lib.so zlib.lib.so sdl.lib.so
+ core init timer audio_out_drv mixer avplay
+ ld.lib.so libc.lib.so libm.lib.so pthread.lib.so zlib.lib.so sdl.lib.so
avfilter.lib.so avutil.lib.so avcodec.lib.so avformat.lib.so swscale.lib.so
mediafile
}
diff --git a/libports/run/eglgears.run b/libports/run/eglgears.run
index c65a303ca..62d6d5e0c 100644
--- a/libports/run/eglgears.run
+++ b/libports/run/eglgears.run
@@ -97,6 +97,11 @@ append config {
+
+
+
+
+
@@ -110,7 +115,7 @@ install_config $config
set boot_modules {
core init ld.lib.so timer nitpicker nit_fb
launchpad eglgears
- gallium.lib.so libc.lib.so libm.lib.so libc_log.lib.so pthread.lib.so
+ gallium.lib.so libc.lib.so libm.lib.so pthread.lib.so
}
lappend_if [have_spec linux] boot_modules fb_sdl
diff --git a/libports/run/expat.run b/libports/run/expat.run
index 6b11a2bb6..646b2756c 100644
--- a/libports/run/expat.run
+++ b/libports/run/expat.run
@@ -40,7 +40,15 @@ install_config {
-
+
+
+
+
+
+
+
+
+
@@ -52,7 +60,7 @@ install_config {
build_boot_image {
core init timer
- ld.lib.so libc.lib.so libc_log.lib.so libc_rom.lib.so expat.lib.so
+ ld.lib.so libc.lib.so expat.lib.so
test-expat
}
diff --git a/libports/run/http_srv_tracing.run b/libports/run/http_srv_tracing.run
index a5b016b5b..bd456a171 100644
--- a/libports/run/http_srv_tracing.run
+++ b/libports/run/http_srv_tracing.run
@@ -30,7 +30,7 @@ requires_installation_of lynx
build {
core init
- drivers/pci drivers/timer drivers/nic
+ drivers/acpi drivers/pci drivers/timer drivers/nic
test/lwip/http_srv_tracing
}
@@ -59,7 +59,7 @@ set config {
-
+
@@ -68,13 +68,32 @@ set config {
- }
+
+
+
+
+
+ }
-append_if [have_spec pci] config {
+append_if [have_spec acpi] config {
+
+
+
+
+
+
+
+
+
+
+
+ }
+
+append_if [expr ![have_spec acpi] && [have_spec pci]] config {
-
+
- }
+ }
append config {
@@ -90,12 +109,13 @@ install_config $config
set boot_modules {
core init timer
nic_drv
- ld.lib.so libc.lib.so libc_log.lib.so lwip.lib.so
+ ld.lib.so libc.lib.so lwip.lib.so
test-lwip_httpsrv_tracing
}
# platform-specific modules
-lappend_if [have_spec pci] boot_modules pci_drv
+lappend_if [have_spec pci] boot_modules pci_drv
+lappend_if [have_spec acpi] boot_modules acpi_drv
build_boot_image $boot_modules
diff --git a/libports/run/http_srv_tracing_nonblocking_panda.run b/libports/run/http_srv_tracing_nonblocking_panda.run
index f934ac831..99af67951 100644
--- a/libports/run/http_srv_tracing_nonblocking_panda.run
+++ b/libports/run/http_srv_tracing_nonblocking_panda.run
@@ -75,7 +75,7 @@ set boot_modules {
usb_drv
gpio_drv
test-lwip_httpsrv_tracing_nob
- ld.lib.so libc.lib.so libc_log.lib.so lwip.lib.so
+ ld.lib.so libc.lib.so lwip.lib.so
}
build_boot_image [join $boot_modules " "]
diff --git a/libports/run/http_srv_tracing_panda.run b/libports/run/http_srv_tracing_panda.run
index a7008d150..9ade79a93 100644
--- a/libports/run/http_srv_tracing_panda.run
+++ b/libports/run/http_srv_tracing_panda.run
@@ -60,6 +60,11 @@ set config {
+
+
+
+
+
}
@@ -75,7 +80,7 @@ set boot_modules {
usb_drv
gpio_drv
test-lwip_httpsrv_tracing
- ld.lib.so libc.lib.so libc_log.lib.so lwip.lib.so
+ ld.lib.so libc.lib.so lwip.lib.so
}
build_boot_image [join $boot_modules " "]
diff --git a/libports/run/test-libc.run b/libports/run/libc.run
similarity index 77%
rename from libports/run/test-libc.run
rename to libports/run/libc.run
index 32b4b4434..61c2b9b19 100644
--- a/libports/run/test-libc.run
+++ b/libports/run/libc.run
@@ -20,14 +20,19 @@ install_config {
-
+
+
+
+
+
+
}
build_boot_image {
core init test-libc
- ld.lib.so libc.lib.so libc_log.lib.so libm.lib.so
+ ld.lib.so libc.lib.so libm.lib.so
}
append qemu_args " -nographic -m 64 "
diff --git a/libports/run/libc_block.run b/libports/run/libc_block.run
index 928fa84b7..fac083825 100644
--- a/libports/run/libc_block.run
+++ b/libports/run/libc_block.run
@@ -76,6 +76,14 @@ set config {
+
+
+
+
+
+
+
+
}
@@ -128,7 +136,7 @@ install_config $config
# generic modules
set boot_modules {
core init timer
- ld.lib.so libc.lib.so libc_log.lib.so libc_block.lib.so
+ ld.lib.so libc.lib.so
test-libc_block
}
diff --git a/libports/run/libc_ffat.run b/libports/run/libc_ffat.run
index 7cc6c89f6..726faa4db 100644
--- a/libports/run/libc_ffat.run
+++ b/libports/run/libc_ffat.run
@@ -2,4 +2,11 @@ set mkfs_cmd mkfs.vfat
set mkfs_opts "-F32"
set filesystem ffat
+#
+# The ffat_libc plugin opens a block session directly. If the VFS opened
+# the block session, the plugin would try to open a second one, which
+# would get denied by the block driver.
+#
+set libc_dev_blkdev ""
+
source ${genode_dir}/libports/run/libc_filesystem_test.inc
diff --git a/libports/run/libc_ffat_fs.run b/libports/run/libc_ffat_fs.run
index b0f860efa..1f8eae84c 100644
--- a/libports/run/libc_ffat_fs.run
+++ b/libports/run/libc_ffat_fs.run
@@ -1,5 +1,5 @@
#
-# \brief Test for using the libc_fs plugin with the FFAT file system
+# \brief Test for using the libc_vfs plugin with the FFAT file system
# \author Christian Prochaska
# \date 2012-07-03
#
@@ -21,7 +21,7 @@ set build_components {
core init
drivers/timer
server/ffat_fs
- test/libc_fs
+ test/libc_vfs
}
lappend_if [have_spec pci] build_components drivers/pci
@@ -63,8 +63,16 @@ set config {
-
+
+
+
+
+
+
+
+
+
}
@@ -116,8 +124,8 @@ install_config $config
# generic modules
set boot_modules {
core init timer ffat_fs
- ld.lib.so libc.lib.so libc_log.lib.so libc_fs.lib.so
- test-libc_fs
+ ld.lib.so libc.lib.so
+ test-libc_vfs
}
lappend_if [have_spec pci] boot_modules pci_drv
diff --git a/libports/run/libc_filesystem_test.inc b/libports/run/libc_filesystem_test.inc
index 72454abcc..754a00166 100644
--- a/libports/run/libc_filesystem_test.inc
+++ b/libports/run/libc_filesystem_test.inc
@@ -105,9 +105,17 @@ append config {
+
+
+ }
+append config $libc_dev_blkdev
+append config {
+
+
+
+
-
-}
+ }
append_if [have_spec acpi] config {
@@ -171,7 +179,7 @@ install_config $config
# generic modules
set boot_modules {
core init timer
- ld.lib.so libc.lib.so libc_log.lib.so libc_block.lib.so
+ ld.lib.so libc.lib.so
}
append boot_modules test-libc_$filesystem
diff --git a/libports/run/libc_fs.run b/libports/run/libc_fs.run
deleted file mode 100644
index d18a2764f..000000000
--- a/libports/run/libc_fs.run
+++ /dev/null
@@ -1,67 +0,0 @@
-#
-# \brief Test for using the libc_fs plugin with the RAM file system
-# \author Norman Feske
-# \date 2012-04-11
-#
-
-#
-# Build
-#
-
-build { core init server/ram_fs test/libc_fs }
-
-create_boot_directory
-
-#
-# Generate config
-#
-
-install_config {
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-}
-
-#
-# Boot modules
-#
-
-build_boot_image {
- core init
- ld.lib.so libc.lib.so libc_log.lib.so libc_fs.lib.so
- ram_fs test-libc_fs
-}
-
-#
-# Execute test case
-#
-
-append qemu_args " -m 128 -nographic "
-run_genode_until {.*child exited with exit value 0.*} 60
-
-puts "\ntest succeeded\n"
-
-# vi: set ft=tcl :
diff --git a/libports/run/libc_fs_tar_fs.run b/libports/run/libc_fs_tar_fs.run
index 2eb7a8cee..8334ade94 100644
--- a/libports/run/libc_fs_tar_fs.run
+++ b/libports/run/libc_fs_tar_fs.run
@@ -1,5 +1,5 @@
#
-# \brief Test for using the libc_fs plugin with the TAR file system
+# \brief Test for using the libc_vfs plugin with the TAR file system
# \author Christian Prochaska
# \date 2012-08-20
#
@@ -53,6 +53,14 @@ set config {
+
+
+
+
+
+
+
+
}
@@ -82,7 +90,7 @@ exec tar cfv bin/libc_fs_tar_fs.tar -C bin/libc_fs_tar_fs .
# generic modules
set boot_modules {
core init timer tar_fs
- ld.lib.so libc.lib.so libc_log.lib.so libc_fs.lib.so
+ ld.lib.so libc.lib.so
test-libc_fs_tar_fs libc_fs_tar_fs.tar
}
diff --git a/libports/run/libc_fuse_exfat.run b/libports/run/libc_fuse_exfat.run
index 95fd5fba6..7f8c3bce0 100644
--- a/libports/run/libc_fuse_exfat.run
+++ b/libports/run/libc_fuse_exfat.run
@@ -1,5 +1,6 @@
-set mkfs_cmd mkfs.exfat
-set mkfs_opts ""
-set filesystem fuse_exfat
+set mkfs_cmd mkfs.exfat
+set mkfs_opts ""
+set filesystem fuse_exfat
+set libc_dev_blkdev {}
source ${genode_dir}/libports/run/libc_filesystem_test.inc
diff --git a/libports/run/libc_fuse_ext2.run b/libports/run/libc_fuse_ext2.run
index a92db5f36..ed7d50c25 100644
--- a/libports/run/libc_fuse_ext2.run
+++ b/libports/run/libc_fuse_ext2.run
@@ -1,5 +1,6 @@
-set mkfs_cmd mkfs.ext2
-set mkfs_opts "-F"
-set filesystem fuse_ext2
+set mkfs_cmd mkfs.ext2
+set mkfs_opts "-F"
+set filesystem fuse_ext2
+set libc_dev_blkdev {}
source ${genode_dir}/libports/run/libc_filesystem_test.inc
diff --git a/libports/run/libc_vfs.run b/libports/run/libc_vfs.run
index 8b33c59f5..2b2578211 100644
--- a/libports/run/libc_vfs.run
+++ b/libports/run/libc_vfs.run
@@ -40,11 +40,12 @@ install_config {
-
+
+
@@ -58,7 +59,7 @@ install_config {
build_boot_image {
core init
- ld.lib.so libc.lib.so libc_log.lib.so
+ ld.lib.so libc.lib.so
ram_fs test-libc_vfs
}
diff --git a/libports/run/lwip.run b/libports/run/lwip.run
index 871ef627e..fd5db894c 100644
--- a/libports/run/lwip.run
+++ b/libports/run/lwip.run
@@ -75,7 +75,12 @@ set config {
- }
+
+
+
+
+
+ }
append_if [have_spec platform_arndale] config {
@@ -125,7 +130,7 @@ append_if [expr ![have_spec acpi] && [have_spec pci]] config {
- }
+ }
append config {
@@ -140,7 +145,7 @@ install_config $config
# generic modules
set boot_modules {
core init timer
- ld.lib.so libc.lib.so libc_log.lib.so lwip.lib.so test-lwip_httpsrv
+ ld.lib.so libc.lib.so lwip.lib.so test-lwip_httpsrv
}
# platform-specific modules
diff --git a/libports/run/lwip_lx.run b/libports/run/lwip_lx.run
index 0bfa66a6c..c42e7985b 100644
--- a/libports/run/lwip_lx.run
+++ b/libports/run/lwip_lx.run
@@ -42,6 +42,11 @@ set config {
+
+
+
+
+
}
@@ -54,7 +59,7 @@ install_config $config
set boot_modules {
core init timer nic_drv
- ld.lib.so libc.lib.so libc_log.lib.so lwip.lib.so test-lwip_httpsrv
+ ld.lib.so libc.lib.so lwip.lib.so test-lwip_httpsrv
}
build_boot_image $boot_modules
diff --git a/libports/run/moon.run b/libports/run/moon.run
index 34b3cf242..0ebc06f05 100644
--- a/libports/run/moon.run
+++ b/libports/run/moon.run
@@ -28,13 +28,18 @@ install_config {
+
+
+
+
+
}
build_boot_image {
core init timer test-moon
- ld.lib.so libc.lib.so libc_log.lib.so libm.lib.so
+ ld.lib.so libc.lib.so libm.lib.so
}
append qemu_args " -nographic -m 64 "
diff --git a/libports/run/mupdf.run b/libports/run/mupdf.run
index df44b46ff..17bda29de 100644
--- a/libports/run/mupdf.run
+++ b/libports/run/mupdf.run
@@ -61,6 +61,14 @@ append config {
+
+
+
+
+
+
+
+
}
@@ -83,7 +91,7 @@ if {![file exist bin/test.pdf]} {
set boot_modules {
core init ld.lib.so timer
mupdf
- libc.lib.so libm.lib.so libc_log.lib.so libc_rom.lib.so
+ libc.lib.so libm.lib.so
openjpeg.lib.so freetype.lib.so libpng.lib.so zlib.lib.so jbig2dec.lib.so
mupdf.lib.so jpeg.lib.so
test.pdf
diff --git a/libports/run/network_test.inc b/libports/run/network_test.inc
index 0cca42ce9..9d5bba897 100644
--- a/libports/run/network_test.inc
+++ b/libports/run/network_test.inc
@@ -81,6 +81,9 @@ append config {
+
+
+
}
append_if $use_nic_bridge config {
@@ -147,7 +150,7 @@ install_config $config
# generic modules
set boot_modules {
core init timer
- ld.lib.so libc.lib.so lwip.lib.so libc_log.lib.so
+ ld.lib.so libc.lib.so lwip.lib.so
}
lappend_if $use_nic_bridge boot_modules nic_bridge
diff --git a/libports/run/pthread.run b/libports/run/pthread.run
index 61caff38c..bdc69089c 100644
--- a/libports/run/pthread.run
+++ b/libports/run/pthread.run
@@ -21,13 +21,18 @@ install_config {
+
+
+
+
+
}
build_boot_image {
core init test-pthread
- ld.lib.so libc.lib.so libc_log.lib.so pthread.lib.so
+ ld.lib.so libc.lib.so pthread.lib.so
}
append qemu_args " -nographic -m 64 "
diff --git a/libports/run/python.run b/libports/run/python.run
index 970beb5c9..5a6e830c1 100644
--- a/libports/run/python.run
+++ b/libports/run/python.run
@@ -41,6 +41,24 @@ set config {
+
+
+
+
+print " \r\n\r";
+print " -============================-";
+print " || ||";
+print " || Python Core 2.6.4 ||";
+print " || ||";
+print " || Genode 11.11 ||";
+print " || ||";
+print " -============================-";
+print " \r";
+print " 2011 by Genode Labs ";
+print " \r\n\r";
+
+
+
@@ -52,29 +70,11 @@ install_config $config
# Boot modules
#
-# Fill up hello.py with zeros, otherwise on OKL4 it fails on native machines.
-# OKL4 bootstrap procedure loads the script to the designated address but does
-# not clear the remainder of the page. Hence, the script is followed by some
-# garbage, which the interpreter tries to execute.
-
-set test_file "[genode_dir]/libports/src/test/python/hello.py"
-set file_size [exec du -b $test_file]
-set file_size [regexp -inline {[0-9]+} $file_size]
-set file_size [expr 4096 - $file_size]
-catch { exec dd if=/dev/zero of=bin/hello.py.tmp bs=1 count=$file_size}
-exec cp $test_file bin/hello.py
-exec cat bin/hello.py.tmp >>bin/hello.py
-exec rm bin/hello.py.tmp
-set file_size [exec du -b bin/hello.py]
-set file_size [regexp -inline {[0-9]+} $file_size]
-if {$file_size != 4096 } { puts "hello.py could not be prepared properly"; exit 1 }
-
# generic modules
set boot_modules {
core init
- ld.lib.so libc.lib.so libc_log.lib.so libc_rom.lib.so libm.lib.so python.lib.so
+ ld.lib.so libc.lib.so libm.lib.so python.lib.so
test-python
- hello.py
}
build_boot_image $boot_modules
@@ -102,6 +102,4 @@ compare_output_to {
[init -> test-python]
}
-exec rm bin/hello.py
-
# vi: set ft=tcl :
diff --git a/libports/run/qt5.run b/libports/run/qt5.run
index ceb874eec..c8db391df 100644
--- a/libports/run/qt5.run
+++ b/libports/run/qt5.run
@@ -103,7 +103,6 @@ set boot_modules {
icu.lib.so
ld.lib.so
libc.lib.so
- libc_log.lib.so
libc_lock_pipe.lib.so
libm.lib.so
libpng.lib.so
diff --git a/libports/run/qt5_avplay.run b/libports/run/qt5_avplay.run
index 3c4b70868..aa887e2a2 100644
--- a/libports/run/qt5_avplay.run
+++ b/libports/run/qt5_avplay.run
@@ -120,7 +120,6 @@ set boot_modules {
icu.lib.so
ld.lib.so
libc.lib.so
- libc_log.lib.so
libc_lock_pipe.lib.so
libm.lib.so
libpng.lib.so
@@ -140,8 +139,6 @@ set boot_modules {
swscale.lib.so
sdl.lib.so
pthread.lib.so
- libc_log.lib.so
- libc_rom.lib.so
avplay
mediafile
stdcxx.lib.so
diff --git a/libports/run/qt5_calculatorform.run b/libports/run/qt5_calculatorform.run
index 75c9fd7c8..79b02887a 100644
--- a/libports/run/qt5_calculatorform.run
+++ b/libports/run/qt5_calculatorform.run
@@ -100,7 +100,6 @@ set boot_modules {
icu.lib.so
ld.lib.so
libc.lib.so
- libc_log.lib.so
libc_lock_pipe.lib.so
libm.lib.so
libpng.lib.so
diff --git a/libports/run/qt5_openglwindow.run b/libports/run/qt5_openglwindow.run
index 811348a57..2d9209c89 100644
--- a/libports/run/qt5_openglwindow.run
+++ b/libports/run/qt5_openglwindow.run
@@ -10,7 +10,6 @@ build {
drivers/framebuffer
drivers/timer
server/nitpicker
- server/liquid_framebuffer
app/qt5/examples/openglwindow
}
@@ -77,6 +76,11 @@ append config {
+
+
+
+
+
}
@@ -93,14 +97,12 @@ set boot_modules {
init
timer
nitpicker
- liquid_fb
openglwindow
freetype.lib.so
gallium.lib.so
icu.lib.so
ld.lib.so
libc.lib.so
- libc_log.lib.so
libc_lock_pipe.lib.so
libm.lib.so
libpng.lib.so
diff --git a/libports/run/qt5_previewer.run b/libports/run/qt5_previewer.run
index da63acb6a..72f7485ff 100644
--- a/libports/run/qt5_previewer.run
+++ b/libports/run/qt5_previewer.run
@@ -100,7 +100,6 @@ set boot_modules {
icu.lib.so
ld.lib.so
libc.lib.so
- libc_log.lib.so
libc_lock_pipe.lib.so
libm.lib.so
libpng.lib.so
diff --git a/libports/run/qt5_qpluginwidget.run b/libports/run/qt5_qpluginwidget.run
index ae7d6c5f5..77a708e55 100644
--- a/libports/run/qt5_qpluginwidget.run
+++ b/libports/run/qt5_qpluginwidget.run
@@ -10,7 +10,6 @@ build {
drivers/framebuffer
drivers/timer
server/nitpicker
- server/liquid_framebuffer
server/loader
server/tar_rom
test/nitpicker
@@ -102,7 +101,6 @@ set boot_modules {
init
timer
nitpicker
- liquid_fb
loader
tar_rom
testnit
@@ -112,7 +110,6 @@ set boot_modules {
icu.lib.so
ld.lib.so
libc.lib.so
- libc_log.lib.so
libc_lock_pipe.lib.so
libcrypto.lib.so
libm.lib.so
diff --git a/libports/run/qt5_quicktest.run b/libports/run/qt5_quicktest.run
index c80204f9e..b7d19adbf 100644
--- a/libports/run/qt5_quicktest.run
+++ b/libports/run/qt5_quicktest.run
@@ -10,8 +10,6 @@ build {
drivers/framebuffer
drivers/timer
server/nitpicker
- server/liquid_framebuffer
- server/tar_fs
app/qt5/qt_quicktest
lib/qt5/qtdeclarative/src/imports/qtquick2
}
@@ -83,16 +81,16 @@ append config {
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
}
@@ -113,16 +111,12 @@ set boot_modules {
init
timer
nitpicker
- liquid_fb
- tar_fs
qt_quicktest
freetype.lib.so
gallium.lib.so
icu.lib.so
ld.lib.so
libc.lib.so
- libc_fs.lib.so
- libc_log.lib.so
libc_lock_pipe.lib.so
libcrypto.lib.so
libm.lib.so
diff --git a/libports/run/qt5_samegame.run b/libports/run/qt5_samegame.run
index ba4d3647e..04514b999 100644
--- a/libports/run/qt5_samegame.run
+++ b/libports/run/qt5_samegame.run
@@ -10,8 +10,6 @@ build {
drivers/framebuffer
drivers/timer
server/nitpicker
- server/liquid_framebuffer
- server/tar_fs
app/qt5/examples/samegame
lib/qt5/qtdeclarative/src/imports/qtquick2
}
@@ -83,16 +81,16 @@ append config {
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
}
@@ -113,16 +111,12 @@ set boot_modules {
init
timer
nitpicker
- liquid_fb
- tar_fs
samegame
freetype.lib.so
gallium.lib.so
icu.lib.so
ld.lib.so
libc.lib.so
- libc_fs.lib.so
- libc_log.lib.so
libc_lock_pipe.lib.so
libcrypto.lib.so
libm.lib.so
diff --git a/libports/run/qt5_tetrix.run b/libports/run/qt5_tetrix.run
index de76a33d5..ad5fcc530 100644
--- a/libports/run/qt5_tetrix.run
+++ b/libports/run/qt5_tetrix.run
@@ -10,7 +10,6 @@ build {
drivers/framebuffer
drivers/timer
server/nitpicker
- server/liquid_framebuffer
app/qt5/examples/tetrix
}
@@ -93,14 +92,12 @@ set boot_modules {
init
timer
nitpicker
- liquid_fb
tetrix
freetype.lib.so
gallium.lib.so
icu.lib.so
ld.lib.so
libc.lib.so
- libc_log.lib.so
libc_lock_pipe.lib.so
libm.lib.so
libpng.lib.so
diff --git a/libports/run/qt5_textedit.run b/libports/run/qt5_textedit.run
index 1115828c9..1e1abfbde 100644
--- a/libports/run/qt5_textedit.run
+++ b/libports/run/qt5_textedit.run
@@ -135,12 +135,20 @@ append config {
-
+
+
+
+
+
-
+
+
+
+
+
}
@@ -164,9 +172,7 @@ set boot_modules {
icu.lib.so
ld.lib.so
libc.lib.so
- libc_log.lib.so
libc_lock_pipe.lib.so
- libc_fs.lib.so
libm.lib.so
libpng.lib.so
jpeg.lib.so
diff --git a/libports/run/sdl.run b/libports/run/sdl.run
index 7b9d7a953..659833d30 100644
--- a/libports/run/sdl.run
+++ b/libports/run/sdl.run
@@ -70,6 +70,9 @@ append config {
+
+
+
}
@@ -84,7 +87,7 @@ set boot_modules {
core init
timer
test-sdl
- ld.lib.so libc.lib.so libc_log.lib.so sdl.lib.so pthread.lib.so
+ ld.lib.so libc.lib.so sdl.lib.so pthread.lib.so
}
# platform-specific modules
diff --git a/libports/run/test-nicbridge_static.run b/libports/run/test-nicbridge_static.run
index 6aafa6ce7..321281e21 100644
--- a/libports/run/test-nicbridge_static.run
+++ b/libports/run/test-nicbridge_static.run
@@ -71,6 +71,11 @@ append config {
+
+
+
+
+
@@ -78,6 +83,11 @@ append config {
+
+
+
+
+
}
@@ -93,7 +103,7 @@ set boot_modules {
timer nic_drv
nic_bridge
ld.lib.so
- libc.lib.so libc_log.lib.so
+ libc.lib.so
lwip.lib.so
test-http_clnt
test-lwip_httpsrv_static
diff --git a/libports/run/test-nicbridge_static2.run b/libports/run/test-nicbridge_static2.run
index e101bad59..ef52e5b74 100644
--- a/libports/run/test-nicbridge_static2.run
+++ b/libports/run/test-nicbridge_static2.run
@@ -4,9 +4,8 @@
set build_components {
core init
- drivers/timer drivers/pci drivers/nic
+ drivers/timer drivers/input drivers/pci drivers/nic
server/nic_bridge
- server/ram_fs
app/lighttpd
test/lwip/http_clnt
@@ -66,15 +65,23 @@ append config {
-
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
# lighttpd configuration
server.port = 80
server.document-root = "/website"
@@ -87,11 +94,11 @@ mimetype.assign = (
".html" => "text/html",
".htm" => "text/html"
)
-
+
+
-
-
-
+
+
Hello
@@ -101,19 +108,10 @@ mimetype.assign = (
I am bold ;-)
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
@@ -126,6 +124,11 @@ mimetype.assign = (
+
+
+
+
+
}
@@ -141,12 +144,11 @@ set boot_modules {
timer nic_drv
nic_bridge
ld.lib.so
- libc.lib.so libc_log.lib.so
+ libc.lib.so
lwip.lib.so
test-http_clnt
- ram_fs
- libm.lib.so libc_fs.lib.so
- zlib.lib.so libcrypto.lib.so libssl.lib.so
+ libm.lib.so
+ zlib.lib.so
lighttpd
}
@@ -164,5 +166,6 @@ append_if [have_spec x86] qemu_args " -net nic,model=pcnet "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -net user "
+append qemu_args " -nographic -serial mon:stdio "
run_genode_until forever
diff --git a/libports/run/test-ping_client.run b/libports/run/test-ping_client.run
index 9052f04d0..69fc7a4db 100644
--- a/libports/run/test-ping_client.run
+++ b/libports/run/test-ping_client.run
@@ -109,11 +109,16 @@ append config {
- }
+ }
append config "
-
+ "
+append config {
+
+
+
+
- "
+ }
append config {
@@ -128,7 +133,7 @@ install_config $config
# generic modules
set boot_modules {
core init timer
- ld.lib.so libc.lib.so libc_log.lib.so lwip_nic_dhcp.lib.so lwip.lib.so
+ ld.lib.so libc.lib.so lwip.lib.so
test-ping_client_libc_lwip
}
diff --git a/libports/run/test-ping_server.run b/libports/run/test-ping_server.run
index 967b5434d..a5c4235e7 100644
--- a/libports/run/test-ping_server.run
+++ b/libports/run/test-ping_server.run
@@ -52,6 +52,9 @@ set config {
+
+
+
}
@@ -104,7 +107,7 @@ install_config $config
# generic modules
set boot_modules {
core init timer
- ld.lib.so libc.lib.so lwip.lib.so libc_log.lib.so
+ ld.lib.so libc.lib.so lwip.lib.so
test-ping_server_libc_lwip
}
diff --git a/libports/src/app/avplay/target.mk b/libports/src/app/avplay/target.mk
index 0499fb54e..8dad463f5 100644
--- a/libports/src/app/avplay/target.mk
+++ b/libports/src/app/avplay/target.mk
@@ -3,7 +3,7 @@ include $(REP_DIR)/lib/import/import-av.inc
TARGET = avplay
SRC_C = avplay.c cmdutils.c libc_dummies.c
LIBS += avfilter avformat avcodec avutil swscale
-LIBS += sdl libc libm libc_log libc_rom config_args
+LIBS += sdl libc libm libc_vfs config_args
CC_WARN += -Wno-parentheses -Wno-switch -Wno-uninitialized \
-Wno-format-zero-length -Wno-pointer-sign
diff --git a/libports/src/app/eglgears/target.mk b/libports/src/app/eglgears/target.mk
index a855addd7..b016b7052 100644
--- a/libports/src/app/eglgears/target.mk
+++ b/libports/src/app/eglgears/target.mk
@@ -1,3 +1,3 @@
TARGET = eglgears
SRC_C = eglgears.c
-LIBS = libc libm libc_log gallium
+LIBS = libc libc_vfs libm gallium
diff --git a/libports/src/app/mupdf/target.mk b/libports/src/app/mupdf/target.mk
index 5cd4587c1..6e02a790e 100644
--- a/libports/src/app/mupdf/target.mk
+++ b/libports/src/app/mupdf/target.mk
@@ -2,7 +2,7 @@ MUPDF_DIR = $(REP_DIR)/contrib/mupdf-0.9
TARGET = mupdf
SRC_C = pdfapp.c
SRC_CC = main.cc
-LIBS = libc mupdf libc_log libc_rom
+LIBS = libc mupdf libc_vfs
INC_DIR += $(MUPDF_DIR)/apps
vpath pdfapp.c $(MUPDF_DIR)/apps
diff --git a/libports/src/app/qt5/examples/samegame/target.mk b/libports/src/app/qt5/examples/samegame/target.mk
index ad944a423..ddacab428 100644
--- a/libports/src/app/qt5/examples/samegame/target.mk
+++ b/libports/src/app/qt5/examples/samegame/target.mk
@@ -6,5 +6,3 @@ include $(QT5_REP_DIR)/src/app/qt5/tmpl/target_defaults.inc
include $(QT5_REP_DIR)/src/app/qt5/tmpl/target_final.inc
-LIBS += libc_fs
-
diff --git a/libports/src/app/qt5/examples/textedit/target.mk b/libports/src/app/qt5/examples/textedit/target.mk
index 81c40c0db..37f5c028c 100644
--- a/libports/src/app/qt5/examples/textedit/target.mk
+++ b/libports/src/app/qt5/examples/textedit/target.mk
@@ -13,4 +13,3 @@ include $(QT5_REP_DIR)/src/app/qt5/tmpl/target_defaults.inc
include $(QT5_REP_DIR)/src/app/qt5/tmpl/target_final.inc
-LIBS += libc_fs
diff --git a/libports/src/app/qt5/qt_avplay/avplay_policy.h b/libports/src/app/qt5/qt_avplay/avplay_policy.h
index 1bcb30df9..958938275 100644
--- a/libports/src/app/qt5/qt_avplay/avplay_policy.h
+++ b/libports/src/app/qt5/qt_avplay/avplay_policy.h
@@ -54,6 +54,25 @@ class Avplay_policy : public QObject, public Genode::Slave_policy
arg1_node.setAttribute("value", _mediafile);
config_node.appendChild(arg1_node);
+ /*
+ * Configure libc of avplay to direct output to LOG and to obtain
+ * the mediafile from ROM.
+ */
+ QDomElement libc_node = config_doc.createElement("libc");
+ libc_node.setAttribute("stdout", "/dev/log");
+ libc_node.setAttribute("stderr", "/dev/log");
+ QDomElement libc_vfs_node = config_doc.createElement("vfs");
+ QDomElement libc_vfs_dev_node = config_doc.createElement("dir");
+ libc_vfs_dev_node.setAttribute("name", "dev");
+ QDomElement libc_vfs_dev_log_node = config_doc.createElement("log");
+ libc_vfs_dev_node.appendChild(libc_vfs_dev_log_node);
+ libc_vfs_node.appendChild(libc_vfs_dev_node);
+ QDomElement libc_vfs_mediafile_node = config_doc.createElement("rom");
+ libc_vfs_mediafile_node.setAttribute("name", "mediafile");
+ libc_vfs_node.appendChild(libc_vfs_mediafile_node);
+ libc_node.appendChild(libc_vfs_node);
+ config_node.appendChild(libc_node);
+
QDomElement sdl_audio_volume_node = config_doc.createElement("sdl_audio_volume");
sdl_audio_volume_node.setAttribute("value", QString::number(_sdl_audio_volume));
config_node.appendChild(sdl_audio_volume_node);
diff --git a/libports/src/app/qt5/qt_quicktest/target.mk b/libports/src/app/qt5/qt_quicktest/target.mk
index ad944a423..ddacab428 100644
--- a/libports/src/app/qt5/qt_quicktest/target.mk
+++ b/libports/src/app/qt5/qt_quicktest/target.mk
@@ -6,5 +6,3 @@ include $(QT5_REP_DIR)/src/app/qt5/tmpl/target_defaults.inc
include $(QT5_REP_DIR)/src/app/qt5/tmpl/target_final.inc
-LIBS += libc_fs
-
diff --git a/libports/src/app/qt5/tmpl/target_final.inc b/libports/src/app/qt5/tmpl/target_final.inc
index 4c3a118b6..bcda8bab3 100644
--- a/libports/src/app/qt5/tmpl/target_final.inc
+++ b/libports/src/app/qt5/tmpl/target_final.inc
@@ -1,6 +1,6 @@
INC_DIR += $(PRG_DIR)
-LIBS += libc libc_log
+LIBS += libc libc_vfs
# set the stack size of the main thread
CC_CXX_OPT += -DQT_MAIN_STACK_SIZE=$(QT_MAIN_STACK_SIZE)
diff --git a/libports/src/lib/libc_block/plugin.cc b/libports/src/lib/libc_block/plugin.cc
deleted file mode 100644
index f171e86f5..000000000
--- a/libports/src/lib/libc_block/plugin.cc
+++ /dev/null
@@ -1,544 +0,0 @@
-/*
- * \brief Libc Block_session plugin
- * \author Josef Soentgen
- * \date 2013-11-04
- */
-
-/*
- * Copyright (C) 2013 Genode Labs GmbH
- *
- * This file is part of the Genode OS framework, which is distributed
- * under the terms of the GNU General Public License version 2.
- */
-
-/* Genode includes */
-#include
-#include
-#include
-
-/* libc plugin includes */
-#include
-#include
-
-/* libc includes */
-#include
-#include
-#include
-#include
-#include
-#include
-
-using namespace Genode;
-
-
-static bool const verbose = false;
-
-/**
- * There is a off_t typedef clash between sys/socket.h
- * and base/stdint.h. We define the macro here to circumvent
- * this issue.
- */
-#undef DIOCGMEDIASIZE
-#define DIOCGMEDIASIZE _IOR('d', 129, Genode::off_t)
-
-/************
- ** Plugin **
- ************/
-
-namespace {
-
- struct Plugin_context : Libc::Plugin_context
- {
- private:
-
- Genode::Allocator *_md_alloc;
- Genode::Allocator_avl _tx_block_alloc;
-
- char *_block_buffer;
-
- Block::Connection *_block;
- size_t _block_size;
- Block::sector_t _block_count;
- Block::Session::Operations _block_ops;
- Block::Session::Tx::Source *_tx_source;
-
- ::off_t _cur_offset;
-
- bool _readable;
- bool _writeable;
-
- int _flags;
-
- public:
-
-
- enum { BUFFER_BLOCK_NUMBER = 16 };
-
- Plugin_context(Genode::Allocator *md_alloc, int flags)
- :
- _md_alloc(md_alloc),
- _tx_block_alloc(_md_alloc),
- _block_buffer(0),
- _block(new (_md_alloc) Block::Connection(&_tx_block_alloc)),
- _tx_source(_block->tx()),
- _cur_offset(0),
- _readable(false),
- _writeable(false),
- _flags(flags)
- {
- _block->info(&_block_count, &_block_size, &_block_ops);
-
- _readable = _block_ops.supported(Block::Packet_descriptor::READ);
- _writeable = _block_ops.supported(Block::Packet_descriptor::WRITE);
-
- _block_buffer = reinterpret_cast(malloc(BUFFER_BLOCK_NUMBER * _block_size));
-
- if (verbose) {
- PDBG("number of blocks: %llu with block size: %zu (bytes)"
- " , readable: %d writeable: %d",
- _block_count, _block_size, _readable, _writeable);
- }
- }
-
- ~Plugin_context()
- {
- destroy(_md_alloc, _block);
- free(_block_buffer);
- }
-
- /**
- * Return read/write state
- */
- bool readable() const { return _readable; }
- bool writeable() const { return _writeable; }
-
- /**
- * Return file descriptor flags
- */
- int flags() const { return _flags; }
-
- /**
- * Return seek offset
- */
- ::off_t seek_offset() const { return _cur_offset; }
-
- /**
- * Set seek offset
- */
- void seek_offset(size_t seek_offset) { _cur_offset = seek_offset; }
-
- /**
- * Advance current seek offset position by 'incr' number of bytes
- */
- void advance_seek_offset(size_t incr) { _cur_offset += incr; }
-
- /**
- * Set seek offset to maximum value
- */
- void infinite_seek_offset() { _cur_offset = ~0; }
-
- /**
- * Return pointer to memory used as block puffer
- */
- char *block_buffer() const { return _block_buffer; }
-
- /**
- * Return number of blocks
- */
- size_t block_count() const { return _block_count; }
-
- /**
- * Return size of a block
- */
- size_t block_size() const { return _block_size; }
-
- /**
- * Issue a block operation
- *
- * This implementation operates synchronized, it will wait for the
- * acknowlegdement for the submitted packet.
- *
- * \param nr number of start block
- * \param buf buffer to read from or write to
- * \param sz size of buffer
- * \param write if true issue write operation, otherwise issue read opertion
- * \param bulk if true operate on as many block as fit into the block buffer
- *
- * return number of bytes transfered
- */
- ssize_t block_io(size_t nr, void *buf, size_t sz, bool write, bool bulk = false)
- {
- /* sync offset */
- _cur_offset = nr * _block_size;
-
- Block::Packet_descriptor::Opcode op;
- op = write ? Block::Packet_descriptor::WRITE : Block::Packet_descriptor::READ;
-
- size_t packet_size = bulk ? sz : _block_size;
- size_t packet_count = bulk ? (sz / _block_size) : 1;
-
- /* sanity check */
- if (packet_count > BUFFER_BLOCK_NUMBER) {
- packet_size = BUFFER_BLOCK_NUMBER * _block_size;
- packet_count = BUFFER_BLOCK_NUMBER;
- }
-
- if (verbose)
- PDBG("%5s: block:%zu size:%zu packets:%zu",
- write ? "write" : "read", nr, sz, packet_count);
-
- Block::Packet_descriptor p(_tx_source->alloc_packet(packet_size), op,
- nr, packet_count);
-
- if (write)
- Genode::memcpy(_tx_source->packet_content(p), buf, packet_size);
-
- _tx_source->submit_packet(p);
- p = _tx_source->get_acked_packet();
-
- if (!p.succeeded()) {
- PERR("Could not read block(s)");
- _tx_source->release_packet(p);
- errno = EIO;
- return -1;
- }
-
- if (!write)
- Genode::memcpy(buf, _tx_source->packet_content(p), packet_size);
-
- _cur_offset += packet_size;
-
- _tx_source->release_packet(p);
- return packet_size;
- }
-
- };
-
- static inline Plugin_context *context(Libc::File_descriptor *fd)
- {
- return static_cast(fd->context);
- }
-
- class Plugin : public Libc::Plugin
- {
- private:
-
- /**
- * File name this plugin feels responsible for
- */
- static char const *_dev_name() { return "/dev/blkdev"; }
-
- bool _supports_path(const char *path)
- {
- return (Genode::strcmp(path, "/dev") == 0) ||
- (Genode::strcmp(path, _dev_name()) == 0);
- }
-
- public:
-
- /**
- * Constructor
- */
- Plugin() { }
-
- bool supports_open(const char *pathname, int flags) {
- return _supports_path(pathname); }
-
- bool supports_stat(const char *path) {
- return _supports_path(path); }
-
- int close(Libc::File_descriptor *fd)
- {
- Plugin_context *ctx = context(fd);
-
- destroy(env()->heap(), ctx);
- Libc::file_descriptor_allocator()->free(fd);
-
- return 0;
- }
-
- int fcntl(Libc::File_descriptor *fd, int cmd, long arg)
- {
- switch (cmd) {
- case F_GETFL:
- return context(fd)->flags();
- case F_SETLK:
- /**
- * We do not support locking a block device but we keep
- * the caller happy.
- */
- return 0;
- default:
- PDBG("cmd: %d not implemented, return error.", cmd);
- return -1;
- }
-
- return -1; /* never reached */
- }
-
- int fstat(Libc::File_descriptor *fd, struct stat *buf)
- {
- /* we pretent to be a block device */
- if (buf) {
- Genode::memset(buf, 0, sizeof (struct stat));
- buf->st_mode = S_IFBLK;
- }
-
- return 0;
- }
-
- int fsync(Libc::File_descriptor *fd)
- {
- /**
- * Currently all block I/O is done synchronized. To
- * keep the caller happy we pretent that the fsync()
- * call was successful.
- */
- return 0;
- }
-
- int ioctl(Libc::File_descriptor *fd, int req, char *argp)
- {
- Plugin_context *ctx = context(fd);
-
- switch (req) {
- case DIOCGMEDIASIZE:
- return ctx->block_count();
- case DIOCGSECTORSIZE:
- return ctx->block_size();
- default:
- PDBG("request: %d not supported", req);
- return -1;
- }
- }
-
- ::off_t lseek(Libc::File_descriptor *fd, ::off_t offset, int whence)
- {
- Plugin_context *ctx = context(fd);
-
- switch (whence) {
- case SEEK_SET:
- ctx->seek_offset(offset);
- return offset;
-
- case SEEK_CUR:
- ctx->advance_seek_offset(offset);
- return ctx->seek_offset();
-
- case SEEK_END:
- if (offset != 0) {
- errno = EINVAL;
- return -1;
- }
- ctx->infinite_seek_offset();
- return (ctx->block_count() * ctx->block_size());
-
- default:
- errno = EINVAL;
- return -1;
- }
- }
-
- Libc::File_descriptor *open(const char *pathname, int flags)
- {
- try {
- if (verbose)
- PDBG("open block device '%s'", pathname);
-
- Plugin_context *context = new (Genode::env()->heap())
- Plugin_context(env()->heap(), flags);
-
- return Libc::file_descriptor_allocator()->alloc(this, context);
- } catch (...) {
- PERR("could not create plugin context");
- }
-
- errno = ENOENT;
- return 0;
- }
-
- ssize_t read(Libc::File_descriptor *fd, void *buf, ::size_t count)
- {
- Plugin_context *ctx = context(fd);
-
- if (!ctx->readable()) {
- PERR("block device is not readable");
- errno = EINVAL;
- return -1;
- }
-
- size_t blk_size = ctx->block_size();
- char *blk_buffer = ctx->block_buffer();
- char *_buf = (char*) buf;
-
- ssize_t read = 0;
- while (count > 0) {
- size_t displ = 0;
- size_t length = 0;
- ssize_t nbytes = 0;
- size_t blk_nr = ctx->seek_offset() / blk_size;
-
- displ = ctx->seek_offset() % blk_size;
-
- if ((displ + count) > blk_size)
- length = (blk_size - displ);
- else
- length = count;
-
- /**
- * We take a shortcut and read the blocks all at once if the
- * offset is aligned on a block boundary and we the count is a
- * multiple of the block size, e.g. 4K reads will be read at
- * once.
- *
- * XXX this is quite hackish because we have to omit partial
- * blocks at the end.
- */
- if (displ == 0 && (count % blk_size) >= 0 && !(count < blk_size)) {
- size_t bytes_left = count - (count % blk_size);
-
- nbytes = ctx->block_io(blk_nr, _buf + read, bytes_left, false, true);
- if (nbytes == -1) {
- PERR("error while reading block:%zu from block device",
- blk_nr);
- return -1;
- }
-
- read += nbytes;
- count -= nbytes;
-
- continue;
- }
-
- if (displ > 0)
- PWRN("offset:%lld is not aligned to block_size:%zu"
- " displacement:%zu", ctx->seek_offset(), blk_size, displ);
-
- nbytes = ctx->block_io(blk_nr, blk_buffer, blk_size, false);
- if ((unsigned)nbytes != blk_size) {
- PERR("error while reading block:%zu from block device",
- blk_nr);
- return -1;
- }
-
- Genode::memcpy(_buf + read, blk_buffer + displ, length);
-
- read += length;
- count -= length;
- }
-
- return read;
- }
-
- int stat(const char *path, struct stat *buf)
- {
- /* we pretent to be a block device */
- if (buf) {
- Genode::memset(buf, 0, sizeof (struct stat));
- if (Genode::strcmp(path, "/dev") == 0)
- buf->st_mode = S_IFDIR;
- else if (Genode::strcmp(path, _dev_name()) == 0)
- buf->st_mode = S_IFBLK;
- else {
- errno = ENOENT;
- return -1;
- }
- }
- return 0;
- }
-
- ssize_t write(Libc::File_descriptor *fd, const void *buf, ::size_t count)
- {
- Plugin_context *ctx = context(fd);
-
- if (!ctx->writeable()) {
- PERR("block device is not writeable");
- errno = EINVAL;
- return -1;
- }
-
- size_t blk_size = ctx->block_size();
- char *blk_buffer = ctx->block_buffer();
- const char *_buf = (const char*)buf;
-
- ssize_t written = 0;
- while (count > 0) {
- size_t displ = 0;
- size_t length = 0;
- ssize_t nbytes = 0;
- size_t blk_nr = ctx->seek_offset() / blk_size;
-
- displ = ctx->seek_offset() % blk_size;
-
- if ((displ + count) > blk_size)
- length = (blk_size - displ);
- else
- length = count;
-
- /**
- * We take a shortcut and write as much as possible without
- * using the block buffer if the offset is aligned on a block
- * boundary and the count is a multiple of the block size,
- * e.g. 4K writes will be written at once.
- *
- * XXX this is quite hackish because we have to omit partial
- * blocks at the end.
- */
- if (displ == 0 && (count % blk_size) >= 0 && !(count < blk_size)) {
- size_t bytes_left = count - (count % blk_size);
-
- nbytes = ctx->block_io(blk_nr, (void*)(_buf + written),
- bytes_left, true, true);
- if (nbytes == -1) {
- PERR("error while reading block:%zu from block device",
- blk_nr);
- return -1;
- }
-
- written += nbytes;
- count -= nbytes;
-
- continue;
- }
-
- /**
- * The offset is not aligned on a block boundary. Therefore
- * we need to read the block to the block buffer first and
- * put the buffer content at the right offset before we can
- * write the whole block back. In addition if length is less
- * than block size, we also have to read the block first.
- */
- if (displ > 0 || length < blk_size) {
- PWRN("offset:%lld block_size:%zd displacement:%zd length:%zu",
- ctx->seek_offset(), blk_size, displ, length);
-
- ctx->block_io(blk_nr, blk_buffer, blk_size, false);
- /* rewind seek offset to account for the block read */
- ctx->seek_offset(ctx->seek_offset()-blk_size);
- }
-
- Genode::memcpy(blk_buffer + displ, _buf + written, length);
-
- nbytes = ctx->block_io(blk_nr, blk_buffer, blk_size, true);
- if ((unsigned)nbytes != blk_size) {
- PERR("error while reading block:%zu from Block_device",
- blk_nr);
- return -1;
- }
-
- written += length;
- count -= length;
- }
-
- return written;
- }
-
- };
-
-} /* unnamed namespace */
-
-void __attribute__((constructor)) init_libc_block(void)
-{
- PDBG("using the libc_block plugin");
- static Plugin plugin;
-}
diff --git a/libports/src/lib/libc_ffat/plugin.cc b/libports/src/lib/libc_ffat/plugin.cc
index c090226c2..9581407a4 100644
--- a/libports/src/lib/libc_ffat/plugin.cc
+++ b/libports/src/lib/libc_ffat/plugin.cc
@@ -162,12 +162,17 @@ class Plugin : public Libc::Plugin
return directory_plugin_context->ffat_dir();
}
+ /*
+ * Override libc_vfs
+ */
+ enum { PLUGIN_PRIORITY = 1 };
+
public:
/**
* Constructor
*/
- Plugin()
+ Plugin() : Libc::Plugin(PLUGIN_PRIORITY)
{
/* mount the file system */
if (verbose)
@@ -188,42 +193,59 @@ class Plugin : public Libc::Plugin
* TODO: decide if the file named shall be handled by this plugin
*/
- bool supports_mkdir(const char *path, mode_t)
+ bool supports_mkdir(const char *path, mode_t) override
{
if (verbose)
PDBG("path = %s", path);
return true;
}
- bool supports_open(const char *pathname, int flags)
+ bool supports_open(const char *pathname, int flags) override
{
if (verbose)
PDBG("pathname = %s", pathname);
return true;
}
- bool supports_rename(const char *oldpath, const char *newpath)
+ bool supports_rename(const char *oldpath, const char *newpath) override
{
if (verbose)
PDBG("oldpath = %s, newpath = %s", oldpath, newpath);
return true;
}
- bool supports_stat(const char *path)
+ bool supports_rmdir(const char *path) override
{
if (verbose)
PDBG("path = %s", path);
return true;
}
- bool supports_unlink(const char *path)
+ bool supports_stat(const char *path) override
{
if (verbose)
PDBG("path = %s", path);
return true;
}
- int close(Libc::File_descriptor *fd)
+ bool supports_unlink(const char *path) override
+ {
+ if (verbose)
+ PDBG("path = %s", path);
+ return true;
+ }
+
+ bool supports_symlink(const char *, const char *) override
+ {
+ /*
+ * Even though FFAT does not support symlinks, we still want
+ * to capture calls of 'symlink' to return ENOSYS, which is
+ * checked in the file-system test.
+ */
+ return true;
+ }
+
+ int close(Libc::File_descriptor *fd) override
{
using namespace Ffat;
@@ -257,7 +279,7 @@ class Plugin : public Libc::Plugin
}
}
- int fcntl(Libc::File_descriptor *fd, int cmd, long arg)
+ int fcntl(Libc::File_descriptor *fd, int cmd, long arg) override
{
switch (cmd) {
case F_GETFD: return context(fd)->fd_flags();
@@ -267,12 +289,12 @@ class Plugin : public Libc::Plugin
}
}
- int fstat(Libc::File_descriptor *fd, struct stat *buf)
+ int fstat(Libc::File_descriptor *fd, struct stat *buf) override
{
return stat(context(fd)->filename(), buf);
}
- int fstatfs(Libc::File_descriptor *, struct statfs *buf)
+ int fstatfs(Libc::File_descriptor *, struct statfs *buf) override
{
/* libc's opendir() fails if _fstatfs() returns -1, so we return 0 here */
if (verbose)
@@ -280,7 +302,7 @@ class Plugin : public Libc::Plugin
return 0;
}
- int fsync(Libc::File_descriptor *fd)
+ int fsync(Libc::File_descriptor *fd) override
{
using namespace Ffat;
@@ -302,7 +324,7 @@ class Plugin : public Libc::Plugin
}
}
- int ftruncate(Libc::File_descriptor *fd, ::off_t length)
+ int ftruncate(Libc::File_descriptor *fd, ::off_t length) override
{
using namespace Ffat;
@@ -330,7 +352,7 @@ class Plugin : public Libc::Plugin
}
ssize_t getdirentries(Libc::File_descriptor *fd, char *buf,
- ::size_t nbytes, ::off_t *basep)
+ ::size_t nbytes, ::off_t *basep) override
{
using namespace Ffat;
@@ -392,7 +414,7 @@ class Plugin : public Libc::Plugin
return sizeof(struct dirent);
}
- ::off_t lseek(Libc::File_descriptor *fd, ::off_t offset, int whence)
+ ::off_t lseek(Libc::File_descriptor *fd, ::off_t offset, int whence) override
{
using namespace Ffat;
@@ -430,7 +452,7 @@ class Plugin : public Libc::Plugin
}
}
- int mkdir(const char *path, mode_t mode)
+ int mkdir(const char *path, mode_t mode) override
{
using namespace Ffat;
@@ -465,7 +487,7 @@ class Plugin : public Libc::Plugin
}
}
- Libc::File_descriptor *open(const char *pathname, int flags)
+ Libc::File_descriptor *open(const char *pathname, int flags) override
{
using namespace Ffat;
@@ -567,7 +589,7 @@ class Plugin : public Libc::Plugin
}
}
- int rename(const char *oldpath, const char *newpath)
+ int rename(const char *oldpath, const char *newpath) override
{
using namespace Ffat;
@@ -603,7 +625,7 @@ class Plugin : public Libc::Plugin
}
}
- ssize_t read(Libc::File_descriptor *fd, void *buf, ::size_t count)
+ ssize_t read(Libc::File_descriptor *fd, void *buf, ::size_t count) override
{
using namespace Ffat;
@@ -629,7 +651,7 @@ class Plugin : public Libc::Plugin
}
}
- int stat(const char *path, struct stat *buf)
+ int stat(const char *path, struct stat *buf) override
{
using namespace Ffat;
@@ -705,7 +727,7 @@ class Plugin : public Libc::Plugin
return 0;
}
- int unlink(const char *path)
+ int unlink(const char *path) override
{
using namespace Ffat;
@@ -738,7 +760,12 @@ class Plugin : public Libc::Plugin
}
}
- ssize_t write(Libc::File_descriptor *fd, const void *buf, ::size_t count)
+ int rmdir(const char *path) override
+ {
+ return unlink(path);
+ }
+
+ ssize_t write(Libc::File_descriptor *fd, const void *buf, ::size_t count) override
{
using namespace Ffat;
@@ -763,6 +790,12 @@ class Plugin : public Libc::Plugin
return -1;
}
}
+
+ int symlink(const char *, const char *) override
+ {
+ errno = ENOSYS;
+ return -1;
+ }
};
diff --git a/libports/src/lib/libc_fs/plugin.cc b/libports/src/lib/libc_fs/plugin.cc
deleted file mode 100644
index 848d6ea5b..000000000
--- a/libports/src/lib/libc_fs/plugin.cc
+++ /dev/null
@@ -1,824 +0,0 @@
-/*
- * \brief Libc plugin for accessing a file-system session
- * \author Norman Feske
- * \date 2012-04-11
- */
-
-/*
- * Copyright (C) 2012-2013 Genode Labs GmbH
- *
- * This file is part of the Genode OS framework, which is distributed
- * under the terms of the GNU General Public License version 2.
- */
-
-/* Genode includes */
-#include
-#include
-#include
-#include
-
-/* libc includes */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/* libc plugin interface */
-#include
-#include
-
-/* libc-internal includes */
-#include
-
-static bool const verbose = false;
-
-
-namespace File_system { struct Packet_ref { }; }
-
-
-namespace {
-
-enum { PATH_MAX_LEN = 256 };
-
-typedef Genode::Path Canonical_path;
-
-
-static File_system::Session *file_system()
-{
- static Genode::Allocator_avl tx_buffer_alloc(Genode::env()->heap());
- static File_system::Connection fs(tx_buffer_alloc);
- return &fs;
-}
-
-
-struct Node_handle_guard
-{
- File_system::Node_handle handle;
-
- Node_handle_guard(File_system::Node_handle handle) : handle(handle) { }
-
- ~Node_handle_guard() { file_system()->close(handle); }
-};
-
-
-class Plugin_context : public Libc::Plugin_context,
- public File_system::Packet_ref
-{
- private:
-
- enum Type { TYPE_FILE, TYPE_DIR, TYPE_SYMLINK };
-
- Type _type;
-
- File_system::Node_handle _node_handle;
-
- int _fd_flags;
- int _status_flags;
-
- /**
- * Current file position if manually seeked, or ~0 for append mode
- */
- off_t _seek_offset;
-
- public:
-
-
- Plugin_context(File_system::File_handle handle)
- : _type(TYPE_FILE), _node_handle(handle), _fd_flags(0),
- _status_flags(0), _seek_offset(~0) { }
-
- Plugin_context(File_system::Dir_handle handle)
- : _type(TYPE_DIR), _node_handle(handle), _fd_flags(0),
- _status_flags(0), _seek_offset(0){ }
-
- Plugin_context(File_system::Symlink_handle handle)
- : _type(TYPE_SYMLINK), _node_handle(handle), _fd_flags(0),
- _status_flags(0), _seek_offset(~0) { }
-
- File_system::Node_handle node_handle() const { return _node_handle; }
-
- /**
- * Set/get file descriptor flags
- */
- void fd_flags(int flags) { _fd_flags = flags; }
- int fd_flags() { return _fd_flags; }
-
- /**
- * Set/get file status status flags
- */
- void status_flags(int flags) { _status_flags = flags; }
- int status_flags() { return _status_flags; }
-
- /**
- * Return true of handle is append mode
- */
- bool is_appending() const { return ~0 == _seek_offset; }
-
- /**
- * Set seek offset, switch to non-append mode
- */
- void seek_offset(size_t seek_offset) { _seek_offset = seek_offset; }
-
- /**
- * Return seek offset if handle is in non-append mode
- */
- off_t seek_offset() const { return _seek_offset; }
-
- /**
- * Advance current seek position by 'incr' number of bytes
- *
- * This function has no effect if the handle is in append mode.
- */
- void advance_seek_offset(size_t incr)
- {
- if (!is_appending())
- _seek_offset += incr;
- }
-
- void infinite_seek_offset()
- {
- _seek_offset = ~0;
- }
-
- virtual ~Plugin_context() { }
-};
-
-
-static inline Plugin_context *context(Libc::File_descriptor *fd)
-{
- return fd->context ? static_cast(fd->context) : 0;
-}
-
-static size_t const session_max_packet_size(File_system::Session::Tx::Source &source)
-{
- using Policy = File_system::Session::Tx_policy;
-
- return source.bulk_buffer_size() - (sizeof(Policy::Ack_queue)
- + sizeof(Policy::Submit_queue));
-}
-
-
-static void obtain_stat_for_node(File_system::Node_handle node_handle,
- struct stat *buf)
-{
- if (!buf)
- return;
-
- File_system::Status status = file_system()->status(node_handle);
-
- /*
- * Translate status information to 'struct stat' format
- */
- memset(buf, 0, sizeof(struct stat));
- buf->st_size = status.size;
-
- if (status.is_directory())
- buf->st_mode |= S_IFDIR;
- else if (status.is_symlink())
- buf->st_mode |= S_IFLNK;
- else
- buf->st_mode |= S_IFREG;
-
- struct tm tm;
- memset(&tm, 0, sizeof(struct tm));
-
- buf->st_mtime = mktime(&tm);
-
- if (buf->st_mtime == -1 && verbose)
- PERR("mktime() returned -1, the file modification time reported by stat() will be incorrect");
-}
-
-
-class Plugin : public Libc::Plugin
-{
- private:
-
- Genode::Lock _rw_lock;
-
- ::off_t _file_size(Libc::File_descriptor *fd)
- {
- struct stat stat_buf;
- if (fstat(fd, &stat_buf) == -1)
- return -1;
- return stat_buf.st_size;
- }
-
- public:
-
- /**
- * Constructor
- *
- * Use priority 1 to override libc_vfs.
- */
- Plugin() : Libc::Plugin(1) { }
-
- ~Plugin() { }
-
- bool supports_mkdir(const char *path, mode_t)
- {
- if (verbose)
- PDBG("path = %s", path);
- return true;
- }
-
- bool supports_open(const char *pathname, int flags)
- {
- if (verbose)
- PDBG("pathname = %s", pathname);
- return true;
- }
-
- bool supports_readlink(const char *path, char *, size_t)
- {
- if (verbose)
- PDBG("path = %s", path);
- return true;
- }
-
- bool supports_rename(const char *oldpath, const char *newpath)
- {
- if (verbose)
- PDBG("oldpath = %s, newpath = %s", oldpath, newpath);
- return true;
- }
-
- bool supports_stat(const char *path)
- {
- if (verbose)
- PDBG("path = %s", path);
- return true;
- }
-
- bool supports_symlink(const char *oldpath, const char *newpath)
- {
- if (verbose)
- PDBG("oldpath = %s, newpath = %s", oldpath, newpath);
- return true;
- }
-
- bool supports_unlink(const char *path)
- {
- if (verbose)
- PDBG("path = %s", path);
- return true;
- }
-
- bool supports_mmap() { return true; }
-
- int close(Libc::File_descriptor *fd)
- {
- file_system()->close(context(fd)->node_handle());
-
- Genode::destroy(Genode::env()->heap(), context(fd));
- Libc::file_descriptor_allocator()->free(fd);
-
- return 0;
- }
-
- int fcntl(Libc::File_descriptor *fd, int cmd, long arg)
- {
- switch (cmd) {
- case F_GETFD: return context(fd)->fd_flags();
- case F_SETFD: context(fd)->fd_flags(arg); return 0;
- case F_GETFL: return context(fd)->status_flags();
- default: PERR("fcntl(): command %d not supported", cmd); return -1;
- }
- }
-
- int fstat(Libc::File_descriptor *fd, struct stat *buf)
- {
- try {
- obtain_stat_for_node(context(fd)->node_handle(), buf);
- return 0;
- }
- catch (...) {
- struct Unhandled_exception_in_fstat { };
- throw Unhandled_exception_in_fstat();
- }
- return -1;
- }
-
- int fstatfs(Libc::File_descriptor *, struct statfs *buf)
- {
- /* libc's opendir() fails if _fstatfs() returns -1, so we return 0 here */
- if (verbose)
- PDBG("_fstatfs() called - not yet implemented");
- return 0;
- }
-
- int fsync(Libc::File_descriptor *fd)
- {
- if (verbose)
- PDBG("not implemented");
- return -1;
- }
-
- int ftruncate(Libc::File_descriptor *fd, ::off_t length)
- {
- File_system::Node_handle node_handle = context(fd)->node_handle();
- File_system::File_handle &file_handle =
- static_cast(node_handle);
-
- try {
- file_system()->truncate(file_handle, length);
- } catch (File_system::Invalid_handle) {
- errno = EINVAL;
- return -1;
- } catch (File_system::Permission_denied) {
- errno = EPERM;
- return -1;
- }
-
- return 0;
- }
-
- /*
- * *basep does not get initialized by the libc and is therefore
- * useless for determining a specific directory index. This
- * function uses the plugin-internal seek offset instead.
- */
- ssize_t getdirentries(Libc::File_descriptor *fd, char *buf,
- ::size_t nbytes, ::off_t *basep)
- {
- using namespace File_system;
-
- if (nbytes < sizeof(struct dirent)) {
- PERR("buf too small");
- return -1;
- }
-
- Directory_entry entry;
- size_t num_bytes = read(fd, &entry, sizeof(entry));
-
- /* detect end of directory entries */
- if (num_bytes == 0)
- return 0;
-
- if (num_bytes != sizeof(entry)) {
- PERR("getdirentries retrieved unexpected directory entry size");
- return -1;
- }
-
- struct dirent *dirent = (struct dirent *)buf;
- Genode::memset(dirent, 0, sizeof(struct dirent));
-
- switch (entry.type) {
- case Directory_entry::TYPE_DIRECTORY: dirent->d_type = DT_DIR; break;
- case Directory_entry::TYPE_FILE: dirent->d_type = DT_REG; break;
- case Directory_entry::TYPE_SYMLINK: dirent->d_type = DT_LNK; break;
- }
-
- dirent->d_fileno = 1 + (context(fd)->seek_offset() / sizeof(struct dirent));
- dirent->d_reclen = sizeof(struct dirent);
-
- Genode::strncpy(dirent->d_name, entry.name, sizeof(dirent->d_name));
-
- dirent->d_namlen = Genode::strlen(dirent->d_name);
-
- *basep += sizeof(struct dirent);
- return sizeof(struct dirent);
- }
-
- ::off_t lseek(Libc::File_descriptor *fd, ::off_t offset, int whence)
- {
- switch (whence) {
-
- case SEEK_SET:
- context(fd)->seek_offset(offset);
- return offset;
-
- case SEEK_CUR:
- context(fd)->advance_seek_offset(offset);
- if (context(fd)->is_appending())
- return _file_size(fd);
- return context(fd)->seek_offset();
-
- case SEEK_END:
- if (offset != 0) {
- errno = EINVAL;
- return -1;
- }
- context(fd)->infinite_seek_offset();
- return _file_size(fd);
-
- default:
- errno = EINVAL;
- return -1;
- }
- }
-
- int mkdir(const char *path, mode_t mode)
- {
- Canonical_path canonical_path(path);
-
- try {
- File_system::Dir_handle const handle =
- file_system()->dir(canonical_path.base(), true);
- file_system()->close(handle);
- return 0;
- }
- catch (File_system::Permission_denied) { errno = EPERM; }
- catch (File_system::Node_already_exists) { errno = EEXIST; }
- catch (File_system::Lookup_failed) { errno = ENOENT; }
- catch (File_system::Name_too_long) { errno = ENAMETOOLONG; }
- catch (File_system::No_space) { errno = ENOSPC; }
-
- return -1;
- }
-
- Libc::File_descriptor *open(const char *pathname, int flags)
- {
- Canonical_path path(pathname);
-
- File_system::Mode mode;
- switch (flags & O_ACCMODE) {
- case O_RDONLY: mode = File_system::READ_ONLY; break;
- case O_WRONLY: mode = File_system::WRITE_ONLY; break;
- case O_RDWR: mode = File_system::READ_WRITE; break;
- default: mode = File_system::STAT_ONLY; break;
- }
-
- /*
- * Probe for an existing directory to open
- */
- try {
- if (verbose)
- PDBG("open dir '%s'", path.base());
- File_system::Dir_handle const handle =
- file_system()->dir(path.base(), false);
-
- Plugin_context *context = new (Genode::env()->heap())
- Plugin_context(handle);
-
- return Libc::file_descriptor_allocator()->alloc(this, context);
- } catch (File_system::Lookup_failed) { }
-
- /*
- * Determine directory path that contains the node to open
- */
- Canonical_path dir_path(pathname);
- dir_path.strip_last_element();
-
- Canonical_path basename(pathname);
- basename.keep_only_last_element();
-
- try {
- /*
- * Open directory that contains the file to be opened/created
- */
- File_system::Dir_handle const dir_handle =
- file_system()->dir(dir_path.base(), false);
-
- Node_handle_guard guard(dir_handle);
-
- File_system::File_handle handle;
-
- /*
- * Open or create file
- */
- bool const create = (flags & O_CREAT) != 0;
-
- bool opened = false;
- while (!opened) {
- try {
- handle = file_system()->file(dir_handle, basename.base() + 1, mode, create);
- opened = true;
- } catch (File_system::Node_already_exists) {
- if (flags & O_EXCL) {
- errno = EEXIST;
- return 0;
- }
- /* try to open the existing file */
- try {
- handle = file_system()->file(dir_handle, basename.base() + 1, mode, false);
- opened = true;
- } catch (File_system::Lookup_failed) {
- /* the file got deleted in the meantime */
- }
- }
- }
-
- Plugin_context *context = new (Genode::env()->heap())
- Plugin_context(handle);
-
- /*
- * Prevent returning the file size as current seek offset
- * for files that are opened read only because this
- * behaviour is only useful for appending write operations
- * to files.
- *
- * XXX Improve handling of files opened in append mode.
- */
- if ((flags & O_ACCMODE) == O_RDONLY)
- context->seek_offset(0);
-
- context->status_flags(flags);
-
- Libc::File_descriptor *fd = Libc::file_descriptor_allocator()->alloc(this, context);
- if ((flags & O_TRUNC) && (ftruncate(fd, 0) == -1)) {
- Libc::file_descriptor_allocator()->free(fd);
- destroy(Genode::env()->heap(), context);
- return 0;
- }
- return fd;
- }
- catch (File_system::Lookup_failed) {
- PERR("open(%s) lookup failed", pathname); }
- return 0;
- }
-
- int rename(const char *oldpath, const char *newpath)
- {
- if (verbose)
- PDBG("not implemented");
- return -1;
- }
-
- ssize_t read(Libc::File_descriptor *fd, void *buf, ::size_t count)
- {
- Genode::Lock::Guard guard(_rw_lock);
-
- File_system::Session::Tx::Source &source = *file_system()->tx();
-
- size_t const max_packet_size = session_max_packet_size(source);
-
- size_t remaining_count = count;
-
- if (context(fd)->seek_offset() == ~0)
- context(fd)->seek_offset(0);
-
- while (remaining_count) {
-
- size_t curr_packet_size = Genode::min(remaining_count, max_packet_size);
- File_system::Packet_descriptor packet(
- source.alloc_packet(curr_packet_size),
- static_cast(context(fd)),
- context(fd)->node_handle(),
- File_system::Packet_descriptor::READ,
- curr_packet_size,
- context(fd)->seek_offset());
-
-
- /* pass packet to server side */
- source.submit_packet(packet);
- packet = source.get_acked_packet();
-
- /*
- * XXX check if acked packet belongs to request,
- * needed for thread safety
- */
-
- size_t read_num_bytes = Genode::min(packet.length(), curr_packet_size);
-
- /* copy-out payload into destination buffer */
- memcpy(buf, source.packet_content(packet), read_num_bytes);
-
- source.release_packet(packet);
-
- /* prepare next iteration */
- context(fd)->advance_seek_offset(read_num_bytes);
- buf = (void *)((Genode::addr_t)buf + read_num_bytes);
- remaining_count -= read_num_bytes;
-
- /*
- * If we received less bytes than requested, we reached the end
- * of the file.
- */
- if (read_num_bytes < curr_packet_size)
- break;
- }
- return count - remaining_count;
- }
-
- ssize_t readlink(const char *path, char *buf, size_t bufsiz)
- {
- if (verbose)
- PDBG("path = %s, bufsiz = %zu", path, bufsiz);
-
- Canonical_path abs_path(path);
- abs_path.strip_last_element();
-
- Canonical_path symlink_name(path);
- symlink_name.keep_only_last_element();
-
- try {
- ::File_system::Dir_handle dir_handle = file_system()->dir(abs_path.base(), false);
-
- ::File_system::Symlink_handle symlink_handle =
- file_system()->symlink(dir_handle, symlink_name.base() + 1, false);
-
- if (symlink_handle.value == -1) {
- errno = ENOSYS;
- return -1;
- }
-
- Plugin_context *context = new (Genode::env()->heap())
- Plugin_context(symlink_handle);
-
- Libc::File_descriptor *fd = Libc::file_descriptor_allocator()->alloc(this, context);
-
- ssize_t result = read(fd, buf, bufsiz);
- if (verbose)
- PDBG("result = %zd, buf = %s", result, buf[result] ?
- "" : buf);
- close(fd);
-
- return result;
- } catch (...) { }
-
- errno = ENOENT;
- return -1;
- }
-
- int stat(const char *pathname, struct stat *buf)
- {
- if (verbose)
- PDBG("stat %s", pathname);
-
- Canonical_path path(pathname);
-
- try {
- File_system::Node_handle const node_handle =
- file_system()->node(path.base());
- Node_handle_guard guard(node_handle);
-
- obtain_stat_for_node(node_handle, buf);
- return 0;
- }
- catch (File_system::Lookup_failed) {
- PERR("stat(%s): lookup failed", pathname);
- errno = ENOENT;
- }
- return -1;
- }
-
- int symlink(const char *oldpath, const char *newpath)
- {
- Canonical_path abs_path(newpath);
- abs_path.strip_last_element();
-
- Canonical_path symlink_name(newpath);
- symlink_name.keep_only_last_element();
-
- try {
- /*
- * Open directory that contains the file to be opened/created
- */
- File_system::Dir_handle const dir_handle =
- file_system()->dir(abs_path.base(), false);
-
- Node_handle_guard guard(dir_handle);
-
- File_system::Symlink_handle symlink_handle =
- file_system()->symlink(dir_handle, symlink_name.base() + 1, true);
-
- if (symlink_handle.value == -1) {
- errno = ENOSYS;
- return -1;
- }
-
- Plugin_context *context = new (Genode::env()->heap())
- Plugin_context(symlink_handle);
-
- Libc::File_descriptor *fd =
- Libc::file_descriptor_allocator()->alloc(this, context);
-
- ssize_t res = write(fd, oldpath, strlen(oldpath) + 1);
-
- Libc::file_descriptor_allocator()->free(fd);
- destroy(Genode::env()->heap(), context);
-
- if (res == -1) {
- errno = EIO;
- return -1;
- }
-
- return 0;
- }
- catch (File_system::Lookup_failed) {
- PERR("symlink(%s) lookup failed", newpath); }
-
- errno = ENOENT;
- return -1;
- }
-
- int unlink(const char *path)
- {
- Canonical_path dir_path(path);
- dir_path.strip_last_element();
-
- Canonical_path basename(path);
- basename.keep_only_last_element();
-
- try {
- /*
- * Open directory that contains the file to be opened/created
- */
- File_system::Dir_handle const dir_handle =
- file_system()->dir(dir_path.base(), false);
-
- Node_handle_guard guard(dir_handle);
-
- file_system()->unlink(dir_handle, basename.base() + 1);
- } catch (...) {
- PERR("unlink(%s) failed", path);
- return -1;
- }
-
- return 0;
- }
-
- ssize_t write(Libc::File_descriptor *fd, const void *buf, ::size_t count)
- {
- Genode::Lock::Guard guard(_rw_lock);
-
- File_system::Session::Tx::Source &source = *file_system()->tx();
-
- size_t const max_packet_size = session_max_packet_size(source);
-
- size_t remaining_count = count;
-
- while (remaining_count) {
-
-
- size_t curr_packet_size = Genode::min(remaining_count, max_packet_size);
-
- File_system::Packet_descriptor
- packet(source.alloc_packet(curr_packet_size),
- static_cast(context(fd)),
- context(fd)->node_handle(),
- File_system::Packet_descriptor::WRITE,
- curr_packet_size,
- context(fd)->seek_offset());
-
- /* copy-in payload into packet */
- memcpy(source.packet_content(packet), buf, curr_packet_size);
-
- /* pass packet to server side */
- source.submit_packet(packet);
- packet = source.get_acked_packet();
-
- /* prepare next iteration */
- context(fd)->advance_seek_offset(curr_packet_size);
- buf = (void *)((Genode::addr_t)buf + curr_packet_size);
- remaining_count -= curr_packet_size;
-
- source.release_packet(packet);
-
- }
- if (verbose)
- PDBG("write returns %zd", count);
- return count;
- }
-
- void *mmap(void *addr_in, ::size_t length, int prot, int flags,
- Libc::File_descriptor *fd, ::off_t offset)
- {
- if (prot != PROT_READ) {
- PERR("mmap for prot=%x not supported", prot);
- errno = EACCES;
- return (void *)-1;
- }
-
- if (addr_in != 0) {
- PERR("mmap for predefined address not supported");
- errno = EINVAL;
- return (void *)-1;
- }
-
- void *addr = Libc::mem_alloc()->alloc(length, PAGE_SHIFT);
- if (addr == (void *)-1) {
- errno = ENOMEM;
- return (void *)-1;
- }
-
- if (::pread(fd->libc_fd, addr, length, offset) < 0) {
- PERR("mmap could not obtain file content");
- ::munmap(addr, length);
- errno = EACCES;
- return (void *)-1;
- }
-
- return addr;
- }
-
- int munmap(void *addr, ::size_t)
- {
- Libc::mem_alloc()->free(addr);
- return 0;
- }
-};
-
-
-} /* unnamed namespace */
-
-
-void __attribute__((constructor)) init_libc_fs(void)
-{
- PDBG("using the libc_fs plugin");
- static Plugin plugin;
-}
diff --git a/libports/src/lib/libc_fuse/plugin.cc b/libports/src/lib/libc_fuse/plugin.cc
index f2f02aa3a..4042dcdd4 100644
--- a/libports/src/lib/libc_fuse/plugin.cc
+++ b/libports/src/lib/libc_fuse/plugin.cc
@@ -55,9 +55,9 @@ static inline int check_result(int res)
}
-/***************************
+/****************************
** override libc defaults **
- ***************************/
+ ****************************/
/*
extern "C" int access(const char *pathname, int mode)
@@ -122,12 +122,14 @@ namespace {
{
private:
+ enum { PLUGIN_PRIORITY = 1 };
+
public:
/**
* Constructor
*/
- Plugin()
+ Plugin() : Libc::Plugin(PLUGIN_PRIORITY)
{
if (!Fuse::init_fs()) {
PERR("FUSE fs initialization failed");
@@ -172,6 +174,14 @@ namespace {
return true;
}
+ bool supports_rmdir(const char *path)
+ {
+ PDBGV("path: %s", path);
+ if (Fuse::fuse() == 0)
+ return false;
+ return true;
+ }
+
bool supports_stat(const char *path)
{
PDBGV("path: %s", path);
@@ -498,6 +508,14 @@ namespace {
return check_result(res);
}
+ int rmdir(const char *path)
+ {
+ PDBGV("path: %s", path);
+ int res = Fuse::fuse()->op.rmdir(path);
+
+ return check_result(res);
+ }
+
int stat(const char *path, struct stat *buf)
{
PDBGV("path: %s", path);
@@ -545,8 +563,17 @@ namespace {
} /* unnamed namespace */
+
void __attribute__((constructor)) init_libc_fuse(void)
{
+ /*
+ * During the initialization of the plugin, we already require the VFS.
+ * Hence, we need to make sure to initialize the VFS before doing our
+ * own initialization.
+ */
+ extern void init_libc_vfs(void);
+ init_libc_vfs();
+
PDBGV("using the libc_fuse plugin");
static Plugin plugin;
}
diff --git a/libports/src/lib/libc_log/plugin.cc b/libports/src/lib/libc_log/plugin.cc
deleted file mode 100644
index ff9ceb167..000000000
--- a/libports/src/lib/libc_log/plugin.cc
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * \brief Libc plugin that uses Genode's LOG service as stdout
- * \author Norman Feske
- * \date 2011-02-15
- *
- * The plugin allocates the file descriptors 1 and 2 and forwards write
- * operations referring to those descriptors to Genode's LOG service.
- */
-
-/*
- * Copyright (C) 2011-2013 Genode Labs GmbH
- *
- * This file is part of the Genode OS framework, which is distributed
- * under the terms of the GNU General Public License version 2.
- */
-
-/* libc plugin interface */
-#include
-#include
-
-/* libc includes */
-#include
-#include
-#include
-
-/* interface to 'log_console' */
-extern "C" int stdout_write(const char *);
-
-
-namespace {
-
-
- struct Plugin_context : Libc::Plugin_context { };
-
-
- class Plugin : public Libc::Plugin
- {
- private:
-
- Plugin_context _context;
-
- Libc::File_descriptor *_stdout;
- Libc::File_descriptor *_stderr;
-
- public:
-
- /**
- * Constructor
- */
- Plugin() :
- _stdout(Libc::file_descriptor_allocator()->alloc(this, &_context, 1)),
- _stderr(Libc::file_descriptor_allocator()->alloc(this, &_context, 2))
- { }
-
- int fcntl(Libc::File_descriptor *fd, int cmd, long arg)
- {
- switch (cmd) {
- case F_GETFL: return O_WRONLY;
- default: PERR("fcntl(): command %d not supported", cmd); return -1;
- }
- }
-
- /*
- * We provide fstat here because printf inqueries _fstat about stdout
- */
- int fstat(Libc::File_descriptor *, struct stat *buf)
- {
- /*
- * The following values were obtained with small test program that
- * calls fstat for stdout on linux.
- */
- buf->st_dev = 11;
- buf->st_ino = 4;
- buf->st_mode = 8592;
- buf->st_nlink = 1;
- buf->st_uid = 0;
- buf->st_gid = 0;
- buf->st_rdev = 34818;
- buf->st_size = 0;
- buf->st_blksize = 1024;
- buf->st_blocks = 0;
-
- return 0;
- }
-
- ssize_t write(Libc::File_descriptor *fd, const void *buf, ::size_t count)
- {
- if (fd != _stdout && fd != _stderr) {
- errno = EBADF;
- return -1;
- }
-
- char *src = (char *)buf;
-
- /* count does not include the trailing '\0' */
- int orig_count = count;
- while (count > 0) {
- char tmp[128];
- int curr_count= count > sizeof(tmp) - 1 ? sizeof(tmp) - 1 : count;
- strncpy(tmp, src, curr_count);
- tmp[curr_count > 0 ? curr_count : 0] = 0;
- stdout_write(tmp);
- count -= curr_count;
- src += curr_count;
- }
- return orig_count;
- }
-
- int ioctl(Libc::File_descriptor *, int request, char *)
- {
- /*
- * Some programs or libraries use to perform 'TIOCGETA'
- * operations on stdout, in particular the termios module of
- * Python. Those programs may break if 'tcgetattr' return with
- * an error. We pretend to be more successful than we really
- * are to make them happy.
- */
- return 0;
- }
- };
-
-
-} /* unnamed namespace */
-
-
-void __attribute__((constructor)) init_libc_log(void)
-{
- static Plugin plugin;
-}
diff --git a/libports/src/lib/libc_rom/README b/libports/src/lib/libc_rom/README
deleted file mode 100644
index 60cc948b6..000000000
--- a/libports/src/lib/libc_rom/README
+++ /dev/null
@@ -1,5 +0,0 @@
-The 'libc_rom' plugin allows the use of Genode's ROM-session interface via file
-operations of the C library.
-
-This implementation is very preliminary. It supports no file operations other
-than open and read.
diff --git a/libports/src/lib/libc_rom/plugin.cc b/libports/src/lib/libc_rom/plugin.cc
deleted file mode 100644
index 60dd37960..000000000
--- a/libports/src/lib/libc_rom/plugin.cc
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- * \brief Libc plugin that uses Genode's ROM session
- * \author Norman Feske
- * \date 2012-01-09
- */
-
-/*
- * Copyright (C) 2011-2013 Genode Labs GmbH
- *
- * This file is part of the Genode OS framework, which is distributed
- * under the terms of the GNU General Public License version 2.
- */
-
-/* Genode includes */
-#include
-#include
-#include
-#include
-
-/* libc plugin interface */
-#include
-#include
-
-/* libc includes */
-#include
-#include
-#include
-
-namespace {
-
- /**
- * An open file descriptor for this plugin corresponds to a ROM connection
- *
- * The connection is created along with the context.
- */
- struct Plugin_context : Libc::Plugin_context, Genode::Attached_rom_dataspace
- {
- Genode::off_t read_offset;
-
- Plugin_context(char const *filename)
- : Genode::Attached_rom_dataspace(filename), read_offset(0) { }
- };
-
-
- static inline Plugin_context *context(Libc::File_descriptor *fd)
- {
- return static_cast(fd->context);
- }
-
-
- class Plugin : public Libc::Plugin
- {
- private:
-
- bool _probe_rom(char const *filename)
- {
- try {
- /*
- * Create ROM connection as local variable. The connection
- * gets closed automatically when leaving the scope of this
- * function.
- */
- Genode::Rom_connection rom(filename);
- return true;
- } catch (...) {
- return false;
- }
- }
-
- public:
-
- /**
- * Constructor
- */
- Plugin()
- { }
-
- bool supports_open(const char *path, int flags)
- {
- return _probe_rom(&path[1]);
- }
-
- bool supports_stat(const char *path)
- {
- return _probe_rom(&path[1]);
- }
-
- Libc::File_descriptor *open(const char *pathname, int flags)
- {
- Plugin_context *context = new (Genode::env()->heap())
- Plugin_context(&pathname[1]);
- return Libc::file_descriptor_allocator()->alloc(this, context);
- }
-
- int close(Libc::File_descriptor *fd)
- {
- Genode::destroy(Genode::env()->heap(), context(fd));
- Libc::file_descriptor_allocator()->free(fd);
- return 0;
- }
-
- int stat(const char *path, struct stat *buf)
- {
- Genode::Rom_connection rom(&path[1]);
-
- memset(buf, 0, sizeof(struct stat));
- buf->st_mode = S_IFREG;
- buf->st_size = Genode::Dataspace_client(rom.dataspace()).size();
- return 0;
- }
-
- ssize_t read(Libc::File_descriptor *fd, void *buf, ::size_t count)
- {
- Plugin_context *rom = context(fd);
-
- /* file read limit is the size of data space */
- Genode::size_t const max_size = rom->size();
-
- /* shortcut to current read offset */
- Genode::off_t &read_offset = rom->read_offset;
-
- /* maximum read offset, clamped to dataspace size */
- Genode::off_t const end_offset = Genode::min(count + read_offset, max_size);
-
- /* source address within the dataspace */
- char const *src = rom->local_addr() + read_offset;
-
- /* check if end of file is reached */
- if (read_offset >= end_offset)
- return 0;
-
- /* copy-out bytes from ROM dataspace */
- Genode::off_t num_bytes = end_offset - read_offset;
- memcpy(buf, src, num_bytes);
-
- /* advance read offset */
- read_offset += num_bytes;
-
- return num_bytes;
- }
-
- ::off_t lseek(Libc::File_descriptor *fd, ::off_t offset, int whence)
- {
- Plugin_context *rom = context(fd);
-
- switch (whence) {
-
- case SEEK_CUR:
-
- offset += rom->read_offset;
-
- /*
- * falling through...
- */
-
- case SEEK_SET:
-
- if (offset > (::off_t)rom->size()) {
- errno = EINVAL;
- return (::off_t)(-1);
- }
-
- rom->read_offset = offset;
- break;
-
- case SEEK_END:
-
- rom->read_offset = rom->size();
- break;
-
- default:
- errno = EINVAL;
- return (::off_t)(-1);
- }
-
- return rom->read_offset;
- }
- };
-
-} /* unnamed namespace */
-
-
-void __attribute__((constructor)) init_libc_rom(void)
-{
- static Plugin plugin;
-}
diff --git a/libports/src/lib/libc_vfs/plugin.cc b/libports/src/lib/libc_vfs/plugin.cc
index 1c60f48b7..247c30c8f 100644
--- a/libports/src/lib/libc_vfs/plugin.cc
+++ b/libports/src/lib/libc_vfs/plugin.cc
@@ -534,9 +534,9 @@ ssize_t Libc::Vfs_plugin::getdirentries(Libc::File_descriptor *fd, char *buf,
case Vfs::Directory_service::DIRENT_TYPE_FILE: dirent->d_type = DT_REG; break;
case Vfs::Directory_service::DIRENT_TYPE_SYMLINK: dirent->d_type = DT_LNK; break;
case Vfs::Directory_service::DIRENT_TYPE_FIFO: dirent->d_type = DT_FIFO; break;
- case Vfs::Directory_service::DIRENT_TYPE_CHARDEV: dirent->d_type = DT_CHR; break;
- case Vfs::Directory_service::DIRENT_TYPE_BLOCKDEV: dirent->d_type = DT_BLK; break;
- case Vfs::Directory_service::DIRENT_TYPE_END: return 0;
+ case Vfs::Directory_service::DIRENT_TYPE_CHARDEV: dirent->d_type = DT_CHR; break;
+ case Vfs::Directory_service::DIRENT_TYPE_BLOCKDEV: dirent->d_type = DT_BLK; break;
+ case Vfs::Directory_service::DIRENT_TYPE_END: return 0;
}
dirent->d_fileno = dirent_out.fileno;
diff --git a/libports/src/lib/libdrm/ioctl.cc b/libports/src/lib/libdrm/ioctl.cc
index 92d1a010c..f06dd26e7 100644
--- a/libports/src/lib/libdrm/ioctl.cc
+++ b/libports/src/lib/libdrm/ioctl.cc
@@ -117,12 +117,19 @@ namespace {
Gpu_driver *_driver;
Gpu_driver::Client *_client;
+ /*
+ * Assign a priority of 1 to override libc_vfs.
+ */
+ enum { PLUGIN_PRIORITY = 1 };
+
public:
- Plugin(Gpu_driver *driver) : _driver(driver), _client(0)
+ Plugin(Gpu_driver *driver)
+ :
+ Libc::Plugin(PLUGIN_PRIORITY), _driver(driver), _client(0)
{
if (!_driver) {
- PERR("could not initalize GPU driver");
+ PERR("could not initialize GPU driver");
return;
}
_client = _driver->create_client();
diff --git a/libports/src/server/fs_log/target.mk b/libports/src/server/fs_log/target.mk
index d3640b9a3..e280fae3e 100644
--- a/libports/src/server/fs_log/target.mk
+++ b/libports/src/server/fs_log/target.mk
@@ -1,3 +1,3 @@
TARGET = fs_log
SRC_CC = main.cc
-LIBS = base libc_fs libc
+LIBS = base libc_vfs libc
diff --git a/libports/src/server/fuse_fs/exfat/target.mk b/libports/src/server/fuse_fs/exfat/target.mk
index 2612cb889..514660947 100644
--- a/libports/src/server/fuse_fs/exfat/target.mk
+++ b/libports/src/server/fuse_fs/exfat/target.mk
@@ -7,7 +7,7 @@ SRC_C = $(notdir $(EXFAT_DIR)/fuse/main.c)
SRC_CC = fuse_fs_main.cc \
init.cc
-LIBS = base config server libc libc_log libc_block libfuse libexfat
+LIBS = base config server libc libc_vfs libfuse libexfat
INC_DIR += $(PRG_DIR)/..
CC_OPT += -Wno-unused-function
diff --git a/libports/src/server/fuse_fs/ext2/target.mk b/libports/src/server/fuse_fs/ext2/target.mk
index 72b6933c9..4f7e990d5 100644
--- a/libports/src/server/fuse_fs/ext2/target.mk
+++ b/libports/src/server/fuse_fs/ext2/target.mk
@@ -10,7 +10,7 @@ SRC_C = $(filter-out $(FILTER_OUT), $(notdir $(wildcard $(FUSE_EXT2_DIR)/*.c)))
SRC_CC = fuse_fs_main.cc \
init.cc
-LIBS = base config server libc libc_log libc_block libfuse libext2fs
+LIBS = base config server libc libc_vfs libfuse libext2fs
CC_OPT += -DHAVE_CONFIG_H -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
diff --git a/libports/src/server/fuse_fs/ntfs-3g/target.mk b/libports/src/server/fuse_fs/ntfs-3g/target.mk
index f70f6980d..3b04d1ff8 100644
--- a/libports/src/server/fuse_fs/ntfs-3g/target.mk
+++ b/libports/src/server/fuse_fs/ntfs-3g/target.mk
@@ -7,7 +7,7 @@ SRC_C = ntfs-3g.c ntfs-3g_common.c
SRC_CC = fuse_fs_main.cc \
init.cc
-LIBS = base config server libc libc_log libc_block libfuse libntfs-3g
+LIBS = base config server libc libc_vfs libfuse libntfs-3g
CC_OPT = -DHAVE_TIMESPEC -DHAVE_CONFIG_H -DRECORD_LOCKING_NOT_IMPLEMENTED
diff --git a/libports/src/test/expat/target.mk b/libports/src/test/expat/target.mk
index a7f3bd92c..3dac897b4 100644
--- a/libports/src/test/expat/target.mk
+++ b/libports/src/test/expat/target.mk
@@ -1,3 +1,3 @@
TARGET = test-expat
SRC_CC = main.cc
-LIBS = expat libc libc_log libc_rom
+LIBS = expat libc libc_vfs
diff --git a/libports/src/test/libc/target.mk b/libports/src/test/libc/target.mk
index 633b5c2f4..c1b4a58a1 100644
--- a/libports/src/test/libc/target.mk
+++ b/libports/src/test/libc/target.mk
@@ -1,3 +1,3 @@
TARGET = test-libc
SRC_CC = main.cc
-LIBS = libm libc libc_log
+LIBS = libm libc libc_vfs
diff --git a/libports/src/test/libc_block/target.mk b/libports/src/test/libc_block/target.mk
index 6e2161f4d..326b070bd 100644
--- a/libports/src/test/libc_block/target.mk
+++ b/libports/src/test/libc_block/target.mk
@@ -1,3 +1,3 @@
TARGET = test-libc_block
-LIBS = libc libc_log libc_block
+LIBS = libc libc_vfs
SRC_CC = main.cc
diff --git a/libports/src/test/libc_ffat/target.mk b/libports/src/test/libc_ffat/target.mk
index 6e81ebb6c..1b7fdd85a 100644
--- a/libports/src/test/libc_ffat/target.mk
+++ b/libports/src/test/libc_ffat/target.mk
@@ -1,3 +1,3 @@
TARGET = test-libc_ffat
-LIBS = libc libc_log libc_ffat
+LIBS = libc libc_vfs libc_ffat
SRC_CC = main.cc
diff --git a/libports/src/test/libc_fs/target.mk b/libports/src/test/libc_fs/target.mk
deleted file mode 100644
index c550ca161..000000000
--- a/libports/src/test/libc_fs/target.mk
+++ /dev/null
@@ -1,6 +0,0 @@
-TARGET = test-libc_fs
-LIBS = libc libc_log libc_fs
-SRC_CC = main.cc
-
-# we re-use the libc_ffat test
-vpath main.cc $(REP_DIR)/src/test/libc_ffat
diff --git a/libports/src/test/libc_fs_tar_fs/target.mk b/libports/src/test/libc_fs_tar_fs/target.mk
index f2bd5821e..15b6d5891 100644
--- a/libports/src/test/libc_fs_tar_fs/target.mk
+++ b/libports/src/test/libc_fs_tar_fs/target.mk
@@ -1,3 +1,3 @@
TARGET = test-libc_fs_tar_fs
-LIBS = libc libc_log libc_fs
+LIBS = libc libc_vfs
SRC_CC = main.cc
diff --git a/libports/src/test/libc_fuse_exfat/target.mk b/libports/src/test/libc_fuse_exfat/target.mk
index 28406100d..b2e2c7497 100644
--- a/libports/src/test/libc_fuse_exfat/target.mk
+++ b/libports/src/test/libc_fuse_exfat/target.mk
@@ -1,5 +1,5 @@
TARGET = test-libc_fuse_exfat
-LIBS = libc libc_log libc_fuse_exfat
+LIBS = libc libc_vfs libc_fuse_exfat
SRC_CC = main.cc
vpath %.cc $(PRG_DIR)/../libc_ffat/
diff --git a/libports/src/test/libc_fuse_ext2/target.mk b/libports/src/test/libc_fuse_ext2/target.mk
index 97c942b73..4c3c28dbd 100644
--- a/libports/src/test/libc_fuse_ext2/target.mk
+++ b/libports/src/test/libc_fuse_ext2/target.mk
@@ -1,5 +1,5 @@
TARGET = test-libc_fuse_ext2
-LIBS = libc libc_log libc_fuse_ext2
+LIBS = libc libc_vfs libc_fuse_ext2
SRC_CC = main.cc
vpath %.cc $(PRG_DIR)/../libc_ffat
diff --git a/libports/src/test/libc_fuse_ntfs-3g/target.mk b/libports/src/test/libc_fuse_ntfs-3g/target.mk
index 81a14ff05..4c59c6347 100644
--- a/libports/src/test/libc_fuse_ntfs-3g/target.mk
+++ b/libports/src/test/libc_fuse_ntfs-3g/target.mk
@@ -1,5 +1,5 @@
TARGET = test-libc_fuse_ntfs-3g
-LIBS = libc libc_log libc_fuse_ntfs-3g
+LIBS = libc libc_vfs libc_fuse_ntfs-3g
SRC_CC = main.cc
vpath %.cc $(PRG_DIR)/../libc_ffat
diff --git a/libports/src/test/libc_vfs/target.mk b/libports/src/test/libc_vfs/target.mk
index c97634b3a..1c0c7d2e0 100644
--- a/libports/src/test/libc_vfs/target.mk
+++ b/libports/src/test/libc_vfs/target.mk
@@ -1,5 +1,5 @@
TARGET = test-libc_vfs
-LIBS = libc libc_log libc_vfs
+LIBS = libc libc_vfs
SRC_CC = main.cc
# we re-use the libc_ffat test
diff --git a/libports/src/test/lwip/http_clnt/target.mk b/libports/src/test/lwip/http_clnt/target.mk
index 133823d95..e2fea9dfd 100644
--- a/libports/src/test/lwip/http_clnt/target.mk
+++ b/libports/src/test/lwip/http_clnt/target.mk
@@ -1,5 +1,5 @@
TARGET = test-http_clnt
-LIBS = lwip libc libc_log
+LIBS = lwip libc libc_vfs
SRC_CC = main.cc
REQUIRES = foc
diff --git a/libports/src/test/lwip/http_srv/target.mk b/libports/src/test/lwip/http_srv/target.mk
index 610133311..d1ae5055c 100644
--- a/libports/src/test/lwip/http_srv/target.mk
+++ b/libports/src/test/lwip/http_srv/target.mk
@@ -1,5 +1,5 @@
TARGET = test-lwip_httpsrv
-LIBS = lwip libc libc_log
+LIBS = lwip libc
SRC_CC = main.cc
INC_DIR += $(REP_DIR)/src/lib/lwip/include
diff --git a/libports/src/test/lwip/http_srv_static/target.mk b/libports/src/test/lwip/http_srv_static/target.mk
index 9f5e5109a..8221218a4 100644
--- a/libports/src/test/lwip/http_srv_static/target.mk
+++ b/libports/src/test/lwip/http_srv_static/target.mk
@@ -1,5 +1,5 @@
TARGET = test-lwip_httpsrv_static
-LIBS = lwip libc libc_log
+LIBS = lwip libc libc_vfs
SRC_CC = main.cc
INC_DIR += $(REP_DIR)/src/lib/lwip/include
diff --git a/libports/src/test/lwip/http_srv_tracing/target.mk b/libports/src/test/lwip/http_srv_tracing/target.mk
index ac4741176..9b8bde8ce 100644
--- a/libports/src/test/lwip/http_srv_tracing/target.mk
+++ b/libports/src/test/lwip/http_srv_tracing/target.mk
@@ -1,5 +1,5 @@
TARGET = test-lwip_httpsrv_tracing
-LIBS = lwip libc libc_log
+LIBS = lwip libc libc_vfs
SRC_CC = main.cc
REQUIRES = foc
diff --git a/libports/src/test/lwip/http_srv_tracing_nonblocking/target.mk b/libports/src/test/lwip/http_srv_tracing_nonblocking/target.mk
index 02679aab4..68e3b0d1c 100644
--- a/libports/src/test/lwip/http_srv_tracing_nonblocking/target.mk
+++ b/libports/src/test/lwip/http_srv_tracing_nonblocking/target.mk
@@ -1,5 +1,5 @@
TARGET = test-lwip_httpsrv_tracing_nob
-LIBS = lwip libc libc_log
+LIBS = lwip libc libc_vfs
SRC_CC = main.cc
REQUIRES = foc
diff --git a/libports/src/test/lwip/loopback/target.mk b/libports/src/test/lwip/loopback/target.mk
index 5d4c53f67..ce657b7b9 100644
--- a/libports/src/test/lwip/loopback/target.mk
+++ b/libports/src/test/lwip/loopback/target.mk
@@ -1,3 +1,3 @@
TARGET = test-lwip_loop
-LIBS = lwip libc libc_lwip_loopback libc_log
+LIBS = lwip libc libc_lwip_loopback libc_vfs
SRC_CC = main.cc
diff --git a/libports/src/test/lwip/pingpong/client/libc_lwip/target.mk b/libports/src/test/lwip/pingpong/client/libc_lwip/target.mk
index 1cc5d9197..80ac38537 100644
--- a/libports/src/test/lwip/pingpong/client/libc_lwip/target.mk
+++ b/libports/src/test/lwip/pingpong/client/libc_lwip/target.mk
@@ -1,5 +1,5 @@
TARGET = test-ping_client_libc_lwip
-LIBS = base libc libc_lwip lwip libc_lwip_nic_dhcp libc_log config_args
+LIBS = base libc lwip libc_lwip_nic_dhcp libc_vfs config_args
SRC_CC = main.cc pingpong.cc
vpath main.cc $(PRG_DIR)/..
diff --git a/libports/src/test/lwip/pingpong/client/lwip/target.mk b/libports/src/test/lwip/pingpong/client/lwip/target.mk
index a9c4eb712..93e821f81 100644
--- a/libports/src/test/lwip/pingpong/client/lwip/target.mk
+++ b/libports/src/test/lwip/pingpong/client/lwip/target.mk
@@ -1,5 +1,5 @@
TARGET = test-ping_client_lwip
-LIBS = base libc lwip libc_log config_args
+LIBS = base libc lwip libc_vfs config_args
SRC_CC = main.cc pingpong.cc
INC_DIR += $(REP_DIR)/src/lib/lwip/include
diff --git a/libports/src/test/lwip/pingpong/client/main.cc b/libports/src/test/lwip/pingpong/client/main.cc
index 184fde963..478ae86fd 100644
--- a/libports/src/test/lwip/pingpong/client/main.cc
+++ b/libports/src/test/lwip/pingpong/client/main.cc
@@ -75,12 +75,13 @@ sendping(const char *addr, size_t dsize, size_t count)
if (n == 0)
break;
if (n != (sizeof (Packetheader) + p.h.dsize)) {
- printf("ERROR: size mismatch: %ld != %lu\n", n, sizeof (Packetheader) + p.h.dsize);
+ printf("ERROR: size mismatch: %ld != %lu\n",
+ (long)n, (long)(sizeof (Packetheader) + p.h.dsize));
break;
}
if (verbose)
- printf("%u %ld\n", p.h.id, n);
+ printf("%u %ld\n", (unsigned)p.h.id, (long)n);
}
close(s);
diff --git a/libports/src/test/lwip/pingpong/server/libc_lwip/target.mk b/libports/src/test/lwip/pingpong/server/libc_lwip/target.mk
index 12cc95373..423d12ea5 100644
--- a/libports/src/test/lwip/pingpong/server/libc_lwip/target.mk
+++ b/libports/src/test/lwip/pingpong/server/libc_lwip/target.mk
@@ -1,5 +1,5 @@
TARGET = test-ping_server_libc_lwip
-LIBS = base libc libc_lwip_nic_dhcp libc_lwip lwip libc_log config_args
+LIBS = base libc libc_vfs libc_lwip_nic_dhcp libc_lwip lwip config_args
SRC_CC = main.cc pingpong.cc
vpath main.cc $(PRG_DIR)/..
diff --git a/libports/src/test/lwip/pingpong/server/lwip/target.mk b/libports/src/test/lwip/pingpong/server/lwip/target.mk
index cbb08a5ff..0b98decb8 100644
--- a/libports/src/test/lwip/pingpong/server/lwip/target.mk
+++ b/libports/src/test/lwip/pingpong/server/lwip/target.mk
@@ -1,5 +1,5 @@
TARGET = test-ping_server_lwip
-LIBS = base libc lwip libc_log config_args
+LIBS = base libc lwip libc_vfs config_args
SRC_CC = main.cc pingpong.cc
CC_OPT += -DLWIP_NATIVE
diff --git a/libports/src/test/moon/target.mk b/libports/src/test/moon/target.mk
index da7dcfa86..2360fc403 100644
--- a/libports/src/test/moon/target.mk
+++ b/libports/src/test/moon/target.mk
@@ -1,3 +1,3 @@
TARGET = test-moon
-LIBS = luacxx libc libc_log libm
+LIBS = luacxx libc libm libc_vfs
SRC_CC = main.cc
diff --git a/libports/src/test/pthread/target.mk b/libports/src/test/pthread/target.mk
index 40c7c2c13..445829338 100644
--- a/libports/src/test/pthread/target.mk
+++ b/libports/src/test/pthread/target.mk
@@ -1,3 +1,3 @@
TARGET = test-pthread
SRC_CC = main.cc
-LIBS = libc libc_log pthread
+LIBS = libc libc_vfs pthread
diff --git a/libports/src/test/python/hello.py b/libports/src/test/python/hello.py
deleted file mode 100644
index 27c89816a..000000000
--- a/libports/src/test/python/hello.py
+++ /dev/null
@@ -1,13 +0,0 @@
-print " \r\n\r";
-print " -============================-";
-print " || ||";
-print " || Python Core 2.6.4 ||";
-print " || ||";
-print " || Genode 11.11 ||";
-print " || ||";
-print " -============================-";
-print " \r";
-print " 2011 by Genode Labs ";
-print " \r\n\r";
-
-
diff --git a/libports/src/test/python/target.mk b/libports/src/test/python/target.mk
index 0ff94cef7..394b4c4b6 100644
--- a/libports/src/test/python/target.mk
+++ b/libports/src/test/python/target.mk
@@ -1,4 +1,4 @@
TARGET = test-python
-LIBS = python libc libc_log libc_rom libm
+LIBS = python libc libc_vfs libm
REQUIRES = x86
SRC_CC = main.cc
diff --git a/libports/src/test/sdl/target.mk b/libports/src/test/sdl/target.mk
index d0511ad3e..4b3e0bf2c 100644
--- a/libports/src/test/sdl/target.mk
+++ b/libports/src/test/sdl/target.mk
@@ -1,3 +1,3 @@
TARGET = test-sdl
-LIBS = sdl libc libc_log
+LIBS = sdl libc
SRC_CC = main.cc
diff --git a/os/run/ldso.run b/os/run/ldso.run
index 757f930fb..574086a1f 100644
--- a/os/run/ldso.run
+++ b/os/run/ldso.run
@@ -18,6 +18,11 @@ install_config {
+
+
+
+
+
}
diff --git a/ports/lib/mk/virtualbox_libc_support.inc b/ports/lib/mk/virtualbox_libc_support.inc
index fe8b62f22..efa1dbea6 100644
--- a/ports/lib/mk/virtualbox_libc_support.inc
+++ b/ports/lib/mk/virtualbox_libc_support.inc
@@ -8,6 +8,7 @@ SRC_C += stdio/findfp.c
SRC_C += stdio/stdio.c
SRC_C += string/memchr.c
SRC_C += string/strncmp.c
+SRC_C += string/strdup.c
# Genode libc code
SRC_CC += libc/clock_gettime.cc
@@ -23,8 +24,8 @@ SRC_CC += libc/select.cc
# Genode terminal plugin
SRC_CC += libc_terminal/plugin.cc
-# Genode fs plugin
-SRC_CC += libc_fs/plugin.cc
+# Genode vfs plugin
+SRC_CC += libc_vfs/plugin.cc
SRC_CC += libc/pread_pwrite.cc
# Genode lock pipe plugin (needed by VirtualBox "HostSerial" driver)
diff --git a/ports/run/arora.run b/ports/run/arora.run
index 960b2f502..c7eb40da4 100644
--- a/ports/run/arora.run
+++ b/ports/run/arora.run
@@ -89,12 +89,17 @@ append config {
-
-
-
-
+
+
+
+
+
+
+
+
+
}
@@ -116,7 +121,7 @@ set boot_modules {
testnit
arora
ld.lib.so
- libc.lib.so libm.lib.so lwip.lib.so libc_log.lib.so
+ libc.lib.so libm.lib.so lwip.lib.so
zlib.lib.so libpng.lib.so jpeg.lib.so libssl.lib.so libcrypto.lib.so
freetype.lib.so
libc_lock_pipe.lib.so
diff --git a/ports/run/dosbox.run b/ports/run/dosbox.run
index 1db8b876b..192f7d744 100644
--- a/ports/run/dosbox.run
+++ b/ports/run/dosbox.run
@@ -7,7 +7,6 @@ set build_components {
core init
drivers/timer
drivers/audio_out
- server/tar_fs
drivers/framebuffer drivers/pci drivers/input
app/dosbox
}
@@ -99,18 +98,16 @@ append config {
-
-
-
-
-
-
-
-
+
+
+
+
+
+
}
@@ -123,8 +120,6 @@ if {![file exists bin/dosbox.tar]} {
puts "play. Mount the directory from within DosBox by entering 'mount C: ',"
puts "change CWD to C: and play the game!"
puts ""
- puts "(Note: for all games, which need a R/W filesystem, you cannot use 'tar_fs'.)"
- puts ""
exit 1
}
@@ -135,8 +130,8 @@ if {![file exists bin/dosbox.tar]} {
# generic modules
set boot_modules {
core init timer audio_out_drv
- tar_fs ld.lib.so
- libc_fs.lib.so libc.lib.so libc_log.lib.so
+ ld.lib.so
+ libc.lib.so
libm.lib.so lwip.lib.so libpng.lib.so
stdcxx.lib.so sdl.lib.so sdl_net.lib.so pthread.lib.so zlib.lib.so
dosbox dosbox.tar
diff --git a/ports/run/gdb_monitor.run b/ports/run/gdb_monitor.run
index 32eec7b4c..aa1e2643c 100644
--- a/ports/run/gdb_monitor.run
+++ b/ports/run/gdb_monitor.run
@@ -65,8 +65,17 @@ set config {
-
+
+
+
+
+
+
+
+
+
+
@@ -81,7 +90,7 @@ install_config $config
# generic modules
set boot_modules {
core init timer
- ld.lib.so libc.lib.so libc_log.lib.so libc_lock_pipe.lib.so libc_terminal.lib.so
+ ld.lib.so libc.lib.so libc_lock_pipe.lib.so libc_terminal.lib.so
uart_drv
gdb_monitor test-gdb_monitor
}
diff --git a/ports/run/gdb_monitor_interactive.run b/ports/run/gdb_monitor_interactive.run
index a8e3d550d..cf64e6cbf 100644
--- a/ports/run/gdb_monitor_interactive.run
+++ b/ports/run/gdb_monitor_interactive.run
@@ -54,8 +54,17 @@ set config {
-
+
+
+
+
+
+
+
+
+
+
@@ -70,7 +79,7 @@ install_config $config
# generic modules
set boot_modules {
core init timer
- ld.lib.so libc.lib.so libc_log.lib.so libc_lock_pipe.lib.so libc_terminal.lib.so
+ ld.lib.so libc.lib.so libc_lock_pipe.lib.so libc_terminal.lib.so
uart_drv
gdb_monitor test-gdb_monitor
}
diff --git a/ports/run/genode_org.run b/ports/run/genode_org.run
index d8c0ab06e..ef63dcfa5 100644
--- a/ports/run/genode_org.run
+++ b/ports/run/genode_org.run
@@ -3,16 +3,15 @@
# \author Norman Feske
# \date 2012-08-16
#
-# This run script combines the lighttpd web server with the tar_fs file system
-# to host the genode.org website. When executed the first time, the genode.org
-# website is downloaded to 'bin/genode_org/website'. When the web server is up,
-# you may point your web browser to http://localhost:5555
+# This run script uses the lighttpd web server to host the genode.org website.
+# When executed the first time, the genode.org website is downloaded to
+# 'bin/genode_org/website'. When the web server is up, you may point your web
+# browser to http://localhost:5555
#
set build_components {
core init
drivers/timer
- server/tar_fs
app/lighttpd
}
@@ -107,14 +106,6 @@ append_if [expr ![have_spec acpi] && [have_spec pci]] config {
}
append config {
-
-
-
-
-
-
-
-
@@ -122,6 +113,15 @@ append config {
+
+
+
+
+
+
+
+
+
}
@@ -176,8 +176,8 @@ exec tar cfv bin/genode_org.tar -h -C bin/genode_org .
# generic modules
set boot_modules {
- core init timer ld.lib.so tar_fs
- libc.lib.so libm.lib.so libc_fs.lib.so libc_log.lib.so
+ core init timer ld.lib.so
+ libc.lib.so libm.lib.so
lwip.lib.so zlib.lib.so
lighttpd genode_org.tar
}
diff --git a/ports/run/lighttpd.run b/ports/run/lighttpd.run
index 95f685fe1..d9ac1b227 100644
--- a/ports/run/lighttpd.run
+++ b/ports/run/lighttpd.run
@@ -9,7 +9,6 @@ set build_components {
drivers/pci
drivers/nic
drivers/timer
- server/ram_fs
app/lighttpd
}
@@ -42,7 +41,7 @@ append config {
append_if [have_spec pci] config {
-
+
}
@@ -51,15 +50,22 @@ append config {
-
-
-
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
# lighttpd configuration
server.port = 80
server.document-root = "/website"
@@ -72,11 +78,11 @@ mimetype.assign = (
".html" => "text/html",
".htm" => "text/html"
)
-
+
+
-
-
-
+
+
Hello
@@ -86,18 +92,10 @@ mimetype.assign = (
I am bold ;-)
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
}
@@ -113,9 +111,9 @@ install_config $config
# generic modules
set boot_modules {
- core init timer ld.lib.so nic_drv ram_fs
- libc.lib.so libm.lib.so libc_fs.lib.so libc_log.lib.so
- lwip.lib.so zlib.lib.so libcrypto.lib.so libssl.lib.so
+ core init timer ld.lib.so nic_drv
+ libc.lib.so libm.lib.so
+ lwip.lib.so zlib.lib.so
lighttpd
}
diff --git a/ports/run/netperf.inc b/ports/run/netperf.inc
index 8030e0386..3a7e8499f 100644
--- a/ports/run/netperf.inc
+++ b/ports/run/netperf.inc
@@ -180,7 +180,10 @@ append config {
+append config {
+ stdout="/dev/log" stderr="/dev/log">
+
+
}
append_if $use_nic_bridge config {
@@ -202,7 +205,6 @@ install_config $config
set boot_modules {
core init timer
ld.lib.so libc.lib.so libm.lib.so
- libc_log.lib.so
}
append boot_modules " $netperf_app "
diff --git a/ports/run/noux_net_netcat.run b/ports/run/noux_net_netcat.run
index c49c0392e..3484ac252 100644
--- a/ports/run/noux_net_netcat.run
+++ b/ports/run/noux_net_netcat.run
@@ -185,8 +185,7 @@ install_config $config
# generic modules
set boot_modules {
core init timer tcp_terminal nic_bridge
- ld.lib.so noux_net libc.lib.so libm.lib.so
- libc_lock_pipe.lib.so libc_log.lib.so
+ ld.lib.so noux_net libc.lib.so libm.lib.so libc_lock_pipe.lib.so
libc_resolv.lib.so libc_noux.lib.so lwip.lib.so noux_netcat.tar
}
diff --git a/ports/run/virtualbox.run b/ports/run/virtualbox.run
index 95e66f192..dc6c91cb0 100644
--- a/ports/run/virtualbox.run
+++ b/ports/run/virtualbox.run
@@ -1,6 +1,5 @@
set build_components {
- core init virtualbox
- server/ram_fs
+ core init virtualbox
drivers/input
drivers/framebuffer
drivers/timer
@@ -29,23 +28,11 @@ set config {
-
+
-
-
-
-
-
-
-
-
-
-
-
-
}
append_if [have_spec acpi] config {
@@ -93,19 +80,21 @@ append config {
-
+
+
+
+
+
+
+
-
-
-
-
}
install_config $config
-set boot_modules { core init timer virtualbox ram_fs test.iso }
+set boot_modules { core init timer virtualbox test.iso }
# platform-specific modules
lappend_if [have_spec ps2] boot_modules ps2_drv
diff --git a/ports/run/virtualbox_auto.inc b/ports/run/virtualbox_auto.inc
index 04b630c19..e982af196 100644
--- a/ports/run/virtualbox_auto.inc
+++ b/ports/run/virtualbox_auto.inc
@@ -117,7 +117,7 @@ install_config $config
set boot_modules {
core init timer
part_blk ahci
- ld.lib.so libc.lib.so libc_fs.lib.so
+ ld.lib.so libc.lib.so
rump.lib.so rump_fs.lib.so rump_fs
virtualbox vbox-auto-test-helper
}
diff --git a/ports/run/virtualbox_auto_disk.run b/ports/run/virtualbox_auto_disk.run
index 48abaeb56..e7fad857d 100644
--- a/ports/run/virtualbox_auto_disk.run
+++ b/ports/run/virtualbox_auto_disk.run
@@ -12,6 +12,14 @@ set config_of_app {
+
+
+
+
+
+
+
+
}
@@ -37,6 +45,12 @@ append config_of_app "
}
append config_of_app {
+
+
+
+
+
+
diff --git a/ports/src/app/arora/target.mk b/ports/src/app/arora/target.mk
index 893205445..1092fcbd9 100644
--- a/ports/src/app/arora/target.mk
+++ b/ports/src/app/arora/target.mk
@@ -44,12 +44,12 @@ HEADERS_FILTER_OUT = \
QT_MAIN_STACK_SIZE = 768*1024
-LIBS += libm libc_lwip libc_lwip_nic_dhcp libc_log
+LIBS += libm libc_lwip libc_lwip_nic_dhcp
RESOURCES += demo_html.qrc
#
-# Prevent contrib code from causing warnings with our toolchain compiler
+# Prevent contrib code from causing warnings with our tool chain
#
CC_WARN += -Wno-unused-but-set-variable
diff --git a/ports/src/app/dosbox/target.mk b/ports/src/app/dosbox/target.mk
index 7fd7abbd0..ca8567934 100644
--- a/ports/src/app/dosbox/target.mk
+++ b/ports/src/app/dosbox/target.mk
@@ -54,5 +54,5 @@ CC_WARN += -Wno-unused-variable -Wno-unused-function -Wno-switch -Wno-unused-val
-Wno-sign-compare -Wno-narrowing -Wno-missing-braces -Wno-array-bounds \
-Wno-parentheses
-LIBS += libc libm libpng sdl sdl_net stdcxx zlib
-LIBS += libc_log libc_fs libc_lwip_nic_dhcp config_args
+LIBS += libc libc_vfs libm libpng sdl sdl_net stdcxx zlib
+LIBS += libc_lwip_nic_dhcp config_args
diff --git a/ports/src/app/gdb_monitor/target.mk b/ports/src/app/gdb_monitor/target.mk
index a96dd9ad1..4164181a3 100644
--- a/ports/src/app/gdb_monitor/target.mk
+++ b/ports/src/app/gdb_monitor/target.mk
@@ -10,7 +10,7 @@ INC_DIR += $(GDB_CONTRIB_DIR)/include \
$(PRG_DIR)/gdbserver \
$(PRG_DIR)
-LIBS = libc libc_log libc_terminal libc_lock_pipe \
+LIBS = libc libc_vfs libc_terminal libc_lock_pipe \
gdbserver_platform gdbserver_libc_support
SRC_C = event-loop.c \
diff --git a/ports/src/app/lighttpd/target.mk b/ports/src/app/lighttpd/target.mk
index 0d05c703f..7e011e3a0 100644
--- a/ports/src/app/lighttpd/target.mk
+++ b/ports/src/app/lighttpd/target.mk
@@ -2,4 +2,4 @@ TARGET = lighttpd
include $(REP_DIR)/src/app/lighttpd/target.inc
-LIBS += libc libm libc_log libc_fs libc_lwip_nic_dhcp
+LIBS += libc libm libc_vfs libc_lwip_nic_dhcp
diff --git a/ports/src/app/netperf/target.inc b/ports/src/app/netperf/target.inc
index 24c835b7c..0e1d8daeb 100644
--- a/ports/src/app/netperf/target.inc
+++ b/ports/src/app/netperf/target.inc
@@ -3,7 +3,7 @@ CONTRIB_DIR = $(REP_DIR)/contrib/netperf
LIBS += base libc libm libc-resolv libc-net libc-nameser libc-isc
# plug-in to libc
-LIBS += libc_log config_args
+LIBS += libc_vfs config_args
SRC_C = netserver.c netlib.c netsh.c nettest_bsd.c dscp.c
# omni test
diff --git a/ports/src/test/gdb_monitor/target.mk b/ports/src/test/gdb_monitor/target.mk
index 35bef3663..1c2f83220 100644
--- a/ports/src/test/gdb_monitor/target.mk
+++ b/ports/src/test/gdb_monitor/target.mk
@@ -1,3 +1,3 @@
TARGET = test-gdb_monitor
SRC_CC = main.cc
-LIBS = libc libc_log
+LIBS = libc libc_vfs
diff --git a/ports/src/virtualbox/dummies.cc b/ports/src/virtualbox/dummies.cc
index a0e27877f..aa0261b53 100644
--- a/ports/src/virtualbox/dummies.cc
+++ b/ports/src/virtualbox/dummies.cc
@@ -184,7 +184,6 @@ DUMMY(-1, SELMR3Term)
DUMMY(-1, SELMR3GetSelectorInfo)
DUMMY(-1, libc_select_notify) /* needed for libc_terminal plugin */
-DUMMY(-1, strdup)
DUMMY(-1, DISInstrToStrEx)
CHECKED_DUMMY(-1, signal)
diff --git a/ports/src/virtualbox/logger.cc b/ports/src/virtualbox/logger.cc
index 5d9dcf390..cc269f759 100644
--- a/ports/src/virtualbox/logger.cc
+++ b/ports/src/virtualbox/logger.cc
@@ -143,7 +143,7 @@ namespace {
} /* unnamed namespace */
-void __attribute__((constructor)) init_libc_log(void)
+void __attribute__((constructor)) init_libc_vbox_logger(void)
{
static Plugin plugin;
}
diff --git a/qt4/run/qt_avplay.run b/qt4/run/qt_avplay.run
index e37acfbc2..78097dddd 100644
--- a/qt4/run/qt_avplay.run
+++ b/qt4/run/qt_avplay.run
@@ -133,8 +133,6 @@ set boot_modules {
swscale.lib.so
sdl.lib.so
pthread.lib.so
- libc_log.lib.so
- libc_rom.lib.so
avplay
mediafile
stdcxx.lib.so
diff --git a/qt4/run/textedit.run b/qt4/run/textedit.run
index 1690a8c4a..b1c639561 100644
--- a/qt4/run/textedit.run
+++ b/qt4/run/textedit.run
@@ -134,12 +134,20 @@ append config {
-
+
+
+
+
+
-
+
+
+
+
+
}
@@ -162,7 +170,6 @@ set boot_modules {
ld.lib.so
libc.lib.so
libc_lock_pipe.lib.so
- libc_fs.lib.so
libm.lib.so
libpng.lib.so
jpeg.lib.so
diff --git a/qt4/src/app/examples/textedit/target.mk b/qt4/src/app/examples/textedit/target.mk
index 4f80db22a..aabb72ca5 100644
--- a/qt4/src/app/examples/textedit/target.mk
+++ b/qt4/src/app/examples/textedit/target.mk
@@ -13,4 +13,4 @@ include $(QT4_REP_DIR)/src/app/tmpl/target_defaults.inc
include $(QT4_REP_DIR)/src/app/tmpl/target_final.inc
-LIBS += libc_fs
+LIBS += libc_vfs