From b639b99b3e8f4cf77560d8d473b13d992ac8eb10 Mon Sep 17 00:00:00 2001 From: Alexis211 Date: Sat, 24 Oct 2009 18:24:46 +0200 Subject: More work on userland syscalls : Files are implemented. TextFile now is a common (= kernel and userland) library. --- Source/Kernel/Core/Log.ns.h | 2 +- Source/Kernel/Core/Sys.ns.cpp | 5 +++++ Source/Kernel/Core/kmain.wtf.cpp | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'Source/Kernel/Core') diff --git a/Source/Kernel/Core/Log.ns.h b/Source/Kernel/Core/Log.ns.h index d825f62..dc126dc 100644 --- a/Source/Kernel/Core/Log.ns.h +++ b/Source/Kernel/Core/Log.ns.h @@ -1,7 +1,7 @@ #ifndef DEF_LOG_NS_H #define DEF_LOG_NS_H -#include +#include #define KL_PANIC 0 #define KL_CRITICAL 1 diff --git a/Source/Kernel/Core/Sys.ns.cpp b/Source/Kernel/Core/Sys.ns.cpp index 1b52c0f..e5dbdc0 100644 --- a/Source/Kernel/Core/Sys.ns.cpp +++ b/Source/Kernel/Core/Sys.ns.cpp @@ -5,6 +5,8 @@ #include #include #include +#include +#include #define DEBUGVT(x) SimpleVT *x = new SimpleVT(4, 56, 0, 15); x->map(); x->put('\n'); @@ -146,6 +148,9 @@ void halt() { u32int scall(u8int wat, u32int a, u32int b, u32int c, u32int d) { if (wat == SYIF_HALT && ISROOT) halt(); if (wat == SYIF_REBOOT && ISROOT) reboot(); + if (wat == SYIF_UPTIME) return Time::uptime(); + if (wat == SYIF_TOTALRAM) return PhysMem::total() * 4; + if (wat == SYIF_FREERAM) return PhysMem::free() * 4; return (u32int) - 1; } diff --git a/Source/Kernel/Core/kmain.wtf.cpp b/Source/Kernel/Core/kmain.wtf.cpp index d2f8c7b..76d8971 100644 --- a/Source/Kernel/Core/kmain.wtf.cpp +++ b/Source/Kernel/Core/kmain.wtf.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include -- cgit v1.2.3