summaryrefslogtreecommitdiff
path: root/Source/Kernel/Core/Sys.ns.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Kernel/Core/Sys.ns.cpp')
-rw-r--r--Source/Kernel/Core/Sys.ns.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Kernel/Core/Sys.ns.cpp b/Source/Kernel/Core/Sys.ns.cpp
index eeb92ee..c5af3e8 100644
--- a/Source/Kernel/Core/Sys.ns.cpp
+++ b/Source/Kernel/Core/Sys.ns.cpp
@@ -18,6 +18,10 @@ void outb (u16int port, u8int value) {
asm volatile ("outb %1, %0" : : "dN" (port), "a" (value));
}
+void outw (u16int port, u16int value) {
+ asm volatile ("outw %1, %0" : : "dN" (port), "a" (value));
+}
+
u8int inb (u16int port) {
u8int ret;
asm volatile ("inb %1, %0" : "=a" (ret) : "dN" (port));
@@ -83,7 +87,7 @@ void dumpRegs(registers_t *regs, VirtualTerminal& vt) {
void stackTrace(u32int ebp, VirtualTerminal& vt, u32int maxframes) {
u32int *stack = (u32int*)ebp;
- for (u32int i = 0; i < maxframes and (u32int)stack > 0xC0000000; i++) {
+ for (u32int i = 0; i < maxframes and (u32int)stack > 0xC0000000 and (u32int)stack < (ebp + 0x10000); i++) {
vt << "Frame: " << (u32int)stack << " n:" << stack[0] << " r:" << stack[1] << "\n";
stack = (u32int*)stack[0];
}