Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ sysi86(2) — Interactive 2.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

uname(2)

swap(1M)



          SYSI86(2)            INTERACTIVE UNIX System            SYSI86(2)



          NAME
               sysi86 - machine-specific functions

          SYNOPSIS
               #include <sys/sysi86.h>

               int sysi86(cmd, arg)
               int cmd;
               char *arg;

               int sysi86(cmd, arg);
               int cmd;
               int arg;

               int sysi86(cmd, arg);
               int cmd;
               long arg;

               long sysi86(cmd, arg);
               int cmd;

          DESCRIPTION
               The sysi86 system call implements machine-specific func-
               tions.  The cmd argument determines the function to be per-
               formed.  The types of the arguments expected depend on the
               function.

             Command RTODC
               When cmd is RTODC, the expected argument is the address of a
               struct rtc_t (from the header file sys/rtc.h):

                    struct rtc_t {
                         char rtc_sec, rtc_asec, rtc_min, rtc_amin,
                         rtc_hr, rtc_ahr, rtc_dow, rtc_dom,
                         rtc_mon, rtc_yr, rtc_statusg,
                         rtc_statusb, rtc_statusc, rtc_statusd;
                    };

               This function reads the hardware time-of-day clock and
               returns the data in the structure referenced by the argu-
               ment.  This command is available only to the super-user.

             RDUBLK
               This command reads the u-block (per process user information
               as defined by structuser in the sys/user header file) for a
               given process.  When cmd is RDUBLK, sysi86 takes three addi-
               tional arguments:  the process ID, the address of a buffer,
               and the number of bytes to read; i.e.,
                    sysi86(RDUBLK, pid, buf, n)
                         int  pid;
                         char *buf;
                         ind  n;



          Rev. C Software Development Set                            Page 1





          SYSI86(2)            INTERACTIVE UNIX System            SYSI86(2)



             Command SI86FPHW
               This command expects the address of an integer as its argu-
               ment.  After successful return from the system call, the
               integer specifies how floating-point computation is sup-
               ported.

               The low-order byte of the integer contains the value of
               "fpkind", a variable that specifies whether an 80287 or
               80387 floating-point coprocessor is present, emulated in
               software, or not supported.  The values are defined in the
               header file sys/fp.h.

                    FP_NO       no fp chip, no emulator (no fp support)
                    FP_SW       no fp chip, using software emulator
                    FP_HW       chip present bit
                    FP_287      80287 chip present
                    FP_387      80387 chip present

             Command SETNAME
               This command, which is only available to the super-user,
               expects an argument of type char * which points to a NULL
               terminated string of at most 7 characters.  The command will
               change the running system's sysname and nodename [see
               uname(2)] to this string.

             Command STIME
               When cmd is STIME, an argument of type long is expected.
               This function sets the system time and date (not the
               hardware clock).  The argument contains the time as measured
               in seconds from 00:00:00 GMT January 1, 1970. Note that this
               command is only available to the super-user.

             Command SI86DSCR
               This command sets a segment or gate descriptor in the ker-
               nel.  The following descriptor types are accepted:

                    ⊕ executable and data segments in the LDT at DPL 3
                    ⊕ a call gate in the GDT at DPL 3 that points to a seg-
                    ment in the  LDT

               The argument is a pointer to a request structure that con-
               tains the values to be placed in the descriptor.  The
               request structure is declared in the sys/sysi86.h header
               file.

             Command SI86MEM
               This command returns the size of available memory in bytes.

             Command SI86SWPI
               When cmd is SI86SWPI, individual swapping areas may be
               added, deleted or the current areas determined.  The address
               of an appropriately primed swap buffer is passed as the only
               argument.  (Refer to sys/swap.h header file for details of


          Rev. C Software Development Set                            Page 2





          SYSI86(2)            INTERACTIVE UNIX System            SYSI86(2)



               loading the buffer.)

               The format of the swap buffer is:

               struct swapint {
                 char si_cmd; /* command: SI_LIST, SI_ADD, SI_DEL */
                 char *si_buf;/* swap file path pointer */
                 int  si_swplo;/* start block */
                 int  si_nblks;/* swap size */
                 } ;

               Note that the add and delete options of the command may only
               be exercised by the super-user.

               Typically, a swap area is added by a single call to sysi86.
               First, the swap buffer is primed with appropriate entries
               for the structure members.  Then sysi86 is invoked.

               #include <sys/sysi86.h>
               #include <sys/swap.h>

               struct swapint swapbuf;  /*swap into buffer ptr*/

               sysi86(SI86SWPI, &swapbuf);

               If this command succeeds, it returns 0 to the calling pro-
               cess.  This command fails, returning -1, if one or more of
               the following is true:

               [EFAULT]  Swapbuf points to an invalid address

               [EFAULT]  Swapbuf.si_buf points to an invalid address

               [ENOTBLK] Swap area specified is not a block special device

               [EEXIST]  Swap area specified has already been added

               [ENOSPC]  Too many swap areas in use (if adding)

               [ENOMEM]  Tried to delete last remaining swap area

               [EINVAL]  Bad arguments

               [ENOMEM]  No place to put swapped pages when deleting a swap area

          SEE ALSO
               uname(2).
               swap(1M) in the INTERACTIVE UNIX System User's/System
               Administrator's Reference Manual.

          DIAGNOSTICS
               Upon successful completion, the value of zero is returned;
               otherwise, -1 is returned, and errno is set to indicate the


          Rev. C Software Development Set                            Page 3





          SYSI86(2)            INTERACTIVE UNIX System            SYSI86(2)



               error.  When the cmd is invalid, errno is set to EINVAL.






















































          Rev. C Software Development Set                            Page 4



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026