Files
kern/include/c/syscall.h
T
Tom-on 536f6b2320 Began work on proper terminal I/O
- Chenged Puts() syscall to Write()
- Improved syscalls.h
- added a new header in terminal/terminal.h
- moved gfxMode into screen/gfxmode.h
2024-05-27 15:16:07 +02:00

24 lines
462 B
C

#ifndef SYSCALLNUMS_H
#define SYSCALLNUMS_H
#include <stdint.h>
#define MAX_SYSCALLS 5
typedef enum {
SYS_SLEEP,
SYS_WRITE,
SYS_GETS,
SYS_MALLOC,
SYS_FREE,
} SYSCALL_NUMBERS;
// TODO: Add malloc() and free() syscall wrappers??
int32_t write(int32_t fd, const void* buf, uint32_t len) {
int32_t result = -1;
__asm__ volatile ("int $0x80" : "=a"(result) : "a"(SYS_WRITE), "b"(fd), "c"(buf), "d"(len));
return result;
}
#endif