Architecture
What is the NuTCRACKER Platform?
The NuTCRACKER Platform is the runtime component
of Toolkit that provides UNIX system-layer emulation in a Win32
environment. MKS Toolkit for Enterprise Developers and MKS Toolkit
for Professional Developers include header files, libraries, and
other SDK tools that support development and deployment of NuTCRACKER
Platform applications and DLLs.
Haut de
Page
Installation
Why won't the installer let
me install Toolkit in the root directory of a drive?
We prohibit installation of the MKS Toolkit in
the root directory of a drive for several reasons:
The Toolkit installation puts many files in its
top level directory. Since FAT partitions are limited to 255 files
in the root directory, this would clutter the drive root, and could
fail if the root directory was full or nearly full.
It is desirable to keep one product's files isolated from files
belonging to other products, when possible. This reduces the chances
of naming conflicts among products, and makes it easier to uninstall
a product consistently and safely.
The Toolkit installer does not function consistently when Toolkit
is installed in the root of a drive. In particular, the installer
often places files incorrectly in the /tmp directory if you try
to install in the root directory.
With the introduction in Toolkit 7.0 of symbolic links under Windows
2000, some of the advantages of installing the Toolkit in the root
directory can be accomplished in other ways. In particular, you
can create links between install directories and Unix-style directory
names, as follows:
ln -s '/Program Files/MKS Toolkit/etc' /etc
Haut de
Page
Why does the installer complain about insufficient
disk space when I have plenty on the target drive?
You must have enough room in three locations: the
target drive, the system drive, and %TEMP%. This lets the installer
unpack its files.
Haut de
Page
How do I install all the samples?
The samples are installed by default. If you perform
a custom installation, you can also install source code for the
samples.
Haut de
Page
Why doesn't my serial number work?
Perhaps you have entered the serial number incorrectly.
Double check the number.
If you have upgraded from a version of MKS Toolkit
prior to 7.0, you need to use the new serial number provided with
the upgrade.
Perhaps you have a temporary serial number from
a demo release and that number has expired. You should have received
a permanent serial number with your non-demo product.
Contact MKS or your distributor if you need assistance.
Haut de
Page
When must I reboot?
Please reboot every time the installer tells you
to. If you don't, some files may be removed on the next reboot,
because of the way Windows handles uninstallation.
Haut de
Page
How do I install Wintif?
Wintif is a custom installation option of MKS Toolkit
for Enterprise Developers. Select Custom during installation and
select the Wintif rather than the Motif libraries.
Haut de
Page
Can I install both Wintif and Motif?
The installer does not support this, because Wintif
and Motif have identically named files that would overwrite each
other. It is possible to support both by establishing parallel directory
structures and by modifying your build environment to select one
or the other. Contact MKS or your distributor if you need assistance.
Haut de
Page
Commands and Utilities
Does the MKS Toolkit include the Bourne or C shells?
Are they compatible?
The MKS Toolkit products include
the Korn shell, which is backwards compatible to the Bourne shell
(both were developed by AT&T), and
the C shell, the original Berkeley shell, which uses a "C"-like
programming syntax for shell commands.
MKS Toolkit products also include pdksh and tcsh as unsupported
samples. These samples are located in the $ROOTDIR/samples directory.
Haut de
Page
What tape devices are supported by MKS data transfer
tools?
MKS data transfer utilities support ASPI, SCSI,
and ATAPI tape devices.
Haut de
Page
Can the MKS tape backup products save all information
you need to restore a Windows file system?
Yes. Recent enhancements to the tape backup utilities,
included in Toolkit 7.5, let these tools save Access Control Lists,
in addition to traditional Unix file information. These enhanced
backup tools let you preserve all the information you need to fully
duplicate a Windows file system.
Haut de
Page
Will pax read tar and cpio archives?
Yes. Both the command line pax and the graphical
VisualPax support the tar and cpio archive formats.
Haut de
Page
My users are non-command line savvy. Is there a
way to make scripts more 'Windows user' friendly?
Yes. Using the graphical scripting utilities (dlg,
msgbox, filebox) included with MKS Toolkit products, you can create
and present your users with Windows dialog boxes to interact with
your Korn shell scripts. There are many examples of dlg-ksh scripts
in the MKS Toolkit Resource Kit.
Haut de
Page
Build Environment and Build Process
How does the process of porting with Toolkit work?
The basic porting process is identical to porting
your software to another UNIX platform. The following steps are
discussed in detail in the section Developing Cross-Platform Solutions
in the Cross-Platform Developer's Guide:
Examining make files, header files, and source
code for porting issues.
Gaining access to the source code on Windows.
Compiling and linking.
Fixing linkage issues.
Debugging.
Integrating with Windows.
Distributing the application.
Haut de
Page
Will my existing UNIX build environment work?
Yes. MKS Toolkit products implement a full UNIX
build environment on Windows. Many applications can be built simply
by moving the source code to Windows and typing make. The MKS Toolkit
product family has both C and Korn shells, make, gmake, imake, lex,
yacc, cpp, sed, awk, and all the utilities you need to migrate your
UNIX build environment.
Haut de
Page
How can I move UNIX source to Windows?
You have two choices:
copying the files from UNIX
sharing the files between the two systems.
MKS Toolkit supports standard UNIX facilities for exchanging files
between the two platforms, including rcp and FTP. In addition, Toolkit
includes standard UNIX utilities for handling bulk file copies (cpio,
pax, and tar). To share files, you can use either NFS or Samba.
UNIX text files use a line-feed character to indicate
the end of a line, while Windows expects both a carriage return
and a line-feed in its text files. When you transfer text files
to Windows, make sure their lines are properly terminated. Many
transfer utilities have options to automatically handle the termination.
In addition, you may find the flip command useful. More information
is also available in the Cross-Platform Developer's Guide.
Haut de
Page
How much code requires modification during porting?
This depends entirely on the nature of the application.
Typically, customers modify less than one percent of their code,
especially if the code has already been ported to more than one
UNIX system. Porting to the NuTCRACKER Platform is like porting
to any flavor of UNIX. If you have already ported your application
to other UNIX platforms, you have a good idea of what changes, if
any, will be necessary to move to Windows.
Naturally, you will have to rewrite non-portable
sections of your code, for example, those that depend on system-specific
resources, such as /dev/kmem or AIX's Journaling File System.
Haut de
Page
Can I maintain common code
for both UNIX and Windows versions of my product?
Yes. 95% of Toolkit customers maintain a single
source baseline for both Windows and UNIX, and the fact that the
average customer modifies less than 0.1% of his application code
makes maintaining a single source base easy. Furthermore, you can
often maintain the same build environment, using the same makefiles
to build your application. One MKS customer with over seven million
lines of source code maintains a single source baseline.
Moreover, if you want to evolve your application
to take advantage of Windows features such as COM or the registry,
the changes to your code using Toolkit are straightforward and easy
to conditionally compile, using standard Toolkit defines.
Haut de
Page
What versions of make does Toolkit support?
MKS Toolkit for Developers includes a standard
make utility. MKS Toolkit for Professional Developers and MKS Toolkit
for Enterprise Developers include the GNU make (gmake) utility along
with imake. (The source for GNU make is in the Toolkit samples directory.)
In addition, Windows has its own make utility,
nmake.
Haut de
Page
What do I do about ranlib in my makefiles?
MKS Toolkit for Developers and all higher products
now include ranlib.
Haut de
Page
Compiling and Linking
What languages and compilers does Toolkit support?
MKS Toolkit for Professional Developers and MKS
Toolkit for Enterprise Developers supply cc, cxx, ncf77, and ncf90
compiler drivers for C, C++, Fortran 77, and Fortran 90. The Toolkit
cc and cxx drivers require that you have Microsoft Visual C++ version
5.0 or higher.
The Toolkit Fortran drivers work only with Absoft
Fortran version 5.0 or higher. Absoft Fortran version 7.0 is supported
in version 7.5 of MKS Toolkit for Professional Developers and MKS
Toolkit for Enterprise Developers.
In addition, we have helped customers to successfully
port Ada and COBOL applications. Our Consulting Services organization
would be happy to discuss how we can help you.
Haut de
Page
I have Ada code, do I have to do anything special?
If your Ada application makes calls to C code (pragma
Interface("C",
)) for system calls or X11/Motif,
you may be able to follow the standalone DLL example in Building
Standalone DLLs in the Porting Shared Libraries chapter of the Cross-Platform
Developer's Guide.
You would port your C code to Windows as a standalone
NuTCRACKER Platform DLL and drive the DLL from your Ada code. Use
the Ada linker to build the executable. Remember to consider the
calling convention issues. The standalone DLL example is designed
for use with Visual Basic, which requires the __stdcall convention.
The Rational Ada compiler, for example, expects __cdecl.
Haut de
Page
Can I use Visual Studio to
build NuTCRACKER Platform applications, rather than using my existing
UNIX build environment?
Yes, refer to Using the Visual C++ IDE in the Cross-Platform
Developer's Guide for details. You must use VC++ to build your application,
but you have the choice of using the command line or Visual Studio.
For speed and reduction of the learning curve,
we recommend that you perform your initial port from the command
line as you have done on UNIX. Then, if you decide to migrate to
Visual Studio, you can do it over time.
Haut de
Page
Does Toolkit support Borland C/C++ or GNU C?
No, Toolkit only supports MS VC++ 5.0 and higher.
Haut de
Page
Does Toolkit have crypt()?
Now it does. Version 7.5 of MKS Toolkit for Professional
Developers and MKS Toolkit for Enterprise Developers includes the
functions crypt(), crypt_r(), encrypt(), encrypt_r(), setkey(),
and setkey_r().
Haut de
Page
Can a NuTCRACKER Platform-enabled application be
implemented as a DLL?
Yes, this is easy to do in Toolkit. Refer to Porting
Shared Libraries in the Cross-Platform Developer's Guide.
Haut de
Page
Is Motif available as a DLL?
No, Motif is not available as a DLL. First, architectural
problems on Windows prevent building a DLL that exports the widget
data properly. Second, we cannot supply Motif to you as a DLL without
requiring you to pay a substantial royalty on every copy that you
ship to your customers. We continue to work on resolutions to both
issues.
Haut de
Page
Debugging
What debugger do I use with Toolkit?
You can use any Microsoft VC++-compatible debugger.
The two from Microsoft are the VC++ debugger msdev, and windbg from
the Windows SDK. There are also other commercially available debuggers.
Haut de
Page
Must I create project files to use the Microsoft
debugger?
No. There are several ways to launch the msdev
debugger:
You can launch the debugger on an executable by
typing msdev file.exe at the command line.
You can attach to a running program by typing msdev -p pid on a
command line, where pid is the process ID of the running program
(from the Task Manager or elsewhere).
You can attach to a running program by using the Task Manager; right
click on the process in question and select Debug.
If a NuTCRACKER Platform application calls the _NutDebugBreak()
API, the standard Win32 debugging popup is displayed. Clicking Cancel
on the popup launches the debugger and attaches it to the process.
Haut de
Page
Process Management
Is fork() supported?
Yes, fork() and vfork() are supported, as are the
exec*() family of functions, wait(), and waitpid(). In addition,
Toolkit offers the _NutForkXXX() family of functions. For more information,
refer to Windows Concepts in the Cross-Platform Developer's Guide.
Haut de
Page
What about UNIX signals?
Toolkit implements UNIX signals, supporting both
synchronous (e.g., access violation) and asynchronous (e.g., Ctrl-C)
signal delivery, and interruption of system calls. In the vast majority
of cases, Toolkit signals behave just like UNIX signals. You can
use sigaction() to specify the disposition of the signal handler
after handling a signal, so you can implement either SVR4 or BSD/POSIX
semantics. Refer to Windows Concepts in the Cross-Platform Developer's
Guide for more details.
This table lists the UNIX signals and their default
actions. This table defines how Toolkit maps Win32 exceptions to
UNIX signals.
Toolkit does not support job control signals.
Haut de
Page
What about porting UNIX applications designed for
multiple processors?
Toolkit supports applications designed for multiple
processors.
Haut de
Page
Is Toolkit thread safe?
Toolkit fully supports the POSIX Threads API, and
the run time libraries are thread safe. Toolkit also provides emulation
layers for Solaris and DCE threads. Refer to the Porting Threaded
Applications chapter of the Cross-Platform Developer's Guide for
more details.
For details on specific functions, see the manual
page for each function.
Haut de
Page
Does Toolkit support thread
priorities?
Yes, Toolkit provides a mechanism to change thread
priorities. The APIs pthread_setschedparam(), getpriority(), setpriority(),
and nice() are available.
Haut de
Page
File and User Security
How about UNIX security?
Windows NT and Windows 2000 provide a C2-level
security model, based on Access Control Lists and Access Rights.
This security model is more restrictive than that of most UNIX systems.
Windows 95/98 has almost no security. Toolkit maps UNIX user/group
and file security models onto both these environments. Refer to
Windows Concepts in the Cross-Platform Developer's Guide for more
information.
Haut de
Page
What about setuid()?
Toolkit implements setuid() by temporarily manipulating
the discretionary access control lists (DACLs) of the objects created
and accessed by a process. The full setuid() semantics cannot be
implemented on Windows NT or Windows 2000, because an arbitrary
process cannot assume a different user identity without an account
name/password challenge or appropriate client-server connection.
Haut de
Page
Does Toolkit handle UNIX
file permissions?
Yes, Toolkit maps UNIX file permissions onto Win32.
There is a substantial discussion in Windows Concepts in the Cross-Platform
Developer's Guide.
Haut de
Page
Files, Devices, and Paths
Does Toolkit support UNIX file semantics?
Yes, all UNIX file API calls are supported for
all file systems supported by Windows NT or Windows 2000: VFAT,
NTFS, CDFS, HPFS, NFS, and NETBIOS shared. The file names can be
up to 255 characters and mixed case, if supported by the underlying
file system. Toolkit provides a mapping which lets the UNIX application
see all drive letters as one large UNIX-like file system, without
requiring changes in the UNIX application.
Haut de
Page
What about case-sensitivity of path names?
Windows NTFS and VFAT file systems are case-preserving,
while UNIX file systems are case-sensitive. On UNIX, you can have
three files named Makefile, makefile, and MakeFile in the same directory.
On Windows, you can have a file named Makefile, or one named makefile,
or one named MakeFile, in a given directory, and the case of the
name will be retained. You cannot, however, have more than one of
these files in the same directory, because all three names will
access the same file. This can be important when transferring files
from UNIX to Windows. Refer to File Systems in the Windows Concepts
chapter of the Cross-Platform Developer's Guide.
Haut de
Page
What about links?
Windows NT 4.0 only supports hard links between
files on locally-mounted NTFS file systems. Trying to link files
on any other type of local file system, or on a network file system,
will fail with errno set to EMLINK, specifying that the maximum
number of links to the file has been exceeded. Windows 95/98 does
not support links.
Under Windows 2000, Toolkit implements soft links
(symbolic links) between directories on locally mounted NTFS 5.0
file systems, but soft links are not supported by the other operating
systems or other file systems.
Haut de
Page
Can I access files larger than 2G?
Yes, Toolkit uses unsigned 32-bit file offsets
to let you access 4G for any individual file. NTFS on Windows NT
and Windows 2000 allows files as large as 16 Exabytes (16 million
Terabytes, specified by a 64-bit file offset). You will have to
use Windows APIs to access files larger than 4G.
Haut de
Page
Why do text files have carriage returns in them?
UNIX uses a single line-feed character (\n) as
a line delimiter in text files, while Windows uses a carriage-return/line-feed
pair (\r\n) to delimit text lines. This can cause problems when
porting code that assumes that a line-feed terminates a text file.
To address this issue, Toolkit supports opening files in text mode.
When a file is opened in text mode, reading from the file will convert
carriage-return/line-feed pairs to single line-feeds, while writing
to the file will convert single line-feeds to carriage-return/line-feed
pairs. Refer to Text Files and Binary Files in the Windows Concepts
chapter of the Cross Platform Developer's Guide.
Haut de
Page
How do I convert path names in system() or exec()?
Toolkit passes path names in NuTCRACKER format,
in which Windows drive letters are represented by /<drive-letter>=/.
For example, the path a:/setup.exe in NuTCRACKER format is /a=/setup.exe.
You cannot pass such a path to a native Win32 program without first
converting it to Windows format. Use one of the _NutPathToXXX()
functions (_NutPathToNutc(), _NutPathToWin32(), _NutPathToWin32FS())
to convert it. Refer to the Windows Concepts section of the Cross-Platform
Developer's Guide.
Haut de
Page
Why does argv not get converted to NuTCRACKER format?
Toolkit cannot determine whether a particular entry
in argv is a file path or not. Only your program can know what each
argument represents.
Haut de
Page
Can I port a device driver with Toolkit?
No. Toolkit is designed for porting user-level
applications, rather than kernel-level applications.
Haut de
Page
Where is /dev/kmem?
Toolkit does not support /dev/kmem or other low-level,
hardware-specific, or OS-specific devices. Consult the section Special
Files in the Windows Concepts chapter of the Cross-Platform Developer's
Guide for details about the many devices that Toolkit does support.
Haut de
Page
Where is /dev/fd?
Toolkit does not support /dev/fd.
Haut de
Page
Networking and Interprocess Communication
Is there support for sockets?
Yes. Toolkit implements the standard sockets API,
based on the native Win32 Winsock 2.0 libraries (this is standard
with Windows NT and Windows 2000, and distributed as part of the
NuTCRACKER Platform on Windows 95/98). Toolkit sockets are semantically
the same as UNIX sockets, including support for out-of-band data
and asynchronous I/O notification. Toolkit does not, however, support
the TLI or XTI networking APIs.
What about AF_UNIX sockets?
Toolkit supplies a Winsock 2.0 service provider
to implement the AF_UNIX address family. NuTCRACKER Platform applications
should be able to make full use of the related API functions, including
the use of sendmsg() and recvmsg() for passing file descriptors
between applications. Native Win32 applications also can use AF_UNIX
sockets, although they cannot use sendmsg() and recvmsg().
Haut de
Page
What about IPCs?
Toolkit supports the standard System V Interprocess
Communications (IPC) mechanisms (shared memory, semaphores, and
message queues) by building on Win32 system objects. These facilities
are persistent (i.e., retained even when no Toolkit process is running),
and the standard security attributes are supported (restricted on
Windows 95/98 by the lack of security). Parameters related to these
facilities can be adjusted using the NuTCRACKER Control Panel applet.
Haut de
Page
Is there a way to convert a Windows socket into
a NuTCRACKER Platform socket and vice versa?
It is possible to retrieve the underlying Win32
handle from the NuTCRACKER Platform with the _NutFdToHandle() API
(or donate a handle to the NuTCRACKER Platform with _NutHandleToFd()).
It is not possible, however, to share socket handles in this way.
Once the NuTCRACKER Platform owns a socket handle, you may not continue
to manipulate it with Win32 calls and vice versa.
Haut de
Page
Does Toolkit support FIFOs?
Yes. Toolkit implements FIFOs that are compatible
with standard UNIX implementations. Toolkit lets you access FIFOs
according to the POSIX specification (mkfifo(), mknod(), open(),
read(), write(), select(),
). In particular you can use select()
to block until a FIFO is available for reading or writing, regardless
of its connection state.
Haut de
Page
What are named pipes?
Win32 defines a named pipe, which is entirely different
from a UNIX FIFO. Win32 named pipes let multiple clients establish
bidirectional communications to a single server application, each
with its own pair of buffers. The clients and server can be on different
machines.
You can access Win32 named pipes with open("//server/pipe/<pipe
name>"). Opening the pipe with the O_CREAT option makes
the process a server for the named pipe; opening without O_CREAT
makes the process a client of the named pipe. Windows 95/98 only
supports client-side named pipe connections; Windows NT and Windows
2000 can be either client or server.
Haut de
Page
Why does an anonymous pipe hold about 177 characters?
Win32 pipes are message based. If you create a
pipe with a 5120-byte buffer, and write 177 individual characters
to the pipe, Win32 prepends a message block to each character (about
28 bytes). (28+1) * 177 = 5133, so the 177th character blocks. Since
writes will vary in size, it is possible to write one single 5092
byte (5092+28=5120) byte chunk or 176 one byte writes or various
combinations in between. The _NutConf() API and the NUT_PIPE_BUFFER_SIZE
environment variable let you tailor the size of anonymous pipes
created through the pipe() call.
Haut de
Page
How about shared memory and memory mapping?
Toolkit supports the standard System V Interprocess
Communications (IPC) mechanisms including shared memory (shmat(),
shmctl(), shmdt(), shmget()). It also includes standard memory mapping
APIs (mmap(), munmap(), etc.).
Haut de
Page
Does Toolkit support XTI or TLI?
Toolkit does not support XTI or TLI. However it
may be possible to rework your code to use sockets directly. Contact
MKS or your distributor for more information.
Haut de
Page
Graphical User Interface
Does Toolkit support X11 and Motif?
Yes, MKS Toolkit for Enterprise Developers includes
X11R6.3 and Motif 1.2.5. It also comes with Wintif, a Motif replacement
that lets you select a Windows or a Motif look and feel at runtime.
Haut de
Page
Does Toolkit require the use of an X server for
X11 applications?
Yes, X11 client applications ported with MKS Toolkit
behave just like they do on UNIX, including making use of an X server.
Both MKS Toolkit for Interoperability and MKS Toolkit for Enterprise
Developers contain an X server.
Haut de
Page
I already have an X server. Will it work with NuTCRACKER
Platform applications?
Yes. NuTCRACKER Platform applications work with
any X server because all X clients and servers speak the same, standard
protocol. We have not found a Windows X server that fails to work
with Toolkit.
Haut de
Page
Can I give X applications a Windows look and feel,
without changing my source code?
Yes. MKS Toolkit for Enterprise Developers includes
Wintif, a Motif replacement that lets you and your users select
either a Windows or a Motif look and feel at runtime, without changing
source code, without recompilation, and without relinking.
Haut de
Page
Is there a way to get a Win32 window handle for
an X client window?
No, there is no reliable way to get such a handle,
nor is such an operation advisable or supported. Although it may
be possible to find the window handle by using the Win32 FindWindow()
API and searching for the title, MKS will not support such code.
Haut de
Page
Does Toolkit support XView or OpenLook?
Yes, the MKS Toolkit Resource Kit includes a port
of XView, which provides an OpenLook look and feel.
Haut de
Page
Is OpenGL supported?
Yes, MKS Toolkit for Enterprise Developers contains
OpenGL header files, libraries, and DLLs. In addition, we also offer
the Hummingbird OpenGL Development Option for those customers who
want to use Hummingbird's Exceed X server and Exceed 3D for OpenGL.
Haut de
Page
What about support for public domain and third-party
graphic libraries such as Hoops?
X11/Motif add-on libraries, such as the KL Group's
XRT widgets, must be built with Toolkit. Most major vendors have
Toolkit versions available directly or from MKS. Contact your sales
representative for details.
For non-X11/Motif graphic libraries (such database
access libraries), either a native Win32 version or a Toolkit-ported
version must be available on Windows. Most are available today as
Win32 versions, directly from their vendors just make sure
that you use the DLL version.
Haut de
Page
How do I get rid of the console window on my X
applications?
Link your application as a Windows application,
rather than a console application, by using
ld -W/subsystem:windows
Refer to Porting X Applications in the Cross-Platform Developer's
Guide.
Haut de
Page
Integrating with Windows
How can I mix MFC and UNIX code in the same program?
Using MFC requires your code to include Microsoft
standard header files, which clash with Toolkit header files. To
resolve this, build your UNIX code with Toolkit into a stand-alone
NuTCRACKER Platform DLL (see the Building Standalone DLLs in the
Porting Shared Libraries chapter of the Cross-Platform Developer's
Guide for more details).
Build this DLL in a Toolkit build environment.
Then use VC++ to build the MFC code which loads the DLL you built
from your UNIX code. (Remember the _NutEnableNuTC()/_NutDisableNuTC()
calls around the UNIX code). Pay special attention to those calls
which might block the thread. The MFC message cannot respond while
the thread is blocked in a NuTCRACKER call.
Haut de
Page
Can I mix Win32 and UNIX APIs in a single program?
Yes, but the best solution is to separate your
code into native Win32 and Toolkit build environments. Place the
Win32 code or the UNIX code in its own executable (DLL) and then
link and the Toolkit module into one program. This is best accomplished
by making the UNIX code into a COM component and driving it with
the Win32 code. Here are the rules:
Try to separate the build environments.
We do not recommend that you build your UNIX code with the VC++
IDE although it can be done.
Use #include <winnutc.h> if you want to intermix Win32 and
UNIX code. If the API you need is not included by winnutc.h, you
must place the code in a separate source file (and sometimes separate
DLL). Including other Windows header files will almost certainly
clash with Toolkit headers.
Never mix Winsock and UNIX sockets in the same executable (the same
program is fine, but you cannot pass handles back and forth and
the link libraries are incompatible).
COM is your friend. Build components.
Toolkit includes a libc which is not compatible with any of the
Microsoft "C Runtime Libraries". Thus static libraries
built against Microsoft headers should not be linked with UNIX code.
Haut de
Page
If I mix Win32 and UNIX APIs, how can my program
still be portable between my UNIX and Windows platforms?
Similar to the way in which you make programs portable
among different flavors of UNIX, use "#ifdef __NUTC__"
to conditionally compile the Windows-specific code.
Haut de
Page
Is it possible to convert a NuTCRACKER Platform
application into an OLE server?
Yes, this is a major advantage of using Toolkit.
Please see the "HowTo" in the MKS Toolkit Resource Kit
for details and source examples. In addition, see Evolving Applications
with COM in the Cross-Platform Developer's Guide.
Haut de
Page
Can a NuTCRACKER Platform-enabled application be
implemented as a COM component?
Yes, this is a major advantage of using Toolkit.
Please see the "HowTo" in the MKS Toolkit Resource Kit
for details and source examples. In addition, see Evolving Applications
with COM in the Cross-Platform Developer's Guide.
Haut de
Page
Where can I get more information on COM, OLE, and
ActiveX?
In addition to the chapter Evolving Applications
with COM in the Cross-Platform Developer's Guide, we recommend the
following books:
David Chappell, Understanding ActiveX and OLE,
Microsoft Press, 1996.
OLE 2 Programmer's Reference, Microsoft Press, 1996.
OLE Automation Programmer's Reference, Microsoft Press, 1996.
Haut de
Page
Is there a Deployment Wizard feature to help create
a COM component?
Yes, please see the MKS Toolkit Resource Kit for
details.
Haut de
Page
Is it possible to have native Windows help inside
my application?
Yes, Windows provides a one call interface, WinHelp(),
which can be used from within your NuTCRACKER Platform application.
You must first use the Microsoft help compiler to define and compile
your help text into a .HLP file. WinHelp() can then launch the external
viewer from within your application. Pass NULL as the first parameter.
Do not include <windows.h>, but do link with user32.lib.
Example:
#include <winnutc.h>
...
/*
* Display the contents section of the help file.
*/
WinHelp( NULL, "myhelp.hlp", HELP_CONTENTS, 0 );
/*
* Display a specific item from your help file.
*/
WinHelp( NULL, "myhelp.hlp", HELP_KEY, "TopicA"
);
/*
* Close the external help viewer.
*/
WinHelp( NULL, "myhelp.hlp", HELP_QUIT, 0 );
Haut de
Page
How do I mail-enable my application?
Toolkit includes mapimail and smtpmail. These console-based
applications can easily be launched (where sendmail or mailx might
have been used on the UNIX platform) from your ported UNIX application.
Haut de
Page
Terminal, Console, and UNIX Interoperability Support
Does Toolkit support Terminal Server/WinFrame/Hydra?
Yes, Toolkit, including the NuTCRACKER Platform,
works with thin-client technology.
Haut de
Page
Does Toolkit support Microsoft Services for UNIX?
Yes, Toolkit is compatible with SFU.
Haut de
Page
Does Toolkit include a terminal interface for consoles
and serial lines?
Yes, Toolkit has a terminal emulator (like VT100)
and it provides support for termcap, terminfo, and termios. It also
supports serial lines via COM ports. The ioctl() API is supported
for most commands. Serial ports look like ttys to ported UNIX code,
e.g., open("/dev/com/1", O_RDWR).
Haut de
Page
Does Toolkit support curses programs?
Yes, Toolkit supports curses with colors.
Haut de
Page
Does Toolkit provide a pseudo-terminal interface?
No, Toolkit does not support pseudo-terminals.
Haut de
Page
Does Toolkit include a telnet daemon?
Yes, MKS Toolkit for System Administrators and
higher products bundle the SLnet telnet server. If your application
requires a telnet server, this server is also available for redistribution
at aggressive pricing. This server has special extensions that permit
efficient operation with NuTCRACKER Platform applications. If you
use this daemon, your NuTCRACKER Platform application will see a
console and therefore should set TERM=nutc.
In addition, the Microsoft Windows NT Server Resource
Kit includes a beta version of their telnet service. No full screen
console application (e.g., the vi which ships with Toolkit) will
display properly with this service. However applications ported
with Toolkit curses that set TERM=<remote terminal type> function
correctly. Applications such as sh and cmd, which send sequential
text followed by new-lines, also work as expected.
Microsoft's Services for UNIX (SFU) contains both
a telnet client and server.
Haut de
Page
How many terminal users can be supported?
That depends on the telnet daemon implementation
you choose. With special software available from Seattle Lab, their
product can provide connections limited only by the hardware (number
of COM ports).
Haut de
Page
Can I access the Toolkit shell, commands, utilities,
and applications from a UNIX workstation?
Yes, after installing a telnet daemon on the Windows
machine. But, remember each copy of Toolkit is licensed to one machine.
If you install it on a server, you must still purchase one license
for each client machine.
Haut de
Page
Can I use Samba with Toolkit?
Yes, Toolkit supports Samba.
Haut de
Page
Does Toolkit provide remote APIs such as rexec()
and rcmd()?
Yes, the NuTCRACKER Platform supports rexec() and
rcmd().
Haut de
Page
Does Toolkit provide remote utilities and daemons?
Yes. MKS Toolkit for System Administrators and
all higher products include utilities for accessing remote machines,
including
rcp, remote file copy;
rsh, remote shell;
rexec, remote execution;
rlogin, remote login;
rexecd, remote execution service; and
rshd, remote shell service.
These utilities are compatible with standard UNIX rshd and rexecd
daemons, and with standard UNIX rsh and rexec utilities.
Haut de
Page
Does Toolkit support RPCs and XDR?
Yes, the MKS Toolkit Resource Kit contains a port
of ONC RPC, which has full XDR support.
Haut de
Page
Daemons and Services
Why does my program run fine from the command line,
but fail when run as a service?
This is most likely an issue with the security
context under which the application runs. By default, services run
as NT Authority\System. This account has limited access to system
resources (e.g., the file system). Please see the Debugging a Service
section of the Porting Daemons chapter of the Cross-Platform Developer's
Guide to learn how to determine what is failing. Once you understand
the cause, the solution may be to change the security context of
the service, either programmatically or via the control panel.
Haut de
Page
When a service launches a process, does it survive
a user logoff?
Yes, services do not receive user logoff messages.
Haut de
Page
Third-Party Software
Can I run DOS commands and Windows applications
from the Toolkit UNIX shell?
Yes.
Haut de
Page
Can we use the Microsoft Profiler, Intel's V-Tune,
or Rational's Quantify for performance testing?
Yes. We have successfully used these tools at MKS,
but none of them readily follow calls to fork() in the program.
Haut de
Page
Can we use Purify or Insure++ for memory analysis?
Purify works with Toolkit, but it is not able to
follow calls to fork() in the program.
Insure++ does not work with Toolkit's NuTCRACKER
Platform.
Haut de
Page
Does Toolkit support database applications, such
as Oracle, Sybase, or Informix applications?
Yes. Just purchase the appropriate vendor's client
libraries (DLL for Win32 version) and link them with your application.
Haut de
Page
Which mainstream third-party UNIX libraries are
currently implemented for Windows NT and Windows 2000?
Virtually all (99%) are available as Win32 libraries
and can be used with Toolkit.
Haut de
Page
Performance and Memory Consumption
What is Toolkit's performance impact?
In general, the NuTCRACKER Platform that extends
Win32 to support UNIX functionality adds insignificant overhead.
In some cases very specifically, fork() and UNIX-to-Windows
NT/2000 security mapping the NuTCRACKER Platform must do
more and therefore adds slightly more overhead. However, our customers
generally find that their applications perform acceptably. If you
do have a performance problem, you can call Win32 functions directly
to resolve the issue.
Haut de
Page
How much disk space is required in the target environment?
This depends upon the nature of your program. X11
applications typically need more disk space than a daemon or a character-based
application. The MKS NuTCRACKER Workstation requires around 4Mb
of disk space. The NuTCRACKER Deployment Wizard will estimate how
much disk space you will need, based on the components you need
to redistribute.
Haut de
Page
How much memory does Toolkit use? What memory overhead
can I expect in my application?
A memory block of about 300KB is shared by all
NuTCRACKER Platform applications running on a particular Windows
host. This represents the code and data required for Toolkit to
map UNIX to Win32. As your application allocates memory and opens
files, the overall memory demands will grow as on UNIX.
Haut de
Page
Packaging, Deployment, and Runtime
What files do I need to redistribute with my application?
Some NuTCRACKER Workstation components must be
installed along with your application. The set of UNIX compatibility
components that will be required depends on what Toolkit options
are being used by your product. The NuTCRACKER Deployment Wizard
(on the Toolkit Start menu) is used to select the components needed
by your product, and will stage all of the redistributable components
needed for your distribution. The MKS Toolkit Resource Kit contains
an InstallShield tutorial to help deploy a NuTCRACKER Platform application.
Refer to Deploying NuTCRACKER Platform Applications in the Cross-Platform
Developer's Guide.
Haut de
Page
Why do I have a separate key for the NuTCRACKER
Workstation?
The NuTCRACKER Workstation key enables packaging
of applications that you redistribute.
Haut de
Page
What do I do with my NuTCRACKER Workstation key?
You must install it before you can use the NuTCRACKER
Deployment Wizard to distribute your application. There are three
ways to install it:
Select Licenses from the MKS Toolkit Start menu
and enter the numbers in the appropriate fields.
Select the Licenses tab from the NuTCRACKER Control Panel applet.
Use the Edit License button on the first dialog in the NuTCRACKER
Deployment Wizard.
Haut de
Page
Why won't the NuTCRACKER Deployment Wizard let
me select a component?
The Deployment Wizard will only let you select
a component if:
You have installed that component,
You have a license to redistribute that component, and
That component does not conflict with another component that you
have selected.
Haut de
Page
Why does nutinsInstallOe()
fail?
You may be passing it incorrect paths. The first
parameter is the location where the NuTCRACKER Platform Components
are found, e.g., d:\...\nutc. The oe.cfg file is found in this directory.
The second parameter is where you want to install the NuTCRACKER
Workstation on the end user machine, e.g., c:\NuTCROOT. This path
must exist before calling nutinsInstallOe().
Haut de
Page
What are the arguments to nutinsInstallOe()?
See the header files for the most current interface.
If you are writing an installer using InstallShield, please use
<nutinsis.h>. Otherwise your code should include <nutins.h>.
The first two arguments to nutinsInstallOe() are
both paths to directories. To understand the use of these arguments,
you must remember that nutinsInstallOe() is called by your product's
installer running on one of your end user's machines.
The first directory names the location of the NuTCRACKER
Platform components in your distribution. For example, assume that
your product is being installed from a CD, mounted in drive D: on
the end user machine. Further assume that in building your CD, you
placed the NuTCRACKER Platform components in a subdirectory named
nutc in the root directory of your CD. The path that you would pass
to nutinsInstallOe() would be D:\nutc. You must compose this path
at installation time. When you wrote the installer, you knew the
location of the NuTCRACKER Platform components, but you couldn't
possibly have known which drive the customer would use.
The second directory names the location on the
end user's machine where you want to install the NuTCRACKER Platform
components. If there is already an OE on this machine, nutinsInstallOe
will ignore the parameter and update the existing NuTCRACKER Workstation,
if necessary.
We recommend installing in a directory on the system
drive. You may want to offer your customer a default location and
offer the chance to change the location, or you may want to totally
hide the fact that the NuTCRACKER Workstation is being installed.
Haut de
Page
Why do system()/popen() in the NuTCRACKER Workstation
behave differently than in the development environment?
Both functions rely on a shell or command processor.
system()/ popen() first looks for a shell in the $SHELL environment
variable. If this is not defined, it uses the Windows command interpreter
specified by $COMSPEC. The differences you are seeing are probably
caused by one of two things:
$SHELL is probably not set for the NuTCRACKER Workstation.
It is set by default to the Korn shell, but only in the development
environment. You are probably using the Windows command processor.
If $SHELL is set for the NuTCRACKER Workstation, it is probably
set to a non-existent shell. The Korn shell is not part of the base
NuTCRACKER Workstation.
Haut de
Page
My application requires a shell at runtime. What
are my options?
MKS Toolkit for Power Users contains a Korn shell
and a C shell. You may need to license this option.
MKS Toolkit products also provide two sample shells
(tcsh and pdksh) in $ROOTDIR/samples. One of these may work. Your
application would need to install these because they are not part
of any Toolkit component.
You may be able to rewrite your shell commands
to use the Windows command processor.
Haut de
Page
How do I adjust configuration limits at runtime?
Use the NuTCRACKER Control Panel applet to tune
the various configuration parameters.
Haut de
Page
Why are there no Toolkit entries on the Start menu
after I install my application?
None of the NuTCRACKER Workstation components create
Start menu entries. This is the responsibility of your application.
Toolkit cannot know what menu entries are appropriate for your application.
Haut de
Page
Troubleshooting
Why do I see a SIGSEGV from my ported UNIX application?
Just because your code runs on UNIX does not mean
that it will run unmodified on Windows. In our experience, your
code may really have a latent bug (or non-portable code) which simply
does not manifest on UNIX. To debug such situations:
Build your code with -g to enable debugging symbols.
Either run msdev <executable>.exe,
Set the "stop always" state for the Access Violation exception
in the Debug/Exceptions menu.
Or,
Set NUT_DEFAULT_WIN32_FAULT=1 in the environment.
Set SIGSEGV to SIG_DFL.
On a segmentation violation, a pop-up dialog box will let you launch
the debugger at the location of the fault.
See the Debugging the Application section of the Developing Cross-Platform
Solutions chapter of the Cross-Platform Developer's Guide for more
details about debugging applications.
Haut de
Page
Why does my NuTCRACKER Platform application read
my binary data files incorrectly?
You could have a byte-ordering problem. The MKS
Toolkit Resource Kit contains a port of ONC RPC, including XDR.
The XDR functions (and the program RPCGEN) help you encode and decode
binary data. The resource kit contains a sample use of XDR to save/retrieve
a data structure in a platform neutral form, using the xdrstdio
library. Libraries exist for UDP, TCP, memory, and the file system.
The Toolkit socket library has implementations
of htons(), htonl(), ntohs(), and ntohl(). Where XDR is overkill,
you can use these functions to encode and decode 16- and 32-bit
integers.
Haut de
Page
Other Technical Resources
What is the Toolkit Resource Kit?
The MKS Toolkit Resource Kit contains APIs, libraries,
and utilities developed by the Consulting Services organization,
in the course of helping hundreds of our customers with quick-starts
and on-site consulting.
The Resource Kit is a dynamic entity.
Haut de
Page
Miscellaneous
Are Windows errors mapped into UNIX errno?
Yes, Toolkit maps Win32 error codes to a corresponding
UNIX errno value whenever possible. When no valid mapping exists,
errno is set to the negative of the Win32 error code. Your code
must allow negative errno values. For example, directly accessing
sys_errlist[errno] without validating that errno is positive can
cause an access violation. You should always use strerror() in preference
to sys_errlist[], because it will return the Windows error message
for any error code that does not map to a UNIX error code.
Toolkit also supports h_errno, for networking name-resolution
functions (such as gethostbyname()), by mapping Winsock error codes
as needed.
Toolkit provides a perror command, which takes
an error number as an argument. This command interactively displays
error messages corresponding to UNIX errno values (a positive number
as an argument), or Windows error codes (a negative number as an
argument). perror() is also available as an API.
This table shows the mapping of Windows error codes
to errno values.
Haut de
Page
My program pipes to lpr for printing. What can
I do?
Windows NT and Windows 2000 have a tcp printing
service (Windows 95/98 does not). Once installed (Control Panel/Networks/Services/Add),
a command line-based lpr.exe is located in %SystemRoot%\system32.
Unfortunately this utility does not accept stdin for the printer
data, so your application must be modified to output the formatted
printer data to a file and then ask lp to send it to a tcp printing
service on some server.
Toolkit does provide /dev/lp which interfaces to
the default printer. And, you can send data directly to a network
printer with open("//<server>/<printer>").
Haut de
Page
What is the binary compatibility between NuTCRACKER
and Toolkit releases?
All releases going forward from NuTCRACKER 4.0
are upwardly binary compatible. In particular, NuTCRACKER 4.5, 4.3,
4.2a, 4.2, 4.1 and 4.0 are compatible. This means that an application
built with NuTCRACKER 4.0 will run with no problems on subsequent
releases of the NuTCRACKER Platform. Toolkit 7.5 includes NuTCRACKER
Platform 4.5.
Haut de
Page
|