Index: kernel/generic/src/proc/task.c
===================================================================
--- kernel/generic/src/proc/task.c	(revision 1167520724b9b526c27b67f2d4bc447ef626240c)
+++ kernel/generic/src/proc/task.c	(revision c049309818d0a3eca8aa6dfecad99aa1f06ee0d6)
@@ -116,4 +116,5 @@
 	ta->main_thread = NULL;
 	ta->refcount = 0;
+	ta->context = THE->context;
 
 	ta->capabilities = 0;
@@ -356,6 +357,6 @@
 		
 			spinlock_lock(&t->lock);
-			printf("%s(%lld): address=%#zx, as=%#zx, ActiveCalls: %zd",
-				t->name, t->taskid, t, t->as, atomic_get(&t->active_calls));
+			printf("%s(%lld): context=%ld, address=%#zx, as=%#zx, ActiveCalls: %zd",
+				t->name, t->taskid, t->context, t, t->as, atomic_get(&t->active_calls));
 			for (j=0; j < IPC_MAX_PHONES; j++) {
 				if (t->phones[j].callee)
Index: kernel/generic/src/proc/the.c
===================================================================
--- kernel/generic/src/proc/the.c	(revision 1167520724b9b526c27b67f2d4bc447ef626240c)
+++ kernel/generic/src/proc/the.c	(revision c049309818d0a3eca8aa6dfecad99aa1f06ee0d6)
@@ -59,4 +59,5 @@
 	the->task = NULL;
 	the->as = NULL;
+	the->context = 0;
 }
 
Index: kernel/generic/src/proc/thread.c
===================================================================
--- kernel/generic/src/proc/thread.c	(revision 1167520724b9b526c27b67f2d4bc447ef626240c)
+++ kernel/generic/src/proc/thread.c	(revision c049309818d0a3eca8aa6dfecad99aa1f06ee0d6)
@@ -124,5 +124,5 @@
 static int thr_constructor(void *obj, int kmflags)
 {
-	thread_t *t = (thread_t *)obj;
+	thread_t *t = (thread_t *) obj;
 
 	spinlock_initialize(&t->lock, "thread_t_lock");
@@ -156,5 +156,5 @@
 static int thr_destructor(void *obj)
 {
-	thread_t *t = (thread_t *)obj;
+	thread_t *t = (thread_t *) obj;
 
 	frame_free(KA2PA(t->kstack));
@@ -300,5 +300,5 @@
 	
 	/* Not needed, but good for debugging */
-	memsetb((uintptr_t)t->kstack, THREAD_STACK_SIZE * 1<<STACK_FRAMES, 0);
+	memsetb((uintptr_t) t->kstack, THREAD_STACK_SIZE * 1 << STACK_FRAMES, 0);
 	
 	ipl = interrupts_disable();
@@ -319,4 +319,5 @@
 	memcpy(t->name, name, THREAD_NAME_BUFLEN);
 	
+	t->context = THE->context;
 	t->thread_code = func;
 	t->thread_arg = arg;
@@ -534,6 +535,6 @@
 		
 			t = (thread_t *) node->value[i];
-			printf("%s: address=%#zx, tid=%zd, state=%s, task=%#zx, code=%#zx, stack=%#zx, cpu=",
-				t->name, t, t->tid, thread_states[t->state], t->task, t->thread_code, t->kstack);
+			printf("%s: address=%#zx, tid=%zd, context=%ld, state=%s, task=%#zx, code=%#zx, stack=%#zx, cpu=",
+				t->name, t, t->tid, t->context, thread_states[t->state], t->task, t->thread_code, t->kstack);
 			if (t->cpu)
 				printf("cpu%zd", t->cpu->id);
