Index: kernel/generic/src/main/main.c
===================================================================
--- kernel/generic/src/main/main.c	(revision 3fcea3438e30a096e9a5590a54508cfe3d5a697f)
+++ kernel/generic/src/main/main.c	(revision 77a0119213839c7dd3edafceec905bf0e9a93e79)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2001-2004 Jakub Jermar
  * All rights reserved.
@@ -110,4 +111,6 @@
 CHECK_INT_TYPE(64);
 
+task_t *kernel_task;
+
 /** Global configuration structure. */
 config_t config = {
@@ -273,4 +276,6 @@
 		panic("Cannot create kernel task.");
 
+	kernel_task = kernel;
+
 	/*
 	 * Create the first thread.
Index: kernel/generic/src/main/shutdown.c
===================================================================
--- kernel/generic/src/main/shutdown.c	(revision 3fcea3438e30a096e9a5590a54508cfe3d5a697f)
+++ kernel/generic/src/main/shutdown.c	(revision 77a0119213839c7dd3edafceec905bf0e9a93e79)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2007 Martin Decky
  * All rights reserved.
@@ -37,11 +38,18 @@
 
 #include <arch.h>
-#include <proc/task.h>
+#include <errno.h>
 #include <halt.h>
 #include <log.h>
+#include <main/main.h>
+#include <main/shutdown.h>
+#include <proc/task.h>
+#include <proc/thread.h>
+
+static thread_t *reboot_thrd = NULL;
+SPINLOCK_INITIALIZE(reboot_lock);
 
 void reboot(void)
 {
-	task_done();
+	task_done(kernel_task);
 
 #ifdef CONFIG_DEBUG
@@ -53,4 +61,47 @@
 }
 
+/** Thread procedure for rebooting the system.
+ *
+ * @param arg Argument (unused)
+ */
+static void reboot_thrd_proc(void *arg)
+{
+	(void)arg;
+
+	reboot();
+}
+
+/** Reboot the system.
+ *
+ * @return EOK if reboot started successfully. EBUSY if reboot already
+ *         started, ENOMEM if out of memory.
+ */
+sys_errno_t sys_reboot(void)
+{
+	thread_t *thread;
+
+	thread = thread_create(reboot_thrd_proc, NULL, kernel_task,
+	    THREAD_FLAG_NONE, "reboot");
+	if (thread == NULL)
+		return ENOMEM;
+
+	spinlock_lock(&reboot_lock);
+
+	if (reboot_thrd != NULL) {
+		spinlock_unlock(&reboot_lock);
+		thread_put(thread);
+		return EBUSY;
+	}
+
+	reboot_thrd = thread;
+
+	spinlock_unlock(&reboot_lock);
+
+	thread_start(thread);
+	thread_detach(thread);
+
+	return EOK;
+}
+
 /** @}
  */
