feat: native .opc executable binary format, hardware PCI GPU driver, terminal text editor, and web browser
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
#define SYS_CPU_INFO 24 /* Query multi-core CPU core count and current core ID */
|
||||
#define SYS_NOTIFY_SEND 25 /* Post desktop notification to GUI compositor */
|
||||
#define SYS_NOTIFY_RECV 26 /* Poll pending desktop notifications non-blockingly */
|
||||
#define SYS_MODULE_EXEC 27 /* Find and execute boot module by name (.opc or .elf) */
|
||||
#define SYS_MODULE_LIST 28 /* List available boot modules in memory */
|
||||
|
||||
/* POSIX Process Signals */
|
||||
#define SIGHUP 1
|
||||
@@ -232,6 +234,21 @@ static inline sysret_t sys_log_debug(const char *msg, size_t len) {
|
||||
return (sysret_t)rax;
|
||||
}
|
||||
|
||||
static inline int64_t sys_module_exec(const char *name) {
|
||||
register uint64_t rax __asm__("rax") = SYS_MODULE_EXEC;
|
||||
register uint64_t rdi __asm__("rdi") = (uint64_t)name;
|
||||
__asm__ volatile("syscall" : "+r"(rax) : "r"(rdi) : "rcx", "r11", "memory");
|
||||
return (int64_t)rax;
|
||||
}
|
||||
|
||||
static inline int sys_module_list(char *out_buf, size_t max_len) {
|
||||
register uint64_t rax __asm__("rax") = SYS_MODULE_LIST;
|
||||
register uint64_t rdi __asm__("rdi") = (uint64_t)out_buf;
|
||||
register uint64_t rsi __asm__("rsi") = (uint64_t)max_len;
|
||||
__asm__ volatile("syscall" : "+r"(rax) : "r"(rdi), "r"(rsi) : "rcx", "r11", "memory");
|
||||
return (int)rax;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user