diff --git a/bin/init/main.c b/bin/init/main.c index 00af457..92d2656 100644 --- a/bin/init/main.c +++ b/bin/init/main.c @@ -42,12 +42,10 @@ /* Create a mailbox for this task */ - /* if (mpi_createMbox("init") != 0x0) { printf("Error: Failed to creating mail box: init\n"); exit(0x1); - } - */ + } /* Make sure we have superuser permissions if not exit */ if ((getuid() != 0x0) || (getgid() != 0x0)) { @@ -60,27 +58,31 @@ /* Start TTYD */ i = fork(); + printf("Forked: %i", i); + if (0x0 == i) { - printf("Error: Could not start TTYD\n"); + printf("Starting TTYD\n"); execve("sys:/bin/ttyd", argv_login, envp_login); printf("Error: Could not start TTYD\n"); exit(0x0); } -/* + #ifdef _IGNORE i = fork(); if (0x0 == i) { printf("Starting Ubix Registry (ubistry)\n"); - exec("sys:/ubistry",0x0); + exec("sys:/bin/ubistry",0x0); printf("Error: Error Starting ubistry\n"); exit(0x0); - } + } + /* while (pidStatus(i) > 0x0) { sched_yield(); - } -*/ + } + */ + #endif startup: i = fork(); diff --git a/bin/ttyd/main.c b/bin/ttyd/main.c index 32b99f8..b5bd000 100644 --- a/bin/ttyd/main.c +++ b/bin/ttyd/main.c @@ -31,27 +31,10 @@ int main(int argc, char **argv) { mpi_message_t myMsg; + char mbox[256] = "system\0"; printf("Initializing TTYD\n"); printf("mpi_post: [%i]\n", mpi_postMessage("system", 0x1, &myMsg)); return (0x0); } - -/*** - $Log: main.c,v $ - Revision 1.1.1.1 2006/06/01 12:46:09 reddawg - ubix2 - - Revision 1.2 2005/10/12 00:13:28 reddawg - Removed - - Revision 1.1.1.1 2005/09/26 17:14:03 reddawg - no message - - Revision 1.1 2004/08/14 11:28:59 reddawg - ttyd - - END - ***/ - diff --git a/bin/ubistry/Makefile b/bin/ubistry/Makefile index cdb7a53..4e00789 100644 --- a/bin/ubistry/Makefile +++ b/bin/ubistry/Makefile @@ -17,7 +17,7 @@ #Objects OBJS = db.o message.o main.o -LIBRARIES = ../../build/lib/libc_old.so +#LIBRARIES = ../../build/lib/libc_old.so # Link The Binary $(BINARY) : $(OBJS) diff --git a/lib/libc_old/sys/Makefile b/lib/libc_old/sys/Makefile index 76e6ba6..e95c6c4 100644 --- a/lib/libc_old/sys/Makefile +++ b/lib/libc_old/sys/Makefile @@ -6,7 +6,7 @@ include ../../Makefile.incl #Objects -OBJS = mpi.o startsde.o mmap.o error.o getuptime.o gettime.o getdrives.o setuid.o setgid.o getuid.o getgid.o exec.o getpid.o fork.o pidstatus.o getpage.o sched.o auth.o execve.o +OBJS = mpi.o startsde.o mmap.o error.o getuptime.o gettime.o getdrives.o setuid.o setgid.o getuid.o getgid.o exec.o getpid.o fork.o pidstatus.o getpage.o sched.o auth.o execve.o mpi_creatembox.o mpi_postmessage.o mpi_fetchmessage.o #Output OUTPUT = sys.so diff --git a/lib/libc_old/sys/getpage.c b/lib/libc_old/sys/getpage.c index 1bf05f5..2c28b82 100644 --- a/lib/libc_old/sys/getpage.c +++ b/lib/libc_old/sys/getpage.c @@ -38,39 +38,3 @@ "int $0x80\n" "ret\n" ); - - - - -void *getPage_old(int count) { - asm volatile( - "movl $88, %eax\n" - "int $0x80 \n" - "ret\n" -// : : "i" (0x80),"a" (7),"b" (&pageAddr),"c" (count) - ); -// return((void *)pageAddr); - } - -/*** - $Log: getpage.c,v $ - Revision 1.1.1.1 2006/06/01 12:46:09 reddawg - ubix2 - - Revision 1.2 2005/10/12 00:13:36 reddawg - Removed - - Revision 1.1.1.1 2005/09/26 17:23:03 reddawg - no message - - Revision 1.5 2004/08/02 18:50:13 reddawg - Updates to make some variable volatile to make work with gcc 3.3. However there are still some issues but we have not caused new issues with gcc 2.95 - - Revision 1.4 2004/08/01 20:14:18 reddawg - Fixens - - Revision 1.3 2004/08/01 19:59:19 reddawg - *** empty log message *** - - END - ***/ diff --git a/lib/libc_old/sys/mpi.c b/lib/libc_old/sys/mpi.c index 5790cf7..d4d835e 100644 --- a/lib/libc_old/sys/mpi.c +++ b/lib/libc_old/sys/mpi.c @@ -28,8 +28,9 @@ *****************************************************************************************/ #include +#include -int mpi_createMbox(char *name) { +int mpi_createMbox_old(char *name) { volatile int status = 0x0; asm volatile( "int %0\n" @@ -49,7 +50,7 @@ return(status); } -int mpi_postMessage(char *name,uInt32 type,mpi_message_t *msg) { +int mpi_postMessage_old(char *name,uInt32 type,mpi_message_t *msg) { asm volatile( "int %0\n" : : "i" (0x81),"a" (52),"b" (name),"c" (&type),"d" (msg) @@ -57,7 +58,7 @@ return(type); } -int mpi_fetchMessage(char *name,mpi_message_t *msg) { +int mpi_fetchMessage_old(char *name,mpi_message_t *msg) { volatile int status = 0x0; asm volatile( "int %0\n" @@ -74,30 +75,3 @@ ); return(status); } - -/*** - $Log: mpi.c,v $ - Revision 1.1.1.1 2006/06/01 12:46:09 reddawg - ubix2 - - Revision 1.2 2005/10/12 00:13:36 reddawg - Removed - - Revision 1.1.1.1 2005/09/26 17:23:04 reddawg - no message - - Revision 1.4 2004/08/14 11:23:02 reddawg - Changes - - Revision 1.3 2004/08/02 18:50:13 reddawg - Updates to make some variable volatile to make work with gcc 3.3. However there are still some issues but we have not caused new issues with gcc 2.95 - - Revision 1.2 2004/05/26 15:39:22 reddawg - mpi: brought mpiDestroyMbox(char *name) in to the userland - - Revision 1.1 2004/05/25 15:43:27 reddawg - Added Userland MPI access - - END - ***/ - diff --git a/sys/include/sys/descrip.h b/sys/include/sys/descrip.h index 6d39371..bee0145 100644 --- a/sys/include/sys/descrip.h +++ b/sys/include/sys/descrip.h @@ -30,7 +30,7 @@ #define _KERN_DESCRIP_H #include -#include +#include #include #include diff --git a/sys/include/sys/gen_calls.h b/sys/include/sys/gen_calls.h index e175176..3450aa8 100644 --- a/sys/include/sys/gen_calls.h +++ b/sys/include/sys/gen_calls.h @@ -30,7 +30,7 @@ #define _GEN_CALLS_H #include -#include +#include int read(struct thread *td,struct read_args *uap); diff --git a/sys/include/sys/kern_sig.h b/sys/include/sys/kern_sig.h index 1979965..c932413 100644 --- a/sys/include/sys/kern_sig.h +++ b/sys/include/sys/kern_sig.h @@ -30,7 +30,7 @@ #define _KERN_SIG_H #include -#include +#include int sigaction(struct thread *,struct sigaction_args *); int sigprocmask(struct thread *, struct sigprocmask_args *); diff --git a/sys/include/sys/kern_sysctl.h b/sys/include/sys/kern_sysctl.h index caba27c..9aeb258 100644 --- a/sys/include/sys/kern_sysctl.h +++ b/sys/include/sys/kern_sysctl.h @@ -29,7 +29,7 @@ #ifndef _SYS_KERN_SYSCTL_H #define _SYS_KERN_SYSCTL_H -#include +#include #include #define CTL_MAXNAME 24 /* largest number of components supported */ diff --git a/sys/include/sys/pipe.h b/sys/include/sys/pipe.h index b76d9dc..dff67de 100644 --- a/sys/include/sys/pipe.h +++ b/sys/include/sys/pipe.h @@ -30,7 +30,7 @@ #define _SYS_PIPE_H #include -#include +#include int pipe(struct thread *, struct pipe_args *); diff --git a/sys/include/sys/sysproto.h b/sys/include/sys/sysproto.h index b0a8de2..159f2ef 100644 --- a/sys/include/sys/sysproto.h +++ b/sys/include/sys/sysproto.h @@ -45,31 +45,44 @@ //Protos struct sys_mpiCreateMbox_args { - char status_l_[PADL_(int)]; + char name_l_[PADL_(char *)]; char *name; - char status_r_[PADR_(int)]; + char name_r_[PADR_(char *)]; }; -struct sys_fork_args { - char status_l_[PADL_(int)]; - int status; - char status_r_[PADR_(int)]; +struct sys_mpiDestroyMbox_args { + char name_l_[PADL_(char *)]; + char *name; + char name_r_[PADR_(char *)]; }; -struct sys_read_args { - char fd_l_[PADL_(int)]; - int fd; - char fd_r_[PADR_(int)]; - char buf_l_[PADL_(const void *)]; - const void * buf; - char buf_r_[PADR_(const void *)]; - char nbyte_l_[PADL_(size_t)]; - size_t nbyte; - char nbyte_r_[PADR_(size_t)]; +struct sys_mpiFetchMessage_args { + char name_l_[PADL_(char *)]; + char *name; + char name_r_[PADR_(char *)]; + char msg_l_[PADL_(const void *)]; + const void * msg; + char msg_r_[PADR_(const void *)]; +}; + +struct sys_mpiPostMessage_args { + char name_l_[PADL_(char *)]; + char *name; + char name_r_[PADR_(char *)]; + char type_l_[PADL_(uint32_t)]; + uint32_t type; + char type_r_[PADR_(uint32_t)]; + char msg_l_[PADL_(const void *)]; + const void *msg; + char msg_r_[PADR_(const void *)]; }; //Func Defs +int sys_invalid(struct thread *, void *); int sys_mpiCreateMbox(struct thread *, struct sys_mpiCreateMbox_args *); +int sys_mpiDestroyMbox(struct thread *, struct sys_mpiDestroyMbox_args *); +int sys_mpiFetchMessage(struct thread *, struct sys_mpiFetchMessage_args *); +int sys_mpiPostMessage(struct thread *, struct sys_mpiPostMessage_args *); #endif diff --git a/sys/include/ubixos/syscalls.h b/sys/include/ubixos/syscalls.h index 8eee923..dd7f241 100644 --- a/sys/include/ubixos/syscalls.h +++ b/sys/include/ubixos/syscalls.h @@ -93,10 +93,10 @@ typedef int (*functionPTR)(); -extern int totalCalls_old; -extern functionPTR systemCalls_Old[]; - extern int totalCalls; extern struct syscall_entry systemCalls[]; +extern int totalCalls_posix; +extern struct syscall_entry systemCalls_posix[]; + #endif diff --git a/sys/include/ubixos/syscalls_new.h b/sys/include/ubixos/syscalls_new.h index be63226..706484e 100644 --- a/sys/include/ubixos/syscalls_new.h +++ b/sys/include/ubixos/syscalls_new.h @@ -29,7 +29,7 @@ #ifndef _SYSCALLS_NEW_H #define _SYSCALLS_NEW_H -#include +#include int sysExit(); int read(); diff --git a/sys/include/vfs/vfs.h b/sys/include/vfs/vfs.h index 9926d31..3a48d5e 100644 --- a/sys/include/vfs/vfs.h +++ b/sys/include/vfs/vfs.h @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/sys/include/vmm/paging.h b/sys/include/vmm/paging.h index 4cd0b78..608f68e 100644 --- a/sys/include/vmm/paging.h +++ b/sys/include/vmm/paging.h @@ -30,7 +30,7 @@ #define _VMM_PAGING_H_ #include -#include +#include #include #define PAGE_SHIFT 12 // Page Shift diff --git a/sys/init/main.c b/sys/init/main.c index dd389cb..9131b84 100644 --- a/sys/init/main.c +++ b/sys/init/main.c @@ -146,7 +146,7 @@ if (sysTask == 0x0) kprintf("OS: Unable to allocate memory\n"); - execThread(systemTask, (uInt32) sysTask + 0x2000, 0x0); + execThread(systemTask, (uint32_t) sysTask + 0x2000, 0x0); kprintf("Thread Start!\n"); execFile("sys:/bin/init", argv_init, envp_init, 0x0); /* OS Initializer */ @@ -162,7 +162,3 @@ /* Return to start however we should never get this far */ return (0x0); } - -/*** - END - ***/ diff --git a/sys/kernel/descrip.c b/sys/kernel/descrip.c index 180e9bf..f4df918 100644 --- a/sys/kernel/descrip.c +++ b/sys/kernel/descrip.c @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include #include diff --git a/sys/kernel/execve.c b/sys/kernel/execve.c index c5bbe5a..a4eaf14 100644 --- a/sys/kernel/execve.c +++ b/sys/kernel/execve.c @@ -28,7 +28,7 @@ #include #include -#include +#include int sys_execve( struct thread *td, struct sys_execve_args *args ) { int ret = sys_exec( td, args->fname, args->argv, args->envp ); diff --git a/sys/kernel/kern_sig.c b/sys/kernel/kern_sig.c index 0681225..32d721c 100644 --- a/sys/kernel/kern_sig.c +++ b/sys/kernel/kern_sig.c @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include #include diff --git a/sys/kernel/kern_sysctl.c b/sys/kernel/kern_sysctl.c index b444472..2571dd8 100644 --- a/sys/kernel/kern_sysctl.c +++ b/sys/kernel/kern_sysctl.c @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include #include diff --git a/sys/kernel/pipe.c b/sys/kernel/pipe.c index ae5fef7..7f0375d 100644 --- a/sys/kernel/pipe.c +++ b/sys/kernel/pipe.c @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include #include diff --git a/sys/kernel/signal.c b/sys/kernel/signal.c index d6c116f..8bffd5a 100644 --- a/sys/kernel/signal.c +++ b/sys/kernel/signal.c @@ -27,7 +27,7 @@ */ #include -#include +#include #include #include #include diff --git a/sys/kernel/syscall.c b/sys/kernel/syscall.c index 0f7f1fe..8ede230 100644 --- a/sys/kernel/syscall.c +++ b/sys/kernel/syscall.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -68,10 +69,10 @@ if (systemCalls[code].sc_status == SYSCALL_DUMMY) kprintf("Syscall->abi: [%i], PID: [%i], Code: %i, Call: %s\n", td->abi, _current->id, frame->tf_eax, systemCalls[code].sc_name); - +/* if (td->abi == ELFOSABI_UBIXOS) error = (int) systemCalls[code].sc_entry( frame->tf_ebx, frame->tf_ecx, frame->tf_edx ); - else if (td->abi == ELFOSABI_FREEBSD) + else */if (td->abi == ELFOSABI_FREEBSD) error = (int) systemCalls[code].sc_entry(td, params); else error = (int) systemCalls[code].sc_entry(td, params); diff --git a/sys/kernel/syscall_posix.c b/sys/kernel/syscall_posix.c index 762a407..12fba2f 100644 --- a/sys/kernel/syscall_posix.c +++ b/sys/kernel/syscall_posix.c @@ -112,7 +112,7 @@ } } -int invalidCall() { +int invalidCall_posix() { int sys_call; asm( diff --git a/sys/kernel/syscalls.c b/sys/kernel/syscalls.c index 12077e4..3222144 100644 --- a/sys/kernel/syscalls.c +++ b/sys/kernel/syscalls.c @@ -81,11 +81,10 @@ { 0, "No Call", sys_invalid, SYSCALL_VALID }, // 1 - { 0, "No Call", sys_invalid, SYSCALL_VALID }, // 1 - { 0, "No Call", sys_invalid, SYSCALL_VALID }, // 1 - - { ARG_COUNT(struct sys_mpiCreateMbox_args) -, "mpiCrateMbox", sys_mpiCreateMbox, SYSCALL_VALID}, // 50 - mpiCreateMbox - { 0, "No Call", sys_invalid, SYSCALL_VALID }, // 51 - mpiDestroyMbox - { 0, "No Call", sys_invalid, SYSCALL_VALID }, // 52 - mpiPostMessage - { 0, "No Call", sys_invalid, SYSCALL_VALID }, // 53 - mpiFetchMessage + { ARG_COUNT(sys_mpiCreateMbox_args), "mpiCrateMbox", sys_mpiCreateMbox, SYSCALL_VALID}, // 50 - mpiCreateMbox + { ARG_COUNT(sys_mpiDestroyMbox_args), "mpiDestroyMbox", sys_mpiDestroyMbox, SYSCALL_VALID }, // 51 - mpiDestroyMbox + { ARG_COUNT(sys_mpiPostMessage_args), "mpiPostMessage", sys_mpiPostMessage, SYSCALL_VALID }, // 52 - mpiPostMessage + { ARG_COUNT(sys_mpiFetchMessage_args), "mpiFetchMEssage", sys_mpiFetchMessage, SYSCALL_VALID }, // 53 - mpiFetchMessage { 0, "No Call", sys_invalid, SYSCALL_VALID }, // 54 - mpiSpam }; diff --git a/sys/kernel/vfs_calls.c b/sys/kernel/vfs_calls.c index 0ff5785..edebc3a 100644 --- a/sys/kernel/vfs_calls.c +++ b/sys/kernel/vfs_calls.c @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/sys/mpi/mpi_syscalls.c b/sys/mpi/mpi_syscalls.c index ff14453..e2e3fba 100644 --- a/sys/mpi/mpi_syscalls.c +++ b/sys/mpi/mpi_syscalls.c @@ -5,3 +5,19 @@ td->td_retval[0] = mpi_createMbox(args->name); return (0x0); } + +int sys_mpiDestroyMbox(struct thread *td, struct sys_mpiDestroyMbox_args *args) { + td->td_retval[0] = mpi_destroyMbox(args->name); + return (0x0); +} + +int sys_mpiFetchMessage(struct thread *td, struct sys_mpiFetchMessage_args *args) { + td->td_retval[0] = mpi_fetchMessage(args->name, (mpi_message_t *)args->msg); + return (0x0); +} + +int sys_mpiPostMessage(struct thread *td, struct sys_mpiPostMessage_args *args) { + kprintf("mPM: %s", args->name); + td->td_retval[0] = mpi_postMessage(args->name, args->type, (mpi_message_t *)args->msg); + return (0x0); +} diff --git a/sys/net/net/sys_arch.c b/sys/net/net/sys_arch.c index 323d013..3b5c93b 100644 --- a/sys/net/net/sys_arch.c +++ b/sys/net/net/sys_arch.c @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include "net/debug.h"