Changes to SCO OpenServer 5 kernel function set
The SVR5 kernel supports a different set of functions
than the SCO OpenServer 5 kernel does.
The manual pages for SCO OpenServer 5 functions
are included in
Section D3oddi manual pages,
Section D3osdi manual pages,
Section D3str manual pages,
and
Section D3mdi manual pages
for reference.
Note that the STREAMS and MDI functions
are documented in the same sections as the
SVR5 functions,
and identified with ODDI pseudo-version numbers
for STREAMS functions,
and mdi: 1 for MDI functions.
See
``ODDI driver interface version for SCO OpenServer 5''
for an explanation of the pseudo-versioning scheme
used to document the SCO OpenServer 5 driver interfaces.
The pages for SCO OpenServer 5 functions include
information about SVR5 features
that provide similar functionality.
Some of the major issues are summarized below.
Locks and synchronization
The SVR5 kernel includes a rich set of
locks and synchronization variables.
For a complete discussion of these, see
``Synchronization variables''.
Note the following:
-
sleep(D3),
wakeup(D3),
and
timeout(D3)
are supported only in DDI versions 6 and earlier
and only for single-threaded drivers.
DDI 8 drivers must be written to use
the multiprocessor-safe locks and synchronization variables.
-
spl(D3)
is supported in all single-threaded ddi: versions,
but is usually inadequate to protect a region
of critical code.
Calls to
spl( )
should be replaced with calls to
LOCK(D3)
or
TRYLOCK(D3).
The lock must first be allocated.
Read/write or sleep locks may be better alternatives
in some cases. See
``Critical code section''
and
``Spin locks (DDI)''.
-
Most calls to
lockb(D3oddi),
ilockb(D3oddi),
and
unlockb(D3oddi)
can be replaced by calls to
LOCK(D3)
and
UNLOCK(D3).
In some cases, it will be better to use
read/write locks, sleep locks, or trylocks
instead of the simple mutex locks.
-
Multithreaded drivers must be identified
in all the following ways:
-
The ``$ddi:'' field in the
Master(DSP/4dsp)
file must be set to one of the multiprocessing ddi: versions.
-
The ``$interface:'' field in the
Master(DSP/4dsp)
file must be set to Version 2.
-
For DDI 8 drivers,
the D_MP flag must be set in the
drvinfo(D4)
structure.
Memory allocation
See
``Memory allocation''
for information about the memory allocation facilities
on both platforms.
Especially note the following:
-
The SCO OpenServer 5
sptalloc( )
functions are not supported. Use functions such as
kmem_alloc(D3)
or
kmem_alloc_physreq(D3)
instead.
-
On SCO OpenServer 5 the
kmem_alloc(D3)
and
kmem_zalloc(D3)
functions allocate ISA DMA-able memory
(below the 16MB boundary)
unless the KM_NO_DMA flag is specified.
On SVR5 these functions never allocate contiguous memory;
use the
kmem_alloc_phys( )
function to allocate contiguous memory.
When porting from SVR5 to SCO OpenServer 5
be sure to specify the KM_NO_DMA flag to the
kmem_alloc( )
functions to avoid wasting the low ranges of memory.
-
On SVR5,
rmalloc(D3)
and related functions can be used to
allocate space from a private
space management map, similar to the kernel-level
malloc( )
functionality that was available in
earlier versions of the UNIX operating system.
Other function call changes
TTY drivers
SVR5 does not support the traditional
clist-based TTY drivers.
Instead, serial drivers should be implemented
using the STREAMS interface.
Consequently, the following SCO OpenServer 5 functions
are not supported in SVR5:
getc(D3oddi),
getcb(D3oddi),
getcf(D3oddi),
putc(D3oddi),
putcb(D3oddi),
putcf(D3oddi),
ldistributed(D3oddi),
the tty locking functions documented on the
tc_tlock(D3oddi)
manual page,
and the functions documented on the
tty(D3oddi)
manual page.
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005