Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision c8cec856c6988a864b5747338c5874abfee33cd1)
+++ kernel/Makefile	(revision 7e3826d9e2baf0dbb07a924b5e30821ee79b8f0d)
@@ -286,4 +286,5 @@
 	generic/src/ipc/irq.c \
 	generic/src/ipc/event.c \
+	generic/src/kobject/kobject.c \
 	generic/src/security/perm.c \
 	generic/src/sysinfo/sysinfo.c \
Index: kernel/generic/include/kobject/kobject.h
===================================================================
--- kernel/generic/include/kobject/kobject.h	(revision c8cec856c6988a864b5747338c5874abfee33cd1)
+++ kernel/generic/include/kobject/kobject.h	(revision 7e3826d9e2baf0dbb07a924b5e30821ee79b8f0d)
@@ -40,6 +40,9 @@
 #define MAX_KERNEL_OBJECTS  64
 
+#define KOBJECT_INVALID_CAP -1
+
 typedef enum {
-	KOBJECT_TYPE_INVALID
+	KOBJECT_TYPE_INVALID,
+	KOBJECT_TYPE_ALLOCATED
 } kobject_type_t;
 
@@ -50,4 +53,9 @@
 } kobject_t;
 
+extern kobject_t *kobject_get_local(int, kobject_type_t);
+
+struct task;
+extern int kobject_alloc(struct task *);
+extern void kobject_free(struct task *, int);
 
 #endif
Index: kernel/generic/include/proc/task.h
===================================================================
--- kernel/generic/include/proc/task.h	(revision c8cec856c6988a864b5747338c5874abfee33cd1)
+++ kernel/generic/include/proc/task.h	(revision 7e3826d9e2baf0dbb07a924b5e30821ee79b8f0d)
@@ -97,5 +97,5 @@
 	perm_t perms;
 
-	/** Sending communication endpoints */
+	/** Kernel objects */
 	kobject_t kobject[MAX_KERNEL_OBJECTS];
 	
Index: kernel/generic/src/kobject/kobject.c
===================================================================
--- kernel/generic/src/kobject/kobject.c	(revision 7e3826d9e2baf0dbb07a924b5e30821ee79b8f0d)
+++ kernel/generic/src/kobject/kobject.c	(revision 7e3826d9e2baf0dbb07a924b5e30821ee79b8f0d)
@@ -0,0 +1,77 @@
+/*
+ * 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
+ */
+
+#include <kobject/kobject.h>
+#include <proc/task.h>
+#include <synch/spinlock.h>
+
+kobject_t *kobject_get_local(int cap, kobject_type_t type)
+{
+	if ((cap < 0) || (cap >= MAX_KERNEL_OBJECTS))
+		return NULL;
+	if (TASK->kobject[cap].type != type)
+		return NULL;
+	return &TASK->kobject[cap];
+}
+
+int kobject_alloc(task_t *task)
+{
+	int cap;
+
+	irq_spinlock_lock(&task->lock, true);
+	for (cap = 0; cap < MAX_KERNEL_OBJECTS; cap++) {
+		if (task->kobject[cap].type == KOBJECT_TYPE_INVALID) {
+			task->kobject[cap].type = KOBJECT_TYPE_ALLOCATED;
+			irq_spinlock_unlock(&task->lock, true);
+			return cap;
+		}
+	}
+	irq_spinlock_unlock(&task->lock, true);
+
+	return KOBJECT_INVALID_CAP;
+}
+
+void kobject_free(task_t *task, int cap)
+{
+	assert(cap >= 0);
+	assert(cap < MAX_KERNEL_OBJECTS);
+	assert(task->kobject[cap].type != KOBJECT_TYPE_INVALID);
+
+	irq_spinlock_lock(&task->lock, true);
+	task->kobject[cap].type = KOBJECT_TYPE_INVALID;
+	irq_spinlock_unlock(&task->lock, true);
+}
+
+/** @}
+ */
