diff --git a/sys/fs/vfs/file.c b/sys/fs/vfs/file.c index 8f5a424..23e74f1 100644 --- a/sys/fs/vfs/file.c +++ b/sys/fs/vfs/file.c @@ -217,9 +217,14 @@ return (error); } +int sys_rename( struct thread *td, struct sys_rename_args *args ) { + td->td_retval[0] = 0; + return (0); +} + int sysUnlink( const char *path, int *retVal ) { - *retVal = unlink( path ); - return (*retVal); + *retVal = 0; + return(*retVal); } /************************************************************************ diff --git a/sys/include/sys/sysproto_posix.h b/sys/include/sys/sysproto_posix.h index b4b530c..70e435a 100644 --- a/sys/include/sys/sysproto_posix.h +++ b/sys/include/sys/sysproto_posix.h @@ -684,6 +684,11 @@ char tolen_l_[PADL_(int)]; int tolen; char tolen_r_[PADR_(int)]; }; +struct sys_rename_args { + char from_l_[PADL_(char *)]; char * from; char from_r_[PADR_(char *)]; + char to_l_[PADL_(char *)]; char * to; char to_r_[PADR_(char *)]; +}; + //Func Defs int sys_invalid(struct thread *, void *); int sys_exit(struct thread *, struct sys_exit_args *); @@ -760,6 +765,8 @@ int sys_setsockopt(struct thread *td, struct sys_setsockopt_args *); int sys_select(struct thread *td, struct sys_select_args *); +int sys_rename(struct thread *td, struct sys_rename_args *); + int sys_gettimeofday(struct thread *td, struct sys_gettimeofday_args *); int sys_sendto(struct thread *td, struct sys_sendto_args *); diff --git a/sys/kernel/kern_sysctl.c b/sys/kernel/kern_sysctl.c index b4a698e..f263417 100644 --- a/sys/kernel/kern_sysctl.c +++ b/sys/kernel/kern_sysctl.c @@ -86,17 +86,36 @@ page_val = 0x4000; sysctl_add(name, name_len, "p1003_1b.pagesize", &page_val, sizeof(uint32_t)); - /* 1, 1 */ + /* XXX 1, 1 */ name[0] = 1; name[1] = 1; char s11[4] = "UBIX"; sysctl_add(name, name_len, "kern.ostype", &s11, 4); - /* 1, 10 */ + /* XXX 1, 10 */ name[0] = 1; - name[1] = 1; + name[1] = 10; char s110[16] = "devel.ubixos.com"; sysctl_add(name, name_len, "kern.hostname", &s110, 16); + + /* XXX 1, 2 */ + name[0] = 1; + name[1] = 2; + char s12[11] = "1.0-RELEASE"; + sysctl_add(name, name_len, "kern.hostname", &s12, 11); + + /* XXX 1, 4 */ + name[0] = 1; + name[1] = 4; + char s14[18] = "UbixOS 1.0-RELEASE"; + sysctl_add(name, name_len, "kern.hostname", &s14, 18); + + /* XXX 6, 1 */ + name[0] = 6; + name[1] = 1; + char s61[4] = "i386"; + sysctl_add(name, name_len, "kern.hostname", &s61, 4); + } int sysctl_init() { @@ -317,7 +336,7 @@ /* Check if it exists */ tmpCtl = sysctl_find(name, namelen); if (tmpCtl != 0x0) { - kprintf("Node Exists!\n"); + kprintf("Node Exists! [%s]\n", str_name); while (1) ; } diff --git a/sys/kernel/syscall.c b/sys/kernel/syscall.c index 12f83d4..b7eeaa4 100644 --- a/sys/kernel/syscall.c +++ b/sys/kernel/syscall.c @@ -55,7 +55,7 @@ code = frame->tf_eax; if (code > totalCalls) { - die_if_kernel("Invalid System Call", frame, frame->tf_eax); + die_if_kernel("Invalid System uCall", frame, frame->tf_eax); kpanic("PID: %i", _current->id); } else if ((uint32_t) systemCalls[code].sc_status == SYSCALL_INVALID) { diff --git a/sys/kernel/syscall_posix.c b/sys/kernel/syscall_posix.c index 12fba2f..9c71601 100644 --- a/sys/kernel/syscall_posix.c +++ b/sys/kernel/syscall_posix.c @@ -65,7 +65,8 @@ } if (code > totalCalls_posix) { - die_if_kernel("Invalid System Call", frame, frame->tf_eax); + kprintf("pCall [%i]\n", code); + die_if_kernel("Invalid System pCall", frame, frame->tf_eax); kpanic("PID: %i", _current->id); } else if ((uint32_t) systemCalls_posix[code].sc_status == SYSCALL_INVALID) { diff --git a/sys/kernel/syscalls_posix.c b/sys/kernel/syscalls_posix.c index 55aee11..c735cae 100644 --- a/sys/kernel/syscalls_posix.c +++ b/sys/kernel/syscalls_posix.c @@ -159,7 +159,7 @@ { 0, "No Call", sys_invalid, SYSCALL_VALID }, /* 125 - Invalid */ { 0, "No Call", sys_invalid, SYSCALL_VALID }, /* 126 - Invalid */ { 0, "No Call", sys_invalid, SYSCALL_VALID }, /* 127 - Invalid */ - { 0, "No Call", sys_invalid, SYSCALL_VALID }, /* 128 - Invalid */ + { ARG_COUNT(sys_rename_args), "rename", sys_rename, SYSCALL_VALID }, /* 128 - rename */ { 0, "No Call", sys_invalid, SYSCALL_VALID }, /* 129 - Invalid */ { 0, "No Call", sys_invalid, SYSCALL_VALID }, /* 130 - Invalid */ { 0, "No Call", sys_invalid, SYSCALL_VALID }, /* 131 - Invalid */