feat: add cwd tracking to kernel, remove shell hack, update system utilities to use getcwd, fix tcc libc stub, fix nonexistent directory issue

This commit is contained in:
2026-03-25 15:45:22 +01:00
parent 9c9a0a9712
commit ea087769f5
22 changed files with 389 additions and 265 deletions
+10
View File
@@ -97,6 +97,8 @@ extern "C" {
#define MTK_SYS_AUDIOCTL 83
#define MTK_SYS_SETTZ 90
#define MTK_SYS_GETTZ 91
#define MTK_SYS_GETCWD 95
#define MTK_SYS_CHDIR 96
#define MTK_SOCK_TCP 1
#define MTK_SOCK_UDP 2
@@ -318,6 +320,14 @@ static inline int mtk_getargs(char *buf, unsigned long max_len) {
return (int)_mtk_syscall2(MTK_SYS_GETARGS, (long)buf, (long)max_len);
}
static inline int mtk_chdir(const char *path) {
return (int)_mtk_syscall1(MTK_SYS_CHDIR, (long)path);
}
static inline int mtk_getcwd(char *buf, unsigned long max_len) {
return (int)_mtk_syscall2(MTK_SYS_GETCWD, (long)buf, (long)max_len);
}
/* ====================================================================
Console I/O
==================================================================== */
+2
View File
@@ -13,6 +13,8 @@ int read(int fd, void *buf, size_t count);
int write(int fd, const void *buf, size_t count);
int close(int fd);
long lseek(int fd, long offset, int whence);
int chdir(const char *path);
char *getcwd(char *buf, size_t size);
unsigned int sleep(unsigned int seconds);