BOOK.T
资源名称:os_source.zip [点击查看]
上传用户:datang2001
上传日期:2007-02-01
资源大小:53269k
文件大小:987k
源码类别:
操作系统开发
开发平台:
C/C++
- .fp 5 CW LucidaT ." To use a font other than Lucida, change 'LucidaT'
- .po .9i
- .lg 0
- .nf
- .ec `
- .ps 7
- .vs 9
- .lt 5.25i
- `f5
- .nr Tb `w'0'
- .nr Fp 0
- .ta 9u*`n(Tbu 17u*`n(Tbu 25u*`n(Tbu 33u*`n(Tbu 41u*`n(Tbu 49u*`n(Tbu 57u*`n(Tbu 65u*`n(Tbu 73u*`n(Tbu 81u*`n(Tbu
- .de Op
- .if ``n(Fp>0 .bp
- .nr Fp 1
- .sp 0.75i
- .tl '``fR``s10MINIX SOURCE CODE``s0'``s11File: ``$2``s0``fP'``fB``s12``n%``s0``fP'
- .sp 0.25i
- ..
- .de Ep
- .if ``n(Fp>0 .bp
- .sp 0.75i
- .tl '``fB``s12``n%``s0``fP``fR'``s11File: ``$2'``s0``s10MINIX SOURCE CODE``s0``fP'
- .nr Fp 1
- .sp 0.25i
- ..
- .Op 1 include/ansi.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/ansi.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00000 /* The <ansi.h> header attempts to decide whether the compiler has enough
- 00001 * conformance to Standard C for Minix to take advantage of. If so, the
- 00002 * symbol _ANSI is defined (as 31415). Otherwise _ANSI is not defined
- 00003 * here, but it may be defined by applications that want to bend the rules.
- 00004 * The magic number in the definition is to inhibit unnecessary bending
- 00005 * of the rules. (For consistency with the new '#ifdef _ANSI" tests in
- 00006 * the headers, _ANSI should really be defined as nothing, but that would
- 00007 * break many library routines that use "#if _ANSI".)
- 00008
- 00009 * If _ANSI ends up being defined, a macro
- 00010 *
- 00011 * _PROTOTYPE(function, params)
- 00012 *
- 00013 * is defined. This macro expands in different ways, generating either
- 00014 * ANSI Standard C prototypes or old-style K&R (Kernighan & Ritchie)
- 00015 * prototypes, as needed. Finally, some programs use _CONST, _VOIDSTAR etc
- 00016 * in such a way that they are portable over both ANSI and K&R compilers.
- 00017 * The appropriate macros are defined here.
- 00018 */
- 00019
- 00020 #ifndef _ANSI_H
- 00021 #define _ANSI_H
- 00022
- 00023 #if __STDC__ == 1
- 00024 #define _ANSI 31459 /* compiler claims full ANSI conformance */
- 00025 #endif
- 00026
- 00027 #ifdef __GNUC__
- 00028 #define _ANSI 31459 /* gcc conforms enough even in non-ANSI mode */
- 00029 #endif
- 00030
- 00031 #ifdef _ANSI
- 00032
- 00033 /* Keep everything for ANSI prototypes. */
- 00034 #define _PROTOTYPE(function, params) function params
- 00035 #define _ARGS(params) params
- 00036
- 00037 #define _VOIDSTAR void *
- 00038 #define _VOID void
- 00039 #define _CONST const
- 00040 #define _VOLATILE volatile
- 00041 #define _SIZET size_t
- 00042
- 00043 #else
- 00044
- 00045 /* Throw away the parameters for K&R prototypes. */
- 00046 #define _PROTOTYPE(function, params) function()
- 00047 #define _ARGS(params) ()
- 00048
- 00049 #define _VOIDSTAR void *
- 00050 #define _VOID void
- 00051 #define _CONST
- 00052 #define _VOLATILE
- 00053 #define _SIZET int
- 00054
- .Ep 2 include/ansi.h
- 00055 #endif /* _ANSI */
- 00056
- 00057 #endif /* ANSI_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/limits.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00100 /* The <limits.h> header defines some basic sizes, both of the language types
- 00101 * (e.g., the number of bits in an integer), and of the operating system (e.g.
- 00102 * the number of characters in a file name.
- 00103 */
- 00104
- 00105 #ifndef _LIMITS_H
- 00106 #define _LIMITS_H
- 00107
- 00108 /* Definitions about chars (8 bits in MINIX, and signed). */
- 00109 #define CHAR_BIT 8 /* # bits in a char */
- 00110 #define CHAR_MIN -128 /* minimum value of a char */
- 00111 #define CHAR_MAX 127 /* maximum value of a char */
- 00112 #define SCHAR_MIN -128 /* minimum value of a signed char */
- 00113 #define SCHAR_MAX 127 /* maximum value of a signed char */
- 00114 #define UCHAR_MAX 255 /* maximum value of an unsigned char */
- 00115 #define MB_LEN_MAX 1 /* maximum length of a multibyte char */
- 00116
- 00117 /* Definitions about shorts (16 bits in MINIX). */
- 00118 #define SHRT_MIN (-32767-1) /* minimum value of a short */
- 00119 #define SHRT_MAX 32767 /* maximum value of a short */
- 00120 #define USHRT_MAX 0xFFFF /* maximum value of unsigned short */
- 00121
- 00122 /* _EM_WSIZE is a compiler-generated symbol giving the word size in bytes. */
- 00123 #if _EM_WSIZE == 2
- 00124 #define INT_MIN (-32767-1) /* minimum value of a 16-bit int */
- 00125 #define INT_MAX 32767 /* maximum value of a 16-bit int */
- 00126 #define UINT_MAX 0xFFFF /* maximum value of an unsigned 16-bit int */
- 00127 #endif
- 00128
- 00129 #if _EM_WSIZE == 4
- 00130 #define INT_MIN (-2147483647-1) /* minimum value of a 32-bit int */
- 00131 #define INT_MAX 2147483647 /* maximum value of a 32-bit int */
- 00132 #define UINT_MAX 0xFFFFFFFF /* maximum value of an unsigned 32-bit int */
- 00133 #endif
- 00134
- 00135 /*Definitions about longs (32 bits in MINIX). */
- 00136 #define LONG_MIN (-2147483647L-1)/* minimum value of a long */
- 00137 #define LONG_MAX 2147483647L /* maximum value of a long */
- 00138 #define ULONG_MAX 0xFFFFFFFFL /* maximum value of an unsigned long */
- 00139
- 00140 /* Minimum sizes required by the POSIX P1003.1 standard (Table 2-3). */
- 00141 #ifdef _POSIX_SOURCE /* these are only visible for POSIX */
- 00142 #define _POSIX_ARG_MAX 4096 /* exec() may have 4K worth of args */
- 00143 #define _POSIX_CHILD_MAX 6 /* a process may have 6 children */
- 00144 #define _POSIX_LINK_MAX 8 /* a file may have 8 links */
- 00145 #define _POSIX_MAX_CANON 255 /* size of the canonical input queue */
- 00146 #define _POSIX_MAX_INPUT 255 /* you can type 255 chars ahead */
- 00147 #define _POSIX_NAME_MAX 14 /* a file name may have 14 chars */
- 00148 #define _POSIX_NGROUPS_MAX 0 /* supplementary group IDs are optional */
- 00149 #define _POSIX_OPEN_MAX 16 /* a process may have 16 files open */
- .Op 3 include/limits.h
- 00150 #define _POSIX_PATH_MAX 255 /* a pathname may contain 255 chars */
- 00151 #define _POSIX_PIPE_BUF 512 /* pipes writes of 512 bytes must be atomic */
- 00152 #define _POSIX_STREAM_MAX 8 /* at least 8 FILEs can be open at once */
- 00153 #define _POSIX_TZNAME_MAX 3 /* time zone names can be at least 3 chars */
- 00154 #define _POSIX_SSIZE_MAX 32767 /* read() must support 32767 byte reads */
- 00155
- 00156 /* Values actually implemented by MINIX (Tables 2-4, 2-5, 2-6, and 2-7). */
- 00157 /* Some of these old names had better be defined when not POSIX. */
- 00158 #define _NO_LIMIT 100 /* arbitrary number; limit not enforced */
- 00159
- 00160 #define NGROUPS_MAX 0 /* supplemental group IDs not available */
- 00161 #if _EM_WSIZE > 2
- 00162 #define ARG_MAX 16384 /* # bytes of args + environ for exec() */
- 00163 #else
- 00164 #define ARG_MAX 4096 /* args + environ on small machines */
- 00165 #endif
- 00166 #define CHILD_MAX _NO_LIMIT /* MINIX does not limit children */
- 00167 #define OPEN_MAX 20 /* # open files a process may have */
- 00168 #define LINK_MAX 127 /* # links a file may have */
- 00169 #define MAX_CANON 255 /* size of the canonical input queue */
- 00170 #define MAX_INPUT 255 /* size of the type-ahead buffer */
- 00171 #define NAME_MAX 14 /* # chars in a file name */
- 00172 #define PATH_MAX 255 /* # chars in a path name */
- 00173 #define PIPE_BUF 7168 /* # bytes in atomic write to a pipe */
- 00174 #define STREAM_MAX 20 /* must be the same as FOPEN_MAX in stdio.h */
- 00175 #define TZNAME_MAX 3 /* maximum bytes in a time zone name is 3 */
- 00176 #define SSIZE_MAX 32767 /* max defined byte count for read() */
- 00177
- 00178 #endif /* _POSIX_SOURCE */
- 00179
- 00180 #endif /* _LIMITS_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/errno.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00200 /* The <errno.h> header defines the numbers of the various errors that can
- 00201 * occur during program execution. They are visible to user programs and
- 00202 * should be small positive integers. However, they are also used within
- 00203 * MINIX, where they must be negative. For example, the READ system call is
- 00204 * executed internally by calling do_read(). This function returns either a
- 00205 * (negative) error number or a (positive) number of bytes actually read.
- 00206 *
- 00207 * To solve the problem of having the error numbers be negative inside the
- 00208 * the system and positive outside, the following mechanism is used. All the
- 00209 * definitions are are the form:
- 00210 *
- 00211 * #define EPERM (_SIGN 1)
- 00212 *
- 00213 * If the macro _SYSTEM is defined, then _SIGN is set to "-", otherwise it is
- 00214 * set to "". Thus when compiling the operating system, the macro _SYSTEM
- 00215 * will be defined, setting EPERM to (- 1), whereas when when this
- 00216 * file is included in an ordinary user program, EPERM has the value ( 1).
- 00217 */
- 00218
- 00219 #ifndef _ERRNO_H /* check if <errno.h> is already included */
- .Ep 4 include/errno.h
- 00220 #define _ERRNO_H /* it is not included; note that fact */
- 00221
- 00222 /* Now define _SIGN as "" or "-" depending on _SYSTEM. */
- 00223 #ifdef _SYSTEM
- 00224 # define _SIGN -
- 00225 # define OK 0
- 00226 #else
- 00227 # define _SIGN
- 00228 #endif
- 00229
- 00230 extern int errno; /* place where the error numbers go */
- 00231
- 00232 /* Here are the numerical values of the error numbers. */
- 00233 #define _NERROR 70 /* number of errors */
- 00234
- 00235 #define EGENERIC (_SIGN 99) /* generic error */
- 00236 #define EPERM (_SIGN 1) /* operation not permitted */
- 00237 #define ENOENT (_SIGN 2) /* no such file or directory */
- 00238 #define ESRCH (_SIGN 3) /* no such process */
- 00239 #define EINTR (_SIGN 4) /* interrupted function call */
- 00240 #define EIO (_SIGN 5) /* input/output error */
- 00241 #define ENXIO (_SIGN 6) /* no such device or address */
- 00242 #define E2BIG (_SIGN 7) /* arg list too long */
- 00243 #define ENOEXEC (_SIGN 8) /* exec format error */
- 00244 #define EBADF (_SIGN 9) /* bad file descriptor */
- 00245 #define ECHILD (_SIGN 10) /* no child process */
- 00246 #define EAGAIN (_SIGN 11) /* resource temporarily unavailable */
- 00247 #define ENOMEM (_SIGN 12) /* not enough space */
- 00248 #define EACCES (_SIGN 13) /* permission denied */
- 00249 #define EFAULT (_SIGN 14) /* bad address */
- 00250 #define ENOTBLK (_SIGN 15) /* Extension: not a block special file */
- 00251 #define EBUSY (_SIGN 16) /* resource busy */
- 00252 #define EEXIST (_SIGN 17) /* file exists */
- 00253 #define EXDEV (_SIGN 18) /* improper link */
- 00254 #define ENODEV (_SIGN 19) /* no such device */
- 00255 #define ENOTDIR (_SIGN 20) /* not a directory */
- 00256 #define EISDIR (_SIGN 21) /* is a directory */
- 00257 #define EINVAL (_SIGN 22) /* invalid argument */
- 00258 #define ENFILE (_SIGN 23) /* too many open files in system */
- 00259 #define EMFILE (_SIGN 24) /* too many open files */
- 00260 #define ENOTTY (_SIGN 25) /* inappropriate I/O control operation */
- 00261 #define ETXTBSY (_SIGN 26) /* no longer used */
- 00262 #define EFBIG (_SIGN 27) /* file too large */
- 00263 #define ENOSPC (_SIGN 28) /* no space left on device */
- 00264 #define ESPIPE (_SIGN 29) /* invalid seek */
- 00265 #define EROFS (_SIGN 30) /* read-only file system */
- 00266 #define EMLINK (_SIGN 31) /* too many links */
- 00267 #define EPIPE (_SIGN 32) /* broken pipe */
- 00268 #define EDOM (_SIGN 33) /* domain error (from ANSI C std) */
- 00269 #define ERANGE (_SIGN 34) /* result too large (from ANSI C std) */
- 00270 #define EDEADLK (_SIGN 35) /* resource deadlock avoided */
- 00271 #define ENAMETOOLONG (_SIGN 36) /* file name too long */
- 00272 #define ENOLCK (_SIGN 37) /* no locks available */
- 00273 #define ENOSYS (_SIGN 38) /* function not implemented */
- 00274 #define ENOTEMPTY (_SIGN 39) /* directory not empty */
- 00275
- 00276 /* The following errors relate to networking. */
- 00277 #define EPACKSIZE (_SIGN 50) /* invalid packet size for some protocol */
- 00278 #define EOUTOFBUFS (_SIGN 51) /* not enough buffers left */
- 00279 #define EBADIOCTL (_SIGN 52) /* illegal ioctl for device */
- .Op 5 include/errno.h
- 00280 #define EBADMODE (_SIGN 53) /* badmode in ioctl */
- 00281 #define EWOULDBLOCK (_SIGN 54)
- 00282 #define EBADDEST (_SIGN 55) /* not a valid destination address */
- 00283 #define EDSTNOTRCH (_SIGN 56) /* destination not reachable */
- 00284 #define EISCONN (_SIGN 57) /* all ready connected */
- 00285 #define EADDRINUSE (_SIGN 58) /* address in use */
- 00286 #define ECONNREFUSED (_SIGN 59) /* connection refused */
- 00287 #define ECONNRESET (_SIGN 60) /* connection reset */
- 00288 #define ETIMEDOUT (_SIGN 61) /* connection timed out */
- 00289 #define EURG (_SIGN 62) /* urgent data present */
- 00290 #define ENOURG (_SIGN 63) /* no urgent data present */
- 00291 #define ENOTCONN (_SIGN 64) /* no connection (yet or anymore) */
- 00292 #define ESHUTDOWN (_SIGN 65) /* a write call to a shutdown connection */
- 00293 #define ENOCONN (_SIGN 66) /* no such connection */
- 00294
- 00295 /* The following are not POSIX errors, but they can still happen. */
- 00296 #define ELOCKED (_SIGN 101) /* can't send message */
- 00297 #define EBADCALL (_SIGN 102) /* error on send/receive */
- 00298
- 00299 /* The following error codes are generated by the kernel itself. */
- 00300 #ifdef _SYSTEM
- 00301 #define E_BAD_DEST -1001 /* destination address illegal */
- 00302 #define E_BAD_SRC -1002 /* source address illegal */
- 00303 #define E_TRY_AGAIN -1003 /* can't send-- tables full */
- 00304 #define E_OVERRUN -1004 /* interrupt for task that is not waiting */
- 00305 #define E_BAD_BUF -1005 /* message buf outside caller's addr space */
- 00306 #define E_TASK -1006 /* can't send to task */
- 00307 #define E_NO_MESSAGE -1007 /* RECEIVE failed: no message present */
- 00308 #define E_NO_PERM -1008 /* ordinary users can't send to tasks */
- 00309 #define E_BAD_FCN -1009 /* only valid fcns are SEND, RECEIVE, BOTH */
- 00310 #define E_BAD_ADDR -1010 /* bad address given to utility routine */
- 00311 #define E_BAD_PROC -1011 /* bad proc number given to utility */
- 00312 #endif /* _SYSTEM */
- 00313
- 00314 #endif /* _ERRNO_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/unistd.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00400 /* The <unistd.h> header contains a few miscellaneous manifest constants. */
- 00401
- 00402 #ifndef _UNISTD_H
- 00403 #define _UNISTD_H
- 00404
- 00405 /* POSIX requires size_t and ssize_t in <unistd.h> and elsewhere. */
- 00406 #ifndef _SIZE_T
- 00407 #define _SIZE_T
- 00408 typedef unsigned int size_t;
- 00409 #endif
- 00410
- 00411 #ifndef _SSIZE_T
- 00412 #define _SSIZE_T
- 00413 typedef int ssize_t;
- 00414 #endif
- .Ep 6 include/unistd.h
- 00415
- 00416 /* Values used by access(). POSIX Table 2-8. */
- 00417 #define F_OK 0 /* test if file exists */
- 00418 #define X_OK 1 /* test if file is executable */
- 00419 #define W_OK 2 /* test if file is writable */
- 00420 #define R_OK 4 /* test if file is readable */
- 00421
- 00422 /* Values used for whence in lseek(fd, offset, whence). POSIX Table 2-9. */
- 00423 #define SEEK_SET 0 /* offset is absolute */
- 00424 #define SEEK_CUR 1 /* offset is relative to current position */
- 00425 #define SEEK_END 2 /* offset is relative to end of file */
- 00426
- 00427 /* This value is required by POSIX Table 2-10. */
- 00428 #define _POSIX_VERSION 199009L /* which standard is being conformed to */
- 00429
- 00430 /* These three definitions are required by POSIX Sec. 8.2.1.2. */
- 00431 #define STDIN_FILENO 0 /* file descriptor for stdin */
- 00432 #define STDOUT_FILENO 1 /* file descriptor for stdout */
- 00433 #define STDERR_FILENO 2 /* file descriptor for stderr */
- 00434
- 00435 #ifdef _MINIX
- 00436 /* How to exit the system. */
- 00437 #define RBT_HALT 0
- 00438 #define RBT_REBOOT 1
- 00439 #define RBT_PANIC 2 /* for servers */
- 00440 #define RBT_MONITOR 3 /* let the monitor do this */
- 00441 #define RBT_RESET 4 /* hard reset the system */
- 00442 #endif
- 00443
- 00444 /* NULL must be defined in <unistd.h> according to POSIX Sec. 2.7.1. */
- 00445 #define NULL ((void *)0)
- 00446
- 00447 /* The following relate to configurable system variables. POSIX Table 4-2. */
- 00448 #define _SC_ARG_MAX 1
- 00449 #define _SC_CHILD_MAX 2
- 00450 #define _SC_CLOCKS_PER_SEC 3
- 00451 #define _SC_CLK_TCK 3
- 00452 #define _SC_NGROUPS_MAX 4
- 00453 #define _SC_OPEN_MAX 5
- 00454 #define _SC_JOB_CONTROL 6
- 00455 #define _SC_SAVED_IDS 7
- 00456 #define _SC_VERSION 8
- 00457 #define _SC_STREAM_MAX 9
- 00458 #define _SC_TZNAME_MAX 10
- 00459
- 00460 /* The following relate to configurable pathname variables. POSIX Table 5-2. */
- 00461 #define _PC_LINK_MAX 1 /* link count */
- 00462 #define _PC_MAX_CANON 2 /* size of the canonical input queue */
- 00463 #define _PC_MAX_INPUT 3 /* type-ahead buffer size */
- 00464 #define _PC_NAME_MAX 4 /* file name size */
- 00465 #define _PC_PATH_MAX 5 /* pathname size */
- 00466 #define _PC_PIPE_BUF 6 /* pipe size */
- 00467 #define _PC_NO_TRUNC 7 /* treatment of long name components */
- 00468 #define _PC_VDISABLE 8 /* tty disable */
- 00469 #define _PC_CHOWN_RESTRICTED 9 /* chown restricted or not */
- 00470
- 00471 /* POSIX defines several options that may be implemented or not, at the
- 00472 * implementer's whim. This implementer has made the following choices:
- 00473 *
- 00474 * _POSIX_JOB_CONTROL not defined: no job control
- .Op 7 include/unistd.h
- 00475 * _POSIX_SAVED_IDS not defined: no saved uid/gid
- 00476 * _POSIX_NO_TRUNC defined as -1: long path names are truncated
- 00477 * _POSIX_CHOWN_RESTRICTED defined: you can't give away files
- 00478 * _POSIX_VDISABLE defined: tty functions can be disabled
- 00479 */
- 00480 #define _POSIX_NO_TRUNC (-1)
- 00481 #define _POSIX_CHOWN_RESTRICTED 1
- 00482
- 00483 /* Function Prototypes. */
- 00484 #ifndef _ANSI_H
- 00485 #include <ansi.h>
- 00486 #endif
- 00487
- 00488 _PROTOTYPE( void _exit, (int _status) );
- 00489 _PROTOTYPE( int access, (const char *_path, int _amode) );
- 00490 _PROTOTYPE( unsigned int alarm, (unsigned int _seconds) );
- 00491 _PROTOTYPE( int chdir, (const char *_path) );
- 00492 _PROTOTYPE( int chown, (const char *_path, Uid_t _owner, Gid_t _group) );
- 00493 _PROTOTYPE( int close, (int _fd) );
- 00494 _PROTOTYPE( char *ctermid, (char *_s) );
- 00495 _PROTOTYPE( char *cuserid, (char *_s) );
- 00496 _PROTOTYPE( int dup, (int _fd) );
- 00497 _PROTOTYPE( int dup2, (int _fd, int _fd2) );
- 00498 _PROTOTYPE( int execl, (const char *_path, const char *_arg, ...) );
- 00499 _PROTOTYPE( int execle, (const char *_path, const char *_arg, ...) );
- 00500 _PROTOTYPE( int execlp, (const char *_file, const char *arg, ...) );
- 00501 _PROTOTYPE( int execv, (const char *_path, char *const _argv[]) );
- 00502 _PROTOTYPE( int execve, (const char *_path, char *const _argv[],
- 00503 char *const _envp[]) );
- 00504 _PROTOTYPE( int execvp, (const char *_file, char *const _argv[]) );
- 00505 _PROTOTYPE( pid_t fork, (void) );
- 00506 _PROTOTYPE( long fpathconf, (int _fd, int _name) );
- 00507 _PROTOTYPE( char *getcwd, (char *_buf, size_t _size) );
- 00508 _PROTOTYPE( gid_t getegid, (void) );
- 00509 _PROTOTYPE( uid_t geteuid, (void) );
- 00510 _PROTOTYPE( gid_t getgid, (void) );
- 00511 _PROTOTYPE( int getgroups, (int _gidsetsize, gid_t _grouplist[]) );
- 00512 _PROTOTYPE( char *getlogin, (void) );
- 00513 _PROTOTYPE( pid_t getpgrp, (void) );
- 00514 _PROTOTYPE( pid_t getpid, (void) );
- 00515 _PROTOTYPE( pid_t getppid, (void) );
- 00516 _PROTOTYPE( uid_t getuid, (void) );
- 00517 _PROTOTYPE( int isatty, (int _fd) );
- 00518 _PROTOTYPE( int link, (const char *_existing, const char *_new) );
- 00519 _PROTOTYPE( off_t lseek, (int _fd, off_t _offset, int _whence) );
- 00520 _PROTOTYPE( long pathconf, (const char *_path, int _name) );
- 00521 _PROTOTYPE( int pause, (void) );
- 00522 _PROTOTYPE( int pipe, (int _fildes[2]) );
- 00523 _PROTOTYPE( ssize_t read, (int _fd, void *_buf, size_t _n) );
- 00524 _PROTOTYPE( int rmdir, (const char *_path) );
- 00525 _PROTOTYPE( int setgid, (Gid_t _gid) );
- 00526 _PROTOTYPE( int setpgid, (pid_t _pid, pid_t _pgid) );
- 00527 _PROTOTYPE( pid_t setsid, (void) );
- 00528 _PROTOTYPE( int setuid, (Uid_t _uid) );
- 00529 _PROTOTYPE( unsigned int sleep, (unsigned int _seconds) );
- 00530 _PROTOTYPE( long sysconf, (int _name) );
- 00531 _PROTOTYPE( pid_t tcgetpgrp, (int _fd) );
- 00532 _PROTOTYPE( int tcsetpgrp, (int _fd, pid_t _pgrp_id) );
- 00533 _PROTOTYPE( char *ttyname, (int _fd) );
- 00534 _PROTOTYPE( int unlink, (const char *_path) );
- .Ep 8 include/unistd.h
- 00535 _PROTOTYPE( ssize_t write, (int _fd, const void *_buf, size_t _n) );
- 00536
- 00537 #ifdef _MINIX
- 00538 _PROTOTYPE( int brk, (char *_addr) );
- 00539 _PROTOTYPE( int chroot, (const char *_name) );
- 00540 _PROTOTYPE( int mknod, (const char *_name, Mode_t _mode, Dev_t _addr) );
- 00541 _PROTOTYPE( int mknod4, (const char *_name, Mode_t _mode, Dev_t _addr,
- 00542 long _size) );
- 00543 _PROTOTYPE( char *mktemp, (char *_template) );
- 00544 _PROTOTYPE( int mount, (char *_spec, char *_name, int _flag) );
- 00545 _PROTOTYPE( long ptrace, (int _req, pid_t _pid, long _addr, long _data) );
- 00546 _PROTOTYPE( char *sbrk, (int _incr) );
- 00547 _PROTOTYPE( int sync, (void) );
- 00548 _PROTOTYPE( int umount, (const char *_name) );
- 00549 _PROTOTYPE( int reboot, (int _how, ...) );
- 00550 _PROTOTYPE( int gethostname, (char *_hostname, size_t _len) );
- 00551 _PROTOTYPE( int getdomainname, (char *_domain, size_t _len) );
- 00552 _PROTOTYPE( int ttyslot, (void) );
- 00553 _PROTOTYPE( int fttyslot, (int _fd) );
- 00554 _PROTOTYPE( char *crypt, (const char *_key, const char *_salt) );
- 00555 #endif
- 00556
- 00557 #endif /* _UNISTD_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/string.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00600 /* The <string.h> header contains prototypes for the string handling
- 00601 * functions.
- 00602 */
- 00603
- 00604 #ifndef _STRING_H
- 00605 #define _STRING_H
- 00606
- 00607 #define NULL ((void *)0)
- 00608
- 00609 #ifndef _SIZE_T
- 00610 #define _SIZE_T
- 00611 typedef unsigned int size_t; /* type returned by sizeof */
- 00612 #endif /*_SIZE_T */
- 00613
- 00614 /* Function Prototypes. */
- 00615 #ifndef _ANSI_H
- 00616 #include <ansi.h>
- 00617 #endif
- 00618
- 00619 _PROTOTYPE( void *memchr, (const void *_s, int _c, size_t _n) );
- 00620 _PROTOTYPE( int memcmp, (const void *_s1, const void *_s2, size_t _n) );
- 00621 _PROTOTYPE( void *memcpy, (void *_s1, const void *_s2, size_t _n) );
- 00622 _PROTOTYPE( void *memmove, (void *_s1, const void *_s2, size_t _n) );
- 00623 _PROTOTYPE( void *memset, (void *_s, int _c, size_t _n) );
- 00624 _PROTOTYPE( char *strcat, (char *_s1, const char *_s2) );
- 00625 _PROTOTYPE( char *strchr, (const char *_s, int _c) );
- 00626 _PROTOTYPE( int strncmp, (const char *_s1, const char *_s2, size_t _n) );
- 00627 _PROTOTYPE( int strcmp, (const char *_s1, const char *_s2) );
- 00628 _PROTOTYPE( int strcoll, (const char *_s1, const char *_s2) );
- 00629 _PROTOTYPE( char *strcpy, (char *_s1, const char *_s2) );
- .Op 9 include/string.h
- 00630 _PROTOTYPE( size_t strcspn, (const char *_s1, const char *_s2) );
- 00631 _PROTOTYPE( char *strerror, (int _errnum) );
- 00632 _PROTOTYPE( size_t strlen, (const char *_s) );
- 00633 _PROTOTYPE( char *strncat, (char *_s1, const char *_s2, size_t _n) );
- 00634 _PROTOTYPE( char *strncpy, (char *_s1, const char *_s2, size_t _n) );
- 00635 _PROTOTYPE( char *strpbrk, (const char *_s1, const char *_s2) );
- 00636 _PROTOTYPE( char *strrchr, (const char *_s, int _c) );
- 00637 _PROTOTYPE( size_t strspn, (const char *_s1, const char *_s2) );
- 00638 _PROTOTYPE( char *strstr, (const char *_s1, const char *_s2) );
- 00639 _PROTOTYPE( char *strtok, (char *_s1, const char *_s2) );
- 00640 _PROTOTYPE( size_t strxfrm, (char *_s1, const char *_s2, size_t _n) );
- 00641
- 00642 #ifdef _MINIX
- 00643 /* For backward compatibility. */
- 00644 _PROTOTYPE( char *index, (const char *_s, int _charwanted) );
- 00645 _PROTOTYPE( char *rindex, (const char *_s, int _charwanted) );
- 00646 _PROTOTYPE( void bcopy, (const void *_src, void *_dst, size_t _length) );
- 00647 _PROTOTYPE( int bcmp, (const void *_s1, const void *_s2, size_t _length));
- 00648 _PROTOTYPE( void bzero, (void *_dst, size_t _length) );
- 00649 _PROTOTYPE( void *memccpy, (char *_dst, const char *_src, int _ucharstop,
- 00650 size_t _size) );
- 00651 /* BSD functions */
- 00652 _PROTOTYPE( int strcasecmp, (const char *_s1, const char *_s2) );
- 00653 #endif
- 00654
- 00655 #endif /* _STRING_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/signal.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00700 /* The <signal.h> header defines all the ANSI and POSIX signals.
- 00701 * MINIX supports all the signals required by POSIX. They are defined below.
- 00702 * Some additional signals are also supported.
- 00703 */
- 00704
- 00705 #ifndef _SIGNAL_H
- 00706 #define _SIGNAL_H
- 00707
- 00708 #ifndef _ANSI_H
- 00709 #include <ansi.h>
- 00710 #endif
- 00711
- 00712 /* Here are types that are closely associated with signal handling. */
- 00713 typedef int sig_atomic_t;
- 00714
- 00715 #ifdef _POSIX_SOURCE
- 00716 #ifndef _SIGSET_T
- 00717 #define _SIGSET_T
- 00718 typedef unsigned long sigset_t;
- 00719 #endif
- 00720 #endif
- 00721
- 00722 #define _NSIG 16 /* number of signals used */
- 00723
- 00724 #define SIGHUP 1 /* hangup */
- .Ep 10 include/signal.h
- 00725 #define SIGINT 2 /* interrupt (DEL) */
- 00726 #define SIGQUIT 3 /* quit (ASCII FS) */
- 00727 #define SIGILL 4 /* illegal instruction */
- 00728 #define SIGTRAP 5 /* trace trap (not reset when caught) */
- 00729 #define SIGABRT 6 /* IOT instruction */
- 00730 #define SIGIOT 6 /* SIGABRT for people who speak PDP-11 */
- 00731 #define SIGUNUSED 7 /* spare code */
- 00732 #define SIGFPE 8 /* floating point exception */
- 00733 #define SIGKILL 9 /* kill (cannot be caught or ignored) */
- 00734 #define SIGUSR1 10 /* user defined signal # 1 */
- 00735 #define SIGSEGV 11 /* segmentation violation */
- 00736 #define SIGUSR2 12 /* user defined signal # 2 */
- 00737 #define SIGPIPE 13 /* write on a pipe with no one to read it */
- 00738 #define SIGALRM 14 /* alarm clock */
- 00739 #define SIGTERM 15 /* software termination signal from kill */
- 00740
- 00741 #define SIGEMT 7 /* obsolete */
- 00742 #define SIGBUS 10 /* obsolete */
- 00743
- 00744 /* POSIX requires the following signals to be defined, even if they are
- 00745 * not supported. Here are the definitions, but they are not supported.
- 00746 */
- 00747 #define SIGCHLD 17 /* child process terminated or stopped */
- 00748 #define SIGCONT 18 /* continue if stopped */
- 00749 #define SIGSTOP 19 /* stop signal */
- 00750 #define SIGTSTP 20 /* interactive stop signal */
- 00751 #define SIGTTIN 21 /* background process wants to read */
- 00752 #define SIGTTOU 22 /* background process wants to write */
- 00753
- 00754 /* The sighandler_t type is not allowed unless _POSIX_SOURCE is defined. */
- 00755 #ifdef _POSIX_SOURCE
- 00756 #define __sighandler_t sighandler_t
- 00757 #else
- 00758 typedef void (*__sighandler_t) (int);
- 00759 #endif
- 00760
- 00761 /* Macros used as function pointers. */
- 00762 #define SIG_ERR ((__sighandler_t) -1) /* error return */
- 00763 #define SIG_DFL ((__sighandler_t) 0) /* default signal handling */
- 00764 #define SIG_IGN ((__sighandler_t) 1) /* ignore signal */
- 00765 #define SIG_HOLD ((__sighandler_t) 2) /* block signal */
- 00766 #define SIG_CATCH ((__sighandler_t) 3) /* catch signal */
- 00767
- 00768 #ifdef _POSIX_SOURCE
- 00769 struct sigaction {
- 00770 __sighandler_t sa_handler; /* SIG_DFL, SIG_IGN, or pointer to function */
- 00771 sigset_t sa_mask; /* signals to be blocked during handler */
- 00772 int sa_flags; /* special flags */
- 00773 };
- 00774
- 00775 /* Fields for sa_flags. */
- 00776 #define SA_ONSTACK 0x0001 /* deliver signal on alternate stack */
- 00777 #define SA_RESETHAND 0x0002 /* reset signal handler when signal caught */
- 00778 #define SA_NODEFER 0x0004 /* don't block signal while catching it */
- 00779 #define SA_RESTART 0x0008 /* automatic system call restart */
- 00780 #define SA_SIGINFO 0x0010 /* extended signal handling */
- 00781 #define SA_NOCLDWAIT 0x0020 /* don't create zombies */
- 00782 #define SA_NOCLDSTOP 0x0040 /* don't receive SIGCHLD when child stops */
- 00783
- 00784 /* POSIX requires these values for use with sigprocmask(2). */
- .Op 11 include/signal.h
- 00785 #define SIG_BLOCK 0 /* for blocking signals */
- 00786 #define SIG_UNBLOCK 1 /* for unblocking signals */
- 00787 #define SIG_SETMASK 2 /* for setting the signal mask */
- 00788 #define SIG_INQUIRE 4 /* for internal use only */
- 00789 #endif /* _POSIX_SOURCE */
- 00790
- 00791 /* POSIX and ANSI function prototypes. */
- 00792 _PROTOTYPE( int raise, (int _sig) );
- 00793 _PROTOTYPE( __sighandler_t signal, (int _sig, __sighandler_t _func) );
- 00794
- 00795 #ifdef _POSIX_SOURCE
- 00796 _PROTOTYPE( int kill, (pid_t _pid, int _sig) );
- 00797 _PROTOTYPE( int sigaction,
- 00798 (int _sig, const struct sigaction *_act, struct sigaction *_oact) );
- 00799 _PROTOTYPE( int sigaddset, (sigset_t *_set, int _sig) );
- 00800 _PROTOTYPE( int sigdelset, (sigset_t *_set, int _sig) );
- 00801 _PROTOTYPE( int sigemptyset, (sigset_t *_set) );
- 00802 _PROTOTYPE( int sigfillset, (sigset_t *_set) );
- 00803 _PROTOTYPE( int sigismember, (sigset_t *_set, int _sig) );
- 00804 _PROTOTYPE( int sigpending, (sigset_t *_set) );
- 00805 _PROTOTYPE( int sigprocmask,
- 00806 (int _how, const sigset_t *_set, sigset_t *_oset) );
- 00807 _PROTOTYPE( int sigsuspend, (const sigset_t *_sigmask) );
- 00808 #endif
- 00809
- 00810 #endif /* _SIGNAL_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/fcntl.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 00900 /* The <fcntl.h> header is needed by the open() and fcntl() system calls,
- 00901 * which have a variety of parameters and flags. They are described here.
- 00902 * The formats of the calls to each of these are:
- 00903 *
- 00904 * open(path, oflag [,mode]) open a file
- 00905 * fcntl(fd, cmd [,arg]) get or set file attributes
- 00906 *
- 00907 */
- 00908
- 00909 #ifndef _FCNTL_H
- 00910 #define _FCNTL_H
- 00911
- 00912 /* These values are used for cmd in fcntl(). POSIX Table 6-1. */
- 00913 #define F_DUPFD 0 /* duplicate file descriptor */
- 00914 #define F_GETFD 1 /* get file descriptor flags */
- 00915 #define F_SETFD 2 /* set file descriptor flags */
- 00916 #define F_GETFL 3 /* get file status flags */
- 00917 #define F_SETFL 4 /* set file status flags */
- 00918 #define F_GETLK 5 /* get record locking information */
- 00919 #define F_SETLK 6 /* set record locking information */
- 00920 #define F_SETLKW 7 /* set record locking info; wait if blocked */
- 00921
- 00922 /* File descriptor flags used for fcntl(). POSIX Table 6-2. */
- 00923 #define FD_CLOEXEC 1 /* close on exec flag for third arg of fcntl */
- 00924
- .Ep 12 include/fcntl.h
- 00925 /* L_type values for record locking with fcntl(). POSIX Table 6-3. */
- 00926 #define F_RDLCK 1 /* shared or read lock */
- 00927 #define F_WRLCK 2 /* exclusive or write lock */
- 00928 #define F_UNLCK 3 /* unlock */
- 00929
- 00930 /* Oflag values for open(). POSIX Table 6-4. */
- 00931 #define O_CREAT 00100 /* creat file if it doesn't exist */
- 00932 #define O_EXCL 00200 /* exclusive use flag */
- 00933 #define O_NOCTTY 00400 /* do not assign a controlling terminal */
- 00934 #define O_TRUNC 01000 /* truncate flag */
- 00935
- 00936 /* File status flags for open() and fcntl(). POSIX Table 6-5. */
- 00937 #define O_APPEND 02000 /* set append mode */
- 00938 #define O_NONBLOCK 04000 /* no delay */
- 00939
- 00940 /* File access modes for open() and fcntl(). POSIX Table 6-6. */
- 00941 #define O_RDONLY 0 /* open(name, O_RDONLY) opens read only */
- 00942 #define O_WRONLY 1 /* open(name, O_WRONLY) opens write only */
- 00943 #define O_RDWR 2 /* open(name, O_RDWR) opens read/write */
- 00944
- 00945 /* Mask for use with file access modes. POSIX Table 6-7. */
- 00946 #define O_ACCMODE 03 /* mask for file access modes */
- 00947
- 00948 /* Struct used for locking. POSIX Table 6-8. */
- 00949 struct flock {
- 00950 short l_type; /* type: F_RDLCK, F_WRLCK, or F_UNLCK */
- 00951 short l_whence; /* flag for starting offset */
- 00952 off_t l_start; /* relative offset in bytes */
- 00953 off_t l_len; /* size; if 0, then until EOF */
- 00954 pid_t l_pid; /* process id of the locks' owner */
- 00955 };
- 00956
- 00957
- 00958 /* Function Prototypes. */
- 00959 #ifndef _ANSI_H
- 00960 #include <ansi.h>
- 00961 #endif
- 00962
- 00963 _PROTOTYPE( int creat, (const char *_path, Mode_t _mode) );
- 00964 _PROTOTYPE( int fcntl, (int _filedes, int _cmd, ...) );
- 00965 _PROTOTYPE( int open, (const char *_path, int _oflag, ...) );
- 00966
- 00967 #endif /* _FCNTL_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/stdlib.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01000 /* The <stdlib.h> header defines certain common macros, types, and functions.*/
- 01001
- 01002 #ifndef _STDLIB_H
- 01003 #define _STDLIB_H
- 01004
- 01005 /* The macros are NULL, EXIT_FAILURE, EXIT_SUCCESS, RAND_MAX, and MB_CUR_MAX.*/
- 01006 #define NULL ((void *)0)
- 01007
- 01008 #define EXIT_FAILURE 1 /* standard error return using exit() */
- 01009 #define EXIT_SUCCESS 0 /* successful return using exit() */
- .Op 13 include/stdlib.h
- 01010 #define RAND_MAX 32767 /* largest value generated by rand() */
- 01011 #define MB_CUR_MAX 1 /* max value of multibyte character in MINIX */
- 01012
- 01013 typedef struct { int quot, rem; } div_t;
- 01014 typedef struct { long quot, rem; } ldiv_t;
- 01015
- 01016 /* The types are size_t, wchar_t, div_t, and ldiv_t. */
- 01017 #ifndef _SIZE_T
- 01018 #define _SIZE_T
- 01019 typedef unsigned int size_t; /* type returned by sizeof */
- 01020 #endif
- 01021
- 01022 #ifndef _WCHAR_T
- 01023 #define _WCHAR_T
- 01024 typedef char wchar_t; /* type expanded character set */
- 01025 #endif
- 01026
- 01027 /* Function Prototypes. */
- 01028 #ifndef _ANSI_H
- 01029 #include <ansi.h>
- 01030 #endif
- 01031
- 01032 _PROTOTYPE( void abort, (void) );
- 01033 _PROTOTYPE( int abs, (int _j) );
- 01034 _PROTOTYPE( int atexit, (void (*_func)(void)) );
- 01035 _PROTOTYPE( double atof, (const char *_nptr) );
- 01036 _PROTOTYPE( int atoi, (const char *_nptr) );
- 01037 _PROTOTYPE( long atol, (const char *_nptr) );
- 01038 _PROTOTYPE( void *calloc, (size_t _nmemb, size_t _size) );
- 01039 _PROTOTYPE( div_t div, (int _numer, int _denom) );
- 01040 _PROTOTYPE( void exit, (int _status) );
- 01041 _PROTOTYPE( void free, (void *_ptr) );
- 01042 _PROTOTYPE( char *getenv, (const char *_name) );
- 01043 _PROTOTYPE( long labs, (long _j) );
- 01044 _PROTOTYPE( ldiv_t ldiv, (long _numer, long _denom) );
- 01045 _PROTOTYPE( void *malloc, (size_t _size) );
- 01046 _PROTOTYPE( int mblen, (const char *_s, size_t _n) );
- 01047 _PROTOTYPE( size_t mbstowcs, (wchar_t *_pwcs, const char *_s, size_t _n));
- 01048 _PROTOTYPE( int mbtowc, (wchar_t *_pwc, const char *_s, size_t _n) );
- 01049 _PROTOTYPE( int rand, (void) );
- 01050 _PROTOTYPE( void *realloc, (void *_ptr, size_t _size) );
- 01051 _PROTOTYPE( void srand, (unsigned int _seed) );
- 01052 _PROTOTYPE( double strtod, (const char *_nptr, char **_endptr) );
- 01053 _PROTOTYPE( long strtol, (const char *_nptr, char **_endptr, int _base) );
- 01054 _PROTOTYPE( int system, (const char *_string) );
- 01055 _PROTOTYPE( size_t wcstombs, (char *_s, const wchar_t *_pwcs, size_t _n));
- 01056 _PROTOTYPE( int wctomb, (char *_s, wchar_t _wchar) );
- 01057 _PROTOTYPE( void *bsearch, (const void *_key, const void *_base,
- 01058 size_t _nmemb, size_t _size,
- 01059 int (*compar) (const void *, const void *)) );
- 01060 _PROTOTYPE( void qsort, (void *_base, size_t _nmemb, size_t _size,
- 01061 int (*compar) (const void *, const void *)) );
- 01062 _PROTOTYPE( unsigned long int strtoul,
- 01063 (const char *_nptr, char **_endptr, int _base) );
- 01064
- 01065 #ifdef _MINIX
- 01066 _PROTOTYPE( int putenv, (const char *_name) );
- 01067 _PROTOTYPE(int getopt, (int _argc, char **_argv, char *_opts));
- 01068 extern char *optarg;
- 01069 extern int optind, opterr, optopt;
- .Ep 14 include/stdlib.h
- 01070 #endif /* _MINIX */
- 01071
- 01072 #endif /* STDLIB_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/termios.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01100 /* The <termios.h> header is used for controlling tty modes. */
- 01101
- 01102 #ifndef _TERMIOS_H
- 01103 #define _TERMIOS_H
- 01104
- 01105 typedef unsigned short tcflag_t;
- 01106 typedef unsigned char cc_t;
- 01107 typedef unsigned int speed_t;
- 01108
- 01109 #define NCCS 20 /* size of cc_c array, some extra space
- 01110 * for extensions. */
- 01111
- 01112 /* Primary terminal control structure. POSIX Table 7-1. */
- 01113 struct termios {
- 01114 tcflag_t c_iflag; /* input modes */
- 01115 tcflag_t c_oflag; /* output modes */
- 01116 tcflag_t c_cflag; /* control modes */
- 01117 tcflag_t c_lflag; /* local modes */
- 01118 speed_t c_ispeed; /* input speed */
- 01119 speed_t c_ospeed; /* output speed */
- 01120 cc_t c_cc[NCCS]; /* control characters */
- 01121 };
- 01122
- 01123 /* Values for termios c_iflag bit map. POSIX Table 7-2. */
- 01124 #define BRKINT 0x0001 /* signal interrupt on break */
- 01125 #define ICRNL 0x0002 /* map CR to NL on input */
- 01126 #define IGNBRK 0x0004 /* ignore break */
- 01127 #define IGNCR 0x0008 /* ignore CR */
- 01128 #define IGNPAR 0x0010 /* ignore characters with parity errors */
- 01129 #define INLCR 0x0020 /* map NL to CR on input */
- 01130 #define INPCK 0x0040 /* enable input parity check */
- 01131 #define ISTRIP 0x0080 /* mask off 8th bit */
- 01132 #define IXOFF 0x0100 /* enable start/stop input control */
- 01133 #define IXON 0x0200 /* enable start/stop output control */
- 01134 #define PARMRK 0x0400 /* mark parity errors in the input queue */
- 01135
- 01136 /* Values for termios c_oflag bit map. POSIX Sec. 7.1.2.3. */
- 01137 #define OPOST 0x0001 /* perform output processing */
- 01138
- 01139 /* Values for termios c_cflag bit map. POSIX Table 7-3. */
- 01140 #define CLOCAL 0x0001 /* ignore modem status lines */
- 01141 #define CREAD 0x0002 /* enable receiver */
- 01142 #define CSIZE 0x000C /* number of bits per character */
- 01143 #define CS5 0x0000 /* if CSIZE is CS5, characters are 5 bits */
- 01144 #define CS6 0x0004 /* if CSIZE is CS6, characters are 6 bits */
- 01145 #define CS7 0x0008 /* if CSIZE is CS7, characters are 7 bits */
- 01146 #define CS8 0x000C /* if CSIZE is CS8, characters are 8 bits */
- 01147 #define CSTOPB 0x0010 /* send 2 stop bits if set, else 1 */
- 01148 #define HUPCL 0x0020 /* hang up on last close */
- 01149 #define PARENB 0x0040 /* enable parity on output */
- .Op 15 include/termios.h
- 01150 #define PARODD 0x0080 /* use odd parity if set, else even */
- 01151
- 01152 /* Values for termios c_lflag bit map. POSIX Table 7-4. */
- 01153 #define ECHO 0x0001 /* enable echoing of input characters */
- 01154 #define ECHOE 0x0002 /* echo ERASE as backspace */
- 01155 #define ECHOK 0x0004 /* echo KILL */
- 01156 #define ECHONL 0x0008 /* echo NL */
- 01157 #define ICANON 0x0010 /* canonical input (erase and kill enabled) */
- 01158 #define IEXTEN 0x0020 /* enable extended functions */
- 01159 #define ISIG 0x0040 /* enable signals */
- 01160 #define NOFLSH 0x0080 /* disable flush after interrupt or quit */
- 01161 #define TOSTOP 0x0100 /* send SIGTTOU (job control, not implemented*/
- 01162
- 01163 /* Indices into c_cc array. Default values in parentheses. POSIX Table 7-5. */
- 01164 #define VEOF 0 /* cc_c[VEOF] = EOF char (^D) */
- 01165 #define VEOL 1 /* cc_c[VEOL] = EOL char (undef) */
- 01166 #define VERASE 2 /* cc_c[VERASE] = ERASE char (^H) */
- 01167 #define VINTR 3 /* cc_c[VINTR] = INTR char (DEL) */
- 01168 #define VKILL 4 /* cc_c[VKILL] = KILL char (^U) */
- 01169 #define VMIN 5 /* cc_c[VMIN] = MIN value for timer */
- 01170 #define VQUIT 6 /* cc_c[VQUIT] = QUIT char (^) */
- 01171 #define VTIME 7 /* cc_c[VTIME] = TIME value for timer */
- 01172 #define VSUSP 8 /* cc_c[VSUSP] = SUSP (^Z, ignored) */
- 01173 #define VSTART 9 /* cc_c[VSTART] = START char (^S) */
- 01174 #define VSTOP 10 /* cc_c[VSTOP] = STOP char (^Q) */
- 01175
- 01176 #define _POSIX_VDISABLE (cc_t)0xFF /* You can't even generate this
- 01177 * character with 'normal' keyboards.
- 01178 * But some language specific keyboards
- 01179 * can generate 0xFF. It seems that all
- 01180 * 256 are used, so cc_t should be a
- 01181 * short...
- 01182 */
- 01183
- 01184 /* Values for the baud rate settings. POSIX Table 7-6. */
- 01185 #define B0 0x0000 /* hang up the line */
- 01186 #define B50 0x1000 /* 50 baud */
- 01187 #define B75 0x2000 /* 75 baud */
- 01188 #define B110 0x3000 /* 110 baud */
- 01189 #define B134 0x4000 /* 134.5 baud */
- 01190 #define B150 0x5000 /* 150 baud */
- 01191 #define B200 0x6000 /* 200 baud */
- 01192 #define B300 0x7000 /* 300 baud */
- 01193 #define B600 0x8000 /* 600 baud */
- 01194 #define B1200 0x9000 /* 1200 baud */
- 01195 #define B1800 0xA000 /* 1800 baud */
- 01196 #define B2400 0xB000 /* 2400 baud */
- 01197 #define B4800 0xC000 /* 4800 baud */
- 01198 #define B9600 0xD000 /* 9600 baud */
- 01199 #define B19200 0xE000 /* 19200 baud */
- 01200 #define B38400 0xF000 /* 38400 baud */
- 01201
- 01202 /* Optional actions for tcsetattr(). POSIX Sec. 7.2.1.2. */
- 01203 #define TCSANOW 1 /* changes take effect immediately */
- 01204 #define TCSADRAIN 2 /* changes take effect after output is done */
- 01205 #define TCSAFLUSH 3 /* wait for output to finish and flush input */
- 01206
- 01207 /* Queue_selector values for tcflush(). POSIX Sec. 7.2.2.2. */
- 01208 #define TCIFLUSH 1 /* flush accumulated input data */
- 01209 #define TCOFLUSH 2 /* flush accumulated output data */
- .Ep 16 include/termios.h
- 01210 #define TCIOFLUSH 3 /* flush accumulated input and output data */
- 01211
- 01212 /* Action values for tcflow(). POSIX Sec. 7.2.2.2. */
- 01213 #define TCOOFF 1 /* suspend output */
- 01214 #define TCOON 2 /* restart suspended output */
- 01215 #define TCIOFF 3 /* transmit a STOP character on the line */
- 01216 #define TCION 4 /* transmit a START character on the line */
- 01217
- 01218
- 01219 /* Function Prototypes. */
- 01220 #ifndef _ANSI_H
- 01221 #include <ansi.h>
- 01222 #endif
- 01223
- 01224 _PROTOTYPE( int tcsendbreak, (int _fildes, int _duration) );
- 01225 _PROTOTYPE( int tcdrain, (int _filedes) );
- 01226 _PROTOTYPE( int tcflush, (int _filedes, int _queue_selector) );
- 01227 _PROTOTYPE( int tcflow, (int _filedes, int _action) );
- 01228 _PROTOTYPE( speed_t cfgetispeed, (const struct termios *_termios_p) );
- 01229 _PROTOTYPE( speed_t cfgetospeed, (const struct termios *_termios_p) );
- 01230 _PROTOTYPE( int cfsetispeed, (struct termios *_termios_p, speed_t _speed) );
- 01231 _PROTOTYPE( int cfsetospeed, (struct termios *_termios_p, speed_t _speed) );
- 01232 _PROTOTYPE( int tcgetattr, (int _filedes, struct termios *_termios_p) );
- 01233 _PROTOTYPE( int tcsetattr,
- 01234 (int _filedes, int _opt_actions, const struct termios *_termios_p) );
- 01235
- 01236 #define cfgetispeed(termios_p) ((termios_p)->c_ispeed)
- 01237 #define cfgetospeed(termios_p) ((termios_p)->c_ospeed)
- 01238 #define cfsetispeed(termios_p, speed) ((termios_p)->c_ispeed = (speed), 0)
- 01239 #define cfsetospeed(termios_p, speed) ((termios_p)->c_ospeed = (speed), 0)
- 01240
- 01241 #ifdef _MINIX
- 01242 /* Here are the local extensions to the POSIX standard for Minix. Posix
- 01243 * conforming programs are not able to access these, and therefore they are
- 01244 * only defined when a Minix program is compiled.
- 01245 */
- 01246
- 01247 /* Extensions to the termios c_iflag bit map. */
- 01248 #define IXANY 0x0800 /* allow any key to continue ouptut */
- 01249
- 01250 /* Extensions to the termios c_oflag bit map. They are only active iff
- 01251 * OPOST is enabled. */
- 01252 #define ONLCR 0x0002 /* Map NL to CR-NL on output */
- 01253 #define XTABS 0x0004 /* Expand tabs to spaces */
- 01254 #define ONOEOT 0x0008 /* discard EOT's (^D) on output) */
- 01255
- 01256 /* Extensions to the termios c_lflag bit map. */
- 01257 #define LFLUSHO 0x0200 /* Flush output. */
- 01258
- 01259 /* Extensions to the c_cc array. */
- 01260 #define VREPRINT 11 /* cc_c[VREPRINT] (^R) */
- 01261 #define VLNEXT 12 /* cc_c[VLNEXT] (^V) */
- 01262 #define VDISCARD 13 /* cc_c[VDISCARD] (^O) */
- 01263
- 01264 /* Extensions to baud rate settings. */
- 01265 #define B57600 0x0100 /* 57600 baud */
- 01266 #define B115200 0x0200 /* 115200 baud */
- 01267
- 01268 /* These are the default settings used by the kernel and by 'stty sane' */
- 01269
- .Op 17 include/termios.h
- 01270 #define TCTRL_DEF (CREAD | CS8 | HUPCL)
- 01271 #define TINPUT_DEF (BRKINT | ICRNL | IXON | IXANY)
- 01272 #define TOUTPUT_DEF (OPOST | ONLCR)
- 01273 #define TLOCAL_DEF (ISIG | IEXTEN | ICANON | ECHO | ECHOE)
- 01274 #define TSPEED_DEF B9600
- 01275
- 01276 #define TEOF_DEF '4' /* ^D */
- 01277 #define TEOL_DEF _POSIX_VDISABLE
- 01278 #define TERASE_DEF '10' /* ^H */
- 01279 #define TINTR_DEF '177' /* ^? */
- 01280 #define TKILL_DEF '25' /* ^U */
- 01281 #define TMIN_DEF 1
- 01282 #define TQUIT_DEF '34' /* ^ */
- 01283 #define TSTART_DEF '21' /* ^Q */
- 01284 #define TSTOP_DEF '23' /* ^S */
- 01285 #define TSUSP_DEF '32' /* ^Z */
- 01286 #define TTIME_DEF 0
- 01287 #define TREPRINT_DEF '22' /* ^R */
- 01288 #define TLNEXT_DEF '26' /* ^V */
- 01289 #define TDISCARD_DEF '17' /* ^O */
- 01290
- 01291 /* Window size. This information is stored in the TTY driver but not used.
- 01292 * This can be used for screen based applications in a window environment.
- 01293 * The ioctls TIOCGWINSZ and TIOCSWINSZ can be used to get and set this
- 01294 * information.
- 01295 */
- 01296
- 01297 struct winsize
- 01298 {
- 01299 unsigned short ws_row; /* rows, in characters */
- 01300 unsigned short ws_col; /* columns, in characters */
- 01301 unsigned short ws_xpixel; /* horizontal size, pixels */
- 01302 unsigned short ws_ypixel; /* vertical size, pixels */
- 01303 };
- 01304 #endif /* _MINIX */
- 01305
- 01306 #endif /* _TERMIOS_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/a.out.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01400 /* The <a.out> header file describes the format of executable files. */
- 01401
- 01402 #ifndef _AOUT_H
- 01403 #define _AOUT_H
- 01404
- 01405 struct exec { /* a.out header */
- 01406 unsigned char a_magic[2]; /* magic number */
- 01407 unsigned char a_flags; /* flags, see below */
- 01408 unsigned char a_cpu; /* cpu id */
- 01409 unsigned char a_hdrlen; /* length of header */
- 01410 unsigned char a_unused; /* reserved for future use */
- 01411 unsigned short a_version; /* version stamp (not used at present) */
- 01412 long a_text; /* size of text segement in bytes */
- 01413 long a_data; /* size of data segment in bytes */
- 01414 long a_bss; /* size of bss segment in bytes */
- .Ep 18 include/a.out.h
- 01415 long a_entry; /* entry point */
- 01416 long a_total; /* total memory allocated */
- 01417 long a_syms; /* size of symbol table */
- 01418
- 01419 /* SHORT FORM ENDS HERE */
- 01420 long a_trsize; /* text relocation size */
- 01421 long a_drsize; /* data relocation size */
- 01422 long a_tbase; /* text relocation base */
- 01423 long a_dbase; /* data relocation base */
- 01424 };
- 01425
- 01426 #define A_MAGIC0 (unsigned char) 0x01
- 01427 #define A_MAGIC1 (unsigned char) 0x03
- 01428 #define BADMAG(X) ((X).a_magic[0] != A_MAGIC0 ||(X).a_magic[1] != A_MAGIC1)
- 01429
- 01430 /* CPU Id of TARGET machine (byte order coded in low order two bits) */
- 01431 #define A_NONE 0x00 /* unknown */
- 01432 #define A_I8086 0x04 /* intel i8086/8088 */
- 01433 #define A_M68K 0x0B /* motorola m68000 */
- 01434 #define A_NS16K 0x0C /* national semiconductor 16032 */
- 01435 #define A_I80386 0x10 /* intel i80386 */
- 01436 #define A_SPARC 0x17 /* Sun SPARC */
- 01437
- 01438 #define A_BLR(cputype) ((cputype&0x01)!=0) /* TRUE if bytes left-to-right */
- 01439 #define A_WLR(cputype) ((cputype&0x02)!=0) /* TRUE if words left-to-right */
- 01440
- 01441 /* Flags. */
- 01442 #define A_UZP 0x01 /* unmapped zero page (pages) */
- 01443 #define A_PAL 0x02 /* page aligned executable */
- 01444 #define A_NSYM 0x04 /* new style symbol table */
- 01445 #define A_EXEC 0x10 /* executable */
- 01446 #define A_SEP 0x20 /* separate I/D */
- 01447 #define A_PURE 0x40 /* pure text */ /* not used */
- 01448 #define A_TOVLY 0x80 /* text overlay */ /* not used */
- 01449
- 01450 /* Offsets of various things. */
- 01451 #define A_MINHDR 32
- 01452 #define A_TEXTPOS(X) ((long)(X).a_hdrlen)
- 01453 #define A_DATAPOS(X) (A_TEXTPOS(X) + (X).a_text)
- 01454 #define A_HASRELS(X) ((X).a_hdrlen > (unsigned char) A_MINHDR)
- 01455 #define A_HASEXT(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 8))
- 01456 #define A_HASLNS(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 16))
- 01457 #define A_HASTOFF(X) ((X).a_hdrlen > (unsigned char) (A_MINHDR + 24))
- 01458 #define A_TRELPOS(X) (A_DATAPOS(X) + (X).a_data)
- 01459 #define A_DRELPOS(X) (A_TRELPOS(X) + (X).a_trsize)
- 01460 #define A_SYMPOS(X) (A_TRELPOS(X) + (A_HASRELS(X) ?
- 01461 ((X).a_trsize + (X).a_drsize) : 0))
- 01462
- 01463 struct reloc {
- 01464 long r_vaddr; /* virtual address of reference */
- 01465 unsigned short r_symndx; /* internal segnum or extern symbol num */
- 01466 unsigned short r_type; /* relocation type */
- 01467 };
- 01468
- 01469 /* r_tyep values: */
- 01470 #define R_ABBS 0
- 01471 #define R_RELLBYTE 2
- 01472 #define R_PCRBYTE 3
- 01473 #define R_RELWORD 4
- 01474 #define R_PCRWORD 5
- .Op 19 include/a.out.h
- 01475 #define R_RELLONG 6
- 01476 #define R_PCRLONG 7
- 01477 #define R_REL3BYTE 8
- 01478 #define R_KBRANCHE 9
- 01479
- 01480 /* r_symndx for internal segments */
- 01481 #define S_ABS ((unsigned short)-1)
- 01482 #define S_TEXT ((unsigned short)-2)
- 01483 #define S_DATA ((unsigned short)-3)
- 01484 #define S_BSS ((unsigned short)-4)
- 01485
- 01486 struct nlist { /* symbol table entry */
- 01487 char n_name[8]; /* symbol name */
- 01488 long n_value; /* value */
- 01489 unsigned char n_sclass; /* storage class */
- 01490 unsigned char n_numaux; /* number of auxiliary entries (not used) */
- 01491 unsigned short n_type; /* language base and derived type (not used) */
- 01492 };
- 01493
- 01494 /* Low bits of storage class (section). */
- 01495 #define N_SECT 07 /* section mask */
- 01496 #define N_UNDF 00 /* undefined */
- 01497 #define N_ABS 01 /* absolute */
- 01498 #define N_TEXT 02 /* text */
- 01499 #define N_DATA 03 /* data */
- 01500 #define N_BSS 04 /* bss */
- 01501 #define N_COMM 05 /* (common) */
- 01502
- 01503 /* High bits of storage class. */
- 01504 #define N_CLASS 0370 /* storage class mask */
- 01505 #define C_NULL
- 01506 #define C_EXT 0020 /* external symbol */
- 01507 #define C_STAT 0030 /* static */
- 01508
- 01509 /* Function prototypes. */
- 01510 #ifndef _ANSI_H
- 01511 #include <ansi.h>
- 01512 #endif
- 01513
- 01514 _PROTOTYPE( int nlist, (char *_file, struct nlist *_nl) );
- 01515
- 01516 #endif /* _AOUT_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/types.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01600 /* The <sys/types.h> header contains important data type definitions.
- 01601 * It is considered good programming practice to use these definitions,
- 01602 * instead of the underlying base type. By convention, all type names end
- 01603 * with _t.
- 01604 */
- 01605
- 01606 #ifndef _TYPES_H
- 01607 #define _TYPES_H
- 01608
- 01609 /* _ANSI is somehow used to determine whether or not the compiler is a
- .Ep 20 include/sys/types.h
- 01610 * 16 bit compiler
- 01611 */
- 01612 #ifndef _ANSI
- 01613 #include <ansi.h>
- 01614 #endif
- 01615
- 01616 /* The type size_t holds all results of the sizeof operator. At first glance,
- 01617 * it seems obvious that it should be an unsigned int, but this is not always
- 01618 * the case. For example, MINIX-ST (68000) has 32-bit pointers and 16-bit
- 01619 * integers. When one asks for the size of a 70K struct or array, the result
- 01620 * requires 17 bits to express, so size_t must be a long type. The type
- 01621 * ssize_t is the signed version of size_t.
- 01622 */
- 01623 #ifndef _SIZE_T
- 01624 #define _SIZE_T
- 01625 typedef unsigned int size_t;
- 01626 #endif
- 01627
- 01628 #ifndef _SSIZE_T
- 01629 #define _SSIZE_T
- 01630 typedef int ssize_t;
- 01631 #endif
- 01632
- 01633 #ifndef _TIME_T
- 01634 #define _TIME_T
- 01635 typedef long time_t; /* time in sec since 1 Jan 1970 0000 GMT */
- 01636 #endif
- 01637
- 01638 #ifndef _CLOCK_T
- 01639 #define _CLOCK_T
- 01640 typedef long clock_t; /* unit for system accounting */
- 01641 #endif
- 01642
- 01643 #ifndef _SIGSET_T
- 01644 #define _SIGSET_T
- 01645 typedef unsigned long sigset_t;
- 01646 #endif
- 01647
- 01648 /* Types used in disk, inode, etc. data structures. */
- 01649 typedef short dev_t; /* holds (major|minor) device pair */
- 01650 typedef char gid_t; /* group id */
- 01651 typedef unsigned short ino_t; /* i-node number */
- 01652 typedef unsigned short mode_t; /* file type and permissions bits */
- 01653 typedef char nlink_t; /* number of links to a file */
- 01654 typedef unsigned long off_t; /* offset within a file */
- 01655 typedef int pid_t; /* process id (must be signed) */
- 01656 typedef short uid_t; /* user id */
- 01657 typedef unsigned long zone_t; /* zone number */
- 01658 typedef unsigned long block_t; /* block number */
- 01659 typedef unsigned long bit_t; /* bit number in a bit map */
- 01660 typedef unsigned short zone1_t; /* zone number for V1 file systems */
- 01661 typedef unsigned short bitchunk_t; /* collection of bits in a bitmap */
- 01662
- 01663 typedef unsigned char u8_t; /* 8 bit type */
- 01664 typedef unsigned short u16_t; /* 16 bit type */
- 01665 typedef unsigned long u32_t; /* 32 bit type */
- 01666
- 01667 typedef char i8_t; /* 8 bit signed type */
- 01668 typedef short i16_t; /* 16 bit signed type */
- 01669 typedef long i32_t; /* 32 bit signed type */
- .Op 21 include/sys/types.h
- 01670
- 01671 /* The following types are needed because MINIX uses K&R style function
- 01672 * definitions (for maximum portability). When a short, such as dev_t, is
- 01673 * passed to a function with a K&R definition, the compiler automatically
- 01674 * promotes it to an int. The prototype must contain an int as the parameter,
- 01675 * not a short, because an int is what an old-style function definition
- 01676 * expects. Thus using dev_t in a prototype would be incorrect. It would be
- 01677 * sufficient to just use int instead of dev_t in the prototypes, but Dev_t
- 01678 * is clearer.
- 01679 */
- 01680 typedef int Dev_t;
- 01681 typedef int Gid_t;
- 01682 typedef int Nlink_t;
- 01683 typedef int Uid_t;
- 01684 typedef int U8_t;
- 01685 typedef unsigned long U32_t;
- 01686 typedef int I8_t;
- 01687 typedef int I16_t;
- 01688 typedef long I32_t;
- 01689
- 01690 /* ANSI C makes writing down the promotion of unsigned types very messy. When
- 01691 * sizeof(short) == sizeof(int), there is no promotion, so the type stays
- 01692 * unsigned. When the compiler is not ANSI, there is usually no loss of
- 01693 * unsignedness, and there are usually no prototypes so the promoted type
- 01694 * doesn't matter. The use of types like Ino_t is an attempt to use ints
- 01695 * (which are not promoted) while providing information to the reader.
- 01696 */
- 01697
- 01698 #ifndef _ANSI_H
- 01699 #include <ansi.h>
- 01700 #endif
- 01701
- 01702 #if _EM_WSIZE == 2 || !defined(_ANSI)
- 01703 typedef unsigned int Ino_t;
- 01704 typedef unsigned int Zone1_t;
- 01705 typedef unsigned int Bitchunk_t;
- 01706 typedef unsigned int U16_t;
- 01707 typedef unsigned int Mode_t;
- 01708
- 01709 #else /* _EM_WSIZE == 4, or _EM_WSIZE undefined, or _ANSI defined */
- 01710 typedef int Ino_t;
- 01711 typedef int Zone1_t;
- 01712 typedef int Bitchunk_t;
- 01713 typedef int U16_t;
- 01714 typedef int Mode_t;
- 01715
- 01716 #endif /* _EM_WSIZE == 2, etc */
- 01717
- 01718 /* Signal handler type, e.g. SIG_IGN */
- 01719 #if defined(_ANSI)
- 01720 typedef void (*sighandler_t) (int);
- 01721 #else
- 01722 typedef void (*sighandler_t)();
- 01723 #endif
- 01724
- 01725 #endif /* _TYPES_H */
- .Ep 22 include/sys/ioctl.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/ioctl.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 01800 /* The ioctl.h header declares device controlling operations. */
- 01801
- 01802 #ifndef _IOCTL_H
- 01803 #define _IOCTL_H
- 01804
- 01805 #if _EM_WSIZE >= 4
- 01806 /* Ioctls have the command encoded in the low-order word, and the size
- 01807 * of the parameter in the high-order word. The 3 high bits of the high-
- 01808 * order word are used to encode the in/out/void status of the parameter.
- 01809 */
- 01810
- 01811 #define _IOCPARM_MASK 0x1FFF
- 01812 #define _IOC_VOID 0x20000000
- 01813 #define _IOCTYPE_MASK 0xFFFF
- 01814 #define _IOC_IN 0x40000000
- 01815 #define _IOC_OUT 0x80000000
- 01816 #define _IOC_INOUT (_IOC_IN | _IOC_OUT)
- 01817
- 01818 #define _IO(x,y) ((x << 8) | y | _IOC_VOID)
- 01819 #define _IOR(x,y,t) ((x << 8) | y | ((sizeof(t) & _IOCPARM_MASK) << 16) |
- 01820 _IOC_OUT)
- 01821 #define _IOW(x,y,t) ((x << 8) | y | ((sizeof(t) & _IOCPARM_MASK) << 16) |
- 01822 _IOC_IN)
- 01823 #define _IORW(x,y,t) ((x << 8) | y | ((sizeof(t) & _IOCPARM_MASK) << 16) |
- 01824 _IOC_INOUT)
- 01825 #else
- 01826 /* No fancy encoding on a 16-bit machine. */
- 01827
- 01828 #define _IO(x,y) ((x << 8) | y)
- 01829 #define _IOR(x,y,t) _IO(x,y)
- 01830 #define _IOW(x,y,t) _IO(x,y)
- 01831 #define _IORW(x,y,t) _IO(x,y)
- 01832 #endif
- 01833
- 01834
- 01835 /* Terminal ioctls. */
- 01836 #define TCGETS _IOR('T', 8, struct termios) /* tcgetattr */
- 01837 #define TCSETS _IOW('T', 9, struct termios) /* tcsetattr, TCSANOW */
- 01838 #define TCSETSW _IOW('T', 10, struct termios) /* tcsetattr, TCSADRAIN */
- 01839 #define TCSETSF _IOW('T', 11, struct termios) /* tcsetattr, TCSAFLUSH */
- 01840 #define TCSBRK _IOW('T', 12, int) /* tcsendbreak */
- 01841 #define TCDRAIN _IO ('T', 13) /* tcdrain */
- 01842 #define TCFLOW _IOW('T', 14, int) /* tcflow */
- 01843 #define TCFLSH _IOW('T', 15, int) /* tcflush */
- 01844 #define TIOCGWINSZ _IOR('T', 16, struct winsize)
- 01845 #define TIOCSWINSZ _IOW('T', 17, struct winsize)
- 01846 #define TIOCGPGRP _IOW('T', 18, int)
- 01847 #define TIOCSPGRP _IOW('T', 19, int)
- 01848 #define TIOCSFON _IOW('T', 20, u8_t [8192])
- 01849
- 01850 #define TIOCGETP _IOR('t', 1, struct sgttyb)
- 01851 #define TIOCSETP _IOW('t', 2, struct sgttyb)
- 01852 #define TIOCGETC _IOR('t', 3, struct tchars)
- 01853 #define TIOCSETC _IOW('t', 4, struct tchars)
- 01854
- .Op 23 include/sys/ioctl.h
- 01855
- 01856 /* Network ioctls. */
- 01857 #define NWIOSETHOPT _IOW('n', 16, struct nwio_ethopt)
- 01858 #define NWIOGETHOPT _IOR('n', 17, struct nwio_ethopt)
- 01859 #define NWIOGETHSTAT _IOR('n', 18, struct nwio_ethstat)
- 01860
- 01861 #define NWIOSIPCONF _IOW('n', 32, struct nwio_ipconf)
- 01862 #define NWIOGIPCONF _IOR('n', 33, struct nwio_ipconf)
- 01863 #define NWIOSIPOPT _IOW('n', 34, struct nwio_ipopt)
- 01864 #define NWIOGIPOPT _IOR('n', 35, struct nwio_ipopt)
- 01865
- 01866 #define NWIOIPGROUTE _IORW('n', 40, struct nwio_route)
- 01867 #define NWIOIPSROUTE _IOW ('n', 41, struct nwio_route)
- 01868 #define NWIOIPDROUTE _IOW ('n', 42, struct nwio_route)
- 01869
- 01870 #define NWIOSTCPCONF _IOW('n', 48, struct nwio_tcpconf)
- 01871 #define NWIOGTCPCONF _IOR('n', 49, struct nwio_tcpconf)
- 01872 #define NWIOTCPCONN _IOW('n', 50, struct nwio_tcpcl)
- 01873 #define NWIOTCPLISTEN _IOW('n', 51, struct nwio_tcpcl)
- 01874 #define NWIOTCPATTACH _IOW('n', 52, struct nwio_tcpatt)
- 01875 #define NWIOTCPSHUTDOWN _IO ('n', 53)
- 01876 #define NWIOSTCPOPT _IOW('n', 54, struct nwio_tcpopt)
- 01877 #define NWIOGTCPOPT _IOR('n', 55, struct nwio_tcpopt)
- 01878
- 01879 #define NWIOSUDPOPT _IOW('n', 64, struct nwio_udpopt)
- 01880 #define NWIOGUDPOPT _IOR('n', 65, struct nwio_udpopt)
- 01881
- 01882 /* Disk ioctls. */
- 01883 #define DIOCEJECT _IO ('d', 5)
- 01884 #define DIOCSETP _IOW('d', 6, struct partition)
- 01885 #define DIOCGETP _IOR('d', 7, struct partition)
- 01886
- 01887 /* Keyboard ioctls. */
- 01888 #define KIOCSMAP _IOW('k', 3, keymap_t)
- 01889
- 01890 /* Memory ioctls. */
- 01891 #define MIOCRAMSIZE _IOW('m', 3, u32_t) /* Size of the ramdisk */
- 01892 #define MIOCSPSINFO _IOW('m', 4, void *)
- 01893 #define MIOCGPSINFO _IOR('m', 5, struct psinfo)
- 01894
- 01895 /* Magnetic tape ioctls. */
- 01896 #define MTIOCTOP _IOW('M', 1, struct mtop)
- 01897 #define MTIOCGET _IOR('M', 2, struct mtget)
- 01898
- 01899 /* SCSI command. */
- 01900 #define SCIOCCMD _IOW('S', 1, struct scsicmd)
- 01901
- 01902 /* CD-ROM ioctls. */
- 01903 #define CDIOPLAYTI _IOR('c', 1, struct cd_play_track)
- 01904 #define CDIOPLAYMSS _IOR('c', 2, struct cd_play_mss)
- 01905 #define CDIOREADTOCHDR _IOW('c', 3, struct cd_toc_entry)
- 01906 #define CDIOREADTOC _IOW('c', 4, struct cd_toc_entry)
- 01907 #define CDIOREADSUBCH _IOW('c', 5, struct cd_toc_entry)
- 01908 #define CDIOSTOP _IO ('c', 10)
- 01909 #define CDIOPAUSE _IO ('c', 11)
- 01910 #define CDIORESUME _IO ('c', 12)
- 01911 #define CDIOEJECT DIOCEJECT
- 01912
- 01913 /* Soundcard DSP ioctls. */
- 01914 #define DSPIORATE _IOR('s', 1, unsigned int)
- .Ep 24 include/sys/ioctl.h
- 01915 #define DSPIOSTEREO _IOR('s', 2, unsigned int)
- 01916 #define DSPIOSIZE _IOR('s', 3, unsigned int)
- 01917 #define DSPIOBITS _IOR('s', 4, unsigned int)
- 01918 #define DSPIOSIGN _IOR('s', 5, unsigned int)
- 01919 #define DSPIOMAX _IOW('s', 6, unsigned int)
- 01920 #define DSPIORESET _IO ('s', 7)
- 01921
- 01922 /* Soundcard mixer ioctls. */
- 01923 #define MIXIOGETVOLUME _IORW('s', 10, struct volume_level)
- 01924 #define MIXIOGETINPUTLEFT _IORW('s', 11, struct inout_ctrl)
- 01925 #define MIXIOGETINPUTRIGHT _IORW('s', 12, struct inout_ctrl)
- 01926 #define MIXIOGETOUTPUT _IORW('s', 13, struct inout_ctrl)
- 01927 #define MIXIOSETVOLUME _IORW('s', 20, struct volume_level)
- 01928 #define MIXIOSETINPUTLEFT _IORW('s', 21, struct inout_ctrl)
- 01929 #define MIXIOSETINPUTRIGHT _IORW('s', 22, struct inout_ctrl)
- 01930 #define MIXIOSETOUTPUT _IORW('s', 23, struct inout_ctrl)
- 01931
- 01932 #ifndef _ANSI
- 01933 #include <ansi.h>
- 01934 #endif
- 01935
- 01936 _PROTOTYPE( int ioctl, (int _fd, int _request, void *_data) );
- 01937
- 01938 #endif /* _IOCTL_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/sigcontext.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02000 #ifndef _SIGCONTEXT_H
- 02001 #define _SIGCONTEXT_H
- 02002
- 02003 /* The sigcontext structure is used by the sigreturn(2) system call.
- 02004 * sigreturn() is seldom called by user programs, but it is used internally
- 02005 * by the signal catching mechanism.
- 02006 */
- 02007
- 02008 #ifndef _ANSI_H
- 02009 #include <ansi.h>
- 02010 #endif
- 02011
- 02012 #ifndef _CONFIG_H
- 02013 #include <minix/config.h>
- 02014 #endif
- 02015
- 02016 #if !defined(CHIP)
- 02017 #include "error, configuration is not known"
- 02018 #endif
- 02019
- 02020 /* The following structure should match the stackframe_s structure used
- 02021 * by the kernel's context switching code. Floating point registers should
- 02022 * be added in a different struct.
- 02023 */
- 02024 #if (CHIP == INTEL)
- 02025 struct sigregs {
- 02026 #if _WORD_SIZE == 4
- 02027 short sr_gs;
- 02028 short sr_fs;
- 02029 #endif /* _WORD_SIZE == 4 */
- .Op 25 include/sys/sigcontext.h
- 02030 short sr_es;
- 02031 short sr_ds;
- 02032 int sr_di;
- 02033 int sr_si;
- 02034 int sr_bp;
- 02035 int sr_st; /* stack top -- used in kernel */
- 02036 int sr_bx;
- 02037 int sr_dx;
- 02038 int sr_cx;
- 02039 int sr_retreg;
- 02040 int sr_retadr; /* return address to caller of save -- used
- 02041 * in kernel */
- 02042 int sr_pc;
- 02043 int sr_cs;
- 02044 int sr_psw;
- 02045 int sr_sp;
- 02046 int sr_ss;
- 02047 };
- 02048
- 02049 struct sigframe { /* stack frame created for signalled process */
- 02050 _PROTOTYPE( void (*sf_retadr), (void) );
- 02051 int sf_signo;
- 02052 int sf_code;
- 02053 struct sigcontext *sf_scp;
- 02054 int sf_fp;
- 02055 _PROTOTYPE( void (*sf_retadr2), (void) );
- 02056 struct sigcontext *sf_scpcopy;
- 02057 };
- 02058
- 02059 #else
- 02060 #if (CHIP == M68000)
- 02061 struct sigregs {
- 02062 long sr_retreg; /* d0 */
- 02063 long sr_d1;
- 02064 long sr_d2;
- 02065 long sr_d3;
- 02066 long sr_d4;
- 02067 long sr_d5;
- 02068 long sr_d6;
- 02069 long sr_d7;
- 02070 long sr_a0;
- 02071 long sr_a1;
- 02072 long sr_a2;
- 02073 long sr_a3;
- 02074 long sr_a4;
- 02075 long sr_a5;
- 02076 long sr_a6;
- 02077 long sr_sp; /* also known as a7 */
- 02078 long sr_pc;
- 02079 short sr_psw;
- 02080 short sr_dummy; /* make size multiple of 4 for system.c */
- 02081 };
- 02082 #else
- 02083 #include "error, CHIP is not supported"
- 02084 #endif
- 02085 #endif /* CHIP == INTEL */
- 02086
- 02087 struct sigcontext {
- 02088 int sc_flags; /* sigstack state to restore */
- 02089 long sc_mask; /* signal mask to restore */
- .Ep 26 include/sys/sigcontext.h
- 02090 struct sigregs sc_regs; /* register set to restore */
- 02091 };
- 02092
- 02093 #if (CHIP == INTEL)
- 02094 #if _WORD_SIZE == 4
- 02095 #define sc_gs sc_regs.sr_gs
- 02096 #define sc_fs sc_regs.sr_fs
- 02097 #endif /* _WORD_SIZE == 4 */
- 02098 #define sc_es sc_regs.sr_es
- 02099 #define sc_ds sc_regs.sr_ds
- 02100 #define sc_di sc_regs.sr_di
- 02101 #define sc_si sc_regs.sr_si
- 02102 #define sc_fp sc_regs.sr_bp
- 02103 #define sc_st sc_regs.sr_st /* stack top -- used in kernel */
- 02104 #define sc_bx sc_regs.sr_bx
- 02105 #define sc_dx sc_regs.sr_dx
- 02106 #define sc_cx sc_regs.sr_cx
- 02107 #define sc_retreg sc_regs.sr_retreg
- 02108 #define sc_retadr sc_regs.sr_retadr /* return address to caller of
- 02109 save -- used in kernel */
- 02110 #define sc_pc sc_regs.sr_pc
- 02111 #define sc_cs sc_regs.sr_cs
- 02112 #define sc_psw sc_regs.sr_psw
- 02113 #define sc_sp sc_regs.sr_sp
- 02114 #define sc_ss sc_regs.sr_ss
- 02115 #endif /* CHIP == INTEL */
- 02116
- 02117 #if (CHIP == M68000)
- 02118 #define sc_retreg sc_regs.sr_retreg
- 02119 #define sc_d1 sc_regs.sr_d1
- 02120 #define sc_d2 sc_regs.sr_d2
- 02121 #define sc_d3 sc_regs.sr_d3
- 02122 #define sc_d4 sc_regs.sr_d4
- 02123 #define sc_d5 sc_regs.sr_d5
- 02124 #define sc_d6 sc_regs.sr_d6
- 02125 #define sc_d7 sc_regs.sr_d7
- 02126 #define sc_a0 sc_regs.sr_a0
- 02127 #define sc_a1 sc_regs.sr_a1
- 02128 #define sc_a2 sc_regs.sr_a2
- 02129 #define sc_a3 sc_regs.sr_a3
- 02130 #define sc_a4 sc_regs.sr_a4
- 02131 #define sc_a5 sc_regs.sr_a5
- 02132 #define sc_fp sc_regs.sr_a6
- 02133 #define sc_sp sc_regs.sr_sp
- 02134 #define sc_pc sc_regs.sr_pc
- 02135 #define sc_psw sc_regs.sr_psw
- 02136 #endif /* CHIP == M68000 */
- 02137
- 02138 /* Values for sc_flags. Must agree with <minix/jmp_buf.h>. */
- 02139 #define SC_SIGCONTEXT 2 /* nonzero when signal context is included */
- 02140 #define SC_NOREGLOCALS 4 /* nonzero when registers are not to be
- 02141 saved and restored */
- 02142
- 02143 _PROTOTYPE( int sigreturn, (struct sigcontext *_scp) );
- 02144
- 02145 #endif /* _SIGCONTEXT_H */
- .Op 27 include/sys/ptrace.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/ptrace.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02200 /* <sys/ptrace.h>
- 02201 * definitions for ptrace(2)
- 02202 */
- 02203
- 02204 #ifndef _PTRACE_H
- 02205 #define _PTRACE_H
- 02206
- 02207 #define T_STOP -1 /* stop the process */
- 02208 #define T_OK 0 /* enable tracing by parent for this process */
- 02209 #define T_GETINS 1 /* return value from instruction space */
- 02210 #define T_GETDATA 2 /* return value from data space */
- 02211 #define T_GETUSER 3 /* return value from user process table */
- 02212 #define T_SETINS 4 /* set value from instruction space */
- 02213 #define T_SETDATA 5 /* set value from data space */
- 02214 #define T_SETUSER 6 /* set value in user process table */
- 02215 #define T_RESUME 7 /* resume execution */
- 02216 #define T_EXIT 8 /* exit */
- 02217 #define T_STEP 9 /* set trace bit */
- 02218
- 02219 /* Function Prototypes. */
- 02220 #ifndef _ANSI_H
- 02221 #include <ansi.h>
- 02222 #endif
- 02223
- 02224 _PROTOTYPE( long ptrace, (int _req, pid_t _pid, long _addr, long _data) );
- 02225
- 02226 #endif /* _PTRACE_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/stat.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02300 /* The <sys/stat.h> header defines a struct that is used in the stat() and
- 02301 * fstat functions. The information in this struct comes from the i-node of
- 02302 * some file. These calls are the only approved way to inspect i-nodes.
- 02303 */
- 02304
- 02305 #ifndef _STAT_H
- 02306 #define _STAT_H
- 02307
- 02308 struct stat {
- 02309 dev_t st_dev; /* major/minor device number */
- 02310 ino_t st_ino; /* i-node number */
- 02311 mode_t st_mode; /* file mode, protection bits, etc. */
- 02312 short int st_nlink; /* # links; TEMPORARY HACK: should be nlink_t*/
- 02313 uid_t st_uid; /* uid of the file's owner */
- 02314 short int st_gid; /* gid; TEMPORARY HACK: should be gid_t */
- 02315 dev_t st_rdev;
- 02316 off_t st_size; /* file size */
- 02317 time_t st_atime; /* time of last access */
- 02318 time_t st_mtime; /* time of last data modification */
- 02319 time_t st_ctime; /* time of last file status change */
- .Ep 28 include/sys/stat.h
- 02320 };
- 02321
- 02322 /* Traditional mask definitions for st_mode. */
- 02323 /* The ugly casts on only some of the definitions are to avoid suprising sign
- 02324 * extensions such as S_IFREG != (mode_t) S_IFREG when ints are 32 bits.
- 02325 */
- 02326 #define S_IFMT ((mode_t) 0170000) /* type of file */
- 02327 #define S_IFREG ((mode_t) 0100000) /* regular */
- 02328 #define S_IFBLK 0060000 /* block special */
- 02329 #define S_IFDIR 0040000 /* directory */
- 02330 #define S_IFCHR 0020000 /* character special */
- 02331 #define S_IFIFO 0010000 /* this is a FIFO */
- 02332 #define S_ISUID 0004000 /* set user id on execution */
- 02333 #define S_ISGID 0002000 /* set group id on execution */
- 02334 /* next is reserved for future use */
- 02335 #define S_ISVTX 01000 /* save swapped text even after use */
- 02336
- 02337 /* POSIX masks for st_mode. */
- 02338 #define S_IRWXU 00700 /* owner: rwx------ */
- 02339 #define S_IRUSR 00400 /* owner: r-------- */
- 02340 #define S_IWUSR 00200 /* owner: -w------- */
- 02341 #define S_IXUSR 00100 /* owner: --x------ */
- 02342
- 02343 #define S_IRWXG 00070 /* group: ---rwx--- */
- 02344 #define S_IRGRP 00040 /* group: ---r----- */
- 02345 #define S_IWGRP 00020 /* group: ----w---- */
- 02346 #define S_IXGRP 00010 /* group: -----x--- */
- 02347
- 02348 #define S_IRWXO 00007 /* others: ------rwx */
- 02349 #define S_IROTH 00004 /* others: ------r-- */
- 02350 #define S_IWOTH 00002 /* others: -------w- */
- 02351 #define S_IXOTH 00001 /* others: --------x */
- 02352
- 02353 /* The following macros test st_mode (from POSIX Sec. 5.6.1.1). */
- 02354 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) /* is a reg file */
- 02355 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) /* is a directory */
- 02356 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) /* is a char spec */
- 02357 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) /* is a block spec */
- 02358 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) /* is a pipe/FIFO */
- 02359
- 02360
- 02361 /* Function Prototypes. */
- 02362 #ifndef _ANSI_H
- 02363 #include <ansi.h>
- 02364 #endif
- 02365
- 02366 _PROTOTYPE( int chmod, (const char *_path, Mode_t _mode) );
- 02367 _PROTOTYPE( int fstat, (int _fildes, struct stat *_buf) );
- 02368 _PROTOTYPE( int mkdir, (const char *_path, Mode_t _mode) );
- 02369 _PROTOTYPE( int mkfifo, (const char *_path, Mode_t _mode) );
- 02370 _PROTOTYPE( int stat, (const char *_path, struct stat *_buf) );
- 02371 _PROTOTYPE( mode_t umask, (Mode_t _cmask) );
- 02372
- 02373 #endif /* _STAT_H */
- .Op 29 include/sys/dir.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/dir.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02400 /* The <dir.h> header gives the layout of a directory. */
- 02401
- 02402 #ifndef _DIR_H
- 02403 #define _DIR_H
- 02404
- 02405 #define DIRBLKSIZ 512 /* size of directory block */
- 02406
- 02407 #ifndef DIRSIZ
- 02408 #define DIRSIZ 14
- 02409 #endif
- 02410
- 02411 struct direct {
- 02412 ino_t d_ino;
- 02413 char d_name[DIRSIZ];
- 02414 };
- 02415
- 02416 #endif /* _DIR_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/sys/wait.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02500 /* The <sys/wait.h> header contains macros related to wait(). The value
- 02501 * returned by wait() and waitpid() depends on whether the process
- 02502 * terminated by an exit() call, was killed by a signal, or was stopped
- 02503 * due to job control, as follows:
- 02504 *
- 02505 * High byte Low byte
- 02506 * +---------------------+
- 02507 * exit(status) | status | 0 |
- 02508 * +---------------------+
- 02509 * killed by signal | 0 | signal |
- 02510 * +---------------------+
- 02511 * stopped (job control) | signal | 0177 |
- 02512 * +---------------------+
- 02513 */
- 02514
- 02515 #ifndef _WAIT_H
- 02516 #define _WAIT_H
- 02517
- 02518 #define _LOW(v) ( (v) & 0377)
- 02519 #define _HIGH(v) ( ((v) >> 8) & 0377)
- 02520
- 02521 #define WNOHANG 1 /* do not wait for child to exit */
- 02522 #define WUNTRACED 2 /* for job control; not implemented */
- 02523
- 02524 #define WIFEXITED(s) (_LOW(s) == 0) /* normal exit */
- 02525 #define WEXITSTATUS(s) (_HIGH(s)) /* exit status */
- 02526 #define WTERMSIG(s) (_LOW(s) & 0177) /* sig value */
- 02527 #define WIFSIGNALED(s) (((unsigned int)(s)-1 & 0xFFFF) < 0xFF) /* signaled */
- 02528 #define WIFSTOPPED(s) (_LOW(s) == 0177) /* stopped */
- 02529 #define WSTOPSIG(s) (_HIGH(s) & 0377) /* stop signal */
- .Ep 30 include/sys/wait.h
- 02530
- 02531 /* Function Prototypes. */
- 02532 #ifndef _ANSI_H
- 02533 #include <ansi.h>
- 02534 #endif
- 02535
- 02536 _PROTOTYPE( pid_t wait, (int *_stat_loc) );
- 02537 _PROTOTYPE( pid_t waitpid, (pid_t _pid, int *_stat_loc, int _options) );
- 02538
- 02539 #endif /* _WAIT_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/config.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02600 #ifndef _CONFIG_H
- 02601 #define _CONFIG_H
- 02602
- 02603 /* Minix release and version numbers. */
- 02604 #define OS_RELEASE "2.0"
- 02605 #define OS_VERSION "0"
- 02606
- 02607 /* This file sets configuration parameters for the MINIX kernel, FS, and MM.
- 02608 * It is divided up into two main sections. The first section contains
- 02609 * user-settable parameters. In the second section, various internal system
- 02610 * parameters are set based on the user-settable parameters.
- 02611 */
- 02612
- 02613 /*===========================================================================*
- 02614 * This section contains user-settable parameters *
- 02615 *===========================================================================*/
- 02616 #define MACHINE IBM_PC /* Must be one of the names listed below */
- 02617
- 02618 #define IBM_PC 1 /* any 8088 or 80x86-based system */
- 02619 #define SUN_4 40 /* any Sun SPARC-based system */
- 02620 #define SUN_4_60 40 /* Sun-4/60 (aka SparcStation 1 or Campus) */
- 02621 #define ATARI 60 /* ATARI ST/STe/TT (68000/68030) */
- 02622 #define AMIGA 61 /* Commodore Amiga (68000) */
- 02623 #define MACINTOSH 62 /* Apple Macintosh (68000) */
- 02624
- 02625 /* Word size in bytes (a constant equal to sizeof(int)). */
- 02626 #if __ACK__
- 02627 #define _WORD_SIZE _EM_WSIZE
- 02628 #endif
- 02629
- 02630
- 02631 /* If ROBUST is set to 1, writes of i-node, directory, and indirect blocks
- 02632 * from the cache happen as soon as the blocks are modified. This gives a more
- 02633 * robust, but slower, file system. If it is set to 0, these blocks are not
- 02634 * given any special treatment, which may cause problems if the system crashes.
- 02635 */
- 02636 #define ROBUST 0 /* 0 for speed, 1 for robustness */
- 02637
- 02638 /* Number of slots in the process table for user processes. */
- 02639 #define NR_PROCS 32
- .Op 31 include/minix/config.h
- 02640
- 02641 /* The buffer cache should be made as large as you can afford. */
- 02642 #if (MACHINE == IBM_PC && _WORD_SIZE == 2)
- 02643 #define NR_BUFS 40 /* # blocks in the buffer cache */
- 02644 #define NR_BUF_HASH 64 /* size of buf hash table; MUST BE POWER OF 2*/
- 02645 #endif
- 02646
- 02647 #if (MACHINE == IBM_PC && _WORD_SIZE == 4)
- 02648 #define NR_BUFS 512 /* # blocks in the buffer cache */
- 02649 #define NR_BUF_HASH 1024 /* size of buf hash table; MUST BE POWER OF 2*/
- 02650 #endif
- 02651
- 02652 #if (MACHINE == SUN_4_60)
- 02653 #define NR_BUFS 512 /* # blocks in the buffer cache (<=1536) */
- 02654 #define NR_BUF_HASH 512 /* size of buf hash table; MUST BE POWER OF 2*/
- 02655 #endif
- 02656
- 02657 #if (MACHINE == ATARI)
- 02658 #define NR_BUFS 1536 /* # blocks in the buffer cache (<=1536) */
- 02659 #define NR_BUF_HASH 2048 /* size of buf hash table; MUST BE POWER OF 2*/
- 02660 #endif
- 02661
- 02662 /* Defines for kernel configuration. */
- 02663 #define AUTO_BIOS 0 /* xt_wini.c - use Western's autoconfig BIOS */
- 02664 #define LINEWRAP 1 /* console.c - wrap lines at column 80 */
- 02665 #define ALLOW_GAP_MESSAGES 1 /* proc.c - allow messages in the gap between
- 02666 * the end of bss and lowest stack address */
- 02667
- 02668 /* Enable or disable the second level file system cache on the RAM disk. */
- 02669 #define ENABLE_CACHE2 0
- 02670
- 02671 /* Include or exclude device drivers. Set to 1 to include, 0 to exclude. */
- 02672 #define ENABLE_NETWORKING 0 /* enable TCP/IP code */
- 02673 #define ENABLE_AT_WINI 1 /* enable AT winchester driver */
- 02674 #define ENABLE_BIOS_WINI 0 /* enable BIOS winchester driver */
- 02675 #define ENABLE_ESDI_WINI 0 /* enable ESDI winchester driver */
- 02676 #define ENABLE_XT_WINI 0 /* enable XT winchester driver */
- 02677 #define ENABLE_ADAPTEC_SCSI 0 /* enable ADAPTEC SCSI driver */
- 02678 #define ENABLE_MITSUMI_CDROM 0 /* enable Mitsumi CD-ROM driver */
- 02679 #define ENABLE_SB_AUDIO 0 /* enable Soundblaster audio driver */
- 02680
- 02681 /* DMA_SECTORS may be increased to speed up DMA based drivers. */
- 02682 #define DMA_SECTORS 1 /* DMA buffer size (must be >= 1) */
- 02683
- 02684 /* Include or exclude backwards compatibility code. */
- 02685 #define ENABLE_BINCOMPAT 0 /* for binaries using obsolete calls */
- 02686 #define ENABLE_SRCCOMPAT 0 /* for sources using obsolete calls */
- 02687
- 02688 /* Determine which device to use for pipes. */
- 02689 #define PIPE_DEV ROOT_DEV /* put pipes on root device */
- 02690
- 02691 /* NR_CONS, NR_RS_LINES, and NR_PTYS determine the number of terminals the
- 02692 * system can handle.
- 02693 */
- 02694 #define NR_CONS 2 /* # system consoles (1 to 8) */
- 02695 #define NR_RS_LINES 0 /* # rs232 terminals (0, 1, or 2) */
- 02696 #define NR_PTYS 0 /* # pseudo terminals (0 to 64) */
- 02697
- 02698 #if (MACHINE == ATARI)
- 02699 /* The next define says if you have an ATARI ST or TT */
- .Ep 32 include/minix/config.h
- 02700 #define ATARI_TYPE TT
- 02701 #define ST 1 /* all ST's and Mega ST's */
- 02702 #define STE 2 /* all STe and Mega STe's */
- 02703 #define TT 3
- 02704
- 02705 /* if SCREEN is set to 1 graphical screen operations are possible */
- 02706 #define SCREEN 1
- 02707
- 02708 /* This define says whether the keyboard generates VT100 or IBM_PC escapes. */
- 02709 #define KEYBOARD VT100 /* either VT100 or IBM_PC */
- 02710 #define VT100 100
- 02711
- 02712 /* The next define determines the kind of partitioning. */
- 02713 #define PARTITIONING SUPRA /* one of the following or ATARI */
- 02714 #define SUPRA 1 /*ICD, SUPRA and BMS are all the same */
- 02715 #define BMS 1
- 02716 #define ICD 1
- 02717 #define CBHD 2
- 02718 #define EICKMANN 3
- 02719
- 02720 /* Define the number of hard disk drives on your system. */
- 02721 #define NR_ACSI_DRIVES 3 /* typically 0 or 1 */
- 02722 #define NR_SCSI_DRIVES 1 /* typically 0 (ST, STe) or 1 (TT) */
- 02723
- 02724 /* Some systems need to have a little delay after each winchester
- 02725 * commands. These systems need FAST_DISK set to 0. Other disks do not
- 02726 * need this delay, and thus can have FAST_DISK set to 1 to avoid this delay.
- 02727 */
- 02728 #define FAST_DISK 1 /* 0 or 1 */
- 02729
- 02730 /* Note: if you want to make your kernel smaller, you can set NR_FD_DRIVES
- 02731 * to 0. You will still be able to boot minix.img from floppy. However, you
- 02732 * MUST fetch both the root and usr filesystem from a hard disk
- 02733 */
- 02734
- 02735 /* Define the number of floppy disk drives on your system. */
- 02736 #define NR_FD_DRIVES 1 /* 0, 1, 2 */
- 02737
- 02738 /* This configuration define controls parallel printer code. */
- 02739 #define PAR_PRINTER 1 /* disable (0) / enable (1) parallel printer */
- 02740
- 02741 /* This configuration define controls disk controller clock code. */
- 02742 #define HD_CLOCK 1 /* disable (0) / enable (1) hard disk clock */
- 02743
- 02744 #endif
- 02745
- 02746
- 02747 /*===========================================================================*
- 02748 * There are no user-settable parameters after this line *
- 02749 *===========================================================================*/
- 02750 /* Set the CHIP type based on the machine selected. The symbol CHIP is actually
- 02751 * indicative of more than just the CPU. For example, machines for which
- 02752 * CHIP == INTEL are expected to have 8259A interrrupt controllers and the
- 02753 * other properties of IBM PC/XT/AT/386 types machines in general. */
- 02754 #define INTEL 1 /* CHIP type for PC, XT, AT, 386 and clones */
- 02755 #define M68000 2 /* CHIP type for Atari, Amiga, Macintosh */
- 02756 #define SPARC 3 /* CHIP type for SUN-4 (e.g. SPARCstation) */
- 02757
- 02758 /* Set the FP_FORMAT type based on the machine selected, either hw or sw */
- 02759 #define FP_NONE 0 /* no floating point support */
- .Op 33 include/minix/config.h
- 02760 #define FP_IEEE 1 /* conform IEEE floating point standard */
- 02761
- 02762 #if (MACHINE == IBM_PC)
- 02763 #define CHIP INTEL
- 02764 #define SHADOWING 0
- 02765 #define ENABLE_WINI (ENABLE_AT_WINI || ENABLE_BIOS_WINI ||
- 02766 ENABLE_ESDI_WINI || ENABLE_XT_WINI)
- 02767 #define ENABLE_SCSI (ENABLE_ADAPTEC_SCSI)
- 02768 #define ENABLE_CDROM (ENABLE_MITSUMI_CDROM)
- 02769 #define ENABLE_AUDIO (ENABLE_SB_AUDIO)
- 02770 #endif
- 02771
- 02772 #if (MACHINE == ATARI) || (MACHINE == AMIGA) || (MACHINE == MACINTOSH)
- 02773 #define CHIP M68000
- 02774 #define SHADOWING 1
- 02775 #endif
- 02776
- 02777 #if (MACHINE == SUN_4) || (MACHINE == SUN_4_60)
- 02778 #define CHIP SPARC
- 02779 #define FP_FORMAT FP_IEEE
- 02780 #define SHADOWING 0
- 02781 #endif
- 02782
- 02783 #if (MACHINE == ATARI) || (MACHINE == SUN_4)
- 02784 #define ASKDEV 1 /* ask for boot device */
- 02785 #define FASTLOAD 1 /* use multiple block transfers to init ram */
- 02786 #endif
- 02787
- 02788 #if (ATARI_TYPE == TT) /* and all other 68030's */
- 02789 #define FPP
- 02790 #undef SHADOWING
- 02791 #define SHADOWING 0
- 02792 #endif
- 02793
- 02794 #ifndef FP_FORMAT
- 02795 #define FP_FORMAT FP_NONE
- 02796 #endif
- 02797
- 02798 /* The file buf.h uses MAYBE_WRITE_IMMED. */
- 02799 #if ROBUST
- 02800 #define MAYBE_WRITE_IMMED WRITE_IMMED /* slower but perhaps safer */
- 02801 #else
- 02802 #define MAYBE_WRITE_IMMED 0 /* faster */
- 02803 #endif
- 02804
- 02805 #ifndef MACHINE
- 02806 error "In <minix/config.h> please define MACHINE"
- 02807 #endif
- 02808
- 02809 #ifndef CHIP
- 02810 error "In <minix/config.h> please define MACHINE to have a legal value"
- 02811 #endif
- 02812
- 02813 #if (MACHINE == 0)
- 02814 error "MACHINE has incorrect value (0)"
- 02815 #endif
- 02816
- 02817 #endif /* _CONFIG_H */
- .Ep 34 include/minix/const.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/const.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 02900 /* Copyright (C) 1997 by Prentice-Hall, Inc. Permission is hereby granted
- 02901 * to redistribute the binary and source programs of this system for
- 02902 * educational or research purposes. For other use, written permission from
- 02903 * Prentice-Hall is required.
- 02904 */
- 02905
- 02906 #define EXTERN extern /* used in *.h files */
- 02907 #define PRIVATE static /* PRIVATE x limits the scope of x */
- 02908 #define PUBLIC /* PUBLIC is the opposite of PRIVATE */
- 02909 #define FORWARD static /* some compilers require this to be 'static'*/
- 02910
- 02911 #define TRUE 1 /* used for turning integers into Booleans */
- 02912 #define FALSE 0 /* used for turning integers into Booleans */
- 02913
- 02914 #define HZ 60 /* clock freq (software settable on IBM-PC) */
- 02915 #define BLOCK_SIZE 1024 /* # bytes in a disk block */
- 02916 #define SUPER_USER (uid_t) 0 /* uid_t of superuser */
- 02917
- 02918 #define MAJOR 8 /* major device = (dev>>MAJOR) & 0377 */
- 02919 #define MINOR 0 /* minor device = (dev>>MINOR) & 0377 */
- 02920
- 02921 #define NULL ((void *)0) /* null pointer */
- 02922 #define CPVEC_NR 16 /* max # of entries in a SYS_VCOPY request */
- 02923 #define NR_IOREQS MIN(NR_BUFS, 64)
- 02924 /* maximum number of entries in an iorequest */
- 02925
- 02926 #define NR_SEGS 3 /* # segments per process */
- 02927 #define T 0 /* proc[i].mem_map[T] is for text */
- 02928 #define D 1 /* proc[i].mem_map[D] is for data */
- 02929 #define S 2 /* proc[i].mem_map[S] is for stack */
- 02930
- 02931 /* Process numbers of some important processes. */
- 02932 #define MM_PROC_NR 0 /* process number of memory manager */
- 02933 #define FS_PROC_NR 1 /* process number of file system */
- 02934 #define INET_PROC_NR 2 /* process number of the TCP/IP server */
- 02935 #define INIT_PROC_NR (INET_PROC_NR + ENABLE_NETWORKING)
- 02936 /* init -- the process that goes multiuser */
- 02937 #define LOW_USER (INET_PROC_NR + ENABLE_NETWORKING)
- 02938 /* first user not part of operating system */
- 02939
- 02940 /* Miscellaneous */
- 02941 #define BYTE 0377 /* mask for 8 bits */
- 02942 #define READING 0 /* copy data to user */
- 02943 #define WRITING 1 /* copy data from user */
- 02944 #define NO_NUM 0x8000 /* used as numerical argument to panic() */
- 02945 #define NIL_PTR (char *) 0 /* generally useful expression */
- 02946 #define HAVE_SCATTERED_IO 1 /* scattered I/O is now standard */
- 02947
- 02948 /* Macros. */
- 02949 #define MAX(a, b) ((a) > (b) ? (a) : (b))
- 02950 #define MIN(a, b) ((a) < (b) ? (a) : (b))
- 02951
- 02952 /* Number of tasks. */
- 02953 #define NR_TASKS (9 + ENABLE_WINI + ENABLE_SCSI + ENABLE_CDROM
- 02954 + ENABLE_NETWORKING + 2 * ENABLE_AUDIO)
- .Op 35 include/minix/const.h
- 02955
- 02956 /* Memory is allocated in clicks. */
- 02957 #if (CHIP == INTEL)
- 02958 #define CLICK_SIZE 256 /* unit in which memory is allocated */
- 02959 #define CLICK_SHIFT 8 /* log2 of CLICK_SIZE */
- 02960 #endif
- 02961
- 02962 #if (CHIP == SPARC) || (CHIP == M68000)
- 02963 #define CLICK_SIZE 4096 /* unit in which memory is alocated */
- 02964 #define CLICK_SHIFT 12 /* 2log of CLICK_SIZE */
- 02965 #endif
- 02966
- 02967 #define click_to_round_k(n)
- 02968 ((unsigned) ((((unsigned long) (n) << CLICK_SHIFT) + 512) / 1024))
- 02969 #if CLICK_SIZE < 1024
- 02970 #define k_to_click(n) ((n) * (1024 / CLICK_SIZE))
- 02971 #else
- 02972 #define k_to_click(n) ((n) / (CLICK_SIZE / 1024))
- 02973 #endif
- 02974
- 02975 #define ABS -999 /* this process means absolute memory */
- 02976
- 02977 /* Flag bits for i_mode in the inode. */
- 02978 #define I_TYPE 0170000 /* this field gives inode type */
- 02979 #define I_REGULAR 0100000 /* regular file, not dir or special */
- 02980 #define I_BLOCK_SPECIAL 0060000 /* block special file */
- 02981 #define I_DIRECTORY 0040000 /* file is a directory */
- 02982 #define I_CHAR_SPECIAL 0020000 /* character special file */
- 02983 #define I_NAMED_PIPE 0010000 /* named pipe (FIFO) */
- 02984 #define I_SET_UID_BIT 0004000 /* set effective uid_t on exec */
- 02985 #define I_SET_GID_BIT 0002000 /* set effective gid_t on exec */
- 02986 #define ALL_MODES 0006777 /* all bits for user, group and others */
- 02987 #define RWX_MODES 0000777 /* mode bits for RWX only */
- 02988 #define R_BIT 0000004 /* Rwx protection bit */
- 02989 #define W_BIT 0000002 /* rWx protection bit */
- 02990 #define X_BIT 0000001 /* rwX protection bit */
- 02991 #define I_NOT_ALLOC 0000000 /* this inode is free */
- 02992
- 02993 /* Some limits. */
- 02994 #define MAX_BLOCK_NR ((block_t) 077777777) /* largest block number */
- 02995 #define HIGHEST_ZONE ((zone_t) 077777777) /* largest zone number */
- 02996 #define MAX_INODE_NR ((ino_t) 0177777) /* largest inode number */
- 02997 #define MAX_FILE_POS ((off_t) 037777777777) /* largest legal file offset */
- 02998
- 02999 #define NO_BLOCK ((block_t) 0) /* absence of a block number */
- 03000 #define NO_ENTRY ((ino_t) 0) /* absence of a dir entry */
- 03001 #define NO_ZONE ((zone_t) 0) /* absence of a zone number */
- 03002 #define NO_DEV ((dev_t) 0) /* absence of a device numb */
- .Ep 36 include/minix/type.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/type.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03100 #ifndef _TYPE_H
- 03101 #define _TYPE_H
- 03102 #ifndef _MINIX_TYPE_H
- 03103 #define _MINIX_TYPE_H
- 03104
- 03105 /* Type definitions. */
- 03106 typedef unsigned int vir_clicks; /* virtual addresses and lengths in clicks */
- 03107 typedef unsigned long phys_bytes;/* physical addresses and lengths in bytes */
- 03108 typedef unsigned int phys_clicks;/* physical addresses and lengths in clicks */
- 03109
- 03110 #if (CHIP == INTEL)
- 03111 typedef unsigned int vir_bytes; /* virtual addresses and lengths in bytes */
- 03112 #endif
- 03113
- 03114 #if (CHIP == M68000)
- 03115 typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
- 03116 #endif
- 03117
- 03118 #if (CHIP == SPARC)
- 03119 typedef unsigned long vir_bytes;/* virtual addresses and lengths in bytes */
- 03120 #endif
- 03121
- 03122 /* Types relating to messages. */
- 03123 #define M1 1
- 03124 #define M3 3
- 03125 #define M4 4
- 03126 #define M3_STRING 14
- 03127
- 03128 typedef struct {int m1i1, m1i2, m1i3; char *m1p1, *m1p2, *m1p3;} mess_1;
- 03129 typedef struct {int m2i1, m2i2, m2i3; long m2l1, m2l2; char *m2p1;} mess_2;
- 03130 typedef struct {int m3i1, m3i2; char *m3p1; char m3ca1[M3_STRING];} mess_3;
- 03131 typedef struct {long m4l1, m4l2, m4l3, m4l4, m4l5;} mess_4;
- 03132 typedef struct {char m5c1, m5c2; int m5i1, m5i2; long m5l1, m5l2, m5l3;}mess_5;
- 03133 typedef struct {int m6i1, m6i2, m6i3; long m6l1; sighandler_t m6f1;} mess_6;
- 03134
- 03135 typedef struct {
- 03136 int m_source; /* who sent the message */
- 03137 int m_type; /* what kind of message is it */
- 03138 union {
- 03139 mess_1 m_m1;
- 03140 mess_2 m_m2;
- 03141 mess_3 m_m3;
- 03142 mess_4 m_m4;
- 03143 mess_5 m_m5;
- 03144 mess_6 m_m6;
- 03145 } m_u;
- 03146 } message;
- 03147
- 03148 /* The following defines provide names for useful members. */
- 03149 #define m1_i1 m_u.m_m1.m1i1
- 03150 #define m1_i2 m_u.m_m1.m1i2
- 03151 #define m1_i3 m_u.m_m1.m1i3
- 03152 #define m1_p1 m_u.m_m1.m1p1
- 03153 #define m1_p2 m_u.m_m1.m1p2
- 03154 #define m1_p3 m_u.m_m1.m1p3
- .Op 37 include/minix/type.h
- 03155
- 03156 #define m2_i1 m_u.m_m2.m2i1
- 03157 #define m2_i2 m_u.m_m2.m2i2
- 03158 #define m2_i3 m_u.m_m2.m2i3
- 03159 #define m2_l1 m_u.m_m2.m2l1
- 03160 #define m2_l2 m_u.m_m2.m2l2
- 03161 #define m2_p1 m_u.m_m2.m2p1
- 03162
- 03163 #define m3_i1 m_u.m_m3.m3i1
- 03164 #define m3_i2 m_u.m_m3.m3i2
- 03165 #define m3_p1 m_u.m_m3.m3p1
- 03166 #define m3_ca1 m_u.m_m3.m3ca1
- 03167
- 03168 #define m4_l1 m_u.m_m4.m4l1
- 03169 #define m4_l2 m_u.m_m4.m4l2
- 03170 #define m4_l3 m_u.m_m4.m4l3
- 03171 #define m4_l4 m_u.m_m4.m4l4
- 03172 #define m4_l5 m_u.m_m4.m4l5
- 03173
- 03174 #define m5_c1 m_u.m_m5.m5c1
- 03175 #define m5_c2 m_u.m_m5.m5c2
- 03176 #define m5_i1 m_u.m_m5.m5i1
- 03177 #define m5_i2 m_u.m_m5.m5i2
- 03178 #define m5_l1 m_u.m_m5.m5l1
- 03179 #define m5_l2 m_u.m_m5.m5l2
- 03180 #define m5_l3 m_u.m_m5.m5l3
- 03181
- 03182 #define m6_i1 m_u.m_m6.m6i1
- 03183 #define m6_i2 m_u.m_m6.m6i2
- 03184 #define m6_i3 m_u.m_m6.m6i3
- 03185 #define m6_l1 m_u.m_m6.m6l1
- 03186 #define m6_f1 m_u.m_m6.m6f1
- 03187
- 03188 struct mem_map {
- 03189 vir_clicks mem_vir; /* virtual address */
- 03190 phys_clicks mem_phys; /* physical address */
- 03191 vir_clicks mem_len; /* length */
- 03192 };
- 03193
- 03194 struct iorequest_s {
- 03195 long io_position; /* position in device file (really off_t) */
- 03196 char *io_buf; /* buffer in user space */
- 03197 int io_nbytes; /* size of request */
- 03198 unsigned short io_request; /* read, write (optionally) */
- 03199 };
- 03200 #endif /* _TYPE_H */
- 03201
- 03202 typedef struct {
- 03203 vir_bytes iov_addr; /* address of an I/O buffer */
- 03204 vir_bytes iov_size; /* sizeof an I/O buffer */
- 03205 } iovec_t;
- 03206
- 03207 typedef struct {
- 03208 vir_bytes cpv_src; /* src address of data */
- 03209 vir_bytes cpv_dst; /* dst address of data */
- 03210 vir_bytes cpv_size; /* size of data */
- 03211 } cpvec_t;
- 03212
- 03213 /* MM passes the address of a structure of this type to KERNEL when
- 03214 * do_sendsig() is invoked as part of the signal catching mechanism.
- .Ep 38 include/minix/type.h
- 03215 * The structure contain all the information that KERNEL needs to build
- 03216 * the signal stack.
- 03217 */
- 03218 struct sigmsg {
- 03219 int sm_signo; /* signal number being caught */
- 03220 unsigned long sm_mask; /* mask to restore when handler returns */
- 03221 vir_bytes sm_sighandler; /* address of handler */
- 03222 vir_bytes sm_sigreturn; /* address of _sigreturn in C library */
- 03223 vir_bytes sm_stkptr; /* user stack pointer */
- 03224 };
- 03225
- 03226 #define MESS_SIZE (sizeof(message)) /* might need usizeof from fs here */
- 03227 #define NIL_MESS ((message *) 0)
- 03228
- 03229 struct psinfo { /* information for the ps(1) program */
- 03230 u16_t nr_tasks, nr_procs; /* NR_TASKS and NR_PROCS constants. */
- 03231 vir_bytes proc, mproc, fproc; /* addresses of the main process tables. */
- 03232 };
- 03233
- 03234 #endif /* _MINIX_TYPE_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/syslib.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03300 /* Prototypes for system library functions. */
- 03301
- 03302 #ifndef _SYSLIB_H
- 03303 #define _SYSLIB_H
- 03304
- 03305 /* Hide names to avoid name space pollution. */
- 03306 #define sendrec _sendrec
- 03307 #define receive _receive
- 03308 #define send _send
- 03309
- 03310 /* Minix user+system library. */
- 03311 _PROTOTYPE( void printk, (char *_fmt, ...) );
- 03312 _PROTOTYPE( int sendrec, (int _src_dest, message *_m_ptr) );
- 03313 _PROTOTYPE( int _taskcall, (int _who, int _syscallnr, message *_msgptr) );
- 03314
- 03315 /* Minix system library. */
- 03316 _PROTOTYPE( int receive, (int _src, message *_m_ptr) );
- 03317 _PROTOTYPE( int send, (int _dest, message *_m_ptr) );
- 03318
- 03319 _PROTOTYPE( int sys_abort, (int _how, ...) );
- 03320 _PROTOTYPE( int sys_adjmap, (int _proc, struct mem_map *_ptr,
- 03321 vir_clicks _data_clicks, vir_clicks _sp) );
- 03322 _PROTOTYPE( int sys_copy, (int _src_proc, int _src_seg, phys_bytes _src_vir,
- 03323 int _dst_proc, int _dst_seg, phys_bytes _dst_vir, phys_bytes _bytes));
- 03324 _PROTOTYPE( int sys_exec, (int _proc, char *_ptr, int _traced,
- 03325 char *_aout, vir_bytes _initpc) );
- 03326 _PROTOTYPE( int sys_execmap, (int _proc, struct mem_map *_ptr) );
- 03327 _PROTOTYPE( int sys_fork, (int _parent, int _child, int _pid,
- 03328 phys_clicks _shadow) );
- 03329 _PROTOTYPE( int sys_fresh, (int _proc, struct mem_map *_ptr,
- .Op 39 include/minix/syslib.h
- 03330 phys_clicks _dc, phys_clicks *_basep, phys_clicks *_sizep) );
- 03331 _PROTOTYPE( int sys_getsp, (int _proc, vir_bytes *_newsp) );
- 03332 _PROTOTYPE( int sys_newmap, (int _proc, struct mem_map *_ptr) );
- 03333 _PROTOTYPE( int sys_getmap, (int _proc, struct mem_map *_ptr) );
- 03334 _PROTOTYPE( int sys_sendsig, (int _proc, struct sigmsg *_ptr) );
- 03335 _PROTOTYPE( int sys_oldsig, (int _proc, int _sig, sighandler_t _sighandler));
- 03336 _PROTOTYPE( int sys_endsig, (int _proc) );
- 03337 _PROTOTYPE( int sys_sigreturn, (int _proc, vir_bytes _scp, int _flags) );
- 03338 _PROTOTYPE( int sys_trace, (int _req, int _procnr, long _addr, long *_data_p));
- 03339 _PROTOTYPE( int sys_xit, (int _parent, int _proc, phys_clicks *_basep,
- 03340 phys_clicks *_sizep));
- 03341 _PROTOTYPE( int sys_kill, (int _proc, int _sig) );
- 03342 _PROTOTYPE( int sys_times, (int _proc, clock_t _ptr[5]) );
- 03343
- 03344 #endif /* _SYSLIB_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/callnr.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03400 #define NCALLS 77 /* number of system calls allowed */
- 03401
- 03402 #define EXIT 1
- 03403 #define FORK 2
- 03404 #define READ 3
- 03405 #define WRITE 4
- 03406 #define OPEN 5
- 03407 #define CLOSE 6
- 03408 #define WAIT 7
- 03409 #define CREAT 8
- 03410 #define LINK 9
- 03411 #define UNLINK 10
- 03412 #define WAITPID 11
- 03413 #define CHDIR 12
- 03414 #define TIME 13
- 03415 #define MKNOD 14
- 03416 #define CHMOD 15
- 03417 #define CHOWN 16
- 03418 #define BRK 17
- 03419 #define STAT 18
- 03420 #define LSEEK 19
- 03421 #define GETPID 20
- 03422 #define MOUNT 21
- 03423 #define UMOUNT 22
- 03424 #define SETUID 23
- 03425 #define GETUID 24
- 03426 #define STIME 25
- 03427 #define PTRACE 26
- 03428 #define ALARM 27
- 03429 #define FSTAT 28
- 03430 #define PAUSE 29
- 03431 #define UTIME 30
- 03432 #define ACCESS 33
- 03433 #define SYNC 36
- 03434 #define KILL 37
- .Ep 40 include/minix/callnr.h
- 03435 #define RENAME 38
- 03436 #define MKDIR 39
- 03437 #define RMDIR 40
- 03438 #define DUP 41
- 03439 #define PIPE 42
- 03440 #define TIMES 43
- 03441 #define SETGID 46
- 03442 #define GETGID 47
- 03443 #define SIGNAL 48
- 03444 #define IOCTL 54
- 03445 #define FCNTL 55
- 03446 #define EXEC 59
- 03447 #define UMASK 60
- 03448 #define CHROOT 61
- 03449 #define SETSID 62
- 03450 #define GETPGRP 63
- 03451
- 03452 /* The following are not system calls, but are processed like them. */
- 03453 #define KSIG 64 /* kernel detected a signal */
- 03454 #define UNPAUSE 65 /* to MM or FS: check for EINTR */
- 03455 #define REVIVE 67 /* to FS: revive a sleeping process */
- 03456 #define TASK_REPLY 68 /* to FS: reply code from tty task */
- 03457
- 03458 /* Posix signal handling. */
- 03459 #define SIGACTION 71
- 03460 #define SIGSUSPEND 72
- 03461 #define SIGPENDING 73
- 03462 #define SIGPROCMASK 74
- 03463 #define SIGRETURN 75
- 03464
- 03465 #define REBOOT 76
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/com.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03500 /* System calls. */
- 03501 #define SEND 1 /* function code for sending messages */
- 03502 #define RECEIVE 2 /* function code for receiving messages */
- 03503 #define BOTH 3 /* function code for SEND + RECEIVE */
- 03504 #define ANY (NR_PROCS+100) /* receive(ANY, buf) accepts from any source */
- 03505
- 03506 /* Task numbers, function codes and reply codes. */
- 03507
- 03508 /* The values of several task numbers depend on whether they or other tasks
- 03509 * are enabled. They are defined as (PREVIOUS_TASK - ENABLE_TASK) in general.
- 03510 * ENABLE_TASK is either 0 or 1, so a task either gets a new number, or gets
- 03511 * the same number as the previous task and is further unused.
- 03512 * The TTY task must always have the most negative number so that it is
- 03513 * initialized first. Many of the TTY function codes are shared with other
- 03514 * tasks.
- 03515 */
- 03516
- 03517 #define TTY (DL_ETH - 1)
- 03518 /* terminal I/O class */
- 03519 # define CANCEL 0 /* general req to force a task to cancel */
- .Op 41 include/minix/com.h
- 03520 # define HARD_INT 2 /* fcn code for all hardware interrupts */
- 03521 # define DEV_READ 3 /* fcn code for reading from tty */
- 03522 # define DEV_WRITE 4 /* fcn code for writing to tty */
- 03523 # define DEV_IOCTL 5 /* fcn code for ioctl */
- 03524 # define DEV_OPEN 6 /* fcn code for opening tty */
- 03525 # define DEV_CLOSE 7 /* fcn code for closing tty */
- 03526 # define SCATTERED_IO 8 /* fcn code for multiple reads/writes */
- 03527 # define TTY_SETPGRP 9 /* fcn code for setpgroup */
- 03528 # define TTY_EXIT 10 /* a process group leader has exited */
- 03529 # define OPTIONAL_IO 16 /* modifier to DEV_* codes within vector */
- 03530 # define SUSPEND -998 /* used in interrupts when tty has no data */
- 03531
- 03532 #define DL_ETH (CDROM - ENABLE_NETWORKING)
- 03533 /* networking task */
- 03534
- 03535 /* Message type for data link layer reqests. */
- 03536 # define DL_WRITE 3
- 03537 # define DL_WRITEV 4
- 03538 # define DL_READ 5
- 03539 # define DL_READV 6
- 03540 # define DL_INIT 7
- 03541 # define DL_STOP 8
- 03542 # define DL_GETSTAT 9
- 03543
- 03544 /* Message type for data link layer replies. */
- 03545 # define DL_INIT_REPLY 20
- 03546 # define DL_TASK_REPLY 21
- 03547
- 03548 # define DL_PORT m2_i1
- 03549 # define DL_PROC m2_i2
- 03550 # define DL_COUNT m2_i3
- 03551 # define DL_MODE m2_l1
- 03552 # define DL_CLCK m2_l2
- 03553 # define DL_ADDR m2_p1
- 03554 # define DL_STAT m2_l1
- 03555
- 03556 /* Bits in 'DL_STAT' field of DL replies. */
- 03557 # define DL_PACK_SEND 0x01
- 03558 # define DL_PACK_RECV 0x02
- 03559 # define DL_READ_IP 0x04
- 03560
- 03561 /* Bits in 'DL_MODE' field of DL requests. */
- 03562 # define DL_NOMODE 0x0
- 03563 # define DL_PROMISC_REQ 0x2
- 03564 # define DL_MULTI_REQ 0x4
- 03565 # define DL_BROAD_REQ 0x8
- 03566
- 03567 # define NW_OPEN DEV_OPEN
- 03568 # define NW_CLOSE DEV_CLOSE
- 03569 # define NW_READ DEV_READ
- 03570 # define NW_WRITE DEV_WRITE
- 03571 # define NW_IOCTL DEV_IOCTL
- 03572 # define NW_CANCEL CANCEL
- 03573
- 03574 #define CDROM (AUDIO - ENABLE_CDROM)
- 03575 /* cd-rom device task */
- 03576
- 03577 #define AUDIO (MIXER - ENABLE_AUDIO)
- 03578 #define MIXER (SCSI - ENABLE_AUDIO)
- 03579 /* audio & mixer device tasks */
- .Ep 42 include/minix/com.h
- 03580
- 03581 #define SCSI (WINCHESTER - ENABLE_SCSI)
- 03582 /* scsi device task */
- 03583
- 03584 #define WINCHESTER (SYN_ALRM_TASK - ENABLE_WINI)
- 03585 /* winchester (hard) disk class */
- 03586
- 03587 #define SYN_ALRM_TASK -8 /* task to send CLOCK_INT messages */
- 03588
- 03589 #define IDLE -7 /* task to run when there's nothing to run */
- 03590
- 03591 #define PRINTER -6 /* printer I/O class */
- 03592
- 03593 #define FLOPPY -5 /* floppy disk class */
- 03594
- 03595 #define MEM -4 /* /dev/ram, /dev/(k)mem and /dev/null class */
- 03596 # define NULL_MAJOR 1 /* major device for /dev/null */
- 03597 # define RAM_DEV 0 /* minor device for /dev/ram */
- 03598 # define MEM_DEV 1 /* minor device for /dev/mem */
- 03599 # define KMEM_DEV 2 /* minor device for /dev/kmem */
- 03600 # define NULL_DEV 3 /* minor device for /dev/null */
- 03601
- 03602 #define CLOCK -3 /* clock class */
- 03603 # define SET_ALARM 1 /* fcn code to CLOCK, set up alarm */
- 03604 # define GET_TIME 3 /* fcn code to CLOCK, get real time */
- 03605 # define SET_TIME 4 /* fcn code to CLOCK, set real time */
- 03606 # define GET_UPTIME 5 /* fcn code to CLOCK, get uptime */
- 03607 # define SET_SYNC_AL 6 /* fcn code to CLOCK, set up alarm which */
- 03608 /* times out with a send */
- 03609 # define REAL_TIME 1 /* reply from CLOCK: here is real time */
- 03610 # define CLOCK_INT HARD_INT
- 03611 /* this code will only be sent by */
- 03612 /* SYN_ALRM_TASK to a task that requested a */
- 03613 /* synchronous alarm */
- 03614
- 03615 #define SYSTASK -2 /* internal functions */
- 03616 # define SYS_XIT 1 /* fcn code for sys_xit(parent, proc) */
- 03617 # define SYS_GETSP 2 /* fcn code for sys_sp(proc, &new_sp) */
- 03618 # define SYS_OLDSIG 3 /* fcn code for sys_oldsig(proc, sig) */
- 03619 # define SYS_FORK 4 /* fcn code for sys_fork(parent, child) */
- 03620 # define SYS_NEWMAP 5 /* fcn code for sys_newmap(procno, map_ptr) */
- 03621 # define SYS_COPY 6 /* fcn code for sys_copy(ptr) */
- 03622 # define SYS_EXEC 7 /* fcn code for sys_exec(procno, new_sp) */
- 03623 # define SYS_TIMES 8 /* fcn code for sys_times(procno, bufptr) */
- 03624 # define SYS_ABORT 9 /* fcn code for sys_abort() */
- 03625 # define SYS_FRESH 10 /* fcn code for sys_fresh() (Atari only) */
- 03626 # define SYS_KILL 11 /* fcn code for sys_kill(proc, sig) */
- 03627 # define SYS_GBOOT 12 /* fcn code for sys_gboot(procno, bootptr) */
- 03628 # define SYS_UMAP 13 /* fcn code for sys_umap(procno, etc) */
- 03629 # define SYS_MEM 14 /* fcn code for sys_mem() */
- 03630 # define SYS_TRACE 15 /* fcn code for sys_trace(req,pid,addr,data) */
- 03631 # define SYS_VCOPY 16 /* fnc code for sys_vcopy(src_proc, dest_proc,
- 03632 vcopy_s, vcopy_ptr) */
- 03633 # define SYS_SENDSIG 17 /* fcn code for sys_sendsig(&sigmsg) */
- 03634 # define SYS_SIGRETURN 18 /* fcn code for sys_sigreturn(&sigmsg) */
- 03635 # define SYS_ENDSIG 19 /* fcn code for sys_endsig(procno) */
- 03636 # define SYS_GETMAP 20 /* fcn code for sys_getmap(procno, map_ptr) */
- 03637
- 03638 #define HARDWARE -1 /* used as source on interrupt generated msgs*/
- 03639
- .Op 43 include/minix/com.h
- 03640 /* Names of message fields for messages to CLOCK task. */
- 03641 #define DELTA_TICKS m6_l1 /* alarm interval in clock ticks */
- 03642 #define FUNC_TO_CALL m6_f1 /* pointer to function to call */
- 03643 #define NEW_TIME m6_l1 /* value to set clock to (SET_TIME) */
- 03644 #define CLOCK_PROC_NR m6_i1 /* which proc (or task) wants the alarm? */
- 03645 #define SECONDS_LEFT m6_l1 /* how many seconds were remaining */
- 03646
- 03647 /* Names of message fields used for messages to block and character tasks. */
- 03648 #define DEVICE m2_i1 /* major-minor device */
- 03649 #define PROC_NR m2_i2 /* which (proc) wants I/O? */
- 03650 #define COUNT m2_i3 /* how many bytes to transfer */
- 03651 #define REQUEST m2_i3 /* ioctl request code */
- 03652 #define POSITION m2_l1 /* file offset */
- 03653 #define ADDRESS m2_p1 /* core buffer address */
- 03654
- 03655 /* Names of message fields for messages to TTY task. */
- 03656 #define TTY_LINE DEVICE /* message parameter: terminal line */
- 03657 #define TTY_REQUEST COUNT /* message parameter: ioctl request code */
- 03658 #define TTY_SPEK POSITION /* message parameter: ioctl speed, erasing */
- 03659 #define TTY_FLAGS m2_l2 /* message parameter: ioctl tty mode */
- 03660 #define TTY_PGRP m2_i3 /* message parameter: process group */
- 03661
- 03662 /* Names of the message fields for QIC 02 status reply from tape driver */
- 03663 #define TAPE_STAT0 m2_l1
- 03664 #define TAPE_STAT1 m2_l2
- 03665
- 03666 /* Names of messages fields used in reply messages from tasks. */
- 03667 #define REP_PROC_NR m2_i1 /* # of proc on whose behalf I/O was done */
- 03668 #define REP_STATUS m2_i2 /* bytes transferred or error number */
- 03669
- 03670 /* Names of fields for copy message to SYSTASK. */
- 03671 #define SRC_SPACE m5_c1 /* T or D space (stack is also D) */
- 03672 #define SRC_PROC_NR m5_i1 /* process to copy from */
- 03673 #define SRC_BUFFER m5_l1 /* virtual address where data come from */
- 03674 #define DST_SPACE m5_c2 /* T or D space (stack is also D) */
- 03675 #define DST_PROC_NR m5_i2 /* process to copy to */
- 03676 #define DST_BUFFER m5_l2 /* virtual address where data go to */
- 03677 #define COPY_BYTES m5_l3 /* number of bytes to copy */
- 03678
- 03679 /* Field names for accounting, SYSTASK and miscellaneous. */
- 03680 #define USER_TIME m4_l1 /* user time consumed by process */
- 03681 #define SYSTEM_TIME m4_l2 /* system time consumed by process */
- 03682 #define CHILD_UTIME m4_l3 /* user time consumed by process' children */
- 03683 #define CHILD_STIME m4_l4 /* sys time consumed by process' children */
- 03684 #define BOOT_TICKS m4_l5 /* number of clock ticks since boot time */
- 03685
- 03686 #define PROC1 m1_i1 /* indicates a process */
- 03687 #define PROC2 m1_i2 /* indicates a process */
- 03688 #define PID m1_i3 /* process id passed from MM to kernel */
- 03689 #define STACK_PTR m1_p1 /* used for stack ptr in sys_exec, sys_getsp */
- 03690 #define PR m6_i1 /* process number for sys_sig */
- 03691 #define SIGNUM m6_i2 /* signal number for sys_sig */
- 03692 #define FUNC m6_f1 /* function pointer for sys_sig */
- 03693 #define MEM_PTR m1_p1 /* tells where memory map is for sys_newmap */
- 03694 #define NAME_PTR m1_p2 /* tells where program name is for dmp */
- 03695 #define IP_PTR m1_p3 /* initial value for ip after exec */
- 03696 #define SIG_PROC m2_i1 /* process number for inform */
- 03697 #define SIG_MAP m2_l1 /* used by kernel for passing signal bit map */
- 03698 #define SIG_MSG_PTR m1_i1 /* pointer to info to build sig catch stack */
- 03699 #define SIG_CTXT_PTR m1_p1 /* pointer to info to restore signal context */
- .Ep 44 include/minix/boot.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/boot.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03700 /* boot.h */
- 03701
- 03702 #ifndef _BOOT_H
- 03703 #define _BOOT_H
- 03704
- 03705 /* Redefine root and root image devices as variables.
- 03706 * This keeps the diffs small but may cause future confusion.
- 03707 */
- 03708 #define ROOT_DEV (boot_parameters.bp_rootdev)
- 03709 #define IMAGE_DEV (boot_parameters.bp_ramimagedev)
- 03710
- 03711 /* Device numbers of RAM, floppy and hard disk devices.
- 03712 * h/com.h defines RAM_DEV but only as the minor number.
- 03713 */
- 03714 #define DEV_FD0 0x200
- 03715 #define DEV_HD0 0x300
- 03716 #define DEV_RAM 0x100
- 03717 #define DEV_SCSI 0x700 /* Atari TT only */
- 03718
- 03719 /* Structure to hold boot parameters. */
- 03720 struct bparam_s
- 03721 {
- 03722 dev_t bp_rootdev;
- 03723 dev_t bp_ramimagedev;
- 03724 unsigned short bp_ramsize;
- 03725 unsigned short bp_processor;
- 03726 };
- 03727
- 03728 extern struct bparam_s boot_parameters;
- 03729 #endif /* _BOOT_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/keymap.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 03800 /* keymap.h - defines for keymapping Author: Marcus Hampel
- 03801 */
- 03802 #ifndef _SYS__KEYMAP_H
- 03803 #define _SYS__KEYMAP_H
- 03804
- 03805 #define C(c) ((c) & 0x1F) /* Map to control code */
- 03806 #define A(c) ((c) | 0x80) /* Set eight bit (ALT) */
- 03807 #define CA(c) A(C(c)) /* Control-Alt */
- 03808 #define L(c) ((c) | HASCAPS) /* Add "Caps Lock has effect" attribute */
- 03809
- 03810 #define EXT 0x0100 /* Normal function keys */
- 03811 #define CTRL 0x0200 /* Control key */
- 03812 #define SHIFT 0x0400 /* Shift key */
- 03813 #define ALT 0x0800 /* Alternate key */
- 03814 #define EXTKEY 0x1000 /* extended keycode */
- .Op 45 include/minix/keymap.h
- 03815 #define HASCAPS 0x8000 /* Caps Lock has effect */
- 03816
- 03817 /* Numeric keypad */
- 03818 #define HOME (0x01 + EXT)
- 03819 #define END (0x02 + EXT)
- 03820 #define UP (0x03 + EXT)
- 03821 #define DOWN (0x04 + EXT)
- 03822 #define LEFT (0x05 + EXT)
- 03823 #define RIGHT (0x06 + EXT)
- 03824 #define PGUP (0x07 + EXT)
- 03825 #define PGDN (0x08 + EXT)
- 03826 #define MID (0x09 + EXT)
- 03827 #define NMIN (0x0A + EXT)
- 03828 #define PLUS (0x0B + EXT)
- 03829 #define INSRT (0x0C + EXT)
- 03830
- 03831 /* Alt + Numeric keypad */
- 03832 #define AHOME (0x01 + ALT)
- 03833 #define AEND (0x02 + ALT)
- 03834 #define AUP (0x03 + ALT)
- 03835 #define ADOWN (0x04 + ALT)
- 03836 #define ALEFT (0x05 + ALT)
- 03837 #define ARIGHT (0x06 + ALT)
- 03838 #define APGUP (0x07 + ALT)
- 03839 #define APGDN (0x08 + ALT)
- 03840 #define AMID (0x09 + ALT)
- 03841 #define ANMIN (0x0A + ALT)
- 03842 #define APLUS (0x0B + ALT)
- 03843 #define AINSRT (0x0C + ALT)
- 03844
- 03845 /* Ctrl + Numeric keypad */
- 03846 #define CHOME (0x01 + CTRL)
- 03847 #define CEND (0x02 + CTRL)
- 03848 #define CUP (0x03 + CTRL)
- 03849 #define CDOWN (0x04 + CTRL)
- 03850 #define CLEFT (0x05 + CTRL)
- 03851 #define CRIGHT (0x06 + CTRL)
- 03852 #define CPGUP (0x07 + CTRL)
- 03853 #define CPGDN (0x08 + CTRL)
- 03854 #define CMID (0x09 + CTRL)
- 03855 #define CNMIN (0x0A + CTRL)
- 03856 #define CPLUS (0x0B + CTRL)
- 03857 #define CINSRT (0x0C + CTRL)
- 03858
- 03859 /* Lock keys */
- 03860 #define CALOCK (0x0D + EXT) /* caps lock */
- 03861 #define NLOCK (0x0E + EXT) /* number lock */
- 03862 #define SLOCK (0x0F + EXT) /* scroll lock */
- 03863
- 03864 /* Function keys */
- 03865 #define F1 (0x10 + EXT)
- 03866 #define F2 (0x11 + EXT)
- 03867 #define F3 (0x12 + EXT)
- 03868 #define F4 (0x13 + EXT)
- 03869 #define F5 (0x14 + EXT)
- 03870 #define F6 (0x15 + EXT)
- 03871 #define F7 (0x16 + EXT)
- 03872 #define F8 (0x17 + EXT)
- 03873 #define F9 (0x18 + EXT)
- 03874 #define F10 (0x19 + EXT)
- .Ep 46 include/minix/keymap.h
- 03875 #define F11 (0x1A + EXT)
- 03876 #define F12 (0x1B + EXT)
- 03877
- 03878 /* Alt+Fn */
- 03879 #define AF1 (0x10 + ALT)
- 03880 #define AF2 (0x11 + ALT)
- 03881 #define AF3 (0x12 + ALT)
- 03882 #define AF4 (0x13 + ALT)
- 03883 #define AF5 (0x14 + ALT)
- 03884 #define AF6 (0x15 + ALT)
- 03885 #define AF7 (0x16 + ALT)
- 03886 #define AF8 (0x17 + ALT)
- 03887 #define AF9 (0x18 + ALT)
- 03888 #define AF10 (0x19 + ALT)
- 03889 #define AF11 (0x1A + ALT)
- 03890 #define AF12 (0x1B + ALT)
- 03891
- 03892 /* Ctrl+Fn */
- 03893 #define CF1 (0x10 + CTRL)
- 03894 #define CF2 (0x11 + CTRL)
- 03895 #define CF3 (0x12 + CTRL)
- 03896 #define CF4 (0x13 + CTRL)
- 03897 #define CF5 (0x14 + CTRL)
- 03898 #define CF6 (0x15 + CTRL)
- 03899 #define CF7 (0x16 + CTRL)
- 03900 #define CF8 (0x17 + CTRL)
- 03901 #define CF9 (0x18 + CTRL)
- 03902 #define CF10 (0x19 + CTRL)
- 03903 #define CF11 (0x1A + CTRL)
- 03904 #define CF12 (0x1B + CTRL)
- 03905
- 03906 /* Shift+Fn */
- 03907 #define SF1 (0x10 + SHIFT)
- 03908 #define SF2 (0x11 + SHIFT)
- 03909 #define SF3 (0x12 + SHIFT)
- 03910 #define SF4 (0x13 + SHIFT)
- 03911 #define SF5 (0x14 + SHIFT)
- 03912 #define SF6 (0x15 + SHIFT)
- 03913 #define SF7 (0x16 + SHIFT)
- 03914 #define SF8 (0x17 + SHIFT)
- 03915 #define SF9 (0x18 + SHIFT)
- 03916 #define SF10 (0x19 + SHIFT)
- 03917 #define SF11 (0x1A + SHIFT)
- 03918 #define SF12 (0x1B + SHIFT)
- 03919
- 03920 /* Alt+Shift+Fn */
- 03921 #define ASF1 (0x10 + ALT + SHIFT)
- 03922 #define ASF2 (0x11 + ALT + SHIFT)
- 03923 #define ASF3 (0x12 + ALT + SHIFT)
- 03924 #define ASF4 (0x13 + ALT + SHIFT)
- 03925 #define ASF5 (0x14 + ALT + SHIFT)
- 03926 #define ASF6 (0x15 + ALT + SHIFT)
- 03927 #define ASF7 (0x16 + ALT + SHIFT)
- 03928 #define ASF8 (0x17 + ALT + SHIFT)
- 03929 #define ASF9 (0x18 + ALT + SHIFT)
- 03930 #define ASF10 (0x19 + ALT + SHIFT)
- 03931 #define ASF11 (0x1A + ALT + SHIFT)
- 03932 #define ASF12 (0x1B + ALT + SHIFT)
- 03933
- 03934 #define MAP_COLS 6 /* Number of columns in keymap */
- .Op 47 include/minix/keymap.h
- 03935 #define NR_SCAN_CODES 0x80 /* Number of scan codes (rows in keymap) */
- 03936
- 03937 typedef unsigned short keymap_t[NR_SCAN_CODES * MAP_COLS];
- 03938
- 03939 #define KEY_MAGIC "KMAZ" /* Magic number of keymap file */
- 03940
- 03941 #endif /* _SYS__KEYMAP_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/minix/partition.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 04000 /* minix/partition.h Author: Kees J. Bot
- 04001 * 7 Dec 1995
- 04002 * Place of a partition on disk and the disk geometry,
- 04003 * for use with the DIOCGETP and DIOCSETP ioctl's.
- 04004 */
- 04005 #ifndef _MINIX__PARTITION_H
- 04006 #define _MINIX__PARTITION_H
- 04007
- 04008 struct partition {
- 04009 u32_t base; /* byte offset to the partition start */
- 04010 u32_t size; /* number of bytes in the partition */
- 04011 unsigned cylinders; /* disk geometry */
- 04012 unsigned heads;
- 04013 unsigned sectors;
- 04014 };
- 04015 #endif /* _MINIX__PARTITION_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- include/ibm/partition.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 04100 /* Description of entry in partition table. */
- 04101 #ifndef _PARTITION_H
- 04102 #define _PARTITION_H
- 04103
- 04104 struct part_entry {
- 04105 unsigned char bootind; /* boot indicator 0/ACTIVE_FLAG */
- 04106 unsigned char start_head; /* head value for first sector */
- 04107 unsigned char start_sec; /* sector value + cyl bits for first sector */
- 04108 unsigned char start_cyl; /* track value for first sector */
- 04109 unsigned char sysind; /* system indicator */
- 04110 unsigned char last_head; /* head value for last sector */
- 04111 unsigned char last_sec; /* sector value + cyl bits for last sector */
- 04112 unsigned char last_cyl; /* track value for last sector */
- 04113 unsigned long lowsec; /* logical first sector */
- 04114 unsigned long size; /* size of partition in sectors */
- 04115 };
- 04116
- 04117 #define ACTIVE_FLAG 0x80 /* value for active in bootind field (hd0) */
- 04118 #define NR_PARTITIONS 4 /* number of entries in partition table */
- 04119 #define PART_TABLE_OFF 0x1BE /* offset of partition table in boot sector */
- .Ep 48 include/ibm/partition.h
- 04120
- 04121 /* Partition types. */
- 04122 #define MINIX_PART 0x81 /* Minix partition type */
- 04123 #define NO_PART 0x00 /* unused entry */
- 04124 #define OLD_MINIX_PART 0x80 /* created before 1.4b, obsolete */
- 04125 #define EXT_PART 0x05 /* extended partition */
- 04126
- 04127 #endif /* _PARTITION_H */
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- src/kernel/kernel.h
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
- 04200 /* This is the master header for the kernel. It includes some other files
- 04201 * and defines the principal constants.