[an error occurred while processing this directive]
Node:Program Index,
Previous:Topic Index,
Up:Top
This index lists the problems and solutions by the program/package to which they pertain. If you know what program or package gives you the trouble, look it up here.
386Max, how to ensure virtual memory
: QDPMI VM
386Max, speeding up DJGPP start-up
: QDPMI VM
4DOS, redirecting GCC messages to a file
: Redirect
Aladdin Expander, unzipping DJGPP
: Urgent
Allegro, a graphics and gaming package
: What to download
Allegro, compilation speed
: Slow compiler
Allegro, compiling on DOSEmu
: DOSEmu
Allegro, linker switch
: Unresolved externals
Allegro, problems on Windows/NT
: WindowsNT
ATT2INTL, a converter from AT&T to Intel assembly
: Converting ASM
Bash crashes
: Bash crashes
Bash hangs on Windows 9X
: Programs hang
BatchFTP, automated downloading from a Unix box
: DJGPP Fatware
BCC2GRX, porting Borland graphics
: What to download
BCCBGI (from BCC2GRX) crashes with the default stack
: Stack size
BCSERIO, async communications package for DJGPP
: Packages
Binutils configured for ELF32
: ELF vs COFF
Binutils, incompatibilities with DJP
: Large executable
Bison doesn't imply GPL/LGPL
: Application distribution
Bison, debugging generated code
: Included source
Boot loader for an operating system
: Packages
byacc, a DJGPP port
: Packages
bzip2, a DJGPP port
: Packages
Caldera's DR-DOS, and redirection
: Minimum
Caldera's DR-DOS, and RHIDE
: Minimum
Cawf, using to read man pages
: Man pages
CC1PLUS crashes with SIGSEGV
: Stack size
Cdecl, ported to DJGPP
: Packages
CHCP DOS command might prevent MSHELL from working
: Debug graphics
collect2, accesses the network
: Linker accesses other drives
collect2
, slow operation on Windows 9X
: Slow linker
CPP, compiling, memory requirements
: Reasonable hardware
CPP, compiling, RAM disk
: Config
CWSDPMI allows ``Fat DS''
: Fat DS
CWSDPMI crashes programs allocating memory is small chunks
: QDPMI alloc
CWSDPMI crashes programs which dereference NULL pointers
: v2 crash
CWSDPMI doesn't support hooking Int 24h
: Int 24h
CWSDPMI r4, bugs with lots of virtual memory
: More than 64MB
CWSDPMI runs out of virtual memory
: Internal error
CWSDPMI, alternative DPMI hosts
: Environment
CWSDPMI, disabling virtual memory
: Slow compiler
CWSDPMI, legal restrictions
: DJGPP redistribution
CWSDPMI, maximum available virtual memory
: How much memory
CWSDPMI, memory usage for nested programs
: Swap out
CWSDPMI, minimum required system RAM
: Minimum
CWSDPMI, pages too early under EMM386
: EMM386 alloc
CWSDPMI, setting parameters for optimal performance
: Config
CWSDPMI, should be distributed with DJGPP programs
: Distributing
CWSDPR0 reduces interrupt reflection overhead
: HW Int pitfalls
CWSDPR0, use for testing HW interrupt handlers
: Hardware interrupts
CWSPARAM, a program to tune CWSDPMI performance
: Config
cxxfilt.exe, duplicate versions
: g++.exe
DISPLAY.SYS and EMM386, conflict with Info
: Info crashes
DJGPP.ENV, linker environment variables
: Libraries order
DJP compressor supports DLM
: Large executable
DJP, an executable compressor for DJGPP
: Large executable
DJP, incompatibilities with Binutils
: Large executable
DLM compression, with DJP
: Large executable
DLM, a facility to load code at run time
: Packages
DOSEMU doesn't allow ``Fat DS''
: Fat DS
DOSEmu, and recursive Make invocation
: DOSEmu
DOSEmu, leaks DPMI selectors
: DOSEmu
DOSEmu, problems with FAT32 volumes
: DOSEmu
DOSEmu, RHIDE conflicts with mouse support
: DOSEmu
DR-DOS, Ctrl-BREAK crashes
: Minimum
DR-DOS, problems with linear frame buffer
: Minimum
DXEGEN, undefined references
: DXE
EDEBUG32 can debug a DXE
: How to debug
Emacs hangs on Windows 9X
: Programs hang
Emacs, reading docs
: Where is the docs
Emacs, reading Info files
: Where is the docs
Emacs, using to read man pages
: Man pages
EMM386 and DISPLAY.SYS, conflict with Info
: Info crashes
EMM386, cannot use all free memory
: EMM386 alloc
EMM386, conflicts with dual-monitor systems
: Debug graphics
EMM386, effect on max interrupt frequency
: HW Int pitfalls
EMM386, getting the most memory
: Config
EMM386, how to get more than 32MB of memory
: More than 64MB
EMM386, malloc/calloc fails
: EMM386 alloc
EMM386, settings for optimal performance
: Config
emTeX, printing the docs
: Printed docs
emu387.dxe, distribution with DJGPP programs
: Emulation
F2C, debugging generated code
: Included source
FIND.EXE, incompatible with GNU Find
: What to download
Flex doesn't imply GPL/LGPL
: Application distribution
Flex, debugging generated code
: Included source
Flex, undefined references
: Unresolved externals
FORTIFY, a malloc debugger
: Packages
FreeBE/AF, 2D accelerator
: Packages
FSDB, the full-screen debugger
: How to debug
g++ compilation driver, alternative names on DOS
: Libraries order
g++.exe, unzip complains on DOS
: g++.exe
Gas, accepts Intel assembly syntax
: Syntax
GCC 2.95, slower compilation than old GCC versions
: Slow compiler
GCC aborts or crashes during compilation
: Internal error
GCC can't find C++ headers
: Missing C++ headers
GCC can't find crt0.o
: Missing headers or libraries
GCC can't find headers
: Missing headers or libraries
GCC can't find libraries
: Missing headers or libraries
GCC cannot resolve djgpp_first_ctor symbol when linking
: djgpp_first_ctor
GCC crashes due to CPU overclocking
: Internal error
GCC crashes due to incorrect CMOS setup
: Internal error
GCC crashes during optimization
: GCC optimizations
GCC crashes with Page Fault on Windows 3.X
: Internal error
GCC crashes, which subprogram of
: General trouble
GCC doesn't pack structs in C++ programs
: Struct packing
GCC doesn't recognize .lib libraries
: OBJ and LIB
GCC doesn't recognize .obj object files
: OBJ and LIB
GCC doesn't recognize file format
: Which language
GCC exhausts virtual memory
: GCC optimizations
GCC from v2.x crashes under v1.x Make
: Make hangs
GCC hangs under Make
: Make hangs
GCC says ``garbage at end of number''
: 0xfe+0x20
GCC won't compile C++-style comments in C programs
: C++ comments
GCC won't find inline functions without -O
: Still unresolved
GCC, -fconserve-space switch
: Large image
GCC, -v
switch shows the compilation passes
: Which language
GCC, assumes C++ source is .cc
: GDB and C++ source
GCC, code efficiency
: How fast
GCC, compiling for debugging
: How to debug
GCC, compiling, memory requirements
: Reasonable hardware
GCC, compiling, RAM disk
: Config
GCC, environment variables
: Missing headers or libraries
GCC, file source language recognition
: Which language
GCC, I/O speed
: IO speed
GCC, inline assembly facilities
: Inline Asm
GCC, maximum length of command line in Makefiles
: How long
GCC, passing long command lines via Makefile
: Makefiles
GCC, recompiling
: Changing
GCC, redirecting messages to a file
: Redirect
GCC, slow compilation
: Slow compiler
GCC, uses lots of memory with -Wall
: GCC optimizations
GDB causes stack overflow in a debuggee
: Stack size
GDB doesn't pass command-line arguments to debuggee
: How to debug
GDB doesn't recognize source language
: C++ classes in GDB
GDB fails to set or display static variables
: Static vars
GDB GP Faults on breakpoint/watchpoint under Windows
: Debugging woes
GDB, conflicts with file redirection
: How to debug
GDB, debugging DJGPP programs
: How to debug
GDB, debugging graphics programs
: Debug graphics
GDB, how is it different on MS-DOS
: How to debug
GDB, how to use C++ class variables' names
: C++ classes in GDB
GDB, how to use C++ method names
: C++ classes in GDB
GDB, init file name
: How to debug
GDB, name of the READLINE init file
: How to debug
GDB, slow loading of symbols and sources
: How to debug
GLUT for DJGPP
: OpenGL
GMP library
: Packages
go32-v2 reports the amount of memory and swap space
: Disk space
go32-v2 usage
: go32-v2
go32-v2, use to find out how much memory is available to DJGPP
: EMM386 alloc
Gprof produces garbled profile
: Garbled profile
gprof produces no output
: No profile
Gprof shows 100% of time in one function
: Garbled profile
Gprof, documentation
: Cannot find docs
Gprof, the GNU profiler
: How to profile
Groff, port to DJGPP
: Man pages
Groff, using to read man pages
: Man pages
GRX, a graphics package
: What to download
GRX, failure to compile inline assembly
: Allegro and GRX
GRX, latest versions, where to find
: What to download
GRX, linker switch
: Unresolved externals
GRX, supported SVGA types
: GRX driver
gsymify, a substitute for SYMIFY for stabs debugging
: C++ classes in GDB
gxx driver, not in gcc272b distribution
: Unresolved externals
gxx driver, searches C++ libraries automatically
: Unresolved externals
gxx.exe, duplicate versions
: g++.exe
HIMEM, malloc/calloc fails
: EMM386 alloc
INFNG, produces the FAQ in Norton Guides format
: FAQ format
Info crashes due to ^Z or whitespace at end of DJGPP.ENV
: Info crashes
Info crashes immediately upon startup
: Info crashes
Info crashes under QDPMI
: Buggy DPMI
Info hangs on Windows 9X
: Programs hang
Info won't display a file
: Info cannot find Top
Info, a stand-alone docs browser
: Where is the docs
Info, conflicts with DISPLAY.SYS, EMM386
: Info crashes
Info, using to read man pages
: Man pages
InfView, an Info browser
: Where is the docs
install-info, a program to install Info docs
: What to download
Intel2gas, a converter from Intel to AT&T assembly syntax
: Converting ASM
Internet Explorer, downloading DJGPP
: DJGPP by WWW
JAS, a free assembler with Intel-like syntax
: Converting ASM
Jlib, a gaming library
: Packages
JPTUI, a text user interface library
: Packages
LaTeX, printing the docs
: Printed docs
lcc-win32, a free compiler for Windows
: Windows apps
LCLINT, a Lint clone for DJGPP
: Packages
LD linker, linker script defines djgpp_first_ctor
: djgpp_first_ctor
ld
, how to improve linking speed
: Slow linker
ld.exe, from RSXNTDJ
: Windows apps
Less hangs on Windows 9X
: Programs hang
Less, using to read man pages
: Man pages
Lex, debugging generated code
: Included source
libemu.a FP emulation library
: Emulation
LibINI, Windows .ini files handling
: Packages
libmslot, a Windows Mailslot library
: Packages
libwin, a library for interfacing with Windows
: Packages
Linker can't find library functions in non-default directories
: Libraries order
Linker, environment variables
: Libraries order
Linker, order of libraries in the command line
: Libraries order
Linux doesn't allow ``Fat DS''
: Fat DS
Linux, compatibility
: Minimum
Linux, needs a patch to run nested programs
: DOSEmu
Linux, slow response to interactive programs
: DOSEmu
LWP multitasking for DJGPP
: Packages
Make crashes on DOSEmu
: DOSEmu
Make crashes on OS/2
: OS2
Make error message ``missing separator''
: Missing separator
Make requires floating point
: Changing
Make, can be built to not issue FP instructions
: DOSEmu
Make, GCC hangs when invoked from it
: Make hangs
Make, maximum length of command line to pass to GCC
: How long
Make, passing long command lines via Makefile
: Makefiles
Make, warning ``file modification time in the future''.
: Modification time
Makeinfo, using to convert Info files to plain ASCII
: No Info
MAKERTF, produces the FAQ in RTF format
: FAQ format
Man program for DJGPP docs
: Man pages
MDA device driver for redirecting debug output
: Debug graphics
MESA for DJGPP
: OpenGL
MESA is under LGPL
: OpenGL
MGL for DJGPP
: OpenGL
MGUI, a cross-platform GUI library
: Packages
Midnight Commander port to DJGPP
: Packages
Mingw32 port of GCC
: Windows apps
More, using to read man pages
: Man pages
MSHELL fails because of TSR programs
: Debug graphics
MSHELL, redirecting screen output
: Debug graphics
MSS, a malloc debugger
: Packages
NASM, a portable assembler with Intel syntax support
: Converting ASM
NASM, a tutorial on usage with DJGPP
: Syntax
NC clone, ported to DJGPP
: Packages
Netscape, downloading DJGPP
: DJGPP by WWW
NM, printing library contents
: Which library
Notepad, appends .txt to source files
: No input files
Novell NWDOS 7, buggy DPMI services
: Minimum
Novell NWDOS 7, compatibility
: Minimum
Novell VLM causes slow-down of DJGPP programs
: Slow-down
NWDOS, buggy DPMI services crash DJGPP
: Buggy DPMI
OBJ2BFD converter from .obj to COFF format
: OBJ and LIB
OBJ2COFF converter from .obj to COFF format
: OBJ and LIB
OBJ2COFF, commercial use is prohibited
: OBJ and LIB
Objective C, compilation problems
: Objective C
OpenDOS, bug in DPMI services crash DJGPP
: Buggy DPMI
OpenGL for DJGPP
: OpenGL
OpenGL, what it is
: OpenGL
OS/2 and RHIDE
: OS2
OS/2 Warp allows ``Fat DS''
: Fat DS
OS/2, and _go32_remaining_physical_memory
: Confusing alloc
OS/2, and delay
function
: OS2
OS/2, compatibility
: Minimum
OS/2, Ctrl-C aborts programs
: OS2
OS/2, incompatibilities
: OS2
OS/2, SIGINT cannot be caught
: OS2
Palantir, a multitasking kernel for Allegro
: Packages
PDMLWP, a multithreading package
: Packages
PGCC exhausts virtual memory
: GCC optimizations
PGCC, bugs with optimization levels -O7 and higher
: Older is faster
PKUNZIP v2.50, creates numeric tails
: Dual DOS/Windows
PMODE/DJ reduces interrupt reflection overhead
: HW Int pitfalls
PMODE/DJ, can be used to produce stand-alone programs
: Distributing
Pthreads for DJGPP
: Packages
QDPMI allows ``Fat DS''
: Fat DS
QDPMI and _crt0_startup_flags settings
: QDPMI VM
QDPMI crashes DJGPP programs when they cause Int 24h
: Int 24h
QDPMI crashes Info and debuggers
: Buggy DPMI
QDPMI fails to provide virtual memory
: QDPMI VM
QDPMI, malloc/calloc failure
: QDPMI alloc
QDPMI, memory usage for nested programs
: Swap out
QEMM, how to get more than 64MB of memory
: More than 64MB
QEMM386, settings for optimal performance
: Config
RAMDRIVE.SYS, problems with long file names
: Config
RCS port to DJGPP
: Packages
REDIR, problems on Windows/NT
: WindowsNT
REDIR, redirecting GCC messages to a file
: Redirect
REDIR, redirecting stack dump to a file
: Crash traceback
REDIR, use to get redirection and long command lines
: Makefiles
REGEDIT, running from an input file
: Dual DOS/Windows
RHGDB fails to set or display static variables
: Static vars
RHIDE aborts on OS/2
: OS2
RHIDE debugger GP Faults on breakpoints under Windows
: Debugging woes
RHIDE fails to set or display static variables
: Static vars
RHIDE hangs on Windows 9X
: Programs hang
RHIDE puts files in the wrong directory
: RHIDE
RHIDE, and Caldera's DR-DOS
: Minimum
RHIDE, and monochrome display
: Debug graphics
RHIDE, debugging graphics programs on Windows
: Debug graphics
RHIDE, display problems
: RHIDE
RHIDE, includes an integrated debugger
: How to debug
RHIDE, long command lines
: Makefiles
RHIDE, mouse problems on DOSEmu
: DOSEmu
RHIDE, problems on NT
: WindowsNT
RHIDE, problems with using
: RHIDE
RHIDE, reading Info docs
: Where is the docs
RHIDE, where to find the latest version
: What to download
RSXIDE, where to download
: Windows apps
RSXNTDJ include files, mixing with DJGPP
: Still unresolved
RSXNTDJ toolkit for developing Win32 applications
: Windows apps
RSXNTDJ, how to install
: Windows apps
RSXNTDJ, MS Platform SDK
: Windows apps
RSXNTDJ, problems with header files
: Windows apps
RSXNTDJ, using with GCC 2.8.1 and later
: Windows apps
SCRIPT, redirecting GCC messages to a file
: Redirect
Sed requires floating point
: Changing
Sed script to convert ASM to AT&T syntax
: Converting ASM
Sed, documentation
: Cannot find docs
Sed, using to convert formatted man pages to plain text
: Man pages
SeeR, a scripting engine
: Packages
SETEdit, where to download
: Man pages
setitimer, bugs
: Garbled profile
SHARE, limits available file handles
: File handles
SmartDrv, installation
: Config
STRIP makes executables smaller
: Large executable
STUBEDIT, changing stack size
: Stack size
STUBEDIT, effect on memory left to spawned programs
: Swap out
STUBIFY fails to produce .EXE
: No EXE
STUBIFY, not found during compilation
: No stubify
STUBIFY.EXE, infected by a virus
: Unknown filetype
SWORD, GUI environment
: Packages
SYMIFY, a program to read crash traceback
: Crash traceback
SYMIFY, inaccurate report for inline assembly
: Crash traceback
SYSINFO package
: Packages
TA2AS, a converter from Intel to AT&T assembly syntax
: Converting ASM
TeX, printing the docs
: Printed docs
TEXI2PS, converting docs to crude PostScript
: Printed docs
TkInfo, a Win32 tool to read Info files
: Where is the docs
UNIVBE, software VESA 2.0 emulation
: GRX driver
UPX, an excutable compressor for DJGPP
: Large executable
usleep, insufficient resolution
: usleep
VDISK from Caldera's DR-DOS
: Minimum
VIM, a Vi clone for DJGPP
: Packages
Warp, compatibility
: Minimum
Warp, incompatibilities
: OS2
WATTCP
: Packages
Windows 3.X allows ``Fat DS''
: Fat DS
Windows 3.X, compatibility
: Minimum
Windows 3.X, malloc/calloc fails
: Windows alloc
Windows 98 complains about memory access
: Windows 98
Windows 9X allows ``Fat DS''
: Fat DS
Windows 9X doesn't allow more than 16MB virtual memory
: Windows9X alloc
Windows 9X DPMI server loses selectors calling spawnXX
: WindowsNT
Windows 9X long filenames and C++ headers
: Missing C++ headers
Windows 9X, calls both PM and RM interrupt handlers
: Hardware interrupts
Windows 9X, compatibility
: Minimum
Windows 9X, how to get more than 64MB of DPMI memory
: More than 64MB
Windows 9X, setting DJGPP environment variable
: Missing headers or libraries
Windows messes up graphics screen
: Graphics and Windows
Windows, FP emulator hangs
: Emulation in Windows
Windows, malloc/calloc failure
: QDPMI alloc
Windows, memory usage for nested programs
: Swap out
Windows, setting memory parameters for DJGPP
: Config
Windows, stack size control
: Stack size
Windows, wants to run graphics programs in DOS Mode
: Graphics and Windows
Windows/NT and delay
function
: WindowsNT
Windows/NT doesn't allow ``Fat DS''
: Fat DS
Windows/NT doesn't allow port I/O
: WindowsNT
Windows/NT DPMI server loses selectors calling spawnXX
: WindowsNT
Windows/NT LFN driver
: WindowsNT
Windows/NT, bug in handling signals
: WindowsNT
Windows/NT, compatibility
: Minimum
Windows/NT, Ctrl-C aborts DJGPP programs
: WindowsNT
Windows/NT, profiled programs crash
: WindowsNT
WindowsNT doesn't support VDS
: DMA
WindowsNT, setting DJGPP environment variable
: Missing headers or libraries
WinZip, how to unzip DJGPP
: Urgent
WMEMU causes undefined references when linking
: Emulation
WMEMU, an alternative floating-point emulator
: Emulation
WMEMU, use when debugging FP programs on non-FPU machine
: Debugging woes
Yacc, debugging generated code
: Included source
YAMD, a malloc debugger
: Packages
YAMD, debugging buffer overruns
: malloc crash
ZipMagic, disable to unzip DJGPP
: Urgent
Please report any issues that couldn't be found via the indices to the maintainer of this FAQ, whose name and e-mail address can be found near the end of the FAQ.
Posix is an international standard for a portable operating system. It specifies facilities of a compiler, its libraries, and the basic set of development tools. Posix was originally modeled on Unix systems, but is currently supported by most modern operating systems.
For example, the DOS version of the well-known game Quake
by id
Software was compiled with DJGPP.
The typo in the word Exception
is in the actual message popped by
Linux.
This was reported for DOSEmu version 0.66.7; the format of
dosemu.conf
might be different in version 0.9x.
But the development environment will only run on Windows 9X/NT.
This DLL can be stripped off the debugging symbols using the
strip
utility, which leaves a much smaller--about
500KB--file.
The BUFFERS=40,8
setting defines a primary cache of 40 512-byte
blocks and a secondary cache of 8 blocks. The primary cache is used by
DOS to store the data actually read by a program, in case it is re-read
shortly afterwards; while the secondary cache is used to read data ahead
of the requests, which is optimized towards sequential reads.
ftp.simtel.net is actually several ftp sites arranged in a rotating pattern of IP addresses to help balance the load and to avoid access problems due to network outages and simultaneous user limits.
The version numbers of the packages listed here might not be up to date by the time you read this. For the latest versions, check out the DJGPP Mini-FAQ posted weekly to the the comp.os.msdos.djgpp news group. The file LISTINGS.zip available on every DJGPP site includes one file for every zip that lists all the files inside that zip; download and unzip it on your machine, and you've got a set of files you can search for substrings. Another place where you can look for the latest versions of all files is on the DJGPP server, which is also a convenient way of downloading individual files if you have lost them somehow.
Like its name suggests, texi2html
converts a Texinfo source to
HTML.
You will need to install the port of Bash and some auxiliary utilities
to be able to run shell scripts; texi2dvi
itself is part of the
GNU Texinfo distribution and comes with the v2gnu/txiNNNb.zip
archive.
The example uses Unix-style forward slashes, but DOS-style backslashes can also be used.
While admittedly perverse, this little monstrosity was written with the sole purpose of demonstrating that C and C++ have quite different semantics under certain circumstances. Some people think that C is a proper subset of C++; the above example shows that this is not true.
If you define an empty
substitute for __crt0_setup_arguments
, you don't need to define a
substitute for __crt0_glob_function
.
In particular, running strip
on a program and then compressing it
with DJP would produce a program that crashes upon startup.
Those who want all the details should consult a good book about DOS internals, such as Undocumented DOS, 2nd ed. by Andrew Schullman, or Geoff Chappel's DOS Internals.
All DOS programs get the default 20-handle table when they start; DOS only copies the first 20 handles into the child, so it is not possible to inherit more than 20 handles. The expansion of the default 20-handle table to 255 handles is a special feature of the DJGPP library, and it only happens when the programs exhausts all of the 20 handles while it runs. Therefore, when all of the first 20 handles are taken up by files inherited from the parent program, the child program can fail to start because the DJGPP stub loader needs one free handle to open and read the COFF executable into memory. The stub cannot use the enlarged 255-handle table, since it cannot call the DJGPP library. Such problems indeed happen in programs compiled with DJGPP v2.01; v2.02 fixes this bug.
Each handle created by a call to open
uses up one slot in the
SFT, whereas a handle created by dup
just increments the use
count of a slot that was already in use.
That's the program being debugged, in case you didn't know.
Programs that create machine code in malloc
ed storage and then
jump into it could have their EIP above EBP. The Allegro
library utilizes this technique in some of its functions (specifically,
compiled sprites and stretched blits are normally performed in this
way).
If you absolutely need to call ld.exe
directly, invoke gcc
once with a -v
switch and you will see what are the arguments
that you should pass to the linker in your case.
Here's a more detailed explanation. DOS cannot access memory above 1MB mark, where your DJGPP program lives, since real-mode addresses are 20-bit wide, and 20-bit addresses cover only the first megabyte. So, each time a DJGPP program needs to call a DOS function (or any other real-mode service, like some BIOS interrupt) and needs to pass data to or from that service, we must use some buffer in conventional memory to communicate with DOS and BIOS. The transfer buffer is a block of conventional memory that the DJGPP startup code allocates for this purpose. When a real-mode service is called, the data that needs to be submitted to it is copied to the transfer buffer, and the address of the transfer buffer is passed to the real-mode service. If the service returns some data (e.g., if you want to read a portion of a file), data is copied from the transfer buffer when the service returns.
The transfer buffer primarily exists for library functions, but it can also be used by an application, if it needs to invoke real-mode services.
Actually, the maximum possible value is FEF0h, or 65254 in decimal,
because the transfer buffer is created by the startup code by resizing
the PSP memory block. Since the resized block needs to leave 256 bytes
for the PSP, and needs to be aligned on a 16-byte boundary, you cannot
have the entire 65535 bytes for the transfer buffer. In DJGPP v2.01, if
you invoke stubedit
with a bufsize=64k
parameter, what you
actually get is a 2KB buffer, since the combined size of the PSP and the
transfer buffer will wrap around in a 16-bit variable when the startup
code computes it. The versions of stubedit
which will come with
DJGPP v2.02 and later explicitly warn you about this case and will reset
any value that is too large to the maximum allowed size of FE00h (65024
decimal) bytes--this is less than FEF0h because the latter is not
aligned on the 512-byte DOS sector size, which could slow down disk
I/O.
Without a real x87 FPU, an exception is generated by the CPU each time a
floating-point instruction is seen in the code.
__djgpp_exception_processor
is called for each such exception and
services it by calling the emulator, emu387.dxe
, or functions
from the emulator library libemu.a
(if the program was linked
with -lemu
), to emulate the instruction. Since exception
processing incurs a lot of overhead, this emulation is slow.
The DPMI 0.9 spec does not provide any means for the application to control where in the address space will the DPMI server allocate a particular chunk of memory. The application asks the DPMI server for whatever amount of memory it needs, and gets a chunk of that size whose address can be anywhere. Since the stack must be contiguous and expands downwards, growing it during program's run would require a very complicated code, unless it is pre-allocated at startup.
In case you wonder, the name !proxy
comes from the string
which identifies the use of this method: instead of getting the actual
command line, the program gets !proxy
followed by the address of
the actual command line.
If you use MASM or LIB32, please post your experiences to the comp.os.msdos.djgpp news group, so that I can make the above instructions less vague.
Note that mixing object files from different compilers generally doesn't
work at all, even if all the object files are in .obj
format.
This function calls the video BIOS interrupt 10h to allow bright
background colors to be used instead of blinking characters. DJGPP has
a library function, called intensevideo
, to do that, but for the
purpose of this example, let's assume we have reasons not to use it.
The DPMI spec indicates that you should not use the default stack if your procedure/interrupt handler uses more that 60 bytes, or 1/8 of the total stack space available by default.
DJGPP v2.01 makes the limit of _dos_ds
be 4GB, which effectively
disables memory protection when you use that selector. However, since
no memory outside the first 1MB is properly mapped into your program's
address space without additional DPMI calls, and the DPMI host is then
free to put memory-mapped devices, such as Weitek I/O space or the
linear frame buffer of an SVGA, on any address it sees fit, that huge
limit is an unjustified security hole. DJGPP v2.02 will really be
limited by 1MB+64KB.
If you want to decipher the 8-byte structure that is passed to
__dpmi_set_descriptor
in this example, read the documentation of
the __dpmi_get_descriptor
library function in the library
reference. This structure is the descriptor maintained by the processor
for each protected-mode segment, such as those loaded into the CS
and DS registers.
If you are using this example in your program, don't forget to disable
the handler at program's exit by calling the same function 0Ch of Int
33h with a zero mask in the CX register, and then deallocate the
callback by calling the _go32_dpmi_free_real_mode_callback
library function. Also, remember that all code and data touched by the
handler must be locked, otherwise it will crash under some DPMI servers,
such as CWSDPMI.
Locking a region of memory means that this region should be always present in RAM. Usually, the virtual-memory mechanism is allowed to page regions out of RAM when it needs to load another region that is not loaded. This happens if the program uses more memory than what is physically available to it. When a program needs to access an address that isn't currently in RAM, the operating system will look for some memory region that wasn't accessed for quite some time, and replace it with the block that needs to be accessed now. Locking a region prevents that region to be paged out, for as long as the program runs.
This discussion does not pertain to the __dpmi_int
function as opposed to the _go32_dpmi_simulate_int
function. On
the contrary, you will be much better off using __dpmi_int
, since
it automatically zeroes out some of the members of the real-mode
registers structure, while with _go32_dpmi_simulate_int
you need
to do that by hand.
Actually, it is possible to avoid reentrancy problems in interrupt-driven programs: programs known as TSRs (Terminate and Stay Resident) have been doing that for years. But doing so requires hooking and monitoring many DOS and BIOS interrupts, to know when it is safe to page. If CWSDPMI would use these techniques, it would take much more DOS memory to load and run. It would also need to be updated with every new DOS release, since some of the internal DOS structures it would need to monitor change their address and/or layout with new versions of DOS.
CWSDPMI has an experimental VDS support in its sources, but the distributed binary was compiled without it. Contact Charles Sandmann if you want to try to enable VDS support in CWSDPMI.
In case somebody thinks there is a contradiction here: I don't consider a requirement to provide information to be a restriction.
Note that this still allows the struct to be padded at the end.
For some reason, Microsoft doesn't like it when users disable numeric
tails. Several Microsoft publications warn against doing that, and I'm
told that Windows 98 has made it harder to disable them. I'm not sure
why do they object so much. Presumably, some programs rely on certain
directories to have numeric tails, so that they could be found even in
plain DOS mode. Apparently, some of those programs have short aliases
such as PROGRA~1
(the short version of the Program Files
directory) hard-wired into them, and Microsoft is afraid you could
reinstall or move those directories when numeric tails are disabled, and
thus cause such programs not to find their "home".
It is obvious that such programs are badly broken (e.g., the short alias
could easily be PROGRA~2
), and you have every right to yell at
the vendor who sells them to you. But even if you have no other way
than to live with them, my experience shows that you have nothing real
to worry about. Remember: numeric tails only have effect when files are
created or renamed. So, if you want to be on the safe side, re-enable
them before installing Windows software, especially if the programs you
install need to run in DOS mode as well (a typical example would be a
disk-recovery package such as Norton Utilities). Then disable numeric
tails again, once the installation is over.
For what it's worth, I always run my system with numeric tails disabled, and I have yet to see a single real problem.
If you need Binutils configured for elf32-i386
target that can be
used with DJGPP, you can find it at
http://www.multimania.com/~placr/.
Since these series are computed using a deterministic algorithm, they are not really random. Real random numbers can only be a result of unpredictable physical processes such as radioactive decay etc. However, a good algorithm for pseudo-random numbers produces a series of numbers that pass many tests for randomality.