starting to work on pty drivers, fork(), and scheduler redesign
This commit is contained in:
@@ -4,9 +4,11 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#define SYS_EXIT 1
|
||||
#define SYS_READ 3
|
||||
#define SYS_WRITE 4
|
||||
#define SYS_EXIT 1
|
||||
#define SYS_READ 3
|
||||
#define SYS_WRITE 4
|
||||
#define SYS_PTY 20
|
||||
#define SYS_FORK 21
|
||||
|
||||
int write(int fd, const void *buf, size_t count);
|
||||
int read(int fd, void *buf, size_t count);
|
||||
@@ -19,4 +21,7 @@ void exit(int status) __attribute__((noreturn));
|
||||
void *sbrk(intptr_t increment);
|
||||
int brk(void *addr);
|
||||
|
||||
int pty(int* slave);
|
||||
int fork();
|
||||
|
||||
#endif
|
||||
@@ -34,4 +34,12 @@ int write(int fd, const void* buf, size_t cnt) {
|
||||
|
||||
int read(int fd, void* buf, size_t cnt) {
|
||||
return syscall3(SYS_READ, (uint32_t)fd, (uint32_t)buf, (uint32_t)cnt);
|
||||
}
|
||||
|
||||
int pty(int* slave) {
|
||||
return syscall1(SYS_PTY, (uint32_t)slave);
|
||||
}
|
||||
|
||||
int fork() {
|
||||
return syscall1(SYS_FORK, 0);
|
||||
}
|
||||
Reference in New Issue
Block a user