summaryrefslogtreecommitdiff
path: root/Source/Kernel
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel')
-rw-r--r--Source/Kernel/Core/Sys.ns.cpp4
-rw-r--r--Source/Kernel/Core/Sys.ns.h2
-rw-r--r--Source/Kernel/TaskManager/Thread.class.cpp6
-rw-r--r--Source/Kernel/VFS/FSNode-sc.proto.cpp1
-rw-r--r--Source/Kernel/VTManager/FileVT.class.cpp2
-rw-r--r--Source/Kernel/VTManager/VirtualTerminal-kbd.proto.cpp3
6 files changed, 12 insertions, 6 deletions
diff --git a/Source/Kernel/Core/Sys.ns.cpp b/Source/Kernel/Core/Sys.ns.cpp
index c5af3e8..59da244 100644
--- a/Source/Kernel/Core/Sys.ns.cpp
+++ b/Source/Kernel/Core/Sys.ns.cpp
@@ -85,9 +85,9 @@ void dumpRegs(registers_t *regs, VirtualTerminal& vt) {
vt << "eflags=" << (u32int)regs->eflags << ", useresp=" << (u32int)regs->useresp << ", ss=" << (u32int)regs->ss << "\n";
}
-void stackTrace(u32int ebp, VirtualTerminal& vt, u32int maxframes) {
+void stackTrace(u32int ebp, VirtualTerminal& vt, u32int maxframes, bool isUser) {
u32int *stack = (u32int*)ebp;
- for (u32int i = 0; i < maxframes and (u32int)stack > 0xC0000000 and (u32int)stack < (ebp + 0x10000); i++) {
+ for (u32int i = 0; i < maxframes and (isUser or ((u32int)stack > 0xC0000000)) and (u32int)stack < (ebp + 0x10000); i++) {
vt << "Frame: " << (u32int)stack << " n:" << stack[0] << " r:" << stack[1] << "\n";
stack = (u32int*)stack[0];
}
diff --git a/Source/Kernel/Core/Sys.ns.h b/Source/Kernel/Core/Sys.ns.h
index 26f04e6..f386135 100644
--- a/Source/Kernel/Core/Sys.ns.h
+++ b/Source/Kernel/Core/Sys.ns.h
@@ -30,7 +30,7 @@ namespace Sys {
u8int inb(u16int port);
u16int inw(u16int port);
void dumpRegs(registers_t *regs, VirtualTerminal& vt);
- void stackTrace(u32int ebp, VirtualTerminal& vt, u32int maxframes);
+ void stackTrace(u32int ebp, VirtualTerminal& vt, u32int maxframes, bool isUser = false);
void panic(char* message, char *file, u32int line);
void panic(char* message, registers_t *regs, char *file, u32int line);
void panic_assert(char* file, u32int line, char *desc);
diff --git a/Source/Kernel/TaskManager/Thread.class.cpp b/Source/Kernel/TaskManager/Thread.class.cpp
index af501fe..2cd9515 100644
--- a/Source/Kernel/TaskManager/Thread.class.cpp
+++ b/Source/Kernel/TaskManager/Thread.class.cpp
@@ -182,9 +182,11 @@ void Thread::handleException(registers_t *regs, int no) {
if (rw) vt << "R/W ";
if (us) vt << "User ";
if (rsvd) vt << "Rsvd ";
- vt << "At:" << (u32int)faddr;
+ vt << "At:" << (u32int)faddr << "\n";
- vt << "\nThread finishing.\n";
+ Sys::stackTrace(regs->ebp, vt, 5, true);
+
+ vt << "Thread finishing.\n";
Task::currentThreadExits(E_PAGEFAULT); //Calling this will setup a new stack
return;
}
diff --git a/Source/Kernel/VFS/FSNode-sc.proto.cpp b/Source/Kernel/VFS/FSNode-sc.proto.cpp
index 717ccef..d86014c 100644
--- a/Source/Kernel/VFS/FSNode-sc.proto.cpp
+++ b/Source/Kernel/VFS/FSNode-sc.proto.cpp
@@ -90,6 +90,7 @@ bool FSNode::readable(User* user) {
}
bool FSNode::writable(User* user) {
+ if (!m_fs->isWritable()) return false;
if (ISROOT) return true;
if (user == 0) user = Usr::user();
if (user->getUid() == m_uid)
diff --git a/Source/Kernel/VTManager/FileVT.class.cpp b/Source/Kernel/VTManager/FileVT.class.cpp
index 5469fbd..24a1b63 100644
--- a/Source/Kernel/VTManager/FileVT.class.cpp
+++ b/Source/Kernel/VTManager/FileVT.class.cpp
@@ -39,7 +39,7 @@ keypress_t FileVT::getKeypress(bool show, bool block) {
ret.hascmd = true;
ret.command = KBDC_ENTER;
if (m_file.eof()) {
- m_buffer = ".";
+ m_buffer = EOF;
} else {
m_buffer = m_file.readLine();
}
diff --git a/Source/Kernel/VTManager/VirtualTerminal-kbd.proto.cpp b/Source/Kernel/VTManager/VirtualTerminal-kbd.proto.cpp
index 5b551eb..e96c327 100644
--- a/Source/Kernel/VTManager/VirtualTerminal-kbd.proto.cpp
+++ b/Source/Kernel/VTManager/VirtualTerminal-kbd.proto.cpp
@@ -64,6 +64,9 @@ String VirtualTerminal::readLine(bool show) {
else if (show) put(" "); //Put a space so that cursor stays at same place
} else if (tmp.hascmd && !tmp.haschar && tmp.command == KBDC_TAB) {
ret += "\t";
+ } else if (tmp.hascmd && tmp.haschar && tmp.modifiers == STATUS_CTRL && tmp.character == WChar("d")) {
+ ret += EOF;
+ break;
} else if (tmp.haschar && !tmp.hascmd) {
ret += tmp.character;
}