Index: boot/Makefile.common
===================================================================
--- boot/Makefile.common	(revision 5c058d500ee41368a4ddb76818f2320282a12dae)
+++ boot/Makefile.common	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -72,5 +72,6 @@
 	$(USPACEDIR)/app/trace/trace \
 	$(USPACEDIR)/app/ps/ps \
-	$(USPACEDIR)/app/top/top
+	$(USPACEDIR)/app/top/top \
+	$(USPACEDIR)/app/uptime/uptime
 
 COMPONENTS = \
Index: kernel/Makefile
===================================================================
--- kernel/Makefile	(revision 5c058d500ee41368a4ddb76818f2320282a12dae)
+++ kernel/Makefile	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -231,5 +231,6 @@
 	generic/src/sysinfo/sysinfo.c \
 	generic/src/ps/ps.c \
-	generic/src/ps/load.c
+	generic/src/ps/load.c \
+	generic/src/ps/uptime.c
 
 ## Kernel console support
Index: kernel/generic/include/ps/uptime.h
===================================================================
--- kernel/generic/include/ps/uptime.h	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
+++ kernel/generic/include/ps/uptime.h	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * 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_UPTIME_H_
+#define KERN_UPTIME_H_
+
+extern int sys_ps_get_uptime(uint64_t *user_load);
+
+#endif
+
+/** @}
+ */
Index: kernel/generic/include/syscall/syscall.h
===================================================================
--- kernel/generic/include/syscall/syscall.h	(revision 5c058d500ee41368a4ddb76818f2320282a12dae)
+++ kernel/generic/include/syscall/syscall.h	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -91,4 +91,5 @@
 	SYS_PS_GET_TASK_INFO,
 	SYS_PS_GET_THREADS,
+	SYS_PS_GET_UPTIME,
 	SYS_PS_GET_LOAD,
 
Index: kernel/generic/src/ps/uptime.c
===================================================================
--- kernel/generic/src/ps/uptime.c	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
+++ kernel/generic/src/ps/uptime.c	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * 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 genericuptime
+ * @{
+ */
+
+/**
+ * @file
+ * @brief	Get system uptime.
+ */
+
+#include <time/clock.h>
+#include <syscall/copy.h>
+#include <ps/uptime.h>
+
+int sys_ps_get_uptime(uint64_t *user_uptime)
+{
+	uint64_t seconds = uptime->seconds1;
+	copy_to_uspace(user_uptime, &seconds, sizeof(uint64_t));
+	return 0;
+}
+
+
+/** @}
+ */
Index: kernel/generic/src/syscall/syscall.c
===================================================================
--- kernel/generic/src/syscall/syscall.c	(revision 5c058d500ee41368a4ddb76818f2320282a12dae)
+++ kernel/generic/src/syscall/syscall.c	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -56,4 +56,5 @@
 #include <ps/ps.h>
 #include <ps/load.h>
+#include <ps/uptime.h>
 
 /** Dispatch system call */
@@ -172,4 +173,5 @@
 	(syshandler_t) sys_ps_get_task_info,
 	(syshandler_t) sys_ps_get_threads,
+	(syshandler_t) sys_ps_get_uptime,
 	(syshandler_t) sys_ps_get_load,
 	
Index: uspace/Makefile
===================================================================
--- uspace/Makefile	(revision 5c058d500ee41368a4ddb76818f2320282a12dae)
+++ uspace/Makefile	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -47,4 +47,5 @@
 	app/ps \
 	app/top \
+	app/uptime \
 	srv/clip \
 	srv/devmap \
Index: uspace/app/uptime/Makefile
===================================================================
--- uspace/app/uptime/Makefile	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
+++ uspace/app/uptime/Makefile	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -0,0 +1,36 @@
+#
+# Copyright (c) 2005 Martin Decky
+# Copyright (c) 2007 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.
+#
+
+USPACE_PREFIX = ../..
+BINARY = uptime
+
+SOURCES = \
+	uptime.c
+
+include $(USPACE_PREFIX)/Makefile.common
Index: uspace/app/uptime/uptime.c
===================================================================
--- uspace/app/uptime/uptime.c	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
+++ uspace/app/uptime/uptime.c	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * 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 uptime
+ * @brief Echo system uptime.
+ * @{
+ */
+/**
+ * @file
+ */
+
+#include <stdio.h>
+#include <uptime.h>
+
+int main(int argc, char *argv[])
+{
+	uint64_t uptime;
+
+	get_uptime(&uptime);
+	printf("Up %llu days, %llu hours, %llu minutes, %llu seconds\n",
+		uptime / 86400, (uptime % 86400) / 3600, (uptime % 3600) / 60, uptime % 60);
+	return 0;
+}
+
+/** @}
+ */
Index: uspace/lib/c/Makefile
===================================================================
--- uspace/lib/c/Makefile	(revision 5c058d500ee41368a4ddb76818f2320282a12dae)
+++ uspace/lib/c/Makefile	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -92,5 +92,6 @@
 	generic/stacktrace.c \
 	generic/ps.c \
-	generic/load.c
+	generic/load.c \
+	generic/uptime.c
 
 SOURCES = \
Index: uspace/lib/c/generic/uptime.c
===================================================================
--- uspace/lib/c/generic/uptime.c	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
+++ uspace/lib/c/generic/uptime.c	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * 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 <libc.h>
+#include <uptime.h>
+
+/** Get current system uptime
+ *
+ * @param load		Pointer where uptime will be stored.
+ *
+ * @return		EOK.
+ *
+ */
+int get_uptime(uint64_t *uptime)
+{
+	return __SYSCALL1(SYS_PS_GET_UPTIME, (sysarg_t) uptime);
+}
+
+/** @}
+ */
Index: uspace/lib/c/include/uptime.h
===================================================================
--- uspace/lib/c/include/uptime.h	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
+++ uspace/lib/c/include/uptime.h	(revision c0379fcd0ca28d6439cb4dbc7c14648b1e2d8462)
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2010 Stanislav Kozina
+ * 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
+ */ 
+
+#ifndef LIBC_UPTIME_H_
+#define LIBC_UPTIME_H_
+
+#include <sys/types.h>
+#include <libarch/types.h>
+
+extern int get_uptime(uint64_t *uptime);
+
+#endif
+
+/** @}
+ */
