feat: Eliminate all stubs; implement real RTL8139 physical DMA ping, dmesg ring buffer, live scheduler thread list, and physical RAM stats
This commit is contained in:
@@ -10,22 +10,6 @@
|
||||
#define PROC_OP_SPAWN 3
|
||||
#define PROC_OP_STAT 4
|
||||
|
||||
struct ProcessInfo {
|
||||
uint64_t pid;
|
||||
char name[32];
|
||||
uint32_t state; // 0=Running, 1=Sleeping, 2=Dead
|
||||
uint64_t mem_bytes;
|
||||
};
|
||||
|
||||
static __attribute__((unused)) ProcessInfo proc_table[8] = {
|
||||
{ 0, "kernel_idle", 0, 4096 },
|
||||
{ 1, "init_server", 0, 65536 },
|
||||
{ 2, "uart_driver", 1, 65536 },
|
||||
{ 3, "sh", 0, 131072 },
|
||||
{ 4, "procmgr", 0, 65536 },
|
||||
};
|
||||
static size_t proc_count = 5;
|
||||
|
||||
extern "C" void _start() {
|
||||
puts("[PROCMGR] Process & Server Manager Daemon Initialized (Ring 3).");
|
||||
|
||||
@@ -61,7 +45,13 @@ extern "C" void _start() {
|
||||
reply_val0 = rax; // 0 = success, -1 = error
|
||||
reply_val1 = 0;
|
||||
} else if (opcode == PROC_OP_LIST) {
|
||||
reply_val0 = (uint64_t)proc_count;
|
||||
// Query real thread count from kernel
|
||||
thread_info_t list[16];
|
||||
register uint64_t rax __asm__("rax") = SYS_PROC_LIST;
|
||||
register uint64_t rdi __asm__("rdi") = (uint64_t)list;
|
||||
register uint64_t rsi __asm__("rsi") = 16;
|
||||
__asm__ volatile("syscall" : "+r"(rax) : "r"(rdi), "r"(rsi) : "rcx", "r11", "memory");
|
||||
reply_val0 = (rax > 0) ? rax : 0;
|
||||
reply_val1 = 0;
|
||||
} else {
|
||||
reply_val0 = 0;
|
||||
|
||||
Reference in New Issue
Block a user