diff --git a/ports/src/noux/main.cc b/ports/src/noux/main.cc index cb54c3f711..3a58364eb2 100644 --- a/ports/src/noux/main.cc +++ b/ports/src/noux/main.cc @@ -807,6 +807,13 @@ Noux::Io_receptor_registry * Noux::io_receptor_registry() } +Terminal::Connection *Noux::terminal() +{ + static Terminal::Connection _inst; + return &_inst; +} + + void *operator new (Genode::size_t size) { return Genode::env()->heap()->alloc(size); } @@ -869,17 +876,15 @@ int main(int argc, char **argv) resources_ep, false); - static Terminal::Connection terminal; - /* * I/O channels must be dynamically allocated to handle cases where the * init program closes one of these. */ typedef Terminal_io_channel Tio; /* just a local abbreviation */ Shared_pointer - channel_0(new Tio(terminal, Tio::STDIN, sig_rec), Genode::env()->heap()), - channel_1(new Tio(terminal, Tio::STDOUT, sig_rec), Genode::env()->heap()), - channel_2(new Tio(terminal, Tio::STDERR, sig_rec), Genode::env()->heap()); + channel_0(new Tio(*Noux::terminal(), Tio::STDIN, sig_rec), Genode::env()->heap()), + channel_1(new Tio(*Noux::terminal(), Tio::STDOUT, sig_rec), Genode::env()->heap()), + channel_2(new Tio(*Noux::terminal(), Tio::STDERR, sig_rec), Genode::env()->heap()); init_child->add_io_channel(channel_0, 0); init_child->add_io_channel(channel_1, 1); diff --git a/ports/src/noux/terminal_connection.h b/ports/src/noux/terminal_connection.h new file mode 100644 index 0000000000..5c98f8615b --- /dev/null +++ b/ports/src/noux/terminal_connection.h @@ -0,0 +1,34 @@ +/* + * \brief Terminal connection + * \author Josef Soentgen + * \date 2012-08-02 + */ + +/* + * Copyright (C) 2012 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. + */ + +#ifndef _NOUX__TERMINAL_CONNECTION_H_ +#define _NOUX__TERMINAL_CONNECTION_H_ + +/* Genode includes */ +#include +#include +#include +#include + +/* Noux includes */ +#include +#include "file_system.h" + + +namespace Noux { + + Terminal::Connection *terminal(); + +} + +#endif /* _NOUX__TERMINAL_CONNECTION_H_ */