diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 435b781e14..6ea20a9ce5 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -886,8 +886,8 @@ ShouldUnblockProcess Process::dispatch_signal(byte signal) *code_ptr++ = 0xb8; // mov eax, *(dword*)code_ptr = Syscall::SC_sigreturn; code_ptr += sizeof(dword); - *code_ptr++ = 0xcd; // int 0x80 - *code_ptr++ = 0x80; + *code_ptr++ = 0xcd; // int 0x82 + *code_ptr++ = 0x82; *code_ptr++ = 0x0f; // ud2 *code_ptr++ = 0x0b; diff --git a/Kernel/Syscall.cpp b/Kernel/Syscall.cpp index 524ce87c4b..ec6e21ff18 100644 --- a/Kernel/Syscall.cpp +++ b/Kernel/Syscall.cpp @@ -40,8 +40,8 @@ namespace Syscall { void initialize() { - register_user_callable_interrupt_handler(0x80, syscall_trap_handler); - kprintf("Syscall: int 0x80 handler installed\n"); + register_user_callable_interrupt_handler(0x82, syscall_trap_handler); + kprintf("Syscall: int 0x82 handler installed\n"); } int sync() diff --git a/Kernel/Syscall.h b/Kernel/Syscall.h index 730eb9b923..4621da47d9 100644 --- a/Kernel/Syscall.h +++ b/Kernel/Syscall.h @@ -131,7 +131,7 @@ int sync(); inline dword invoke(Function function) { dword result; - asm volatile("int $0x80":"=a"(result):"a"(function):"memory"); + asm volatile("int $0x82":"=a"(result):"a"(function):"memory"); return result; } @@ -139,7 +139,7 @@ template inline dword invoke(Function function, T1 arg1) { dword result; - asm volatile("int $0x80":"=a"(result):"a"(function),"d"((dword)arg1):"memory"); + asm volatile("int $0x82":"=a"(result):"a"(function),"d"((dword)arg1):"memory"); return result; } @@ -147,7 +147,7 @@ template inline dword invoke(Function function, T1 arg1, T2 arg2) { dword result; - asm volatile("int $0x80":"=a"(result):"a"(function),"d"((dword)arg1),"c"((dword)arg2):"memory"); + asm volatile("int $0x82":"=a"(result):"a"(function),"d"((dword)arg1),"c"((dword)arg2):"memory"); return result; } @@ -155,7 +155,7 @@ template inline dword invoke(Function function, T1 arg1, T2 arg2, T3 arg3) { dword result; - asm volatile("int $0x80":"=a"(result):"a"(function),"d"((dword)arg1),"c"((dword)arg2),"b"((dword)arg3):"memory"); + asm volatile("int $0x82":"=a"(result):"a"(function),"d"((dword)arg1),"c"((dword)arg2),"b"((dword)arg3):"memory"); return result; } #endif diff --git a/LibC/locale.cpp b/LibC/locale.cpp index 8b7eb312dd..a17c38f801 100644 --- a/LibC/locale.cpp +++ b/LibC/locale.cpp @@ -10,4 +10,9 @@ char* setlocale(int category, const char* locale) return nullptr; } +struct lconv* localeconv() +{ + assert(false); +} + } diff --git a/LibC/locale.h b/LibC/locale.h index e7496e6470..50baff97b8 100644 --- a/LibC/locale.h +++ b/LibC/locale.h @@ -9,9 +9,11 @@ enum { LC_NUMERIC, LC_CTYPE, LC_COLLATE, + LC_TIME, }; struct lconv { + char *decimal_point; }; struct lconv* localeconv(); diff --git a/LibC/stdio.cpp b/LibC/stdio.cpp index c45a84b078..baa5dbb53f 100644 --- a/LibC/stdio.cpp +++ b/LibC/stdio.cpp @@ -384,5 +384,22 @@ int rename(const char* oldpath, const char* newpath) ASSERT_NOT_REACHED(); } +char* tmpnam(char*) +{ + assert(false); +} + +FILE* popen(const char* command, const char* type) +{ + (void)command; + (void)type; + assert(false); +} + +int pclose(FILE*) +{ + assert(false); +} + } diff --git a/LibC/stdio.h b/LibC/stdio.h index 54186cb784..d07570c4a2 100644 --- a/LibC/stdio.h +++ b/LibC/stdio.h @@ -83,6 +83,9 @@ void setbuf(FILE*, char* buf); void setlinebuf(FILE*); int rename(const char* oldpath, const char* newpath); FILE* tmpfile(); +char* tmpnam(char*); +FILE* popen(const char* command, const char* type); +int pclose(FILE*); __END_DECLS diff --git a/LibC/stdlib.cpp b/LibC/stdlib.cpp index f9e425d6dd..d7e12e9276 100644 --- a/LibC/stdlib.cpp +++ b/LibC/stdlib.cpp @@ -201,6 +201,11 @@ char* getenv(const char* name) return nullptr; } +int putenv(char*) +{ + assert(false); +} + double atof(const char*) { assert(false); diff --git a/LibC/stdlib.h b/LibC/stdlib.h index d36a99395c..0fe439eff0 100644 --- a/LibC/stdlib.h +++ b/LibC/stdlib.h @@ -14,6 +14,7 @@ __attribute__((malloc)) __attribute__((alloc_size(1, 2))) void* calloc(size_t nm void free(void*); void* realloc(void *ptr, size_t); char* getenv(const char* name); +int putenv(char*); int atoi(const char*); long atol(const char*); double strtod(const char*, char** endptr); diff --git a/LibC/string.cpp b/LibC/string.cpp index c1651d6c69..01661e3174 100644 --- a/LibC/string.cpp +++ b/LibC/string.cpp @@ -293,5 +293,12 @@ char* strpbrk(const char* s, const char* accept) return nullptr; } +char *strtok(char* str, const char* delim) +{ + (void)str; + (void)delim; + assert(false); +} + } diff --git a/LibC/sys/select.h b/LibC/sys/select.h index d978f28b44..845ac9d52b 100644 --- a/LibC/sys/select.h +++ b/LibC/sys/select.h @@ -12,10 +12,12 @@ __BEGIN_DECLS #define FD_SET(fd, set) ((set)->bits[(fd / 8)] |= (1 << (fd) % 8)) #define FD_ISSET(fd, set) ((set)->bits[(fd / 8)] & (1 << (fd) % 8)) -struct fd_set { +struct __fd_set { unsigned char bits[FD_SETSIZE / 8]; }; +typedef struct __fd_set fd_set; + int select(int nfds, fd_set* readfds, fd_set* writefds, fd_set* exceptfds, struct timeval* timeout); __END_DECLS diff --git a/LibC/sys/types.h b/LibC/sys/types.h index 92461dd409..442387379a 100644 --- a/LibC/sys/types.h +++ b/LibC/sys/types.h @@ -55,6 +55,11 @@ struct stat { time_t st_ctime; /* time of last status change */ }; +struct utimbuf { + time_t actime; + time_t modtime; +}; + #ifdef __cplusplus #define NULL nullptr #else diff --git a/LibC/sys/wait.h b/LibC/sys/wait.h index 7311b74cd6..c9d9e960aa 100644 --- a/LibC/sys/wait.h +++ b/LibC/sys/wait.h @@ -5,6 +5,7 @@ __BEGIN_DECLS +#define WNOHANG 1 pid_t wait(int* wstatus); __END_DECLS diff --git a/LibC/termios.cpp b/LibC/termios.cpp index 74944c3736..c3c0ea6b57 100644 --- a/LibC/termios.cpp +++ b/LibC/termios.cpp @@ -32,5 +32,17 @@ int tcflow(int fd, int action) assert(false); } +int tcflush(int fd, int queue_selector) +{ + (void)fd; + (void)queue_selector; + assert(false); +} + +speed_t cfgetospeed(const struct termios*) +{ + assert(false); +} + } diff --git a/LibC/termios.h b/LibC/termios.h index 364df493b2..a055f8e255 100644 --- a/LibC/termios.h +++ b/LibC/termios.h @@ -9,6 +9,7 @@ __BEGIN_DECLS typedef uint32_t tcflag_t; typedef uint8_t cc_t; +typedef uint32_t speed_t; struct termios { tcflag_t c_iflag; @@ -21,6 +22,7 @@ struct termios { int tcgetattr(int fd, struct termios*); int tcsetattr(int fd, int optional_actions, const struct termios*); int tcflow(int fd, int action); +int tcflush(int fd, int queue_selector); /* c_cc characters */ #define VINTR 0 diff --git a/LibC/unistd.cpp b/LibC/unistd.cpp index c79760055f..1f24340cde 100644 --- a/LibC/unistd.cpp +++ b/LibC/unistd.cpp @@ -379,4 +379,9 @@ int release_shared_buffer(int shared_buffer_id) __RETURN_WITH_ERRNO(rc, rc, -1); } +char* getlogin() +{ + assert(false); +} + } diff --git a/LibC/unistd.h b/LibC/unistd.h index 20b524592d..d8164d11b9 100644 --- a/LibC/unistd.h +++ b/LibC/unistd.h @@ -3,10 +3,14 @@ #include #include #include +#include __BEGIN_DECLS #define HZ 1000 +#define STDIN_FILENO 0 +#define STDOUT_FILENO 1 +#define STDERR_FILENO 2 extern char** environ; @@ -68,6 +72,7 @@ int isatty(int fd); int mknod(const char* pathname, mode_t, dev_t); long fpathconf(int fd, int name); long pathconf(const char *path, int name); +char* getlogin(); enum { _PC_NAME_MAX,