almost got the term emu working and shell
This commit is contained in:
@@ -27,6 +27,10 @@ void exit(int status) {
|
||||
while(1);
|
||||
}
|
||||
|
||||
int open(const char* path) {
|
||||
return syscall1(SYS_OPEN, (uint32_t)path);
|
||||
}
|
||||
|
||||
int write(int fd, const void* buf, size_t cnt) {
|
||||
return syscall3(SYS_WRITE, (uint32_t)fd, (uint32_t)buf, (uint32_t)cnt);
|
||||
}
|
||||
@@ -35,10 +39,22 @@ int read(int fd, void* buf, size_t cnt) {
|
||||
return syscall3(SYS_READ, (uint32_t)fd, (uint32_t)buf, (uint32_t)cnt);
|
||||
}
|
||||
|
||||
int close(int fd) {
|
||||
return syscall1(SYS_CLOSE, fd);
|
||||
}
|
||||
|
||||
int pty(int* slave) {
|
||||
return syscall1(SYS_PTY, (uint32_t)slave);
|
||||
}
|
||||
|
||||
int fork() {
|
||||
return syscall1(SYS_FORK, 0);
|
||||
}
|
||||
|
||||
int exec(const char* path) {
|
||||
return syscall1(SYS_EXEC, (uint32_t)path);
|
||||
}
|
||||
|
||||
int dup2(int src, int dst) {
|
||||
return syscall3(SYS_DUP2, src, dst, 0);
|
||||
}
|
||||
Reference in New Issue
Block a user