diff --git a/include/sys/ubixos/access.h b/include/sys/ubixos/access.h deleted file mode 100644 index 773102a..0000000 --- a/include/sys/ubixos/access.h +++ /dev/null @@ -1,49 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_ACCESS_H -#define _UBIXOS_ACCESS_H - -#include - -struct sys_setUID_args { - uint32_t uid; -}; - -struct sys_setGID_args { - uint32_t gid; -}; - -int sys_getUID(struct thread *, void *); -int sys_getEUID(struct thread *, void *); -int sys_setUID(struct thread *, struct sys_setUID_args *); - -int sys_getGID(struct thread *, void *); -int sys_setGID(struct thread *, struct sys_setGID_args *); - -#endif /* END _UBIXOS_ACCESS_H */ diff --git a/include/sys/ubixos/endtask.h b/include/sys/ubixos/endtask.h deleted file mode 100644 index 998623e..0000000 --- a/include/sys/ubixos/endtask.h +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_ENDTASK_H -#define _UBIXOS_ENDTASK_H - -#include -#include - -void endTask(pidType); - -#endif /* END _UBIXOS_ENDTASK_H */ diff --git a/include/sys/ubixos/errno.h b/include/sys/ubixos/errno.h deleted file mode 100644 index 04aa285..0000000 --- a/include/sys/ubixos/errno.h +++ /dev/null @@ -1,177 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_ERRNO_H -#define _UBIXOS_ERRNO_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define ENOERR 0 /* No Error */ -#define EPERM 1 /* Operation not permitted */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* I/O error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Arg list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file number */ -#define ECHILD 10 /* No child processes */ -#define EAGAIN 11 /* Try again */ -#define ENOMEM 12 /* Out of memory */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#define ENOTBLK 15 /* Block device required */ -#define EBUSY 16 /* Device or resource busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* File table overflow */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Not a typewriter */ -#define ETXTBSY 26 /* Text file busy */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Math argument out of domain of func */ -#define ERANGE 34 /* Math result not representable */ -#define EDEADLK 35 /* Resource deadlock would occur */ -#define ENAMETOOLONG 36 /* File name too long */ -#define ENOLCK 37 /* No record locks available */ -#define ENOSYS 38 /* Function not implemented */ -#define ENOTEMPTY 39 /* Directory not empty */ -#define ELOOP 40 /* Too many symbolic links encountered */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define ENOMSG 42 /* No message of desired type */ -#define EIDRM 43 /* Identifier removed */ -#define ECHRNG 44 /* Channel number out of range */ -#define EL2NSYNC 45 /* Level 2 not synchronized */ -#define EL3HLT 46 /* Level 3 halted */ -#define EL3RST 47 /* Level 3 reset */ -#define ELNRNG 48 /* Link number out of range */ -#define EUNATCH 49 /* Protocol driver not attached */ -#define ENOCSI 50 /* No CSI structure available */ -#define EL2HLT 51 /* Level 2 halted */ -#define EBADE 52 /* Invalid exchange */ -#define EBADR 53 /* Invalid request descriptor */ -#define EXFULL 54 /* Exchange full */ -#define ENOANO 55 /* No anode */ -#define EBADRQC 56 /* Invalid request code */ -#define EBADSLT 57 /* Invalid slot */ - -#define EDEADLOCK EDEADLK - -#define EBFONT 59 /* Bad font file format */ -#define ENOSTR 60 /* Device not a stream */ -#define ENODATA 61 /* No data available */ -#define ETIME 62 /* Timer expired */ -#define ENOSR 63 /* Out of streams resources */ -#define ENONET 64 /* Machine is not on the network */ -#define ENOPKG 65 /* Package not installed */ -#define EREMOTE 66 /* Object is remote */ -#define ENOLINK 67 /* Link has been severed */ -#define EADV 68 /* Advertise error */ -#define ESRMNT 69 /* Srmount error */ -#define ECOMM 70 /* Communication error on send */ -#define EPROTO 71 /* Protocol error */ -#define EMULTIHOP 72 /* Multihop attempted */ -#define EDOTDOT 73 /* RFS specific error */ -#define EBADMSG 74 /* Not a data message */ -#define EOVERFLOW 75 /* Value too large for defined data type */ -#define ENOTUNIQ 76 /* Name not unique on network */ -#define EBADFD 77 /* File descriptor in bad state */ -#define EREMCHG 78 /* Remote address changed */ -#define ELIBACC 79 /* Can not access a needed shared library */ -#define ELIBBAD 80 /* Accessing a corrupted shared library */ -#define ELIBSCN 81 /* .lib section in a.out corrupted */ -#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ -#define ELIBEXEC 83 /* Cannot exec a shared library directly */ -#define EILSEQ 84 /* Illegal byte sequence */ -#define ERESTART 85 /* Interrupted system call should be restarted */ -#define ESTRPIPE 86 /* Streams pipe error */ -#define EUSERS 87 /* Too many users */ -#define ENOTSOCK 88 /* Socket operation on non-socket */ -#define EDESTADDRREQ 89 /* Destination address required */ -#define EMSGSIZE 90 /* Message too long */ -#define EPROTOTYPE 91 /* Protocol wrong type for socket */ -#define ENOPROTOOPT 92 /* Protocol not available */ -#define EPROTONOSUPPORT 93 /* Protocol not supported */ -#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ -#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define EPFNOSUPPORT 96 /* Protocol family not supported */ -#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ -#define EADDRINUSE 98 /* Address already in use */ -#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ -#define ENETDOWN 100 /* Network is down */ -#define ENETUNREACH 101 /* Network is unreachable */ -#define ENETRESET 102 /* Network dropped connection because of reset */ -#define ECONNABORTED 103 /* Software caused connection abort */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define EISCONN 106 /* Transport endpoint is already connected */ -#define ENOTCONN 107 /* Transport endpoint is not connected */ -#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -#define ETOOMANYREFS 109 /* Too many references: cannot splice */ -#define ETIMEDOUT 110 /* Connection timed out */ -#define ECONNREFUSED 111 /* Connection refused */ -#define EHOSTDOWN 112 /* Host is down */ -#define EHOSTUNREACH 113 /* No route to host */ -#define EALREADY 114 /* Operation already in progress */ -#define EINPROGRESS 115 /* Operation now in progress */ -#define ESTALE 116 /* Stale NFS file handle */ -#define EUCLEAN 117 /* Structure needs cleaning */ -#define ENOTNAM 118 /* Not a XENIX named type file */ -#define ENAVAIL 119 /* No XENIX semaphores available */ -#define EISNAM 120 /* Is a named type file */ -#define EREMOTEIO 121 /* Remote I/O error */ -#define EDQUOT 122 /* Quota exceeded */ - -#define ENOMEDIUM 123 /* No medium found */ -#define EMEDIUMTYPE 124 /* Wrong medium type */ - -#ifndef errno - extern int errno; -#endif - -#ifndef err_t -typedef int err_t; -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* _UBIXOS_ERRNO*/ diff --git a/include/sys/ubixos/exec.h b/include/sys/ubixos/exec.h deleted file mode 100644 index 3731eaf..0000000 --- a/include/sys/ubixos/exec.h +++ /dev/null @@ -1,40 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_EXEC_H -#define _UBIXOS_EXEC_H - -#include -#include - -uint32_t execThread(void (*tproc)(void), uint32_t, char *); -void execFile(char *file, char **argv, char **envp, int console); - -int sys_exec(struct thread *, char *, char **, char **); - -#endif /* END _UBIXOS_EXEC_H */ diff --git a/include/sys/ubixos/fork.h b/include/sys/ubixos/fork.h deleted file mode 100644 index ad66125..0000000 --- a/include/sys/ubixos/fork.h +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_FORK_H -#define _UBIXOS_FORK_H - -#include -#include - -//void sysFork(); -int sysFork(struct thread *, void *); - -#endif /* END _UBIXOS_FORK_H */ diff --git a/include/sys/ubixos/init.h b/include/sys/ubixos/init.h deleted file mode 100644 index 2754672..0000000 --- a/include/sys/ubixos/init.h +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_INIT_H -#define _UBIXOS_INIT_H - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -typedef int (*intFunctionPTR)(void); - -intFunctionPTR init_tasks[] = { static_constructors, i8259_init, idt_init, vitals_init, sysctl_init, vfs_init, sched_init, pit_init, atkbd_init, time_init, pci_init, devfs_init, tty_init, ufs_init, initHardDisk, initLNC, net_init }; - -//ne2k_init, -//ubixfs_init, -//fdc_init, - -int init_tasksTotal = sizeof(init_tasks) / sizeof(intFunctionPTR); - -#endif /* END _UBIXOS_INIT_H */ diff --git a/include/sys/ubixos/kmod.h b/include/sys/ubixos/kmod.h deleted file mode 100644 index 39a3660..0000000 --- a/include/sys/ubixos/kmod.h +++ /dev/null @@ -1,48 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_KMOD_H -#define _UBIXOS_KMOD_H - -#include - -#define LD_START 0x1000000 - -typedef struct kmod_struct { - struct kmod_struct *next; - struct kmod_struct *prev; - uInt16 id; - uInt16 refs; - uInt32 address; - char name[128]; -} kmod_t; - -uInt32 kmod_load(const char *); -uInt32 kmod_add(const char *, const char *name); - -#endif diff --git a/include/sys/ubixos/kpanic.h b/include/sys/ubixos/kpanic.h deleted file mode 100644 index 3adc795..0000000 --- a/include/sys/ubixos/kpanic.h +++ /dev/null @@ -1,36 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _SYS_KPANIC_H -#define _SYS_KPANIC_H - -#define K_PANIC(msg) kpanic("Error: (%s), File: %s, Line: %i\n",msg ,__FILE__,__LINE__); - -void kpanic(const char *fmt, ...); - -#endif /* END _SYS_KPANIC_H */ diff --git a/include/sys/ubixos/ld.h b/include/sys/ubixos/ld.h deleted file mode 100644 index 2790ec4..0000000 --- a/include/sys/ubixos/ld.h +++ /dev/null @@ -1,38 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_LD_H -#define _UBIXOS_LD_H - -#include - -#define LD_START 0xAAA00000 //0x1000000 - -uInt32 ldEnable(); - -#endif /* END _UBIXOS_LD_H */ diff --git a/include/sys/ubixos/lists.h b/include/sys/ubixos/lists.h deleted file mode 100644 index f730a52..0000000 --- a/include/sys/ubixos/lists.h +++ /dev/null @@ -1,69 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#define IN -#define STATUS_FAILURE -1 -#define STATUS_SUCCESS 0 - -typedef struct _item_t Item_t; -typedef struct _list_t List_t; -struct _item_t { - Item_t *Previous; - Item_t *Next; - void *data; -}; - -struct _list_t { - Item_t *First; - Item_t *Last; -}; - -List_t * -InitializeList(); -Item_t * -CreateItem(); -int -InsertItemAtFront( IN List_t * TList, IN Item_t * kItem); -int -InsertItemBetweenItems( IN List_t * TList, IN Item_t * Previous, IN Item_t * Next, IN Item_t * Insert); -int -RemoveItem( IN List_t * TList, IN Item_t * kItem); -int -DestroyItemsInList(IN List_t * ItemList); -int -DestroyItemList(IN List_t * ItemList); -Item_t * -GetFirstItem(IN List_t * kItem); - -Item_t * -GetLastItem(IN List_t * kItem); -List_t * -RemoveItemListBetweenItems( IN Item_t * Previous, IN Item_t * Next); - -void -InsertItemListBetweenItems( IN Item_t * Previous, IN Item_t * Next, IN List_t * Insert); diff --git a/include/sys/ubixos/sched.h b/include/sys/ubixos/sched.h deleted file mode 100644 index 3388bec..0000000 --- a/include/sys/ubixos/sched.h +++ /dev/null @@ -1,113 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_SCHED_H -#define _UBIXOS_SCHED_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include - -#include -#include - -#define NO_GROUP -1 -#define NR_GROUPS 32 - -typedef enum { - PLACEHOLDER = -2, DEAD = -1, NEW = 0, READY = 1, RUNNING = 2, IDLE = 3, FORK = 4, WAIT = 5, UNINTERRUPTIBLE = 6, INTERRUPTIBLE = 7 -} tState; - -struct osInfo { - uInt8 timer; - uInt8 v86Task; - bool v86If; - uInt32 vmStart; - uInt32 stdinSize; - uInt32 controlKeys; - char *stdin; - char cwd[1024]; /* current working dir */ - uint8_t gpf; -}; - -typedef struct taskStruct { - pidType id; - char name[256]; - struct taskStruct *prev; - struct taskStruct *next; - struct tssStruct tss; - struct i387Struct i387; - struct osInfo oInfo; - //fileDescriptor *imageFd; - fileDescriptor_t *files[MAX_OFILES]; - tState state; - uint32_t uid, gid; - uint16_t euid, suid; - uint16_t egid, sgid; - uInt16 usedMath; - tty_term *term; - struct thread td; - struct { - struct inode *pwd; - struct inode *root; - struct inode *exec; - } inodes; - uint32_t counter; - uint16_t groups[NR_GROUPS]; - pidType ppid; - uint32_t pgrp; - uint32_t children; // Hack for WAIT - uint32_t last_exit; // Hack For WAIT - struct taskStruct *parent; -} kTask_t; - -int sched_init(); -int sched_setStatus(pidType, tState); -int sched_deleteTask(pidType); -int sched_addDelTask(kTask_t *); -kTask_t *sched_getDelTask(); -void sched_yield(); -void sched(); - -void schedEndTask(pidType pid); -kTask_t *schedNewTask(); -kTask_t *schedFindTask(uInt32 id); - -extern kTask_t *_current; -extern kTask_t *_usedMath; - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/include/sys/ubixos/sem.h b/include/sys/ubixos/sem.h deleted file mode 100644 index 7afd3de..0000000 --- a/include/sys/ubixos/sem.h +++ /dev/null @@ -1,58 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_SEM_H -#define _UBIXOS_SEM_H - -#include -#include -#include - -struct sys_sem { - uint32_t signaled; - ubthread_cond_t cond; - ubthread_mutex_t mutex; -}; - -typedef struct sys_sem sys_sem_t; - -typedef uint32_t semID_t; -struct timespec; - -int sem_close(semID_t id); -int sem_post(semID_t id); -int sem_wait(semID_t id); -int sem_trywait(semID_t id); -int sem_timedwait(semID_t id, const struct timespec *); -int sem_init(sys_sem_t **, uint8_t); -int sem_open(semID_t *id, const char *name, int oflag, mode_t mode, unsigned int value); -int sem_unlink(const char *name); -int sem_getvalue(semID_t id, int *val); -int sem_destroy(sys_sem_t **); - -#endif /* END _UBIXOS_SEM_H */ diff --git a/include/sys/ubixos/smp.h b/include/sys/ubixos/smp.h deleted file mode 100644 index d4a630d..0000000 --- a/include/sys/ubixos/smp.h +++ /dev/null @@ -1,53 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_SMP_H -#define _UBIXOS_SMP_H - -#include - -struct cpuinfo_t { - uInt8 id; - uInt8 ok; // 1=Ok, 0=Bad - uInt8 apic_id, apic_ver; - uInt32 signature; // Family, Model, Stepping - uInt32 feature; - uInt32 max; - char brand[49]; // Brand name - char ident[17]; -}; - -void smpInit(); -void cpuidDetect(); -uInt8 cpuInfo(); -uInt32 getEflags(); -void setEflags(uInt32); -void cpuid(uInt32, uInt32 *); -void apicMagic(); - -#endif diff --git a/include/sys/ubixos/spinlock.h b/include/sys/ubixos/spinlock.h deleted file mode 100644 index 2ebfa2a..0000000 --- a/include/sys/ubixos/spinlock.h +++ /dev/null @@ -1,96 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_SPINLOCK_H -#define _UBIXOS_SPINLOCK_H - -#include - -#define LOCKED 1 -#define UNLOCKED 0 -#define SPIN_LOCK_INITIALIZER {NULL, 0} -#define LLOCK_FLAG 1 - -//typedef volatile int spinLock_t; - -struct spinLock { - struct spinLock *next; - uint32_t locked; -}; - -typedef struct spinLock *spinLock_t; - -extern struct spinLock Master; - -void spinLockInit(spinLock_t); -void spinUnlock(spinLock_t); -int spinTryLock(spinLock_t); -void spinLock(spinLock_t); - -void spinLock_scheduler(spinLock_t *); /* Only use this spinlock in the sched. */ - -int spinLockLocked(spinLock_t *); - -/* Atomic exchange (of various sizes) */ -static inline u_long xchg_64(volatile uint32_t *ptr, u_long x) { - __asm__ __volatile__("xchgq %1,%0" - :"+r" (x), - "+m" (*ptr)); - - return x; -} - -static inline unsigned xchg_32(volatile uint32_t *ptr, uint32_t x) { - __asm__ __volatile__("xchgl %1,%0" - :"+r" (x), - "+m" (*ptr)); - - return x; -} - -static inline unsigned short xchg_16(volatile uint32_t *ptr, uint16_t x) { - __asm__ __volatile__("xchgw %1,%0" - :"+r" (x), - "+m" (*ptr)); - - return x; -} - -/* Test and set a bit */ -static inline char atomic_bitsetandtest(void *ptr, int x) { - char out; - __asm__ __volatile__("lock; bts %2,%1\n" - "sbb %0,%0\n" - :"=r" (out), "=m" (*(volatile long long *)ptr) - :"Ir" (x) - :"memory"); - - return out; -} - -#endif diff --git a/include/sys/ubixos/static.h b/include/sys/ubixos/static.h deleted file mode 100644 index 59986ca..0000000 --- a/include/sys/ubixos/static.h +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_STATIC_H -#define _UBIXOS_STATIC_H - -int static_constructors(void); - -#endif diff --git a/include/sys/ubixos/syscall.h b/include/sys/ubixos/syscall.h deleted file mode 100644 index e824415..0000000 --- a/include/sys/ubixos/syscall.h +++ /dev/null @@ -1,39 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_SYSCALL_H -#define _UBIXOS_SYSCALL_H - -#include - -void _sys_call(); -void sys_call(struct trapframe *frame); -int invalidCall(); -void invalidCallINT(int); - -#endif diff --git a/include/sys/ubixos/syscall_posix.h b/include/sys/ubixos/syscall_posix.h deleted file mode 100644 index 65b2f09..0000000 --- a/include/sys/ubixos/syscall_posix.h +++ /dev/null @@ -1,37 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_SYSCALL_POSIX_H -#define _UBIXOS_SYSCALL_POSIX_H - -#include - -void _sys_call_posix(); -void sys_call_posix(struct trapframe *frame); - -#endif diff --git a/include/sys/ubixos/syscalls.h b/include/sys/ubixos/syscalls.h deleted file mode 100644 index 1336ac6..0000000 --- a/include/sys/ubixos/syscalls.h +++ /dev/null @@ -1,103 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _SYSCALLS_H -#define _SYSCALLS_H - -#include -#include -#include - -#define SYSCALLS_MAX 1024 - -#define PSL_C 0x00000001 /* carry bit */ -#define EJUSTRETURN (-2) /* don't modify regs, just return */ -#define ERESTART (-1) /* restart syscall */ - -#define ARG_COUNT(name) (sizeof(struct name) / sizeof(register_t)) - -#define SYSCALL_INVALID 0 -#define SYSCALL_VALID 1 -#define SYSCALL_DUMMY 2 -#define SYSCALL_NOTIMP 3 - -typedef int sys_call_t(struct thread *, void *); - -struct syscall_entry { - int sc_args; - char *sc_name; - sys_call_t *sc_entry; - int sc_status; -}; - -/* - * - * Old Style Calls Need Updates - * - */ -int sysAuth(); -int sysPasswd(); -int sysAddModule(); -int sysRmModule(); -int sysGetpid(); -int sysExit(); -int sysExec(); - -int sysCheckPid(); -int sysGetFreePage(); - -int sysFgetc(); -int sysFopen(); -int sysFclose(); -int sysFseek(); -int sysMkDir(); -int sysRmDir(); - -//int sysSDE(); -int sysGetDrives(); -int sysGetCwd(); -int sysChDir(); -int sysGetUptime(); -int sysGetTime(); -int sysStartSDE(); -int sysUnlink(); -int sysMpiCreateMbox(); -int sysMpiDestroyMbox(); -int sysMpiPostMessage(); -int sysMpiFetchMessage(); -int sysMpiSpam(); - -typedef int (*functionPTR)(); - -extern int totalCalls; -extern struct syscall_entry systemCalls[]; - -extern int totalCalls_posix; -extern struct syscall_entry systemCalls_posix[]; - -#endif diff --git a/include/sys/ubixos/syscalls_new.h b/include/sys/ubixos/syscalls_new.h deleted file mode 100644 index 706484e..0000000 --- a/include/sys/ubixos/syscalls_new.h +++ /dev/null @@ -1,531 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _SYSCALLS_NEW_H -#define _SYSCALLS_NEW_H - -#include - -int sysExit(); -int read(); -int getpid(); -int fcntl(); -int issetugid(); -int __sysctl(); -int pipe(); -int readlink(); -int getuid(); -int getgid(); -int close(); -int mmap(); -int obreak(); -int sigaction(); -int getdtablesize(); -int munmap(); -int sigprocmask(); -int gettimeofday_new(); -int fstat(); -int ioctl(); - -#define invalid_call 0x0 -#define PSL_C 0x00000001 /* carry bit */ -#define EJUSTRETURN (-2) /* don't modify regs, just return */ -#define ERESTART (-1) /* restart syscall */ - -typedef int (*functionPTR)(); - -/*! - * \brief Mast System Call List - */ -functionPTR systemCalls_new[] = { -invalid_call, /** 0 **/ -sysExit, /** 1 **/ -invalid_call, /** 2 **/ -read, /** 3 **/ -sys_write, /** 4 **/ -sys_open, /** 5 **/ -close, /** 6 **/ -invalid_call, /** 7 **/ -invalid_call, /** 8 **/ -invalid_call, /** 9 **/ -invalid_call, /** 10 **/ -invalid_call, /** 11 **/ -invalid_call, /** 12 **/ -invalid_call, /** 13 **/ -invalid_call, /** 14 **/ -invalid_call, /** 15 **/ -invalid_call, /** 16 **/ -obreak, /** 17 **/ -invalid_call, /** 18 **/ -invalid_call, /** 19 **/ -getpid, /** 20 **/ -invalid_call, /** 21 **/ -invalid_call, /** 22 **/ -invalid_call, /** 23 **/ -getuid, /** 24 **/ -invalid_call, /** 25 **/ -invalid_call, /** 26 **/ -invalid_call, /** 27 **/ -invalid_call, /** 28 **/ -invalid_call, /** 29 **/ -invalid_call, /** 30 **/ -invalid_call, /** 31 **/ -invalid_call, /** 32 **/ -access, /** 33 **/ -invalid_call, /** 34 **/ -invalid_call, /** 35 **/ -invalid_call, /** 36 **/ -invalid_call, /** 37 **/ -invalid_call, /** 38 **/ -invalid_call, /** 39 **/ -invalid_call, /** 40 **/ -invalid_call, /** 41 **/ -pipe, /** 42 **/ -invalid_call, /** 43 **/ -invalid_call, /** 44 **/ -invalid_call, /** 45 **/ -invalid_call, /** 46 **/ -getgid, /** 47 **/ -invalid_call, /** 48 **/ -invalid_call, /** 49 **/ -invalid_call, /** 50 **/ -invalid_call, /** 51 **/ -invalid_call, /** 52 **/ -invalid_call, /** 53 **/ -ioctl, /** 54 **/ -invalid_call, /** 55 **/ -invalid_call, /** 56 **/ -invalid_call, /** 57 **/ -readlink, /** 58 **/ -invalid_call, /** 59 **/ -invalid_call, /** 60 **/ -invalid_call, /** 61 **/ -invalid_call, /** 62 **/ -invalid_call, /** 63 **/ -invalid_call, /** 64 **/ -invalid_call, /** 65 **/ -invalid_call, /** 66 **/ -invalid_call, /** 67 **/ -invalid_call, /** 68 **/ -invalid_call, /** 69 **/ -invalid_call, /** 70 **/ -invalid_call, /** 71 **/ -invalid_call, /** 72 **/ -munmap, /** 73 **/ -mprotect, /** 74 **/ -invalid_call, /** 75 **/ -invalid_call, /** 76 **/ -invalid_call, /** 77 **/ -invalid_call, /** 78 **/ -invalid_call, /** 79 **/ -invalid_call, /** 80 **/ -invalid_call, /** 81 **/ -invalid_call, /** 82 **/ -setitimer, /** 83 **/ -invalid_call, /** 84 **/ -invalid_call, /** 85 **/ -invalid_call, /** 86 **/ -invalid_call, /** 87 **/ -invalid_call, /** 88 **/ -getdtablesize, /** 89 **/ -invalid_call, /** 90 **/ -invalid_call, /** 91 **/ -fcntl, /** 92 **/ -invalid_call, /** 93 **/ -invalid_call, /** 94 **/ -invalid_call, /** 95 **/ -invalid_call, /** 96 **/ -invalid_call, /** 97 **/ -invalid_call, /** 98 **/ -invalid_call, /** 99 **/ -invalid_call, /** 100 **/ -invalid_call, /** 101 **/ -invalid_call, /** 102 **/ -invalid_call, /** 103 **/ -invalid_call, /** 104 **/ -invalid_call, /** 105 **/ -invalid_call, /** 106 **/ -invalid_call, /** 107 **/ -invalid_call, /** 108 **/ -invalid_call, /** 109 **/ -invalid_call, /** 110 **/ -invalid_call, /** 111 **/ -invalid_call, /** 112 **/ -invalid_call, /** 113 **/ -invalid_call, /** 114 **/ -invalid_call, /** 115 **/ -gettimeofday_new, /** 116 **/ -invalid_call, /** 117 **/ -invalid_call, /** 118 **/ -invalid_call, /** 119 **/ -invalid_call, /** 120 **/ -invalid_call, /** 121 **/ -invalid_call, /** 122 **/ -invalid_call, /** 123 **/ -invalid_call, /** 124 **/ -invalid_call, /** 125 **/ -invalid_call, /** 126 **/ -invalid_call, /** 127 **/ -invalid_call, /** 128 **/ -invalid_call, /** 129 **/ -invalid_call, /** 130 **/ -invalid_call, /** 131 **/ -invalid_call, /** 132 **/ -invalid_call, /** 133 **/ -invalid_call, /** 134 **/ -invalid_call, /** 135 **/ -invalid_call, /** 136 **/ -invalid_call, /** 137 **/ -invalid_call, /** 138 **/ -invalid_call, /** 139 **/ -invalid_call, /** 140 **/ -invalid_call, /** 141 **/ -invalid_call, /** 142 **/ -invalid_call, /** 143 **/ -invalid_call, /** 144 **/ -invalid_call, /** 145 **/ -invalid_call, /** 146 **/ -invalid_call, /** 147 **/ -invalid_call, /** 148 **/ -invalid_call, /** 149 **/ -invalid_call, /** 150 **/ -invalid_call, /** 151 **/ -invalid_call, /** 152 **/ -invalid_call, /** 153 **/ -invalid_call, /** 154 **/ -invalid_call, /** 155 **/ -invalid_call, /** 156 **/ -invalid_call, /** 157 **/ -invalid_call, /** 158 **/ -invalid_call, /** 159 **/ -invalid_call, /** 160 **/ -invalid_call, /** 161 **/ -invalid_call, /** 162 **/ -invalid_call, /** 163 **/ -invalid_call, /** 164 **/ -invalid_call, /** 165 **/ -invalid_call, /** 166 **/ -invalid_call, /** 167 **/ -invalid_call, /** 168 **/ -invalid_call, /** 169 **/ -invalid_call, /** 170 **/ -invalid_call, /** 171 **/ -invalid_call, /** 172 **/ -invalid_call, /** 173 **/ -invalid_call, /** 174 **/ -invalid_call, /** 175 **/ -invalid_call, /** 176 **/ -invalid_call, /** 177 **/ -invalid_call, /** 178 **/ -invalid_call, /** 179 **/ -invalid_call, /** 180 **/ -invalid_call, /** 181 **/ -invalid_call, /** 182 **/ -invalid_call, /** 183 **/ -invalid_call, /** 184 **/ -invalid_call, /** 185 **/ -invalid_call, /** 186 **/ -invalid_call, /** 187 **/ -invalid_call, /** 188 **/ -fstat, /** 189 **/ -invalid_call, /** 190 **/ -invalid_call, /** 191 **/ -invalid_call, /** 192 **/ -invalid_call, /** 193 **/ -invalid_call, /** 194 **/ -invalid_call, /** 195 **/ -invalid_call, /** 196 **/ -mmap, /** 197 **/ -invalid_call, /** 198 **/ -invalid_call, /** 199 **/ -invalid_call, /** 200 **/ -invalid_call, /** 201 **/ -__sysctl, /** 202 **/ -invalid_call, /** 203 **/ -invalid_call, /** 204 **/ -invalid_call, /** 205 **/ -invalid_call, /** 206 **/ -invalid_call, /** 207 **/ -invalid_call, /** 208 **/ -invalid_call, /** 209 **/ -invalid_call, /** 210 **/ -invalid_call, /** 211 **/ -invalid_call, /** 212 **/ -invalid_call, /** 213 **/ -invalid_call, /** 214 **/ -invalid_call, /** 215 **/ -invalid_call, /** 216 **/ -invalid_call, /** 217 **/ -invalid_call, /** 218 **/ -invalid_call, /** 219 **/ -invalid_call, /** 220 **/ -invalid_call, /** 221 **/ -invalid_call, /** 222 **/ -invalid_call, /** 223 **/ -invalid_call, /** 224 **/ -invalid_call, /** 225 **/ -invalid_call, /** 226 **/ -invalid_call, /** 227 **/ -invalid_call, /** 228 **/ -invalid_call, /** 229 **/ -invalid_call, /** 230 **/ -invalid_call, /** 231 **/ -invalid_call, /** 232 **/ -invalid_call, /** 233 **/ -invalid_call, /** 234 **/ -invalid_call, /** 235 **/ -invalid_call, /** 236 **/ -invalid_call, /** 237 **/ -invalid_call, /** 238 **/ -invalid_call, /** 239 **/ -invalid_call, /** 240 **/ -invalid_call, /** 241 **/ -invalid_call, /** 242 **/ -invalid_call, /** 243 **/ -invalid_call, /** 244 **/ -invalid_call, /** 245 **/ -invalid_call, /** 246 **/ -invalid_call, /** 247 **/ -invalid_call, /** 248 **/ -invalid_call, /** 249 **/ -invalid_call, /** 250 **/ -invalid_call, /** 251 **/ -invalid_call, /** 252 **/ -issetugid, /** 253 **/ -invalid_call, /** 254 **/ -invalid_call, /** 255 **/ -invalid_call, /** 256 **/ -invalid_call, /** 257 **/ -invalid_call, /** 258 **/ -invalid_call, /** 259 **/ -invalid_call, /** 260 **/ -invalid_call, /** 261 **/ -invalid_call, /** 262 **/ -invalid_call, /** 263 **/ -invalid_call, /** 264 **/ -invalid_call, /** 265 **/ -invalid_call, /** 266 **/ -invalid_call, /** 267 **/ -invalid_call, /** 268 **/ -invalid_call, /** 269 **/ -invalid_call, /** 270 **/ -invalid_call, /** 271 **/ -invalid_call, /** 272 **/ -invalid_call, /** 273 **/ -invalid_call, /** 274 **/ -invalid_call, /** 275 **/ -invalid_call, /** 276 **/ -invalid_call, /** 277 **/ -invalid_call, /** 278 **/ -invalid_call, /** 279 **/ -invalid_call, /** 280 **/ -invalid_call, /** 281 **/ -invalid_call, /** 282 **/ -invalid_call, /** 283 **/ -invalid_call, /** 284 **/ -invalid_call, /** 285 **/ -invalid_call, /** 286 **/ -invalid_call, /** 287 **/ -invalid_call, /** 288 **/ -invalid_call, /** 289 **/ -invalid_call, /** 290 **/ -invalid_call, /** 291 **/ -invalid_call, /** 292 **/ -invalid_call, /** 293 **/ -invalid_call, /** 294 **/ -invalid_call, /** 295 **/ -invalid_call, /** 296 **/ -invalid_call, /** 297 **/ -invalid_call, /** 298 **/ -invalid_call, /** 299 **/ -invalid_call, /** 300 **/ -invalid_call, /** 301 **/ -invalid_call, /** 302 **/ -invalid_call, /** 303 **/ -invalid_call, /** 304 **/ -invalid_call, /** 305 **/ -invalid_call, /** 306 **/ -invalid_call, /** 307 **/ -invalid_call, /** 308 **/ -invalid_call, /** 309 **/ -invalid_call, /** 310 **/ -invalid_call, /** 311 **/ -invalid_call, /** 312 **/ -invalid_call, /** 313 **/ -invalid_call, /** 314 **/ -invalid_call, /** 315 **/ -invalid_call, /** 316 **/ -invalid_call, /** 317 **/ -invalid_call, /** 318 **/ -invalid_call, /** 319 **/ -invalid_call, /** 320 **/ -invalid_call, /** 321 **/ -invalid_call, /** 322 **/ -invalid_call, /** 323 **/ -invalid_call, /** 324 **/ -invalid_call, /** 325 **/ -invalid_call, /** 326 **/ -invalid_call, /** 327 **/ -invalid_call, /** 328 **/ -invalid_call, /** 329 **/ -invalid_call, /** 330 **/ -invalid_call, /** 331 **/ -invalid_call, /** 332 **/ -invalid_call, /** 333 **/ -invalid_call, /** 334 **/ -invalid_call, /** 335 **/ -invalid_call, /** 336 **/ -invalid_call, /** 337 **/ -invalid_call, /** 338 **/ -invalid_call, /** 339 **/ -sigprocmask, /** 340 **/ -invalid_call, /** 341 **/ -invalid_call, /** 342 **/ -invalid_call, /** 343 **/ -invalid_call, /** 344 **/ -invalid_call, /** 345 **/ -invalid_call, /** 346 **/ -invalid_call, /** 347 **/ -invalid_call, /** 348 **/ -invalid_call, /** 349 **/ -invalid_call, /** 350 **/ -invalid_call, /** 351 **/ -invalid_call, /** 352 **/ -invalid_call, /** 353 **/ -invalid_call, /** 354 **/ -invalid_call, /** 355 **/ -invalid_call, /** 356 **/ -invalid_call, /** 357 **/ -invalid_call, /** 358 **/ -invalid_call, /** 359 **/ -invalid_call, /** 360 **/ -invalid_call, /** 361 **/ -invalid_call, /** 362 **/ -invalid_call, /** 363 **/ -invalid_call, /** 364 **/ -invalid_call, /** 365 **/ -invalid_call, /** 366 **/ -invalid_call, /** 367 **/ -invalid_call, /** 368 **/ -invalid_call, /** 369 **/ -invalid_call, /** 370 **/ -invalid_call, /** 371 **/ -invalid_call, /** 372 **/ -invalid_call, /** 373 **/ -invalid_call, /** 374 **/ -invalid_call, /** 375 **/ -invalid_call, /** 376 **/ -invalid_call, /** 377 **/ -invalid_call, /** 378 **/ -invalid_call, /** 379 **/ -invalid_call, /** 380 **/ -invalid_call, /** 381 **/ -invalid_call, /** 382 **/ -invalid_call, /** 383 **/ -invalid_call, /** 384 **/ -invalid_call, /** 385 **/ -invalid_call, /** 386 **/ -invalid_call, /** 387 **/ -invalid_call, /** 388 **/ -invalid_call, /** 389 **/ -invalid_call, /** 390 **/ -invalid_call, /** 391 **/ -invalid_call, /** 392 **/ -invalid_call, /** 393 **/ -invalid_call, /** 394 **/ -invalid_call, /** 395 **/ -invalid_call, /** 396 **/ -fstatfs, /** 397 **/ -invalid_call, /** 398 **/ -invalid_call, /** 399 **/ -invalid_call, /** 400 **/ -invalid_call, /** 401 **/ -invalid_call, /** 402 **/ -invalid_call, /** 403 **/ -invalid_call, /** 404 **/ -invalid_call, /** 405 **/ -invalid_call, /** 406 **/ -invalid_call, /** 407 **/ -invalid_call, /** 408 **/ -invalid_call, /** 409 **/ -invalid_call, /** 410 **/ -invalid_call, /** 411 **/ -invalid_call, /** 412 **/ -invalid_call, /** 413 **/ -invalid_call, /** 414 **/ -invalid_call, /** 415 **/ -sigaction, /** 416 **/ -invalid_call, /** 417 **/ -invalid_call, /** 418 **/ -invalid_call, /** 419 **/ -invalid_call, /** 420 **/ -invalid_call, /** 421 **/ -invalid_call, /** 422 **/ -invalid_call, /** 423 **/ -invalid_call, /** 424 **/ -invalid_call, /** 425 **/ -invalid_call, /** 426 **/ -invalid_call, /** 427 **/ -invalid_call, /** 428 **/ -invalid_call, /** 429 **/ -invalid_call, /** 430 **/ -invalid_call, /** 431 **/ -invalid_call, /** 432 **/ -invalid_call, /** 433 **/ -invalid_call, /** 434 **/ -invalid_call, /** 435 **/ -invalid_call, /** 436 **/ -invalid_call, /** 437 **/ -invalid_call, /** 438 **/ -invalid_call, /** 439 **/ -invalid_call, /** 440 **/ -invalid_call, /** 441 **/ -invalid_call, /** 442 **/ -invalid_call, /** 443 **/ -invalid_call, /** 444 **/ -invalid_call, /** 445 **/ -invalid_call, /** 446 **/ -invalid_call, /** 447 **/ -invalid_call, /** 448 **/ -invalid_call, /** 449 **/ -invalid_call, /** 450 **/ -invalid_call, /** 451 **/ -invalid_call, /** 452 **/ -invalid_call, /** 453 **/ -invalid_call, /** 454 **/ -invalid_call, /** 455 **/ -}; - -int totalCalls_new = sizeof(systemCalls_new) / sizeof(functionPTR); - -#endif - -/*** - END - ***/ - diff --git a/include/sys/ubixos/systemtask.h b/include/sys/ubixos/systemtask.h deleted file mode 100644 index 22589b1..0000000 --- a/include/sys/ubixos/systemtask.h +++ /dev/null @@ -1,60 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _SYSTEMTASK_H -#define _SYSTEMTASK_H - -#include - -void systemTask(); - -#endif - -/*** - $Log: systemtask.h,v $ - Revision 1.1.1.1 2006/06/01 12:46:14 reddawg - ubix2 - - Revision 1.2 2005/10/12 00:13:37 reddawg - Removed - - Revision 1.1.1.1 2005/09/26 17:23:56 reddawg - no message - - Revision 1.2 2004/06/04 17:49:32 reddawg - Wont work with out the makefile updated - - Revision 1.1 2004/06/04 17:33:33 reddawg - Changed idle task to system task - - Revision 1.2 2004/05/21 15:20:00 reddawg - Cleaned up - - - END - ***/ diff --git a/include/sys/ubixos/time.h b/include/sys/ubixos/time.h deleted file mode 100644 index d9ab30d..0000000 --- a/include/sys/ubixos/time.h +++ /dev/null @@ -1,89 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_TIME_H -#define _UBIXOS_TIME_H - -#include -#include -#include - -typedef long suseconds_t; - -#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) - -#define MINUTE 60 -#define HOUR (60*MINUTE) -#define DAY (24*HOUR) -#define YEAR (365*DAY) - - -struct timeStruct { - int sec; - int min; - int hour; - int day; - int mon; - int year; -}; - -struct timezone { - int tz_minuteswest; /* minutes west of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; - -int gettimeofday(struct timeval *tp, struct timezone *tzp); - -int time_init(); -uInt32 timeMake(struct timeStruct *time); - -#endif - -/*** - $Log: time.h,v $ - Revision 1.1.1.1 2006/06/01 12:46:14 reddawg - ubix2 - - Revision 1.2 2005/10/12 00:13:37 reddawg - Removed - - Revision 1.1.1.1 2005/09/26 17:23:56 reddawg - no message - - Revision 1.4 2004/07/09 13:37:30 reddawg - time: timeInit to time_init - Adjusted initialization routines - - Revision 1.3 2004/06/29 11:41:44 reddawg - Fixed some global variables - - Revision 1.2 2004/05/21 15:20:00 reddawg - Cleaned up - - END - ***/ diff --git a/include/sys/ubixos/times.h b/include/sys/ubixos/times.h deleted file mode 100644 index eb575b1..0000000 --- a/include/sys/ubixos/times.h +++ /dev/null @@ -1,64 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _TIMES_H -#define _TIMES_H - -#include - -#ifndef _CLOCK_T_DECLARED -typedef __clock_t clock_t; -#define _CLOCK_T_DECLARED -#endif - -struct tms { - clock_t tms_utime; /* User CPU time */ - clock_t tms_stime; /* System CPU time */ - clock_t tms_cutime; /* User CPU time of terminated child procs */ - clock_t tms_cstime; /* System CPU time of terminated child procs */ -}; - -#endif - -/*** - $Log: times.h,v $ - Revision 1.1.1.1 2006/06/01 12:46:14 reddawg - ubix2 - - Revision 1.2 2005/10/12 00:13:37 reddawg - Removed - - Revision 1.1.1.1 2005/09/26 17:23:57 reddawg - no message - - Revision 1.2 2004/05/21 15:20:00 reddawg - Cleaned up - - - END - ***/ diff --git a/include/sys/ubixos/tty.h b/include/sys/ubixos/tty.h deleted file mode 100644 index 4389db6..0000000 --- a/include/sys/ubixos/tty.h +++ /dev/null @@ -1,54 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_TTY_H -#define _UBIXOS_TTY_H - -#include - -#define TTY_MAX_TERMS 5 - -typedef struct tty_termNode { - char *tty_buffer; - char *tty_pointer; - uint8_t tty_colour; - uint16_t tty_x; - uint16_t tty_y; - pidType owner; - char stdin[512]; - int stdinSize; -} tty_term; - -int tty_init(); -int tty_change(uInt16); -tty_term *tty_find(uInt16); -int tty_print(char *, tty_term *); - -extern tty_term *tty_foreground; - -#endif diff --git a/include/sys/ubixos/ubthread.h b/include/sys/ubixos/ubthread.h deleted file mode 100644 index 26a07f4..0000000 --- a/include/sys/ubixos/ubthread.h +++ /dev/null @@ -1,86 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBTHREAD_H -#define _UBTHREAD_H - -#include -#include -#include - -#define LOCKED 1 -#define UNLOCKED 0 - -typedef struct ubthread *ubthread_t; -typedef struct ubthread_cond *ubthread_cond_t; -typedef struct ubthread_mutex *ubthread_mutex_t; - -struct ubthread { - struct taskStruct *task; -}; - -struct ubthread_cond { - int id; - bool lock; -}; - -struct ubthread_mutex { - int id; - bool lock; - pidType pid; -}; - -struct ubthread_list { - struct ubthread_list *next; - ubthread_t thread; -}; - -struct ubthread_cond_list { - struct ubthread_cond_list *next; - ubthread_cond_t *cond; -}; - -struct ubthread_mutex_list { - struct ubthread_mutex_list *next; - ubthread_mutex_t *mutex; -}; - -struct taskStruct *ubthread_self(); -int ubthread_cond_init(ubthread_cond_t *cond, const uInt32 attr); -int ubthread_mutex_init(ubthread_mutex_t *mutex, const uInt32 attr); -int ubthread_cond_destroy(ubthread_cond_t *cond); -int ubthread_mutex_destroy(ubthread_mutex_t *mutex); -int ubthread_create(struct taskStruct **thread, const uInt32 *attr, void (*tproc)(void), void *arg); -int ubthread_mutex_lock(ubthread_mutex_t *mutex); -int ubthread_mutex_unlock(ubthread_mutex_t *mutex); -int ubthread_cond_timedwait(ubthread_cond_t *cond, ubthread_mutex_t *mutex, const struct timespec *abstime); -int ubthread_cond_wait(ubthread_cond_t *cond, ubthread_mutex_t *mutex); -int ubthread_cond_signal(ubthread_cond_t *cond); -int ubthread_cond_broadcast(ubthread_cond_t *cond); - -#endif diff --git a/include/sys/ubixos/uthread.h b/include/sys/ubixos/uthread.h deleted file mode 100644 index ac8b160..0000000 --- a/include/sys/ubixos/uthread.h +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_UTHREAD_H -#define _UBIXOS_UTHREAD_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - struct uthread { - struct uthread *uthread_pointer; - size_t uthread_size; - unsigned long uthread_flags; - void *tls_master_mmap; - size_t tls_master_size; - size_t tls_master_align; - void *tls_mmap; - size_t stack_size; - void *arg_mmap; - size_t arg_size; - size_t __uthread_reserved[4]; - }; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/include/sys/ubixos/vitals.h b/include/sys/ubixos/vitals.h deleted file mode 100644 index 8c81915..0000000 --- a/include/sys/ubixos/vitals.h +++ /dev/null @@ -1,58 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_VITALS_H -#define _UBIXOS_VITALS_H - -#include -#include -#include - -typedef struct vitalsStruct { - uint32_t sysTicks; // 0 - Do Not Change Order - uint32_t sysUptime; // 4 - Do Not Change Order - uint32_t quantum; // 8 - Do Not Change Order - uint32_t dQuantum; // 12 - Do Not Change Order - uint32_t openFiles; - uint32_t lastFD; - uint32_t freePages; - struct fileSystem *fileSystems; - struct vfs_mountPoint *mountPoints; - uint32_t timeStart; - void *screen; - void *font; - char *packet; - uint32_t packetLength; -} vitalsNode; - -extern vitalsNode *systemVitals; -extern spinLock_t vitals_lock; - -int vitals_init(); - -#endif diff --git a/include/sys/ubixos/wait.h b/include/sys/ubixos/wait.h deleted file mode 100644 index 9c9f703..0000000 --- a/include/sys/ubixos/wait.h +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * Copyright (c) 2002-2018 The UbixOS Project. - * All rights reserved. - * - * This was developed by Christopher W. Olsen for the UbixOS Project. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted - * provided that the following conditions are met: - * - * 1) Redistributions of source code must retain the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors. - * 2) Redistributions in binary form must reproduce the above copyright notice, this list of - * conditions, the following disclaimer and the list of authors in the documentation and/or - * other materials provided with the distribution. - * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to - * endorse or promote products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT - * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _UBIXOS_WAIT_H -#define _UBIXOS_WAIT_H - -struct taskStruct; - -struct wait_queue { - struct taskStruct *task; - struct wait_queue *next; -}; - -struct semaphore { - int sount; - struct wait_queue *wait; -}; - -#define sti() __asm__ __volatile__ ("sti": : :"memory") -#define cli() __asm__ __volatile__ ("cli": : :"memory") -#define nop() __asm__ __volatile__ ("nop") - -#define save_flags(x) __asm__ __volatile__("pushfl ; popl %0":"=r" (x): /* no input */ :"memory") - -#define restore_flags(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"r" (x):"memory") - -#endif diff --git a/include/ubixos/access.h b/include/ubixos/access.h new file mode 100644 index 0000000..773102a --- /dev/null +++ b/include/ubixos/access.h @@ -0,0 +1,49 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_ACCESS_H +#define _UBIXOS_ACCESS_H + +#include + +struct sys_setUID_args { + uint32_t uid; +}; + +struct sys_setGID_args { + uint32_t gid; +}; + +int sys_getUID(struct thread *, void *); +int sys_getEUID(struct thread *, void *); +int sys_setUID(struct thread *, struct sys_setUID_args *); + +int sys_getGID(struct thread *, void *); +int sys_setGID(struct thread *, struct sys_setGID_args *); + +#endif /* END _UBIXOS_ACCESS_H */ diff --git a/include/ubixos/endtask.h b/include/ubixos/endtask.h new file mode 100644 index 0000000..998623e --- /dev/null +++ b/include/ubixos/endtask.h @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_ENDTASK_H +#define _UBIXOS_ENDTASK_H + +#include +#include + +void endTask(pidType); + +#endif /* END _UBIXOS_ENDTASK_H */ diff --git a/include/ubixos/errno.h b/include/ubixos/errno.h new file mode 100644 index 0000000..04aa285 --- /dev/null +++ b/include/ubixos/errno.h @@ -0,0 +1,177 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_ERRNO_H +#define _UBIXOS_ERRNO_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define ENOERR 0 /* No Error */ +#define EPERM 1 /* Operation not permitted */ +#define ENOENT 2 /* No such file or directory */ +#define ESRCH 3 /* No such process */ +#define EINTR 4 /* Interrupted system call */ +#define EIO 5 /* I/O error */ +#define ENXIO 6 /* No such device or address */ +#define E2BIG 7 /* Arg list too long */ +#define ENOEXEC 8 /* Exec format error */ +#define EBADF 9 /* Bad file number */ +#define ECHILD 10 /* No child processes */ +#define EAGAIN 11 /* Try again */ +#define ENOMEM 12 /* Out of memory */ +#define EACCES 13 /* Permission denied */ +#define EFAULT 14 /* Bad address */ +#define ENOTBLK 15 /* Block device required */ +#define EBUSY 16 /* Device or resource busy */ +#define EEXIST 17 /* File exists */ +#define EXDEV 18 /* Cross-device link */ +#define ENODEV 19 /* No such device */ +#define ENOTDIR 20 /* Not a directory */ +#define EISDIR 21 /* Is a directory */ +#define EINVAL 22 /* Invalid argument */ +#define ENFILE 23 /* File table overflow */ +#define EMFILE 24 /* Too many open files */ +#define ENOTTY 25 /* Not a typewriter */ +#define ETXTBSY 26 /* Text file busy */ +#define EFBIG 27 /* File too large */ +#define ENOSPC 28 /* No space left on device */ +#define ESPIPE 29 /* Illegal seek */ +#define EROFS 30 /* Read-only file system */ +#define EMLINK 31 /* Too many links */ +#define EPIPE 32 /* Broken pipe */ +#define EDOM 33 /* Math argument out of domain of func */ +#define ERANGE 34 /* Math result not representable */ +#define EDEADLK 35 /* Resource deadlock would occur */ +#define ENAMETOOLONG 36 /* File name too long */ +#define ENOLCK 37 /* No record locks available */ +#define ENOSYS 38 /* Function not implemented */ +#define ENOTEMPTY 39 /* Directory not empty */ +#define ELOOP 40 /* Too many symbolic links encountered */ +#define EWOULDBLOCK EAGAIN /* Operation would block */ +#define ENOMSG 42 /* No message of desired type */ +#define EIDRM 43 /* Identifier removed */ +#define ECHRNG 44 /* Channel number out of range */ +#define EL2NSYNC 45 /* Level 2 not synchronized */ +#define EL3HLT 46 /* Level 3 halted */ +#define EL3RST 47 /* Level 3 reset */ +#define ELNRNG 48 /* Link number out of range */ +#define EUNATCH 49 /* Protocol driver not attached */ +#define ENOCSI 50 /* No CSI structure available */ +#define EL2HLT 51 /* Level 2 halted */ +#define EBADE 52 /* Invalid exchange */ +#define EBADR 53 /* Invalid request descriptor */ +#define EXFULL 54 /* Exchange full */ +#define ENOANO 55 /* No anode */ +#define EBADRQC 56 /* Invalid request code */ +#define EBADSLT 57 /* Invalid slot */ + +#define EDEADLOCK EDEADLK + +#define EBFONT 59 /* Bad font file format */ +#define ENOSTR 60 /* Device not a stream */ +#define ENODATA 61 /* No data available */ +#define ETIME 62 /* Timer expired */ +#define ENOSR 63 /* Out of streams resources */ +#define ENONET 64 /* Machine is not on the network */ +#define ENOPKG 65 /* Package not installed */ +#define EREMOTE 66 /* Object is remote */ +#define ENOLINK 67 /* Link has been severed */ +#define EADV 68 /* Advertise error */ +#define ESRMNT 69 /* Srmount error */ +#define ECOMM 70 /* Communication error on send */ +#define EPROTO 71 /* Protocol error */ +#define EMULTIHOP 72 /* Multihop attempted */ +#define EDOTDOT 73 /* RFS specific error */ +#define EBADMSG 74 /* Not a data message */ +#define EOVERFLOW 75 /* Value too large for defined data type */ +#define ENOTUNIQ 76 /* Name not unique on network */ +#define EBADFD 77 /* File descriptor in bad state */ +#define EREMCHG 78 /* Remote address changed */ +#define ELIBACC 79 /* Can not access a needed shared library */ +#define ELIBBAD 80 /* Accessing a corrupted shared library */ +#define ELIBSCN 81 /* .lib section in a.out corrupted */ +#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ +#define ELIBEXEC 83 /* Cannot exec a shared library directly */ +#define EILSEQ 84 /* Illegal byte sequence */ +#define ERESTART 85 /* Interrupted system call should be restarted */ +#define ESTRPIPE 86 /* Streams pipe error */ +#define EUSERS 87 /* Too many users */ +#define ENOTSOCK 88 /* Socket operation on non-socket */ +#define EDESTADDRREQ 89 /* Destination address required */ +#define EMSGSIZE 90 /* Message too long */ +#define EPROTOTYPE 91 /* Protocol wrong type for socket */ +#define ENOPROTOOPT 92 /* Protocol not available */ +#define EPROTONOSUPPORT 93 /* Protocol not supported */ +#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ +#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ +#define EPFNOSUPPORT 96 /* Protocol family not supported */ +#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ +#define EADDRINUSE 98 /* Address already in use */ +#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ +#define ENETDOWN 100 /* Network is down */ +#define ENETUNREACH 101 /* Network is unreachable */ +#define ENETRESET 102 /* Network dropped connection because of reset */ +#define ECONNABORTED 103 /* Software caused connection abort */ +#define ECONNRESET 104 /* Connection reset by peer */ +#define ENOBUFS 105 /* No buffer space available */ +#define EISCONN 106 /* Transport endpoint is already connected */ +#define ENOTCONN 107 /* Transport endpoint is not connected */ +#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ +#define ETOOMANYREFS 109 /* Too many references: cannot splice */ +#define ETIMEDOUT 110 /* Connection timed out */ +#define ECONNREFUSED 111 /* Connection refused */ +#define EHOSTDOWN 112 /* Host is down */ +#define EHOSTUNREACH 113 /* No route to host */ +#define EALREADY 114 /* Operation already in progress */ +#define EINPROGRESS 115 /* Operation now in progress */ +#define ESTALE 116 /* Stale NFS file handle */ +#define EUCLEAN 117 /* Structure needs cleaning */ +#define ENOTNAM 118 /* Not a XENIX named type file */ +#define ENAVAIL 119 /* No XENIX semaphores available */ +#define EISNAM 120 /* Is a named type file */ +#define EREMOTEIO 121 /* Remote I/O error */ +#define EDQUOT 122 /* Quota exceeded */ + +#define ENOMEDIUM 123 /* No medium found */ +#define EMEDIUMTYPE 124 /* Wrong medium type */ + +#ifndef errno + extern int errno; +#endif + +#ifndef err_t +typedef int err_t; +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _UBIXOS_ERRNO*/ diff --git a/include/ubixos/exec.h b/include/ubixos/exec.h new file mode 100644 index 0000000..3731eaf --- /dev/null +++ b/include/ubixos/exec.h @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_EXEC_H +#define _UBIXOS_EXEC_H + +#include +#include + +uint32_t execThread(void (*tproc)(void), uint32_t, char *); +void execFile(char *file, char **argv, char **envp, int console); + +int sys_exec(struct thread *, char *, char **, char **); + +#endif /* END _UBIXOS_EXEC_H */ diff --git a/include/ubixos/fork.h b/include/ubixos/fork.h new file mode 100644 index 0000000..ad66125 --- /dev/null +++ b/include/ubixos/fork.h @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_FORK_H +#define _UBIXOS_FORK_H + +#include +#include + +//void sysFork(); +int sysFork(struct thread *, void *); + +#endif /* END _UBIXOS_FORK_H */ diff --git a/include/ubixos/init.h b/include/ubixos/init.h new file mode 100644 index 0000000..2754672 --- /dev/null +++ b/include/ubixos/init.h @@ -0,0 +1,65 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_INIT_H +#define _UBIXOS_INIT_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef int (*intFunctionPTR)(void); + +intFunctionPTR init_tasks[] = { static_constructors, i8259_init, idt_init, vitals_init, sysctl_init, vfs_init, sched_init, pit_init, atkbd_init, time_init, pci_init, devfs_init, tty_init, ufs_init, initHardDisk, initLNC, net_init }; + +//ne2k_init, +//ubixfs_init, +//fdc_init, + +int init_tasksTotal = sizeof(init_tasks) / sizeof(intFunctionPTR); + +#endif /* END _UBIXOS_INIT_H */ diff --git a/include/ubixos/kmod.h b/include/ubixos/kmod.h new file mode 100644 index 0000000..39a3660 --- /dev/null +++ b/include/ubixos/kmod.h @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_KMOD_H +#define _UBIXOS_KMOD_H + +#include + +#define LD_START 0x1000000 + +typedef struct kmod_struct { + struct kmod_struct *next; + struct kmod_struct *prev; + uInt16 id; + uInt16 refs; + uInt32 address; + char name[128]; +} kmod_t; + +uInt32 kmod_load(const char *); +uInt32 kmod_add(const char *, const char *name); + +#endif diff --git a/include/ubixos/kpanic.h b/include/ubixos/kpanic.h new file mode 100644 index 0000000..3adc795 --- /dev/null +++ b/include/ubixos/kpanic.h @@ -0,0 +1,36 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYS_KPANIC_H +#define _SYS_KPANIC_H + +#define K_PANIC(msg) kpanic("Error: (%s), File: %s, Line: %i\n",msg ,__FILE__,__LINE__); + +void kpanic(const char *fmt, ...); + +#endif /* END _SYS_KPANIC_H */ diff --git a/include/ubixos/ld.h b/include/ubixos/ld.h new file mode 100644 index 0000000..2790ec4 --- /dev/null +++ b/include/ubixos/ld.h @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_LD_H +#define _UBIXOS_LD_H + +#include + +#define LD_START 0xAAA00000 //0x1000000 + +uInt32 ldEnable(); + +#endif /* END _UBIXOS_LD_H */ diff --git a/include/ubixos/lists.h b/include/ubixos/lists.h new file mode 100644 index 0000000..f730a52 --- /dev/null +++ b/include/ubixos/lists.h @@ -0,0 +1,69 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#define IN +#define STATUS_FAILURE -1 +#define STATUS_SUCCESS 0 + +typedef struct _item_t Item_t; +typedef struct _list_t List_t; +struct _item_t { + Item_t *Previous; + Item_t *Next; + void *data; +}; + +struct _list_t { + Item_t *First; + Item_t *Last; +}; + +List_t * +InitializeList(); +Item_t * +CreateItem(); +int +InsertItemAtFront( IN List_t * TList, IN Item_t * kItem); +int +InsertItemBetweenItems( IN List_t * TList, IN Item_t * Previous, IN Item_t * Next, IN Item_t * Insert); +int +RemoveItem( IN List_t * TList, IN Item_t * kItem); +int +DestroyItemsInList(IN List_t * ItemList); +int +DestroyItemList(IN List_t * ItemList); +Item_t * +GetFirstItem(IN List_t * kItem); + +Item_t * +GetLastItem(IN List_t * kItem); +List_t * +RemoveItemListBetweenItems( IN Item_t * Previous, IN Item_t * Next); + +void +InsertItemListBetweenItems( IN Item_t * Previous, IN Item_t * Next, IN List_t * Insert); diff --git a/include/ubixos/sched.h b/include/ubixos/sched.h new file mode 100644 index 0000000..3388bec --- /dev/null +++ b/include/ubixos/sched.h @@ -0,0 +1,113 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_SCHED_H +#define _UBIXOS_SCHED_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +#include +#include + +#define NO_GROUP -1 +#define NR_GROUPS 32 + +typedef enum { + PLACEHOLDER = -2, DEAD = -1, NEW = 0, READY = 1, RUNNING = 2, IDLE = 3, FORK = 4, WAIT = 5, UNINTERRUPTIBLE = 6, INTERRUPTIBLE = 7 +} tState; + +struct osInfo { + uInt8 timer; + uInt8 v86Task; + bool v86If; + uInt32 vmStart; + uInt32 stdinSize; + uInt32 controlKeys; + char *stdin; + char cwd[1024]; /* current working dir */ + uint8_t gpf; +}; + +typedef struct taskStruct { + pidType id; + char name[256]; + struct taskStruct *prev; + struct taskStruct *next; + struct tssStruct tss; + struct i387Struct i387; + struct osInfo oInfo; + //fileDescriptor *imageFd; + fileDescriptor_t *files[MAX_OFILES]; + tState state; + uint32_t uid, gid; + uint16_t euid, suid; + uint16_t egid, sgid; + uInt16 usedMath; + tty_term *term; + struct thread td; + struct { + struct inode *pwd; + struct inode *root; + struct inode *exec; + } inodes; + uint32_t counter; + uint16_t groups[NR_GROUPS]; + pidType ppid; + uint32_t pgrp; + uint32_t children; // Hack for WAIT + uint32_t last_exit; // Hack For WAIT + struct taskStruct *parent; +} kTask_t; + +int sched_init(); +int sched_setStatus(pidType, tState); +int sched_deleteTask(pidType); +int sched_addDelTask(kTask_t *); +kTask_t *sched_getDelTask(); +void sched_yield(); +void sched(); + +void schedEndTask(pidType pid); +kTask_t *schedNewTask(); +kTask_t *schedFindTask(uInt32 id); + +extern kTask_t *_current; +extern kTask_t *_usedMath; + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/include/ubixos/sem.h b/include/ubixos/sem.h new file mode 100644 index 0000000..7afd3de --- /dev/null +++ b/include/ubixos/sem.h @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_SEM_H +#define _UBIXOS_SEM_H + +#include +#include +#include + +struct sys_sem { + uint32_t signaled; + ubthread_cond_t cond; + ubthread_mutex_t mutex; +}; + +typedef struct sys_sem sys_sem_t; + +typedef uint32_t semID_t; +struct timespec; + +int sem_close(semID_t id); +int sem_post(semID_t id); +int sem_wait(semID_t id); +int sem_trywait(semID_t id); +int sem_timedwait(semID_t id, const struct timespec *); +int sem_init(sys_sem_t **, uint8_t); +int sem_open(semID_t *id, const char *name, int oflag, mode_t mode, unsigned int value); +int sem_unlink(const char *name); +int sem_getvalue(semID_t id, int *val); +int sem_destroy(sys_sem_t **); + +#endif /* END _UBIXOS_SEM_H */ diff --git a/include/ubixos/smp.h b/include/ubixos/smp.h new file mode 100644 index 0000000..d4a630d --- /dev/null +++ b/include/ubixos/smp.h @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_SMP_H +#define _UBIXOS_SMP_H + +#include + +struct cpuinfo_t { + uInt8 id; + uInt8 ok; // 1=Ok, 0=Bad + uInt8 apic_id, apic_ver; + uInt32 signature; // Family, Model, Stepping + uInt32 feature; + uInt32 max; + char brand[49]; // Brand name + char ident[17]; +}; + +void smpInit(); +void cpuidDetect(); +uInt8 cpuInfo(); +uInt32 getEflags(); +void setEflags(uInt32); +void cpuid(uInt32, uInt32 *); +void apicMagic(); + +#endif diff --git a/include/ubixos/spinlock.h b/include/ubixos/spinlock.h new file mode 100644 index 0000000..2ebfa2a --- /dev/null +++ b/include/ubixos/spinlock.h @@ -0,0 +1,96 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_SPINLOCK_H +#define _UBIXOS_SPINLOCK_H + +#include + +#define LOCKED 1 +#define UNLOCKED 0 +#define SPIN_LOCK_INITIALIZER {NULL, 0} +#define LLOCK_FLAG 1 + +//typedef volatile int spinLock_t; + +struct spinLock { + struct spinLock *next; + uint32_t locked; +}; + +typedef struct spinLock *spinLock_t; + +extern struct spinLock Master; + +void spinLockInit(spinLock_t); +void spinUnlock(spinLock_t); +int spinTryLock(spinLock_t); +void spinLock(spinLock_t); + +void spinLock_scheduler(spinLock_t *); /* Only use this spinlock in the sched. */ + +int spinLockLocked(spinLock_t *); + +/* Atomic exchange (of various sizes) */ +static inline u_long xchg_64(volatile uint32_t *ptr, u_long x) { + __asm__ __volatile__("xchgq %1,%0" + :"+r" (x), + "+m" (*ptr)); + + return x; +} + +static inline unsigned xchg_32(volatile uint32_t *ptr, uint32_t x) { + __asm__ __volatile__("xchgl %1,%0" + :"+r" (x), + "+m" (*ptr)); + + return x; +} + +static inline unsigned short xchg_16(volatile uint32_t *ptr, uint16_t x) { + __asm__ __volatile__("xchgw %1,%0" + :"+r" (x), + "+m" (*ptr)); + + return x; +} + +/* Test and set a bit */ +static inline char atomic_bitsetandtest(void *ptr, int x) { + char out; + __asm__ __volatile__("lock; bts %2,%1\n" + "sbb %0,%0\n" + :"=r" (out), "=m" (*(volatile long long *)ptr) + :"Ir" (x) + :"memory"); + + return out; +} + +#endif diff --git a/include/ubixos/static.h b/include/ubixos/static.h new file mode 100644 index 0000000..59986ca --- /dev/null +++ b/include/ubixos/static.h @@ -0,0 +1,34 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_STATIC_H +#define _UBIXOS_STATIC_H + +int static_constructors(void); + +#endif diff --git a/include/ubixos/syscall.h b/include/ubixos/syscall.h new file mode 100644 index 0000000..e824415 --- /dev/null +++ b/include/ubixos/syscall.h @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_SYSCALL_H +#define _UBIXOS_SYSCALL_H + +#include + +void _sys_call(); +void sys_call(struct trapframe *frame); +int invalidCall(); +void invalidCallINT(int); + +#endif diff --git a/include/ubixos/syscall_posix.h b/include/ubixos/syscall_posix.h new file mode 100644 index 0000000..65b2f09 --- /dev/null +++ b/include/ubixos/syscall_posix.h @@ -0,0 +1,37 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_SYSCALL_POSIX_H +#define _UBIXOS_SYSCALL_POSIX_H + +#include + +void _sys_call_posix(); +void sys_call_posix(struct trapframe *frame); + +#endif diff --git a/include/ubixos/syscalls.h b/include/ubixos/syscalls.h new file mode 100644 index 0000000..1336ac6 --- /dev/null +++ b/include/ubixos/syscalls.h @@ -0,0 +1,103 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYSCALLS_H +#define _SYSCALLS_H + +#include +#include +#include + +#define SYSCALLS_MAX 1024 + +#define PSL_C 0x00000001 /* carry bit */ +#define EJUSTRETURN (-2) /* don't modify regs, just return */ +#define ERESTART (-1) /* restart syscall */ + +#define ARG_COUNT(name) (sizeof(struct name) / sizeof(register_t)) + +#define SYSCALL_INVALID 0 +#define SYSCALL_VALID 1 +#define SYSCALL_DUMMY 2 +#define SYSCALL_NOTIMP 3 + +typedef int sys_call_t(struct thread *, void *); + +struct syscall_entry { + int sc_args; + char *sc_name; + sys_call_t *sc_entry; + int sc_status; +}; + +/* + * + * Old Style Calls Need Updates + * + */ +int sysAuth(); +int sysPasswd(); +int sysAddModule(); +int sysRmModule(); +int sysGetpid(); +int sysExit(); +int sysExec(); + +int sysCheckPid(); +int sysGetFreePage(); + +int sysFgetc(); +int sysFopen(); +int sysFclose(); +int sysFseek(); +int sysMkDir(); +int sysRmDir(); + +//int sysSDE(); +int sysGetDrives(); +int sysGetCwd(); +int sysChDir(); +int sysGetUptime(); +int sysGetTime(); +int sysStartSDE(); +int sysUnlink(); +int sysMpiCreateMbox(); +int sysMpiDestroyMbox(); +int sysMpiPostMessage(); +int sysMpiFetchMessage(); +int sysMpiSpam(); + +typedef int (*functionPTR)(); + +extern int totalCalls; +extern struct syscall_entry systemCalls[]; + +extern int totalCalls_posix; +extern struct syscall_entry systemCalls_posix[]; + +#endif diff --git a/include/ubixos/syscalls_new.h b/include/ubixos/syscalls_new.h new file mode 100644 index 0000000..706484e --- /dev/null +++ b/include/ubixos/syscalls_new.h @@ -0,0 +1,531 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYSCALLS_NEW_H +#define _SYSCALLS_NEW_H + +#include + +int sysExit(); +int read(); +int getpid(); +int fcntl(); +int issetugid(); +int __sysctl(); +int pipe(); +int readlink(); +int getuid(); +int getgid(); +int close(); +int mmap(); +int obreak(); +int sigaction(); +int getdtablesize(); +int munmap(); +int sigprocmask(); +int gettimeofday_new(); +int fstat(); +int ioctl(); + +#define invalid_call 0x0 +#define PSL_C 0x00000001 /* carry bit */ +#define EJUSTRETURN (-2) /* don't modify regs, just return */ +#define ERESTART (-1) /* restart syscall */ + +typedef int (*functionPTR)(); + +/*! + * \brief Mast System Call List + */ +functionPTR systemCalls_new[] = { +invalid_call, /** 0 **/ +sysExit, /** 1 **/ +invalid_call, /** 2 **/ +read, /** 3 **/ +sys_write, /** 4 **/ +sys_open, /** 5 **/ +close, /** 6 **/ +invalid_call, /** 7 **/ +invalid_call, /** 8 **/ +invalid_call, /** 9 **/ +invalid_call, /** 10 **/ +invalid_call, /** 11 **/ +invalid_call, /** 12 **/ +invalid_call, /** 13 **/ +invalid_call, /** 14 **/ +invalid_call, /** 15 **/ +invalid_call, /** 16 **/ +obreak, /** 17 **/ +invalid_call, /** 18 **/ +invalid_call, /** 19 **/ +getpid, /** 20 **/ +invalid_call, /** 21 **/ +invalid_call, /** 22 **/ +invalid_call, /** 23 **/ +getuid, /** 24 **/ +invalid_call, /** 25 **/ +invalid_call, /** 26 **/ +invalid_call, /** 27 **/ +invalid_call, /** 28 **/ +invalid_call, /** 29 **/ +invalid_call, /** 30 **/ +invalid_call, /** 31 **/ +invalid_call, /** 32 **/ +access, /** 33 **/ +invalid_call, /** 34 **/ +invalid_call, /** 35 **/ +invalid_call, /** 36 **/ +invalid_call, /** 37 **/ +invalid_call, /** 38 **/ +invalid_call, /** 39 **/ +invalid_call, /** 40 **/ +invalid_call, /** 41 **/ +pipe, /** 42 **/ +invalid_call, /** 43 **/ +invalid_call, /** 44 **/ +invalid_call, /** 45 **/ +invalid_call, /** 46 **/ +getgid, /** 47 **/ +invalid_call, /** 48 **/ +invalid_call, /** 49 **/ +invalid_call, /** 50 **/ +invalid_call, /** 51 **/ +invalid_call, /** 52 **/ +invalid_call, /** 53 **/ +ioctl, /** 54 **/ +invalid_call, /** 55 **/ +invalid_call, /** 56 **/ +invalid_call, /** 57 **/ +readlink, /** 58 **/ +invalid_call, /** 59 **/ +invalid_call, /** 60 **/ +invalid_call, /** 61 **/ +invalid_call, /** 62 **/ +invalid_call, /** 63 **/ +invalid_call, /** 64 **/ +invalid_call, /** 65 **/ +invalid_call, /** 66 **/ +invalid_call, /** 67 **/ +invalid_call, /** 68 **/ +invalid_call, /** 69 **/ +invalid_call, /** 70 **/ +invalid_call, /** 71 **/ +invalid_call, /** 72 **/ +munmap, /** 73 **/ +mprotect, /** 74 **/ +invalid_call, /** 75 **/ +invalid_call, /** 76 **/ +invalid_call, /** 77 **/ +invalid_call, /** 78 **/ +invalid_call, /** 79 **/ +invalid_call, /** 80 **/ +invalid_call, /** 81 **/ +invalid_call, /** 82 **/ +setitimer, /** 83 **/ +invalid_call, /** 84 **/ +invalid_call, /** 85 **/ +invalid_call, /** 86 **/ +invalid_call, /** 87 **/ +invalid_call, /** 88 **/ +getdtablesize, /** 89 **/ +invalid_call, /** 90 **/ +invalid_call, /** 91 **/ +fcntl, /** 92 **/ +invalid_call, /** 93 **/ +invalid_call, /** 94 **/ +invalid_call, /** 95 **/ +invalid_call, /** 96 **/ +invalid_call, /** 97 **/ +invalid_call, /** 98 **/ +invalid_call, /** 99 **/ +invalid_call, /** 100 **/ +invalid_call, /** 101 **/ +invalid_call, /** 102 **/ +invalid_call, /** 103 **/ +invalid_call, /** 104 **/ +invalid_call, /** 105 **/ +invalid_call, /** 106 **/ +invalid_call, /** 107 **/ +invalid_call, /** 108 **/ +invalid_call, /** 109 **/ +invalid_call, /** 110 **/ +invalid_call, /** 111 **/ +invalid_call, /** 112 **/ +invalid_call, /** 113 **/ +invalid_call, /** 114 **/ +invalid_call, /** 115 **/ +gettimeofday_new, /** 116 **/ +invalid_call, /** 117 **/ +invalid_call, /** 118 **/ +invalid_call, /** 119 **/ +invalid_call, /** 120 **/ +invalid_call, /** 121 **/ +invalid_call, /** 122 **/ +invalid_call, /** 123 **/ +invalid_call, /** 124 **/ +invalid_call, /** 125 **/ +invalid_call, /** 126 **/ +invalid_call, /** 127 **/ +invalid_call, /** 128 **/ +invalid_call, /** 129 **/ +invalid_call, /** 130 **/ +invalid_call, /** 131 **/ +invalid_call, /** 132 **/ +invalid_call, /** 133 **/ +invalid_call, /** 134 **/ +invalid_call, /** 135 **/ +invalid_call, /** 136 **/ +invalid_call, /** 137 **/ +invalid_call, /** 138 **/ +invalid_call, /** 139 **/ +invalid_call, /** 140 **/ +invalid_call, /** 141 **/ +invalid_call, /** 142 **/ +invalid_call, /** 143 **/ +invalid_call, /** 144 **/ +invalid_call, /** 145 **/ +invalid_call, /** 146 **/ +invalid_call, /** 147 **/ +invalid_call, /** 148 **/ +invalid_call, /** 149 **/ +invalid_call, /** 150 **/ +invalid_call, /** 151 **/ +invalid_call, /** 152 **/ +invalid_call, /** 153 **/ +invalid_call, /** 154 **/ +invalid_call, /** 155 **/ +invalid_call, /** 156 **/ +invalid_call, /** 157 **/ +invalid_call, /** 158 **/ +invalid_call, /** 159 **/ +invalid_call, /** 160 **/ +invalid_call, /** 161 **/ +invalid_call, /** 162 **/ +invalid_call, /** 163 **/ +invalid_call, /** 164 **/ +invalid_call, /** 165 **/ +invalid_call, /** 166 **/ +invalid_call, /** 167 **/ +invalid_call, /** 168 **/ +invalid_call, /** 169 **/ +invalid_call, /** 170 **/ +invalid_call, /** 171 **/ +invalid_call, /** 172 **/ +invalid_call, /** 173 **/ +invalid_call, /** 174 **/ +invalid_call, /** 175 **/ +invalid_call, /** 176 **/ +invalid_call, /** 177 **/ +invalid_call, /** 178 **/ +invalid_call, /** 179 **/ +invalid_call, /** 180 **/ +invalid_call, /** 181 **/ +invalid_call, /** 182 **/ +invalid_call, /** 183 **/ +invalid_call, /** 184 **/ +invalid_call, /** 185 **/ +invalid_call, /** 186 **/ +invalid_call, /** 187 **/ +invalid_call, /** 188 **/ +fstat, /** 189 **/ +invalid_call, /** 190 **/ +invalid_call, /** 191 **/ +invalid_call, /** 192 **/ +invalid_call, /** 193 **/ +invalid_call, /** 194 **/ +invalid_call, /** 195 **/ +invalid_call, /** 196 **/ +mmap, /** 197 **/ +invalid_call, /** 198 **/ +invalid_call, /** 199 **/ +invalid_call, /** 200 **/ +invalid_call, /** 201 **/ +__sysctl, /** 202 **/ +invalid_call, /** 203 **/ +invalid_call, /** 204 **/ +invalid_call, /** 205 **/ +invalid_call, /** 206 **/ +invalid_call, /** 207 **/ +invalid_call, /** 208 **/ +invalid_call, /** 209 **/ +invalid_call, /** 210 **/ +invalid_call, /** 211 **/ +invalid_call, /** 212 **/ +invalid_call, /** 213 **/ +invalid_call, /** 214 **/ +invalid_call, /** 215 **/ +invalid_call, /** 216 **/ +invalid_call, /** 217 **/ +invalid_call, /** 218 **/ +invalid_call, /** 219 **/ +invalid_call, /** 220 **/ +invalid_call, /** 221 **/ +invalid_call, /** 222 **/ +invalid_call, /** 223 **/ +invalid_call, /** 224 **/ +invalid_call, /** 225 **/ +invalid_call, /** 226 **/ +invalid_call, /** 227 **/ +invalid_call, /** 228 **/ +invalid_call, /** 229 **/ +invalid_call, /** 230 **/ +invalid_call, /** 231 **/ +invalid_call, /** 232 **/ +invalid_call, /** 233 **/ +invalid_call, /** 234 **/ +invalid_call, /** 235 **/ +invalid_call, /** 236 **/ +invalid_call, /** 237 **/ +invalid_call, /** 238 **/ +invalid_call, /** 239 **/ +invalid_call, /** 240 **/ +invalid_call, /** 241 **/ +invalid_call, /** 242 **/ +invalid_call, /** 243 **/ +invalid_call, /** 244 **/ +invalid_call, /** 245 **/ +invalid_call, /** 246 **/ +invalid_call, /** 247 **/ +invalid_call, /** 248 **/ +invalid_call, /** 249 **/ +invalid_call, /** 250 **/ +invalid_call, /** 251 **/ +invalid_call, /** 252 **/ +issetugid, /** 253 **/ +invalid_call, /** 254 **/ +invalid_call, /** 255 **/ +invalid_call, /** 256 **/ +invalid_call, /** 257 **/ +invalid_call, /** 258 **/ +invalid_call, /** 259 **/ +invalid_call, /** 260 **/ +invalid_call, /** 261 **/ +invalid_call, /** 262 **/ +invalid_call, /** 263 **/ +invalid_call, /** 264 **/ +invalid_call, /** 265 **/ +invalid_call, /** 266 **/ +invalid_call, /** 267 **/ +invalid_call, /** 268 **/ +invalid_call, /** 269 **/ +invalid_call, /** 270 **/ +invalid_call, /** 271 **/ +invalid_call, /** 272 **/ +invalid_call, /** 273 **/ +invalid_call, /** 274 **/ +invalid_call, /** 275 **/ +invalid_call, /** 276 **/ +invalid_call, /** 277 **/ +invalid_call, /** 278 **/ +invalid_call, /** 279 **/ +invalid_call, /** 280 **/ +invalid_call, /** 281 **/ +invalid_call, /** 282 **/ +invalid_call, /** 283 **/ +invalid_call, /** 284 **/ +invalid_call, /** 285 **/ +invalid_call, /** 286 **/ +invalid_call, /** 287 **/ +invalid_call, /** 288 **/ +invalid_call, /** 289 **/ +invalid_call, /** 290 **/ +invalid_call, /** 291 **/ +invalid_call, /** 292 **/ +invalid_call, /** 293 **/ +invalid_call, /** 294 **/ +invalid_call, /** 295 **/ +invalid_call, /** 296 **/ +invalid_call, /** 297 **/ +invalid_call, /** 298 **/ +invalid_call, /** 299 **/ +invalid_call, /** 300 **/ +invalid_call, /** 301 **/ +invalid_call, /** 302 **/ +invalid_call, /** 303 **/ +invalid_call, /** 304 **/ +invalid_call, /** 305 **/ +invalid_call, /** 306 **/ +invalid_call, /** 307 **/ +invalid_call, /** 308 **/ +invalid_call, /** 309 **/ +invalid_call, /** 310 **/ +invalid_call, /** 311 **/ +invalid_call, /** 312 **/ +invalid_call, /** 313 **/ +invalid_call, /** 314 **/ +invalid_call, /** 315 **/ +invalid_call, /** 316 **/ +invalid_call, /** 317 **/ +invalid_call, /** 318 **/ +invalid_call, /** 319 **/ +invalid_call, /** 320 **/ +invalid_call, /** 321 **/ +invalid_call, /** 322 **/ +invalid_call, /** 323 **/ +invalid_call, /** 324 **/ +invalid_call, /** 325 **/ +invalid_call, /** 326 **/ +invalid_call, /** 327 **/ +invalid_call, /** 328 **/ +invalid_call, /** 329 **/ +invalid_call, /** 330 **/ +invalid_call, /** 331 **/ +invalid_call, /** 332 **/ +invalid_call, /** 333 **/ +invalid_call, /** 334 **/ +invalid_call, /** 335 **/ +invalid_call, /** 336 **/ +invalid_call, /** 337 **/ +invalid_call, /** 338 **/ +invalid_call, /** 339 **/ +sigprocmask, /** 340 **/ +invalid_call, /** 341 **/ +invalid_call, /** 342 **/ +invalid_call, /** 343 **/ +invalid_call, /** 344 **/ +invalid_call, /** 345 **/ +invalid_call, /** 346 **/ +invalid_call, /** 347 **/ +invalid_call, /** 348 **/ +invalid_call, /** 349 **/ +invalid_call, /** 350 **/ +invalid_call, /** 351 **/ +invalid_call, /** 352 **/ +invalid_call, /** 353 **/ +invalid_call, /** 354 **/ +invalid_call, /** 355 **/ +invalid_call, /** 356 **/ +invalid_call, /** 357 **/ +invalid_call, /** 358 **/ +invalid_call, /** 359 **/ +invalid_call, /** 360 **/ +invalid_call, /** 361 **/ +invalid_call, /** 362 **/ +invalid_call, /** 363 **/ +invalid_call, /** 364 **/ +invalid_call, /** 365 **/ +invalid_call, /** 366 **/ +invalid_call, /** 367 **/ +invalid_call, /** 368 **/ +invalid_call, /** 369 **/ +invalid_call, /** 370 **/ +invalid_call, /** 371 **/ +invalid_call, /** 372 **/ +invalid_call, /** 373 **/ +invalid_call, /** 374 **/ +invalid_call, /** 375 **/ +invalid_call, /** 376 **/ +invalid_call, /** 377 **/ +invalid_call, /** 378 **/ +invalid_call, /** 379 **/ +invalid_call, /** 380 **/ +invalid_call, /** 381 **/ +invalid_call, /** 382 **/ +invalid_call, /** 383 **/ +invalid_call, /** 384 **/ +invalid_call, /** 385 **/ +invalid_call, /** 386 **/ +invalid_call, /** 387 **/ +invalid_call, /** 388 **/ +invalid_call, /** 389 **/ +invalid_call, /** 390 **/ +invalid_call, /** 391 **/ +invalid_call, /** 392 **/ +invalid_call, /** 393 **/ +invalid_call, /** 394 **/ +invalid_call, /** 395 **/ +invalid_call, /** 396 **/ +fstatfs, /** 397 **/ +invalid_call, /** 398 **/ +invalid_call, /** 399 **/ +invalid_call, /** 400 **/ +invalid_call, /** 401 **/ +invalid_call, /** 402 **/ +invalid_call, /** 403 **/ +invalid_call, /** 404 **/ +invalid_call, /** 405 **/ +invalid_call, /** 406 **/ +invalid_call, /** 407 **/ +invalid_call, /** 408 **/ +invalid_call, /** 409 **/ +invalid_call, /** 410 **/ +invalid_call, /** 411 **/ +invalid_call, /** 412 **/ +invalid_call, /** 413 **/ +invalid_call, /** 414 **/ +invalid_call, /** 415 **/ +sigaction, /** 416 **/ +invalid_call, /** 417 **/ +invalid_call, /** 418 **/ +invalid_call, /** 419 **/ +invalid_call, /** 420 **/ +invalid_call, /** 421 **/ +invalid_call, /** 422 **/ +invalid_call, /** 423 **/ +invalid_call, /** 424 **/ +invalid_call, /** 425 **/ +invalid_call, /** 426 **/ +invalid_call, /** 427 **/ +invalid_call, /** 428 **/ +invalid_call, /** 429 **/ +invalid_call, /** 430 **/ +invalid_call, /** 431 **/ +invalid_call, /** 432 **/ +invalid_call, /** 433 **/ +invalid_call, /** 434 **/ +invalid_call, /** 435 **/ +invalid_call, /** 436 **/ +invalid_call, /** 437 **/ +invalid_call, /** 438 **/ +invalid_call, /** 439 **/ +invalid_call, /** 440 **/ +invalid_call, /** 441 **/ +invalid_call, /** 442 **/ +invalid_call, /** 443 **/ +invalid_call, /** 444 **/ +invalid_call, /** 445 **/ +invalid_call, /** 446 **/ +invalid_call, /** 447 **/ +invalid_call, /** 448 **/ +invalid_call, /** 449 **/ +invalid_call, /** 450 **/ +invalid_call, /** 451 **/ +invalid_call, /** 452 **/ +invalid_call, /** 453 **/ +invalid_call, /** 454 **/ +invalid_call, /** 455 **/ +}; + +int totalCalls_new = sizeof(systemCalls_new) / sizeof(functionPTR); + +#endif + +/*** + END + ***/ + diff --git a/include/ubixos/systemtask.h b/include/ubixos/systemtask.h new file mode 100644 index 0000000..22589b1 --- /dev/null +++ b/include/ubixos/systemtask.h @@ -0,0 +1,60 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYSTEMTASK_H +#define _SYSTEMTASK_H + +#include + +void systemTask(); + +#endif + +/*** + $Log: systemtask.h,v $ + Revision 1.1.1.1 2006/06/01 12:46:14 reddawg + ubix2 + + Revision 1.2 2005/10/12 00:13:37 reddawg + Removed + + Revision 1.1.1.1 2005/09/26 17:23:56 reddawg + no message + + Revision 1.2 2004/06/04 17:49:32 reddawg + Wont work with out the makefile updated + + Revision 1.1 2004/06/04 17:33:33 reddawg + Changed idle task to system task + + Revision 1.2 2004/05/21 15:20:00 reddawg + Cleaned up + + + END + ***/ diff --git a/include/ubixos/time.h b/include/ubixos/time.h new file mode 100644 index 0000000..d9ab30d --- /dev/null +++ b/include/ubixos/time.h @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_TIME_H +#define _UBIXOS_TIME_H + +#include +#include +#include + +typedef long suseconds_t; + +#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) + +#define MINUTE 60 +#define HOUR (60*MINUTE) +#define DAY (24*HOUR) +#define YEAR (365*DAY) + + +struct timeStruct { + int sec; + int min; + int hour; + int day; + int mon; + int year; +}; + +struct timezone { + int tz_minuteswest; /* minutes west of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; + +int gettimeofday(struct timeval *tp, struct timezone *tzp); + +int time_init(); +uInt32 timeMake(struct timeStruct *time); + +#endif + +/*** + $Log: time.h,v $ + Revision 1.1.1.1 2006/06/01 12:46:14 reddawg + ubix2 + + Revision 1.2 2005/10/12 00:13:37 reddawg + Removed + + Revision 1.1.1.1 2005/09/26 17:23:56 reddawg + no message + + Revision 1.4 2004/07/09 13:37:30 reddawg + time: timeInit to time_init + Adjusted initialization routines + + Revision 1.3 2004/06/29 11:41:44 reddawg + Fixed some global variables + + Revision 1.2 2004/05/21 15:20:00 reddawg + Cleaned up + + END + ***/ diff --git a/include/ubixos/times.h b/include/ubixos/times.h new file mode 100644 index 0000000..eb575b1 --- /dev/null +++ b/include/ubixos/times.h @@ -0,0 +1,64 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _TIMES_H +#define _TIMES_H + +#include + +#ifndef _CLOCK_T_DECLARED +typedef __clock_t clock_t; +#define _CLOCK_T_DECLARED +#endif + +struct tms { + clock_t tms_utime; /* User CPU time */ + clock_t tms_stime; /* System CPU time */ + clock_t tms_cutime; /* User CPU time of terminated child procs */ + clock_t tms_cstime; /* System CPU time of terminated child procs */ +}; + +#endif + +/*** + $Log: times.h,v $ + Revision 1.1.1.1 2006/06/01 12:46:14 reddawg + ubix2 + + Revision 1.2 2005/10/12 00:13:37 reddawg + Removed + + Revision 1.1.1.1 2005/09/26 17:23:57 reddawg + no message + + Revision 1.2 2004/05/21 15:20:00 reddawg + Cleaned up + + + END + ***/ diff --git a/include/ubixos/tty.h b/include/ubixos/tty.h new file mode 100644 index 0000000..4389db6 --- /dev/null +++ b/include/ubixos/tty.h @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_TTY_H +#define _UBIXOS_TTY_H + +#include + +#define TTY_MAX_TERMS 5 + +typedef struct tty_termNode { + char *tty_buffer; + char *tty_pointer; + uint8_t tty_colour; + uint16_t tty_x; + uint16_t tty_y; + pidType owner; + char stdin[512]; + int stdinSize; +} tty_term; + +int tty_init(); +int tty_change(uInt16); +tty_term *tty_find(uInt16); +int tty_print(char *, tty_term *); + +extern tty_term *tty_foreground; + +#endif diff --git a/include/ubixos/ubthread.h b/include/ubixos/ubthread.h new file mode 100644 index 0000000..26a07f4 --- /dev/null +++ b/include/ubixos/ubthread.h @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBTHREAD_H +#define _UBTHREAD_H + +#include +#include +#include + +#define LOCKED 1 +#define UNLOCKED 0 + +typedef struct ubthread *ubthread_t; +typedef struct ubthread_cond *ubthread_cond_t; +typedef struct ubthread_mutex *ubthread_mutex_t; + +struct ubthread { + struct taskStruct *task; +}; + +struct ubthread_cond { + int id; + bool lock; +}; + +struct ubthread_mutex { + int id; + bool lock; + pidType pid; +}; + +struct ubthread_list { + struct ubthread_list *next; + ubthread_t thread; +}; + +struct ubthread_cond_list { + struct ubthread_cond_list *next; + ubthread_cond_t *cond; +}; + +struct ubthread_mutex_list { + struct ubthread_mutex_list *next; + ubthread_mutex_t *mutex; +}; + +struct taskStruct *ubthread_self(); +int ubthread_cond_init(ubthread_cond_t *cond, const uInt32 attr); +int ubthread_mutex_init(ubthread_mutex_t *mutex, const uInt32 attr); +int ubthread_cond_destroy(ubthread_cond_t *cond); +int ubthread_mutex_destroy(ubthread_mutex_t *mutex); +int ubthread_create(struct taskStruct **thread, const uInt32 *attr, void (*tproc)(void), void *arg); +int ubthread_mutex_lock(ubthread_mutex_t *mutex); +int ubthread_mutex_unlock(ubthread_mutex_t *mutex); +int ubthread_cond_timedwait(ubthread_cond_t *cond, ubthread_mutex_t *mutex, const struct timespec *abstime); +int ubthread_cond_wait(ubthread_cond_t *cond, ubthread_mutex_t *mutex); +int ubthread_cond_signal(ubthread_cond_t *cond); +int ubthread_cond_broadcast(ubthread_cond_t *cond); + +#endif diff --git a/include/ubixos/uthread.h b/include/ubixos/uthread.h new file mode 100644 index 0000000..ac8b160 --- /dev/null +++ b/include/ubixos/uthread.h @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_UTHREAD_H +#define _UBIXOS_UTHREAD_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + struct uthread { + struct uthread *uthread_pointer; + size_t uthread_size; + unsigned long uthread_flags; + void *tls_master_mmap; + size_t tls_master_size; + size_t tls_master_align; + void *tls_mmap; + size_t stack_size; + void *arg_mmap; + size_t arg_size; + size_t __uthread_reserved[4]; + }; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/ubixos/vitals.h b/include/ubixos/vitals.h new file mode 100644 index 0000000..8c81915 --- /dev/null +++ b/include/ubixos/vitals.h @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_VITALS_H +#define _UBIXOS_VITALS_H + +#include +#include +#include + +typedef struct vitalsStruct { + uint32_t sysTicks; // 0 - Do Not Change Order + uint32_t sysUptime; // 4 - Do Not Change Order + uint32_t quantum; // 8 - Do Not Change Order + uint32_t dQuantum; // 12 - Do Not Change Order + uint32_t openFiles; + uint32_t lastFD; + uint32_t freePages; + struct fileSystem *fileSystems; + struct vfs_mountPoint *mountPoints; + uint32_t timeStart; + void *screen; + void *font; + char *packet; + uint32_t packetLength; +} vitalsNode; + +extern vitalsNode *systemVitals; +extern spinLock_t vitals_lock; + +int vitals_init(); + +#endif diff --git a/include/ubixos/wait.h b/include/ubixos/wait.h new file mode 100644 index 0000000..9c9f703 --- /dev/null +++ b/include/ubixos/wait.h @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2002-2018 The UbixOS Project. + * All rights reserved. + * + * This was developed by Christopher W. Olsen for the UbixOS Project. + * + * Redistribution and use in source and binary forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1) Redistributions of source code must retain the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors. + * 2) Redistributions in binary form must reproduce the above copyright notice, this list of + * conditions, the following disclaimer and the list of authors in the documentation and/or + * other materials provided with the distribution. + * 3) Neither the name of the UbixOS Project nor the names of its contributors may be used to + * endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, + * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _UBIXOS_WAIT_H +#define _UBIXOS_WAIT_H + +struct taskStruct; + +struct wait_queue { + struct taskStruct *task; + struct wait_queue *next; +}; + +struct semaphore { + int sount; + struct wait_queue *wait; +}; + +#define sti() __asm__ __volatile__ ("sti": : :"memory") +#define cli() __asm__ __volatile__ ("cli": : :"memory") +#define nop() __asm__ __volatile__ ("nop") + +#define save_flags(x) __asm__ __volatile__("pushfl ; popl %0":"=r" (x): /* no input */ :"memory") + +#define restore_flags(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"r" (x):"memory") + +#endif