diff --git a/bin/shell/commands.c b/bin/shell/commands.c index 6994656..de753b1 100644 --- a/bin/shell/commands.c +++ b/bin/shell/commands.c @@ -39,7 +39,7 @@ int commands(inputBuffer *data) { int cPid = 0x0,i = 0x0,x = 0x0; - char **argv = &data->argv; + char **argv = data->argv; mpi_message_t cmdMsg; @@ -89,13 +89,12 @@ printf("Pid: [%i:%i]\n",cPid,i); execve("clock",0x0,0x0); exit(0x1); - } + } else { printf("Childs Pid: [%i]\n",cPid); - } + } } - sde - } + } else if (memcmp(data->args->arg,"test3", 5) == 0) { for (i=0x0;i<50;i++) { cPid = fork(); @@ -133,9 +132,9 @@ } else if (memcmp(data->args->arg,"msg",3) == 0x0) { printf("Posting Message\n"); - cmdMsg.header = atoi(argv[2]); - sprintf(cmdMsg.data,argv[3]); - mpi_postMessage(argv[1],0x1,&cmdMsg); + cmdMsg.header = atoi(argv[3]); + sprintf(cmdMsg.data,argv[4]); + mpi_postMessage(argv[2],0x1,&cmdMsg); } else if (memcmp(data->args->arg,"mkdir",5) == 0x0) { if (argv[1]) { diff --git a/include_old/stdio.h b/include_old/stdio.h index b2a32cb..d110511 100644 --- a/include_old/stdio.h +++ b/include_old/stdio.h @@ -31,8 +31,8 @@ /* Type Definitions */ typedef struct fileDescriptor { - uLong fd; - uInt32 size; + u_long fd; + uint32_t size; } FILE; /* Definitions */ diff --git a/include_old/stdlib.h b/include_old/stdlib.h index a274727..3448864 100644 --- a/include_old/stdlib.h +++ b/include_old/stdlib.h @@ -30,7 +30,7 @@ #define MB_CUR_MAX __mb_cur_max void exit(int); -void *malloc(uInt len); +void *malloc(u_int len); void free(void *); int abs(int val); int atoi(const char *str); diff --git a/include_old/sys/_types.h b/include_old/sys/_types.h index fd2c06f..2b5f3c5 100644 --- a/include_old/sys/_types.h +++ b/include_old/sys/_types.h @@ -39,6 +39,9 @@ typedef unsigned long long __uint64_t; typedef unsigned long __clock_t; +typedef struct __timer *__timer_t; /* timer_gettime()... */ +typedef __int32_t __clockid_t; /* clock_gettime()... */ +typedef __int64_t __off_t; /* File Offset */ typedef __uint32_t __ino_t; typedef __int32_t __ssize_t;/* stat types */ typedef __uint32_t __dev_t;/* device number */ @@ -92,5 +95,28 @@ __int64_t _mbstateL; /* for alignment */ } __mbstate_t; +typedef int __ct_rune_t; /* arg type for ctype funcs */ +typedef __ct_rune_t __rune_t; /* rune_t (see above) */ +typedef __ct_rune_t __wint_t; /* wint_t (see above) */ + +#ifdef __GNUCLIKE_BUILTIN_VARARGS +typedef __builtin_va_list __va_list; /* internally known to gcc */ +#else +#ifdef __LP64__ +struct __s_va_list { + __uint32_t _pad1[2]; /* gp_offset, fp_offset */ + __uint64_t _pad2[2]; /* overflow_arg_area, reg_save_area */ +}; +typedef struct __s_va_list __va_list; +#else +typedef char * __va_list; +#endif +#endif +#if defined(__GNUC_VA_LIST_COMPATIBILITY) && !defined(__GNUC_VA_LIST) \ + && !defined(__NO_GNUC_VA_LIST) +#define __GNUC_VA_LIST +typedef __va_list __gnuc_va_list; /* compatibility w/GNU headers*/ +#endif + #endif /* END _SYS__TYPES_H */ diff --git a/include_old/sys/mpi.h b/include_old/sys/mpi.h index a924a19..361aae9 100644 --- a/include_old/sys/mpi.h +++ b/include_old/sys/mpi.h @@ -36,7 +36,7 @@ struct mpi_message { char data[MESSAGE_LENGTH]; - uInt32 header; + uint32_t header; struct mpi_message *next; }; @@ -45,9 +45,9 @@ int mpi_createMbox(char *); int mpi_destroyMbox(char *); -int mpi_postMessage(char *,uInt32,mpi_message_t *); +int mpi_postMessage(char *,uint32_t,mpi_message_t *); int mpi_fetchMessage(char *,mpi_message_t *); -int mpi_fpam(uInt32 type,void *); +int mpi_fpam(uint32_t type,void *); #endif diff --git a/include_old/sys/stat.h b/include_old/sys/stat.h index 585ccd3..e34507f 100644 --- a/include_old/sys/stat.h +++ b/include_old/sys/stat.h @@ -125,13 +125,13 @@ #endif /* __BSD_VISIBLE */ struct stat { - __udev_t st_dev; /* inode's device */ + __dev_t st_dev; /* inode's device */ ino_t st_ino; /* inode's number */ mode_t st_mode; /* inode protection mode */ nlink_t st_nlink; /* number of hard links */ uid_t st_uid; /* user ID of the file's owner */ gid_t st_gid; /* group ID of the file's group */ - __udev_t st_rdev; /* device type */ + __dev_t st_rdev; /* device type */ #if __BSD_VISIBLE struct timespec st_atimespec; /* time of last access */ struct timespec st_mtimespec; /* time of last data modification */ @@ -172,13 +172,13 @@ #if __BSD_VISIBLE struct nstat { - __udev_t st_dev; /* inode's device */ + __dev_t st_dev; /* inode's device */ ino_t st_ino; /* inode's number */ __uint32_t st_mode; /* inode protection mode */ __uint32_t st_nlink; /* number of hard links */ uid_t st_uid; /* user ID of the file's owner */ gid_t st_gid; /* group ID of the file's group */ - __udev_t st_rdev; /* device type */ + __dev_t st_rdev; /* device type */ struct timespec st_atimespec; /* time of last access */ struct timespec st_mtimespec; /* time of last data modification */ struct timespec st_ctimespec; /* time of last file status change */ diff --git a/include_old/sys/time.h b/include_old/sys/time.h index 1b15b48..d37c3a4 100644 --- a/include_old/sys/time.h +++ b/include_old/sys/time.h @@ -39,7 +39,6 @@ #include #include -#include struct timezone { int tz_minuteswest; /* minutes west of Greenwich */ @@ -56,13 +55,13 @@ #if __BSD_VISIBLE struct bintime { time_t sec; - uInt64 frac; + uint64_t frac; }; static __inline void -bintime_addx(struct bintime *bt, uInt64 x) +bintime_addx(struct bintime *bt, uint64_t x) { - uInt64 u; + uint64_t u; u = bt->frac; bt->frac += x; @@ -73,7 +72,7 @@ static __inline void bintime_add(struct bintime *bt, const struct bintime *bt2) { - uInt64 u; + uint64_t u; u = bt->frac; bt->frac += bt2->frac; @@ -85,7 +84,7 @@ static __inline void bintime_sub(struct bintime *bt, const struct bintime *bt2) { - uInt64 u; + uint64_t u; u = bt->frac; bt->frac -= bt2->frac; @@ -113,7 +112,7 @@ { ts->tv_sec = bt->sec; - ts->tv_nsec = ((uInt64)1000000000 * (uInt32)(bt->frac >> 32)) >> 32; + ts->tv_nsec = ((uint64_t)1000000000 * (uint32_t)(bt->frac >> 32)) >> 32; } static __inline void @@ -122,7 +121,7 @@ bt->sec = ts->tv_sec; /* 18446744073 = int(2^64 / 1000000000) */ - bt->frac = ts->tv_nsec * (uInt64)18446744073LL; + bt->frac = ts->tv_nsec * (uint64_t)18446744073LL; } static __inline void @@ -130,7 +129,7 @@ { tv->tv_sec = bt->sec; - tv->tv_usec = ((uInt64)1000000 * (uInt32)(bt->frac >> 32)) >> 32; + tv->tv_usec = ((uint64_t)1000000 * (uint32_t)(bt->frac >> 32)) >> 32; } static __inline void @@ -139,7 +138,7 @@ bt->sec = tv->tv_sec; /* 18446744073709 = int(2^64 / 1000000) */ - bt->frac = tv->tv_usec * (uInt64)18446744073709LL; + bt->frac = tv->tv_usec * (uint64_t)18446744073709LL; } #endif /* __BSD_VISIBLE */ diff --git a/include_old/sys/timespec.h b/include_old/sys/timespec.h deleted file mode 100644 index 0cc0212..0000000 --- a/include_old/sys/timespec.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 1982, 1986, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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 and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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. - * - * @(#)time.h 8.5 (Berkeley) 5/4/95 - * from: FreeBSD: src/sys/sys/time.h,v 1.43 2000/03/20 14:09:05 phk Exp - * $FreeBSD: src/sys/sys/timespec.h,v 1.2 2002/08/21 16:20:01 mike Exp $ - */ - -/* - * Prerequisites: , - */ - -#ifndef _SYS_TIMESPEC_H_ -#define _SYS_TIMESPEC_H_ - -#ifndef _TIME_T_DECLARED -typedef __time_t time_t; -#define _TIME_T_DECLARED -#endif - -struct timespec { - time_t tv_sec; /* seconds */ - long tv_nsec; /* and nanoseconds */ -}; - -#if __BSD_VISIBLE -#define TIMEVAL_TO_TIMESPEC(tv, ts) \ - do { \ - (ts)->tv_sec = (tv)->tv_sec; \ - (ts)->tv_nsec = (tv)->tv_usec * 1000; \ - } while (0) -#define TIMESPEC_TO_TIMEVAL(tv, ts) \ - do { \ - (tv)->tv_sec = (ts)->tv_sec; \ - (tv)->tv_usec = (ts)->tv_nsec / 1000; \ - } while (0) - -#endif /* __BSD_VISIBLE */ - -#endif /* _SYS_TIMESPEC_H_ */ diff --git a/include_old/sys/types.h b/include_old/sys/types.h index 0e60064..99abcb8 100644 --- a/include_old/sys/types.h +++ b/include_old/sys/types.h @@ -59,14 +59,6 @@ typedef __int64_t daddr_t; /* disk address */ typedef __uint32_t u_daddr_t; /* unsigned disk address */ -typedef unsigned char uInt8; -typedef unsigned short uInt16; -typedef unsigned int uInt32; -typedef unsigned int uInt; -typedef char Int8; -typedef short Int16; -typedef long Int32; - typedef unsigned char u_char; typedef unsigned short u_short; typedef unsigned int u_int; @@ -75,7 +67,11 @@ typedef int pidType; typedef int pid_t; -typedef int size_t; /* standart */ + +#ifndef _SIZE_T_DECLARED +typedef __size_t size_t; +#define _SIZE_T_DECLARED +#endif #ifndef NOBOOL #ifndef __cplusplus diff --git a/include_old/time.h b/include_old/time.h index 2b05e1b..15c9b08 100644 --- a/include_old/time.h +++ b/include_old/time.h @@ -89,7 +89,6 @@ #define _TIMER_T_DECLARED #endif -#include #endif /* __POSIX_VISIBLE >= 199309 */ struct tm { diff --git a/include_old/unistd.h b/include_old/unistd.h index 931c9c0..97f170d 100644 --- a/include_old/unistd.h +++ b/include_old/unistd.h @@ -52,11 +52,11 @@ /**** END ****/ -uShort getpid(void); +u_short getpid(void); pid_t fork(); //New Functions Added Belong Under Here -char *getcwd(char *buffer,uInt32 size); +char *getcwd(char *buffer,uint32_t size); int setuid(int); int setgid(int); int getuid(void); diff --git a/include_old/wchar.h b/include_old/wchar.h index e286d7a..34d2c87 100644 --- a/include_old/wchar.h +++ b/include_old/wchar.h @@ -84,7 +84,7 @@ #ifndef __cplusplus #ifndef _WCHAR_T_DECLARED -typedef __wchar_t wchar_t; +typedef ___wchar_t wchar_t; #define _WCHAR_T_DECLARED #endif #endif @@ -109,8 +109,7 @@ __BEGIN_DECLS wint_t btowc(int); wint_t fgetwc(struct __sFILE *); -wchar_t * -fgetws(wchar_t * __restrict, int, struct __sFILE * __restrict); +wchar_t *fgetws(wchar_t * __restrict, int, struct __sFILE * __restrict); wint_t fputwc(wchar_t, struct __sFILE *); int fputws(const wchar_t * __restrict, struct __sFILE * __restrict); int fwide(struct __sFILE *, int); @@ -126,14 +125,11 @@ mbstate_t * __restrict); wint_t putwc(wchar_t, struct __sFILE *); wint_t putwchar(wchar_t); -int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, -...); +int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, ...); int swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...); wint_t ungetwc(wint_t, struct __sFILE *); -int vfwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, -__va_list); -int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, -__va_list); +int vfwprintf(struct __sFILE * __restrict, const wchar_t * __restrict, __va_list); +int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, __va_list); int vwprintf(const wchar_t * __restrict, __va_list); size_t wcrtomb(char * __restrict, wchar_t, mbstate_t * __restrict); wchar_t *wcscat(wchar_t * __restrict, const wchar_t * __restrict); @@ -142,27 +138,22 @@ int wcscoll(const wchar_t *, const wchar_t *); wchar_t *wcscpy(wchar_t * __restrict, const wchar_t * __restrict); size_t wcscspn(const wchar_t *, const wchar_t *); -size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict, -const struct tm * __restrict); +size_t wcsftime(wchar_t * __restrict, size_t, const wchar_t * __restrict, const struct tm * __restrict); size_t wcslen(const wchar_t *); -wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, -size_t); +wchar_t *wcsncat(wchar_t * __restrict, const wchar_t * __restrict, size_t); int wcsncmp(const wchar_t *, const wchar_t *, size_t); wchar_t *wcsncpy(wchar_t * __restrict , const wchar_t * __restrict, size_t); wchar_t *wcspbrk(const wchar_t *, const wchar_t *); wchar_t *wcsrchr(const wchar_t *, wchar_t); -size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t, -mbstate_t * __restrict); +size_t wcsrtombs(char * __restrict, const wchar_t ** __restrict, size_t, mbstate_t * __restrict); size_t wcsspn(const wchar_t *, const wchar_t *); wchar_t *wcsstr(const wchar_t * __restrict, const wchar_t * __restrict); size_t wcsxfrm(wchar_t * __restrict, const wchar_t * __restrict, size_t); int wctob(wint_t); double wcstod(const wchar_t * __restrict, wchar_t ** __restrict); -wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict, -wchar_t ** __restrict); +wchar_t *wcstok(wchar_t * __restrict, const wchar_t * __restrict, wchar_t ** __restrict); long wcstol(const wchar_t * __restrict, wchar_t ** __restrict, int); -unsigned long -wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int); +unsigned long wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int); wchar_t *wmemchr(const wchar_t *, wchar_t, size_t); int wmemcmp(const wchar_t *, const wchar_t *, size_t); wchar_t *wmemcpy(wchar_t * __restrict, const wchar_t * __restrict, size_t); @@ -172,21 +163,16 @@ int wscanf(const wchar_t * __restrict, ...); #if __ISO_C_VISIBLE >= 1999 - int vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, - __va_list); - int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict, - __va_list); + int vfwscanf(struct __sFILE * __restrict, const wchar_t * __restrict, __va_list); + int vswscanf(const wchar_t * __restrict, const wchar_t * __restrict, __va_list); int vwscanf(const wchar_t * __restrict, __va_list); float wcstof(const wchar_t * __restrict, wchar_t ** __restrict); - long double - wcstold(const wchar_t * __restrict, wchar_t ** __restrict); + long double wcstold(const wchar_t * __restrict, wchar_t ** __restrict); #ifdef __LONG_LONG_SUPPORTED /* LONGLONG */ - long long - wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int); + long long wcstoll(const wchar_t * __restrict, wchar_t ** __restrict, int); /* LONGLONG */ - unsigned long long - wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int); + unsigned long long wcstoull(const wchar_t * __restrict, wchar_t ** __restrict, int); #endif #endif /* __ISO_C_VISIBLE >= 1999 */ diff --git a/sys/i386/systemtask.c b/sys/i386/systemtask.c index 194da6c..3c581e6 100644 --- a/sys/i386/systemtask.c +++ b/sys/i386/systemtask.c @@ -65,7 +65,7 @@ kprintf("Switching to term: [%i][%i]\n", *x, myMsg.pid); schedFindTask(myMsg.pid)->term = tty_find(*x); break; - case 1000: + case 1000: kprintf("Restarting the system in 5 seconds\n"); counter = systemVitals->sysUptime + 5; while (systemVitals->sysUptime < counter) { @@ -82,7 +82,7 @@ case 0x80: if (!strcmp(myMsg.data, "sdeStart")) { kprintf("Starting SDE\n"); - //execThread(sdeThread,0x2000),0x0); + execThread(sdeThread,0x2000,0x0); } else if (!strcmp(myMsg.data, "freePage")) { kprintf("kkk Free Pages");