The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/compat/osf1/README.syscalls

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 $NetBSD: README.syscalls,v 1.3 2000/03/13 23:52:35 soren Exp $
    2 
    3 XXX this file should be gutted.  functions' comments should go with
    4 XXX the functions.  Further, this file is ... very out of date.
    5 
    6 Once the new syscall argument-handling method was implemented, most
    7 OSF/1 syscalls boiled down to their NetBSD equivalents.  The
    8 differences are detailed in this file.
    9 
   10 Note that some OSF/1 syscalls, including some of those that map
   11 directly to equivalent NetBSD syscalls, are not implemented; they
   12 were not needed, so the effort to implement and check them was not
   13 expended.
   14 
   15 Finally, there are some OSF/1 syscalls which were left unimplemented,
   16 but which seem strange enough to merit a bit more explanation.
   17 
   18 OSF/1 compatibility is helped by the fact that the sigcontext
   19 structure was created for NetBSD/Alpha to be the same as the OSF/1
   20 sigcontext structure.  Because of this, only one sendsig() function is
   21 needed, and then the NetBSD sigreturn() function can be used for OSF/1
   22 sigreturn(), as well.
   23 
   24 The system calls are split out among the three files:
   25         osf1_ioctl.c
   26         osf1_misc.c
   27         osf1_mount.c
   28 as follows:
   29         osf1_ioctl.c contains all osf1_ioctl() handling code.
   30         osf1_mount.c contains all code dealing with mounting and
   31                 unmounting file systems, and with mount points in
   32                 general (e.g. osf1_getfsstat()).
   33         osf1_misc.c contains the rest of the emulation functions.
   34 
   35 The emulation functions as follows:
   36 
   37 osf1_mknod()
   38         dev_t's are different between OSF/1 and NetBSD.  In OSF/1 a
   39         dev_t has 12 bits of major number and 20 bits of minor number.
   40         Under NetBSD, it's 24 bits of major, 8 bits of minor (but the
   41         top 16 bits of the major number are unused, and may be
   42         rearranged later).  In any case, it was decided that the
   43         primary use for OSF/1 binaries would be to complement native
   44         NetBSD binaries, so file system dev_t's are assumed to be in
   45         the NetBSD format, and osf1_mknod() translates from the OSF/1
   46         format to the NetBSD format.
   47 
   48 osf1_getfsstat()
   49         The statfs structure is different between NetBSD and OSF/1,
   50         and the way file system types are denoted is different, as
   51         well.  This routine is the same as getfsstat(), except it
   52         converts the statfs structures before returning them to the
   53         OSF/1 process.
   54 
   55 osf1_lseek()
   56         To compensate for quad alignment on 32-bit machines, the
   57         NetBSD lseek() needs an extra argument of padding, before the
   58         off_t 'offset' argument.  This wrapper inserts the padding,
   59         and calls the NetBSD routine.
   60 
   61 osf1_mount()
   62         The file system type specification and the way you specify
   63         mount options differs substantially between NetBSD and OSF/1.
   64         This routine (and its callees) fakes up NetBSD arguments, and
   65         calls the NetBSD routine.
   66 
   67 osf1_unmount()
   68         Probably not necessary, but safe; translates flags, in case
   69         the NetBSD unmount flags ever change.
   70 
   71 osf1_exec_with_loader() [UNIMPLEMENTED]
   72         From the description in the OSF/1 manual page, this executes a
   73         file with a named loader, or "/sbin/loader" if none is named.
   74         It appears to be used in some way, when executing dynamically
   75         linked binaries, but is _not_ called directly from user space
   76         in the normal case.  The interface by which it passes the name
   77         of the file to be executed, its arguments, etc., to the loader
   78         is unspecified, and, from experimental evidence, doesn't seem
   79         to be the normal UN*X argument-passing convention (i.e.
   80         argc/argv).  For proper dynamically linked binary support,
   81         this function will probably have to be implemented, but it's
   82         unclear how that can be done (short of disassembling a lot of
   83         code).
   84 
   85 osf1_open()
   86         Translates OSF/1 flags to NetBSD flags.
   87 
   88 osf1_ioctl()
   89         Screens out ioctl requests that aren't known to work, and
   90         translates those that differ between NetBSD and OSF/1.
   91 
   92 osf1_reboot()
   93         Translates OSF/1 flags to NetBSD flags.
   94 
   95 osf1_stat()
   96         The stat structure differs between NetBSD and OSF/1, both in
   97         terms of field sizes, and in the dev_t representation.
   98         This does a NetBSD stat(), translates the results, and returns
   99         them to the OSF/1 process.
  100 
  101 osf1_lstat()
  102         Same as osf1_stat(), but for lstat().
  103 
  104 osf1_mmap()
  105         The NetBSD version needs 4 bytes of padding before the off_t
  106         'pos' argument, and also uses different flags than the OSF/1
  107         version.  This wrapper translates the flags and deals with the
  108         argument struct padding differences, then calls the NetBSD
  109         routine.
  110 
  111 osf1_fstat()
  112         Same as osf1_stat(), but for fstat().
  113 
  114 osf1_fcntl()
  115         Translates OSF/1 fcntl() requests into their NetBSD
  116         counterparts, then calls the NetBSD fcntl() to do the
  117         operations.
  118 
  119 osf1_socket()
  120         Makes sure that the socket type is valid for NetBSD, and if
  121         so, calls NetBSD's socket().
  122 
  123 osf1_sendto()
  124         Makes sure that the 'flags' argument doesn't use flags that
  125         NetBSD can't handle, and calls NetBSD's sendto().
  126 
  127 osf1_getrlimit()
  128         Makes sure that the 'which' selector is one that NetBSD can
  129         deal with, and calls NetBSD's getrlimit().
  130 
  131 osf1_setrlimit()
  132         Same as osf1_getrlimit(), but for setrlimit().
  133 
  134 osf1_sigaction()
  135         Deals with the differences in the NetBSD and OSF/1 sigaction
  136         structures, and calls NetBSD's sigaction with the appropriate
  137         arguments.  If the call requests that the old sigaction be
  138         passed back, osf1_sigaction() translates it back to the OSF/1
  139         form, and returns it appropriately.
  140 
  141 osf1_statfs()
  142         Does that statfs() on the given pathname, then translates the
  143         NetBSD statfs structure into the one that OSF/1 uses and
  144         returns it.  Makes a best effort on the mount type, because
  145         there's not a one-to-one mapping between NetBSD and OSF/1
  146         mount types.
  147 
  148 osf1_fstatfs()
  149         Same as osf1_statfs(), but for fstatfs().
  150 
  151 osf1_usleep_thread()
  152         This function is how sleep() and usleep() (and possibly other
  153         functions) are implemented in OSF/1.  Its usage was discovered
  154         by disassembling the library routines that use it.  It takes
  155         two pointers to timeval structures as arguments.  The first
  156         contains the amount of time (in seconds and microseconds) to
  157         sleep.  If the second pointer is non-null, if the process
  158         wakes up early, the amount of time "unslept" is returned.  If
  159         the process doesn't wake up early, zero is returned.
  160 
  161 osf1_setsysinfo()
  162         A null-op; used early on, but nothing cares that it actually
  163         does anything.

Cache object: 6038e09b5bf3510c205572c4e8f67e03


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.