mirror of
https://github.com/justinian/jsix.git
synced 2025-12-10 08:24:32 -08:00
Pause syscall and int 0xee interrupt syscalls
The syscall/sysret instructions don't swap stacks. This was bad but passable until syscalls caused the scheduler to run, and scheduling a task that paused due to interrupt. Adding a new (hopefully temporary) syscall interrupt `int 0xee` to allow me to test syscalls without stack issues before I tackle the syscall/sysret issue. Also implemented a basic `pause` syscall that causes the calling process to become unready. Because nothing can wake a process yet, it never returns.
This commit is contained in:
19
src/kernel/debug.h
Normal file
19
src/kernel/debug.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
/// \file debug.h
|
||||
/// Debugging utilities
|
||||
|
||||
#include "kutil/memory.h"
|
||||
|
||||
extern "C" {
|
||||
addr_t get_rsp();
|
||||
addr_t get_rip();
|
||||
addr_t get_frame(int frame);
|
||||
|
||||
}
|
||||
|
||||
void print_regs(const cpu_state ®s);
|
||||
void print_stack(const cpu_state ®s);
|
||||
void print_stacktrace(int skip = 0);
|
||||
|
||||
#define print_reg(name, value) cons->printf(" %s: %016lx\n", name, (value));
|
||||
|
||||
Reference in New Issue
Block a user