Index: kernel/generic/include/cap/cap.h
===================================================================
--- kernel/generic/include/cap/cap.h	(revision 3f74275b545272926eb993b683eae30e42326ab4)
+++ kernel/generic/include/cap/cap.h	(revision 3f74275b545272926eb993b683eae30e42326ab4)
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2017 Jakub Jermar
+ * 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 generic
+ * @{
+ */
+/** @file
+ */
+
+#ifndef KERN_CAP_H_
+#define KERN_CAP_H_
+
+#include <typedefs.h>
+#include <ipc/ipc.h>
+#include <ddi/irq.h>
+
+#define MAX_CAPS  64
+
+#define for_each_cap(task, cap, type) \
+	for (int i = 0, l = 1; i < MAX_CAPS && l; i++) \
+		for (cap_t *(cap) = cap_get((task), i, (type)); \
+		    (cap) && !(l = 0); (cap) = NULL, l = 1)
+
+#define for_each_cap_current(cap, type) \
+	for_each_cap(TASK, (cap), (type))
+
+typedef enum {
+	CAP_TYPE_INVALID,
+	CAP_TYPE_ALLOCATED,
+	CAP_TYPE_PHONE,
+	CAP_TYPE_IRQ
+} cap_type_t;
+
+typedef struct cap {
+	cap_type_t type;
+	bool (* can_reclaim)(struct cap *);
+
+	/* The underlying kernel object. */
+	union {
+		phone_t phone;
+		irq_t irq;
+	};
+} cap_t;
+
+struct task;
+
+void caps_task_alloc(struct task *);
+void caps_task_free(struct task *);
+void caps_task_init(struct task *);
+
+extern void cap_initialize(cap_t *);
+extern cap_t *cap_get(struct task *, int, cap_type_t);
+extern cap_t *cap_get_current(int, cap_type_t);
+extern int cap_alloc(struct task *);
+extern void cap_free(struct task *, int);
+
+extern int cap_get_handle(struct task *, cap_t *);
+
+#endif
+
+/** @}
+ */
Index: kernel/generic/include/kobject/kobject.h
===================================================================
--- kernel/generic/include/kobject/kobject.h	(revision e7ac23d02750f85979a275420d969126143b3738)
+++ 	(revision )
@@ -1,86 +1,0 @@
-/*
- * Copyright (c) 2017 Jakub Jermar
- * 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 generic
- * @{
- */
-/** @file
- */
-
-#ifndef KERN_KOBJECT_H_
-#define KERN_KOBJECT_H_
-
-#include <typedefs.h>
-#include <ipc/ipc.h>
-#include <ddi/irq.h>
-
-#define MAX_KERNEL_OBJECTS  64
-
-#define for_each_kobject(task, ko, type) \
-	for (int i = 0, l = 1; i < MAX_KERNEL_OBJECTS && l; i++) \
-		for (kobject_t *(ko) = kobject_get((task), i, (type)); \
-		    (ko) && !(l = 0); (ko) = NULL, l = 1)
-
-#define for_each_kobject_current(ko, type) \
-	for_each_kobject(TASK, (ko), (type))
-
-typedef enum {
-	KOBJECT_TYPE_INVALID,
-	KOBJECT_TYPE_ALLOCATED,
-	KOBJECT_TYPE_PHONE,
-	KOBJECT_TYPE_IRQ
-} kobject_type_t;
-
-typedef struct kobject {
-	kobject_type_t type;
-	bool (* can_reclaim)(struct kobject *);
-
-	union {
-		phone_t phone;
-		irq_t irq;
-	};
-} kobject_t;
-
-struct task;
-
-void kobject_task_alloc(struct task *);
-void kobject_task_free(struct task *);
-void kobject_task_init(struct task *);
-
-extern void kobject_initialize(kobject_t *);
-extern kobject_t *kobject_get(struct task *, int, kobject_type_t);
-extern kobject_t *kobject_get_current(int, kobject_type_t);
-extern int kobject_alloc(struct task *);
-extern void kobject_free(struct task *, int);
-
-extern int kobject_to_cap(struct task *, kobject_t *);
-
-#endif
-
-/** @}
- */
Index: kernel/generic/include/proc/task.h
===================================================================
--- kernel/generic/include/proc/task.h	(revision e7ac23d02750f85979a275420d969126143b3738)
+++ kernel/generic/include/proc/task.h	(revision 3f74275b545272926eb993b683eae30e42326ab4)
@@ -65,5 +65,5 @@
 
 struct thread;
-struct kobject;
+struct cap;
 
 /** Task structure. */
@@ -97,6 +97,6 @@
 	perm_t perms;
 
-	/** Kernel objects */
-	struct kobject *kobject;
+	/** Capabilities */
+	struct cap *caps;
 	
 	/* IPC stuff */
