Commit Graph

106 Commits

Author SHA1 Message Date
Norman Feske
f4881a37c8 libc_noux: fix compile warnings 2012-08-22 09:51:31 +02:00
Josef Söntgen
95f71a5f71 Noux: add is_nonblocking() method
Certain programs tend to set their sockets non-blocking. As previously
descriptors in Noux were only blocking we now introduce a method to mark
the used Io_channel as non-blocking.
2012-08-22 09:51:30 +02:00
Josef Söntgen
343266b06e Noux: add F_GETFL handling to terminal_io_channel
There are certain programms which check if an fd is open by calling
fcntl(fd, F_GETFL, ...). So to keep them happy we return true if
such an request was done to our terminal fd's.
2012-08-22 09:51:30 +02:00
Josef Söntgen
7dfbd9e191 Noux/net: fix write() in socket_io_channel 2012-08-22 09:51:30 +02:00
Josef Söntgen
1c495b79f4 Noux/net: add proper fcntl() to socket_io_channel 2012-08-22 09:51:30 +02:00
Josef Söntgen
a6904b4deb Noux: add F_SETFL to libc_noux's fcntl()
Among other things it is used to set non-blocking mode, so we should
support it (e.g. fcntl(d, F_SETFL, fl | O_NONBLOCK)).
2012-08-22 09:51:30 +02:00
Josef Söntgen
4aac3933b3 Noux: add FIONBIO handling support to libc_noux 2012-08-22 09:51:30 +02:00
Josef Söntgen
8dfb3d5d81 Noux: add cleanup_socket_descriptors() function
When a child exists it makes sure that all remaining socket descriptors
are closed.
2012-08-22 09:51:30 +02:00
Josef Söntgen
2010a74fba Noux/net: add reset_all() method to sd registry
This method is called when a child is exiting to remove all remaining
sockets from the socket descriptor registry to close all sockets.
2012-08-22 09:51:30 +02:00
Josef Söntgen
57b0490fc6 Noux: remove {get,free}addrinfo
This dead-code will not be needed in the future because we now use
libc_resolv.
2012-08-22 09:51:29 +02:00
Josef Söntgen
6aa05e8d46 Noux: add noux-pkg/lynx
Explanation why --disable-rpath-hack is needed:

When building on pistachio_x86 $(LDFLAGS) contains '-L[...]/l4/lib'
which will be transformed by autoconf to '-rpath [...]/l4/lib'.
Now the problem at hand is that we pretend to be FreeBSD when we are
actually not. So autoconf assumes it is valid to use '-path'  when it
is actually not.

Also we use zlib for (de)compressing gzipped streams/files instead of
calling gzip as this currently somewhat buggy.
2012-08-22 09:51:29 +02:00
Josef Söntgen
42c259d9f0 Noux: add noux-pkg/etc
This package provides files in /etc which are needed for domain
resolving etc. pp.
2012-08-22 09:51:29 +02:00
Josef Söntgen
fd3b54a4fb Noux: add libc_resolv to noux-pkg/netcat 2012-08-22 09:51:29 +02:00
Josef Söntgen
b7dc9af447 Noux: rename noux-pkg/gnu-netcat
The other GNU based packages do not have a gnu- prefix either.
2012-08-22 09:51:29 +02:00
Alexander Boettcher
5fcdd61a13 NOVA: fix placement of EC cap for recall
Put EC cap next to SM cap of Vcpu_dispatcher and not of the Vcpu.

Thanks @parthy for pointing out the issue.
2012-08-22 09:51:29 +02:00
Alexander Boettcher
125d274bc7 NOVA: fix locking in vancouver
Reported by @parthy.
2012-08-22 09:51:28 +02:00
Josef Söntgen
a4f4a5fb5a Noux: add /dev/null and /dev/zero filesystems
These device are mandatory for most programs (well, at least null
is required to be present for a POSIX compliant OS, which Noux is
actually not). But for proper shell-script support we will need
them anyway.
2012-08-22 09:51:28 +02:00
Josef Söntgen
a77c3dffd0 Noux: add user information support (struct passwd)
There are certain programs which need the information that is stored in
'struct passwd'. This commit introduces configurable user information
support to NOUX.

One can set the user information via <user> in NOUX config:

! <config>
!   <user name="baron" uid="1" gid="1">
!     <shell name="/bin/bash" />
!     <home name="/home" />
!   </user>
! [...]
! </config>

When <user> is not specified default values are used. Currently these
are 'root', 0, 0, '/bin/bash', '/'.

Note: this is just a single user implementation because each Noux instance
has only one user or rather one identity and there will be no complete
multi-user support in Noux. If you need different users, just start new
Noux instances for each of them.
2012-08-22 09:51:28 +02:00
Josef Söntgen
ae524e4beb Noux: add timeout handling to select()
Previously there was not actual timeout handling. If a select() call
set an timeout it would be set to zero instead and was always handled
as blocking i/o. While this works fine for file descriptors which
will be triggerd externally (for example vim through terminal i/o) it
does not work at all for socket descriptors and network operations in
general.

So this commit introduces proper timeout handling and changes the
behaviour of SYSCALL_SELECT so that it now returns more than just
one descriptor at a time.

noux/minimal and noux/net now depend on thread and alarm libraries.
2012-08-22 09:51:27 +02:00
Norman Feske
606ff66407 Noux: Toggle syscall tracing via config
Noux used to trace syscalls by default, which significantly slows down
its execution. This patch disables the tracing by default. It can be
enabled by specifying 'trace_syscalls="yes"' attribute to the Noux
configuration.
2012-08-22 09:51:27 +02:00
Norman Feske
e60eb0f57f noux: pass correct mode to Fs_vfs_handle
This patch resolves a problem with running 'noux_gdb.run'. Right at the
start, GDB would output a message like:

  ...cli-script.c:1614: internal-error: called with NULL file pointer!
  A problem internal to GDB has been detected,
  further debugging may prove unreliable.
  Quit this debugging session? (y or n)

The LOG output hints at the cause of the problem:

  [init -> noux -> /bin/genode-x86-gdb] fcntl: F_GETFL for libc_fd=3

Thanks to cproc for the fix!
2012-08-22 09:51:27 +02:00
Josef Söntgen
66198660aa Noux: add noux_net_lighttpd.run
This patch adds lighttpd as noux package. However, we do not use the
original build system but rather compile lighttpd directly from the
Genode build system. This is needed because we want to statically link
lighttpd modules into the binary. This mode is (somehow) supported by
the SConscript that comes with lighttpd. However, the GNU build scripts
do not expose this feature.
2012-08-22 09:51:26 +02:00
Norman Feske
228e70bb5f Native version of lighttpd
The port of lighttpd at 'ports/src/app/lighttpd' executes the web server
directly (w/o using Noux). It is accompanied by the lighttpd.run script.

At the current stage, lighttpd is starting up but fails because of an
unsupport fcntl call.
2012-08-22 09:51:22 +02:00
Norman Feske
7a7adfbb63 Add mmap and nunmap to libc_noux, libc_fs
In the current form, only PROT_READ is supported. This case is emulated
by copying the file content into new allocated backing store. Even
though the performance benefits of mmap-using code will not be
preserved, code that relies on mmap can be executed via the libc_noux
or libc_fs plugins, i.e. lightttpd.
2012-08-17 11:52:02 +02:00
Josef Söntgen
971f25976b Noux: add noux-pkg/lighttpd 2012-08-17 11:52:01 +02:00
Norman Feske
fab7b514e3 Move path utility from noux to 'os/include/os'
It turns out that the path-handling utility is valuable not only for
Noux. By moving it to a public header, we can use it for the libc.
2012-08-16 10:03:06 +02:00
Josef Söntgen
ba5ec3a29e Noux: recv* functions override the buffer
Instead of appending to the buffer it is overriden on
continous calls.

Fixes #325.
2012-08-16 10:03:06 +02:00
Josef Söntgen
ae89f88cfb Noux/net: adjust noux/net to lwip-1.4.1-rc1
Fixes #328.
2012-08-16 10:03:01 +02:00
Christian Prochaska
74b7b768f8 Noux: have bash use libc's 'getcwd()' function
The bash configure script cannot detect if the 'getcwd()' function in
Genode's libc works correctly, so it assumes that it is broken and makes
bash use its own version of this function. With this patch bash uses the
libc version, which has a Noux-specific implementation in the 'libc_noux'
plugin.

Fixes #324.
2012-08-15 14:31:33 +02:00
Christian Prochaska
94fad13adb libc: add support for 'O_TRUNC' flag in 'open()'
Fixes #320.
2012-08-09 11:09:43 +02:00
Christian Prochaska
266d5e0be3 libc_noux test
With this patch the libc plugin / file operations test can be built for
libc_noux.

Fixes #317.
2012-08-09 11:09:43 +02:00
Christian Prochaska
dcfcbce856 libc: add support for 'ftruncate()'
Fixes #307.
2012-08-09 11:09:43 +02:00
Christian Prochaska
280fc59edf Fix 'O_CREAT' flag handling in 'open()'
Fixes #313.
2012-08-09 11:09:43 +02:00
Alexander Boettcher
a7235d2411 NOVA: Use Genode interfaces to bootstrap Vancouver
Since no kernel objects can be created anymore outside Genode::core,
the Vancouver port must be adjusted to use solely the Genode interfaces.

The Vcpu_dispatcher creates all portals via the cpu_session interface and
uses the feature to setup a specific receive window during a IPC (the
cap_session::alloc IPC) to place to be received/to be mapped capability
(virtualization exception portal) at the designed indexes.

The actual vCPU thread extends from a normal Genode::Thread and extends it
by specific vCPU requirements, which are a larger exception base window and
the need by Vancouver to place the SM and EC cap at indexes next to each other.

Fixes #316
2012-08-09 11:09:42 +02:00
Christian Prochaska
a55b883146 Noux: fix setup of child environment
Fixes #315.
2012-08-07 22:27:53 +02:00
Norman Feske
d079ef51ae Adapt GDB monitor and Noux to CPU session changes 2012-08-03 12:06:31 +02:00
Christian Prochaska
6c68850524 Noux: add virtual '~Vfs_handle()' destructor
This patch adds a virtual destructor to the 'Vfs_handle' class to have
subclass destructors called on 'destroy()' on a base class pointer.

Fixes #305.
2012-08-01 12:48:26 +02:00
Christian Prochaska
fa541b4545 libc_noux: fix 'read()' function
This patch fixes the problem that data in the read buffer would get
overwritten in cases where multiple 'read()' syscalls are necessary.

Fixes #303.
2012-08-01 12:47:15 +02:00
Christian Prochaska
5f1a66b90c Noux: handle 'not a directory' error in fchdir()
Fixes #298.
2012-07-26 11:29:08 +02:00
Christian Prochaska
55815e4a3a Noux: add support for executing shell scripts
With this patch Noux recognizes the '#!' character sequence in executable
files and executes the specified interpreter.

Fixes #255.
2012-07-26 11:22:04 +02:00
Christian Prochaska
f99648f355 Noux: implement 'Fs_file_system::dataspace()'
Fixes #261.
2012-07-26 11:21:14 +02:00
Josef Söntgen
7e26c79455 Noux: add recvfrom()
Add SYSTEMCALL_RECVFROM to noux/net and the corresponding libc function.

Fixes #290.
2012-07-19 21:05:52 +02:00
Josef Söntgen
d28465cb3a Noux: fix missing mode propagation
When opening a new file, a new Fs_vfs_handle is created but with the
initial mode set to 0 which is not expected by functions like fdopen()
that check if the original flags given to the open() call match the
returned ones on the used fd.

Fixes #289.
2012-07-19 21:05:52 +02:00
Josef Söntgen
976e7b4288 Noux: fix send(), set fd before each syscall
The fd has to be set before each syscall.

Fixes #288.
2012-07-19 21:05:52 +02:00
Josef Söntgen
883453c65d Noux: fix sendto(), set args before each syscall
Set addrlen and dest_addr explicitly before each system call.

Fixes #287.
2012-07-19 21:05:51 +02:00
Alexander Boettcher
33a2f54413 NOVA: Vancouver - establish recall portal
Fixes #283
2012-07-19 21:05:51 +02:00
Christian Prochaska
1b8fd4aa44 GDB for Noux
With this patch the 'GNU Project Debugger' (GDB) can be built for Noux.

The included run script connects GDB and GDB monitor via a cross-link
terminal and allows interactive source-level debugging of the GDB monitor
test application on Genode.

Fixes #280.
2012-07-19 15:42:25 +02:00
Christian Prochaska
e39200d8c6 Noux: update GCC to version 4.6.1
This patch updates GCC to version 4.6.1 and enables tool chain support for
x86_64 and ARM.

Fixes #266.
2012-07-04 14:56:58 +02:00
Christian Prochaska
cdb1c6f203 Disable 'time_t' type size tests in findutils
Some type size tests in the findutils source code expect the 'time_t' type
to be of the same size as the 'long' type, whereas the Genode libc defines
it as '__int64_t' for ARM. This patch disables these tests.

Fixes #262.
2012-07-02 14:15:01 +02:00
Christian Prochaska
92ce7ca909 Don't always rebuild VIM
Fixes #260.
2012-07-02 14:14:25 +02:00