summaryrefslogtreecommitdiff
path: root/Source/Kernel/Core/Log.ns.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel/Core/Log.ns.cpp')
-rw-r--r--Source/Kernel/Core/Log.ns.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/Kernel/Core/Log.ns.cpp b/Source/Kernel/Core/Log.ns.cpp
index 1727024..c8ccd80 100644
--- a/Source/Kernel/Core/Log.ns.cpp
+++ b/Source/Kernel/Core/Log.ns.cpp
@@ -1,4 +1,5 @@
#include "Log.ns.h"
+#include <FileSystems/RamFS/RamFS.class.h>
#include <VFS/VFS.ns.h>
namespace Log {
@@ -11,6 +12,10 @@ void init(u8int loglevel) {
if (VFS::find("/System/Logs") == 0) VFS::createDirectory("/System/Logs");
logs[KL_PANIC] = new TextFile("/System/Logs/Panic.log", FM_APPEND);
+ if (!logs[KL_PANIC]->valid()) { //FS maybee not read/write, mount a ramfs
+ RamFS::mount(1024*1024, (DirectoryNode*)VFS::find("/System/Logs"));
+ logs[KL_PANIC] = new TextFile("/System/Logs/Panic.log", FM_APPEND);
+ }
if (KL_CRITICAL <= loglevel) logs[KL_CRITICAL] = new TextFile("/System/Logs/Critical.log", FM_APPEND);
if (KL_ERROR <= loglevel) logs[KL_ERROR] = new TextFile("/System/Logs/Error.log", FM_APPEND);
if (KL_WARNING <= loglevel) logs[KL_WARNING] = new TextFile("/System/Logs/Warning.log", FM_APPEND);