C userspace programs

This commit is contained in:
2025-09-04 23:20:30 +02:00
parent afa4d383e0
commit 90266f044b
51 changed files with 259 additions and 174 deletions

View File

@ -5,14 +5,9 @@
#include "kprintf.h"
#include "proc/proc.h"
int32_t SYSCALL2(sys_debugprint, string1, len) {
char *buf = dlmalloc(len);
if (buf == NULL) {
return E_NOMEMORY;
}
ksnprintf(buf, len, "%s", string1);
kprintf("%s\n", buf);
dlfree(buf);
int32_t SYSCALL1(sys_debugprint, string) {
char *p = (char *)string;
kprintf("%s\n", p);
return E_OK;
}