Index: uspace/lib/c/generic/async/client.c
===================================================================
--- uspace/lib/c/generic/async/client.c	(revision 63a3276125498d691e4cbe1e0266954b6656ee4d)
+++ uspace/lib/c/generic/async/client.c	(revision 0a8f070c890fb7e10df2f1aa71289773d26926dc)
@@ -124,6 +124,6 @@
 static fibril_rmutex_t message_mutex;
 
-/** Naming service session */
-async_sess_t session_ns;
+/** Primary session (spawn parent, later naming service) */
+async_sess_t *session_primary = NULL;
 
 /** Message data */
@@ -168,25 +168,46 @@
 static FIBRIL_CONDVAR_INITIALIZE(avail_phone_cv);
 
+
+static async_sess_t *create_session_primary(void)
+{
+	async_sess_t *session = (async_sess_t *) malloc(sizeof(async_sess_t));
+
+	if (session != NULL) {
+		session_ns->iface = 0;
+		session->mgmt = EXCHANGE_ATOMIC;
+		session->phone = PHONE_INITIAL;
+		session->arg1 = 0;
+		session->arg2 = 0;
+		session->arg3 = 0;
+		
+		fibril_mutex_initialize(&session->remote_state_mtx);
+		session->remote_state_data = NULL;
+		
+		list_initialize(&session->exch_list);
+		fibril_mutex_initialize(&session->mutex);
+		atomic_set(&session->refcnt, 0);
+		&session.exchanges = 0;
+	}
+
+	return session;
+}
+
+
 /** Initialize the async framework.
  *
  */
-void __async_client_init(void)
+void __async_client_init(async_sess_t *session)
 {
 	if (fibril_rmutex_initialize(&message_mutex) != EOK)
 		abort();
 
-	session_ns.iface = 0;
-	session_ns.mgmt = EXCHANGE_ATOMIC;
-	session_ns.phone = PHONE_NS;
-	session_ns.arg1 = 0;
-	session_ns.arg2 = 0;
-	session_ns.arg3 = 0;
-
-	fibril_mutex_initialize(&session_ns.remote_state_mtx);
-	session_ns.remote_state_data = NULL;
-
-	list_initialize(&session_ns.exch_list);
-	fibril_mutex_initialize(&session_ns.mutex);
-	session_ns.exchanges = 0;
+	if (session == NULL) {
+		session_primary = create_session_primary();
+	} else {
+		session_primary = session;
+	}
+
+	if (session_primary == NULL)
+		abort();
 }
 
@@ -807,4 +828,19 @@
 	*out_phone = (cap_phone_handle_t) ipc_get_arg5(&result);
 	return EOK;
+}
+
+/** Injects another session instead of original primary session
+ *
+ * @param  session  Session to naming service.
+ *
+ * @return old primary session (to spawn parent)
+ */
+async_sess_t *async_session_primary_swap(async_sess_t *session)
+{
+	assert(session_primary->phone == PHONE_INITIAL);
+
+	async_sess_t *old_primary = session_primary;
+	session_primary = session;
+	return old_primary;
 }
 
Index: uspace/lib/c/generic/async/server.c
===================================================================
--- uspace/lib/c/generic/async/server.c	(revision 63a3276125498d691e4cbe1e0266954b6656ee4d)
+++ uspace/lib/c/generic/async/server.c	(revision 0a8f070c890fb7e10df2f1aa71289773d26926dc)
@@ -216,4 +216,5 @@
 }
 
+static async_client_conn_t implicit_connection = NULL;
 static fibril_rmutex_t client_mutex;
 static hash_table_t client_hash_table;
@@ -964,6 +965,11 @@
 	/* Route the call according to its request label */
 	errno_t rc = route_call(call);
-	if (rc == EOK)
+	if (rc == EOK) {
 		return;
+	} else if (implicit_connection != NULL) {
+		async_new_connection(call->in_task_id, call->in_phone_hash,
+		    callid, call, implicit_connection, NULL);
+		return;
+	}
 
 	// TODO: Log the error.
Index: uspace/lib/c/generic/libc.c
===================================================================
--- uspace/lib/c/generic/libc.c	(revision 63a3276125498d691e4cbe1e0266954b6656ee4d)
+++ uspace/lib/c/generic/libc.c	(revision 0a8f070c890fb7e10df2f1aa71289773d26926dc)
@@ -103,7 +103,12 @@
 	}
 #endif
-
+	
+	/* Setup async framework */
 	__async_server_init();
-	__async_client_init();
+	if (__pcb == NULL) {
+		__async_client_init(NULL);
+	} else {
+		__async_client_init(__pcb->session_primary);
+	}
 	__async_ports_init();
 
Index: uspace/lib/c/generic/loader.c
===================================================================
--- uspace/lib/c/generic/loader.c	(revision 63a3276125498d691e4cbe1e0266954b6656ee4d)
+++ uspace/lib/c/generic/loader.c	(revision 0a8f070c890fb7e10df2f1aa71289773d26926dc)
@@ -33,15 +33,16 @@
  */
 
+#include <async.h>
+#include <errno.h>
 #include <ipc/loader.h>
 #include <ipc/services.h>
+#include <ipc/taskman.h>
+#include <libc.h>
+#include <loader/loader.h>
 #include <ns.h>
-#include <libc.h>
+#include <stdlib.h>
+#include <str.h>
 #include <task.h>
-#include <str.h>
-#include <stdlib.h>
-#include <async.h>
-#include <errno.h>
 #include <vfs/vfs.h>
-#include <loader/loader.h>
 #include "private/loader.h"
 
@@ -67,5 +68,5 @@
 
 	async_sess_t *sess =
-	    service_connect_blocking(SERVICE_LOADER, INTERFACE_LOADER, 0);
+	    service_connect_blocking(SERVICE_TASKMAN, TASKMAN_CONNECT_TO_LOADER, 0);
 	if (sess == NULL) {
 		free(ldr);
Index: uspace/lib/c/generic/ns.c
===================================================================
--- uspace/lib/c/generic/ns.c	(revision 63a3276125498d691e4cbe1e0266954b6656ee4d)
+++ uspace/lib/c/generic/ns.c	(revision 0a8f070c890fb7e10df2f1aa71289773d26926dc)
@@ -41,13 +41,13 @@
 
 /*
- * XXX ns does not know about session_ns, so we create an extra session for
+ * XXX ns does not know about session_primary, so we create an extra session for
  * actual communicaton
  */
-static async_sess_t *sess_ns = NULL;
+static async_sess_t *sess_primary = NULL;
 
 errno_t service_register(service_t service, iface_t iface,
     async_port_handler_t handler, void *data)
 {
-	async_sess_t *sess = ns_session_get();
+	async_sess_t *sess = get_session_primary();
 	if (sess == NULL)
 		return EIO;
@@ -81,5 +81,5 @@
 	async_set_fallback_port_handler(handler, data);
 
-	async_sess_t *sess = ns_session_get();
+	async_sess_t *sess = get_session_primary();
 	if (sess == NULL)
 		return EIO;
@@ -105,5 +105,5 @@
 async_sess_t *service_connect(service_t service, iface_t iface, sysarg_t arg3)
 {
-	async_sess_t *sess = ns_session_get();
+	async_sess_t *sess = get_session_primary();
 	if (sess == NULL)
 		return NULL;
@@ -133,5 +133,5 @@
     sysarg_t arg3)
 {
-	async_sess_t *sess = ns_session_get();
+	async_sess_t *sess = get_session_primary();
 	if (sess == NULL)
 		return NULL;
@@ -157,5 +157,5 @@
 errno_t ns_ping(void)
 {
-	async_sess_t *sess = ns_session_get();
+	async_sess_t *sess = get_session_primary();
 	if (sess == NULL)
 		return EIO;
@@ -168,31 +168,18 @@
 }
 
-errno_t ns_intro(task_id_t id)
-{
-	async_exch_t *exch;
-	async_sess_t *sess = ns_session_get();
-	if (sess == NULL)
-		return EIO;
 
-	exch = async_exchange_begin(sess);
-	errno_t rc = async_req_2_0(exch, NS_ID_INTRO, LOWER32(id), UPPER32(id));
-	async_exchange_end(exch);
-
-	return rc;
-}
-
-async_sess_t *ns_session_get(void)
+async_sess_t *get_session_primary(void)
 {
 	async_exch_t *exch;
 
-	if (sess_ns == NULL) {
-		exch = async_exchange_begin(&session_ns);
-		sess_ns = async_connect_me_to(exch, 0, 0, 0);
+	if (sess_primary == NULL) {
+		exch = async_exchange_begin(&session_primary);
+		sess_primary = async_connect_me_to(exch, 0, 0, 0);
 		async_exchange_end(exch);
-		if (sess_ns == NULL)
+		if (sess_primary == NULL)
 			return NULL;
 	}
 
-	return sess_ns;
+	return sess_primary;
 }
 
Index: uspace/lib/c/generic/private/async.h
===================================================================
--- uspace/lib/c/generic/private/async.h	(revision 63a3276125498d691e4cbe1e0266954b6656ee4d)
+++ uspace/lib/c/generic/private/async.h	(revision 0a8f070c890fb7e10df2f1aa71289773d26926dc)
@@ -96,5 +96,5 @@
 extern void __async_server_init(void);
 extern void __async_server_fini(void);
-extern void __async_client_init(void);
+extern void __async_client_init(async_sess_t *);
 extern void __async_client_fini(void);
 extern void __async_ports_init(void);
Index: uspace/lib/c/generic/private/ns.h
===================================================================
--- uspace/lib/c/generic/private/ns.h	(revision 63a3276125498d691e4cbe1e0266954b6656ee4d)
+++ uspace/lib/c/generic/private/ns.h	(revision 0a8f070c890fb7e10df2f1aa71289773d26926dc)
@@ -38,5 +38,5 @@
 #include <async.h>
 
-extern async_sess_t session_ns;
+extern async_sess_t *session_primary;
 
 #endif
Index: uspace/lib/c/generic/task.c
===================================================================
--- uspace/lib/c/generic/task.c	(revision 63a3276125498d691e4cbe1e0266954b6656ee4d)
+++ uspace/lib/c/generic/task.c	(revision 0a8f070c890fb7e10df2f1aa71289773d26926dc)
@@ -325,9 +325,10 @@
 errno_t task_setup_wait(task_id_t id, task_wait_t *wait)
 {
-	async_sess_t *sess_ns = ns_session_get();
+	async_sess_t *sess_ns = get_session_primary();
 	if (sess_ns == NULL)
 		return EIO;
 
 	async_exch_t *exch = async_exchange_begin(sess_ns);
+
 	wait->aid = async_send_2(exch, NS_TASK_WAIT, LOWER32(id), UPPER32(id),
 	    &wait->result);
@@ -407,5 +408,5 @@
 errno_t task_retval(int val)
 {
-	async_sess_t *sess_ns = ns_session_get();
+	async_sess_t *sess_ns = get_session_primary();
 	if (sess_ns == NULL)
 		return EIO;
Index: uspace/lib/c/generic/taskman.c
===================================================================
--- uspace/lib/c/generic/taskman.c	(revision 0a8f070c890fb7e10df2f1aa71289773d26926dc)
+++ uspace/lib/c/generic/taskman.c	(revision 0a8f070c890fb7e10df2f1aa71289773d26926dc)
@@ -0,0 +1,92 @@
+/*
+ * Copyright (c) 2015 Michal Koutny
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup libc
+ * @{
+ */
+/** @file
+ */
+
+#include <errno.h>
+#include <ipc/taskman.h>
+#include <taskman.h>
+
+#include <stdio.h>
+
+//TODO better filename?
+#include "private/ns.h"
+
+static int taskman_ask_callback(async_sess_t *session_tm)
+{
+	async_exch_t *exch = async_exchange_begin(session_tm);
+	int rc = async_connect_to_me(
+	    exch, TASKMAN_LOADER_CALLBACK, 0, 0, NULL, NULL);
+	async_exchange_end(exch);
+
+	return rc;
+}
+
+static async_sess_t *taskman_connect_to_ns(async_sess_t *session_tm)
+{
+	async_exch_t *exch = async_exchange_begin(session_tm);
+	async_sess_t *session_ns = async_connect_me_to(EXCHANGE_ATOMIC,
+	    exch, TASKMAN_LOADER_TO_NS, 0, 0);
+	async_exchange_end(exch);
+
+	return session_ns;
+}
+
+/** Set up phones upon being spawned by taskman
+ *
+ * Assumes primary session exists that is connected to taskman.
+ * After handshake, taskman is connected to us (see, it's opposite) and broker
+ * session is set up according to taskman.
+ *
+ *
+ * @return Session to broker (naming service) or NULL (sets errno).
+ */
+async_sess_t *taskman_handshake(void)
+{
+	printf("%s:%i\n", __func__, __LINE__);
+
+	int rc = taskman_ask_callback(session_primary);
+	if (rc != EOK) {
+		errno = rc;
+		return NULL;
+	}
+
+	async_sess_t *session_ns = taskman_connect_to_ns(session_primary);
+	if (session_ns == NULL) {
+		errno = ENOENT;
+	}
+
+	return session_ns;
+}
+
+/** @}
+ */
