home *** CD-ROM | disk | FTP | other *** search
- ID:PD Porting UNIX X Clients to DOS under DESQview/X
- Quarterdeck Technical Note #405
- by Kris Williams & Mark Welinder
-
- Porting Unix X clients to DOS under DESQview/X
-
- The X Window System Toolkit offers the software developer the ability to
- write an X specific application's code once, then compile it for each X
- Window System platform they want it to run on. These programs are
- refered to as X Clients. X Clients are dependent on the presence of the
- X Window System, which means they won't run without it's resources being
- available.
-
- This document covers:
-
- ■ Components of Quarterdeck's X11R4 Development toolkit,
- ■ Compiler and DOS Extender compatibility,
- ■ Overview of Quarterdeck's QMAKE utility,
- ■ Unix system-call considerations,
- ■ 32-bit to 16-bit porting considerations,
- ■ and Porting Unix C X Clients to DOS Real Mode using Microsoft C.
-
-
- DESQview/X Toolkit Contents
-
- There are a few different packages available for porting/development X
- client applications to/on DOS for use with DESQview/X. Many of these
- packages are included with Quarterdeck's standard X Toolkit, and some of
- them are available from companies other that Quarterdeck. The sections
- to follow will introduce each of these packages.
-
- Quarterdeck's X11R4 Development Toolkit
-
- This is the base X11R4 developement package, which has all of the
- example source, and linkable libraries which are needed to build Xt and
- XLib X Clients. This X development package is directly available from
- Quarterdeck.
-
- Quarterdeck's Motif Toolkit (OSF/Motif 1.1.1)
-
- This development module contains the preprocessor files, linkable
- library files, and sample source code for the OSF/Motif 1.1 Widget X
- Toolkit. This package is directly available from Quarterdeck.
-
- Xview
-
- (X Window-System Visual/Integrated Environment for Workstations). a
- user-interface toolkit which was developed by Sun Microsystems, for the
- SunView windowing system, and ported to DOS for use with DESQview/X and
- the OPENLOOK window manager. This package is also directly available
- from Quarterdeck Office Systems.
-
- XVT
-
- XVT is an X toolkit package, developed by XVT, Inc., to provide a GUI
- programmer with the ability to write a single program, and the code will
- be portable to other graphical platforms. This package is available
- from only XVT, Inc.
-
-
- Supported Compilers
-
- MetaWare High C
-
- This compiler produces 386 protected mode, DOS extended, 32-bit X
- clients. The versions 1.71 and 2.3 are compatible with the X11R4
- Toolkit. Use of this compiler may be necessary for extremely large X
- client applications. This compiler is available from Metaware, Inc.
-
- Microsoft C
-
- This compiler produces Real Mode or 286 DOS extended, 16-bit X clients.
- Versions 5.1 and 6.0 are compatible with the X11R4 Toolkit. Version 6.0
- is required to take advantage of Dynamic Link Libraries (DLL's) created
- with Rational System's DOS4GX.
-
- Zortech C++ 3.0
-
- This compiler produces Real Mode, 286 protected mode DOS extended
- 16-bit, or 386 Dos extended 32-bit X clients. Version 3.0 is required
- to be compatible with the X11R4 Toolkit. Zortech C++ 3.0 is available
- from Zortech, Inc.
-
- Watcom C
-
- This compiler will be supported by first release, and will be available
- from Watcom, Inc.
-
-
- Supported DOS Extenders
-
- Rational Systems' DOS16M & DOS4GX
-
-
- PharLap's 386|DOS-Extender SDK
-
-
- Ergo 386 DOS Extender
-
-
- Supported Debuggers
-
- Rational Systems' Instant D
-
- 16 Bit
- 32 Bit
- Comes with extender
-
- MetaWare Debugger
-
- 32 Bit
- Use with Phar Lap Extender
- Comes with HC386
-
-
- Program Models
-
- Real Mode
- Microsoft C
-
- 286 Protected Mode
- MSC + DOS16M
- MSC + DOS4GX
-
- 386 Protected Mode
- HC386 + DOS4GX
- HC386 + Phar Lap
- EXP executable
- DOS4GX Formats
-
- 16 Bit Protected Mode
- Shared Code
- No Shared Libraries
- SegExe executable
-
- 16 Bit protected mode
- Shared Code
- Shared libraries
- DLL's in standard format
- LinExe executable format
-
- 32 Bit protected mode
- Shared code
- Shared libraries
- DLL's in standard format
-
-
- Porting Tools
-
- X11 Toolkit
- End user DESQview/X
- Xlib
- Xt
- Xaw
- Sample clients and demos
-
- Motif Toolkit
- X11 Toolkit
- Xm
- Mrm
- Uil
- Motif Window Manager
- Sample clients and demos
- Utility Programs
-
-
- QMAKE
-
- QMAKE is Quarterdeck's Unix style make facility takes environment for
- command line parameters.
- Use with included makefiles.
- Supports macros,
- include files,
- multiple targets etc.
- Sample makefiles are model specific: MSCREAL, HCPHAR, HC4GX etc.
- application.
-
- GETPROTO and SORTFNDF
-
- Xset,
- Xsetroot,
- Xev,
- Xwd,
- Xwud etc.
-
- Porting Perspective and Methodology
-
- DOS filenames are limited to 11 characters (ie 12345678.901).
- Unix "/" characters must be replaced with DOS "\" characters.
- All Unix system calls need to accounted for, eg fork().
- Check source for system specific (platform dependant) calls.
- Varying behaviour of compilers, eg variable argument lists.
- DOS applications must support the little endian byte order.
- Unless you are porting from a Digital Equipment machine based on a VAX
- or a MIPS chipset or from the varieties of Unix ported for the Intel
- 80x86, you will have to address this problem at the source level within
- your application.
- Differing system resources.
- Type conversions - signed/unsigned.
-
- Porting Overview
-
- Determine if 16 bit or 32 bit application
- Different integer size (286 integer is 16 bits and 386 integer is 32 bits)
- All code ported to 16 bits should be prototyped.
- Use Quarterdeck method with real mode compiler.
- Use R4 prototypes with protected mode compiler.
-
- Porting Process
-
- Before copying files to DOS, check length of name.
- Make small changes in source: add or change system calls if necessary
- and add or change include files if necessary.
- Compile and link to the X libraries.
- DOS extend if necessary.
-
- Potential bugs
-
- Ensure that the correct header files get included: XT - Intrinsicl.h,
- Intrinsic.h, IntrinsicP.h
- Some functions are also defined as macros.
- Beware of integer size conversions.
-
- Porting Tips
-
- Eliminate compiler warning messages (especially for 16 Bit
- applications). Use XSync, particularly useful at toolkit level. Test on
- as many servers as possible. For extreme bugs, debug remotely. Write
- private error handlers. Work through a sample port.
-
- QMAKE
-
- Quarterdeck's Unix style make facility takes environment for command
- line parameters. Use with included makefiles. Support macros, include
- files, multiple targets etc. Sample makefiles are model specific:
- MSCREAL, HCPHAR, HC4GX etc.
-
- GETPROTO and SORTFNDF
- For prototyping 16 bit code
-
- Xset, Xsetroot, Xev, Xwd, Xwud etc.
-
-
- Porting Perspective and Methodology
-
- DOS filenames are limited to 11 characters (ie 12345678.901). Unix "/"
- characters must be replaced with DOS "\" characters. All Unix system
- calls need to accounted for, eg fork(). Check source for system specific
- (platform dependant) calls.
-
- Varying behaviour of compilers, e.g. variable argument lists.
-
- DOS applications must support the little endian byte order. Unless you
- are porting from a Digital Equipment machine based on a VAX or a MIPS
- chipset or from the varieties of Unix ported for the Intel 80x86, you
- will have to address this problem at the source level within your
- application.
-
- Differing system resources.
-
- Type conversions - signed/unsigned.
-
- Porting Overview
-
- Determine if 16 bit or 32 bit application. Different integer size (286
- integer is 16 bits and 386 integer is 32 bits).
-
- All code ported to 16 Bits should be prototyped.
- Use Quarterdeck method with real mode compiler.
- Use R4 prototypes with protected mode compiler.
-
- Porting Process
-
- Before copying files to DOS, check length of name. Make small changes in
- source: add or change system calls if necessary and add or change
- include files if necessary. Compile and link to the X libraries. DOS
- extend if necessary.
-
- Potential bugs
-
- Ensure that the correct header files get included: XT - Intrinsicl.h,
- Intrinsic.h, IntrinsicP.h Some functions are also defined as macros.
- Beware of integer size conversions.
-
- Porting Tips
-
- Eliminate compiler warning messages (especially for 16 bit
- applications). Use XSync, particularly useful at toolkit level. Test on
- as many servers as possible. For extreme bugs, debug remotely. Write
- private error handlers. Work through a sample port.
-
-