Move to new processctl syscall, share common kernel and ulib headers

This commit is contained in:
2025-09-05 15:44:57 +02:00
parent ca92a0e6a8
commit 708c53c64d
20 changed files with 98 additions and 27 deletions

View File

@ -11,7 +11,7 @@ SRCFILES := $(call GRABSRC, \
system \
)
CFLAGS += -isystem $(ROOT)/ulib -isystem $(ROOT)/std/include
CFLAGS += -isystem $(ROOT)/share/hdrs -isystem $(ROOT)/ulib -isystem $(ROOT)/std/include
ASFILES := $(call GET_ASFILES, $(SRCFILES))
CFILES := $(call GET_CFILES, $(SRCFILES))

View File

@ -6,5 +6,7 @@
_start:
call _premain
mov $SYS_QUITPROC, %rax
movq $2, %rax // sys processctl
movq $0x5E1F, %rdi // self magic num
movq $0, %rsi // kill cmd
int $0x80

Binary file not shown.

View File

@ -1,9 +1,6 @@
#ifndef ULIB_SYSCALL_SYSCALL_H_
#define ULIB_SYSCALL_SYSCALL_H_
#define SYS_DEBUGPRINT 1
#define SYS_QUITPROC 2
#if !defined(__ASSEMBLER__)
uint64_t syscall(uint64_t num, uint64_t arg1, uint64_t arg2,

View File

@ -1,9 +1,13 @@
#include <stdint.h>
#include <system/system.h>
#include <syscall/syscall.h>
#include <syscall.h>
void sys_debugprint(const char *string) {
syscall(SYS_DEBUGPRINT, (uint64_t)string, 0, 0, 0, 0, 0);
}
int32_t sys_processctl(uint64_t pid, uint64_t cmd, void *extra) {
return syscall(SYS_PROCESSCTL, pid, cmd, (uint64_t)extra, 0, 0, 0);
}

View File

@ -1,6 +1,9 @@
#ifndef ULIB_SYSTEM_SYSTEM_H_
#define ULIB_SYSTEM_SYSTEM_H_
#include <stdint.h>
void sys_debugprint(const char *string);
int32_t sys_processctl(uint64_t pid, uint64_t cmd, void *extra);
#endif // ULIB_SYSTEM_SYSTEM_H_