--------------------------------------------------------------------------------
FAQ.TXT 	    DPMI-RSX  (c) Rainer Schnitker		    Dec 1994
--------------------------------------------------------------------------------


	(1) _memaccess() problems
	(2) Copyright message
	(3) read-only files with TeX386
	(3) TeX386 stack faults
	(5) Memory problems (DYN:  out of memory)
	(6) INFO.EXE bugs with RSX
	(7) Running RSX in a Windows NT DOS-BOX
	(8) EMXL.EXE
	(9) File-Handles
       (10) RSX packages










--------------------------------------------------------------------------------

(1) _memaccess() problems

> ... problems with POV
> However, it doesn't do so well under OS/2. ...
> .. when I run display, the gnu graphics viewer, under OS/2)

> I am trying to compile a simple DOS program that runs in an OS/2 VDM and
> all it does is int 10h to go into 320x200x256 mode

First, don't forget to use the -am option (enable memaccess). This
is necessary for all emx programs.

RSX returns a linear address from memaccess(). This address and the base
address of the selector are in the range from A0000L to C0000L for example.
But sbrk() can change the base address of the emx program (this happens
in OS/2). The old memaccess() return value invalid now.

Now, RSX5 preallocates some heap (128 KB). If your program need more
memory use the option -Rm.

    Example:	-Rm512	    Preallocate 512 KB Heap

Also RSX5 has a new interrupt handler for INT10 Vesa calls.


-------------------------------------------------------------------------------

(2) Copyright message

> When I run the OS/2 EMX compiled Gnu grep V1.6, for example, in an
> OS/2 DOS box, I get the RSX copyright message.

> Is there a hidden option ("quiet") that controls this behavior?
> Something I can put in RSXOPT?


The rsx-test for a bound EXE-file uses the header from EMX 0.8g.
Older stubs don't verbose the RSX-message.

Try 'emxbind -u \emx\bin\emxl.exe myprog.exe' with a stub >= 0.8g.
This should work.



-------------------------------------------------------------------------------


(3) read-only files with TeX386

> .. Mattes' tex386 under Windows3.1.
> But the file are read-only!

Get RSX version >= 2a. This versions fixes TeX386 umask bug.



-------------------------------------------------------------------------------

(4) TeX386 stack faults

> .. there is a stack fault with TeX386 and RSX. EMX is ok.

RSX controls the stack with a expand-down stack segment.
TeX386 was compiled with the gcc option '-fomit-frame-pointer'. This option
can cause a stack fault, if gcc uses the frame pointer for a normal pointer.

There are two options for RSX:
    * -Ra    (set ss=ds, no expand-down)
    * -Rs#   (set stack size. If stack size <= 60, the fault does not happen)

You can use emxbind to put the first option in the tex386 file (emxrt 0.9).
    Example:
	    emxbind -a \emtex\tex386.exe -Ra


-------------------------------------------------------------------------------

(5) Memory problems

> What does the TeX386 message
>    DYN:  out of memory
> mean?

This is a TeX message. You must have more memory.

> Is 3.7 MB RAM insufficient for rsx and rsxwin?  If so, why?  If it
> should be enough, then what can the cause of the `out of memory'
> statement be?
> Does rsx use virtual memory?	If so, how much does it need?  If not,
> can you please explain why VM is of no use?

If you run TeX386 you need 3-4 MB virtuel memory (yes, RSX use vm).
This memory block could not be fragmented. Perhaps you should restart
Windows.
If you run the DPMIINFO program, you will get the greatest possible
memory block in the first and second line.


A *permanent* swapfile is recommend. Only this swapfile expand your
physical memory to bigger virtuel memory. Also 32-bit access enables
more virtuel memory.

More information is availble in install.txt in chapter "Get mode DPMI memory".


-------------------------------------------------------------------------------

(6) INFO.EXE bugs with RSX

> kennst Du einen Weg wie man das Helpsystem des emx/gcc unter DOS lesen
> bzw. verwenden kann?
> Gibt es einen patch der diese Files unter windows/ dos zug"anglich
> macht?

> I can't run info.exe with rsx. There are problems with the cursor keys.

RSX 2-3 has a read_kbd() bug. RSX4 is ok.

-------------------------------------------------------------------------------

(7) Running RSX in a Windows NT DOS-BOX

> Kann ich den DOS-Extender dazu "uberreden, unter Windows NT zu laufen?

> Does RSX3a run with Windows NT?

Use 'RSX -e prog' option, or set RSXOPT=-e, if you have no coprocessor.

> .. EmTeX tex386 beta 11 l"auft mit RSXOPT=-e unter Windows NT


-------------------------------------------------------------------------------

(8) EMXL.EXE

> I have a simple question. How do I make fork() work with emx-0.8h ? When
> I compile the program fork.c given in the sample subdirectory and try to
> run it, it dies with an error message that fork is not supported under
> msdos. I even compiled fork.c with fork.s but still no luck. I have set
> emx to point to rsx.exe in my setup file.

I think you are running emx.exe.
try:  "rsx fork.exe"
 or: You must also set RSX=<path>\rsx.exe

The emx0.8h emxl stub first tests for a DPMI host.

If it found *only* DPMI, it searches for rsx.exe in the current directory,
in the environment RSX or in the PATH.

If it found other extended memory standards, it searches for emx.exe
in the current directory, in the environment EMX or in the PATH.
( Qemm386, 386Max support VCPI and DPMI, so emxl try this)

You should set the environment EMX and RSX to c:\rsx\bin\rsx.exe, if
you plan to run programs with fork(), because EMX don't support this.


-------------------------------------------------------------------------------

(9) File-Handles

> In Deinem DOS-Extender ist eine aergerliche Begrenzung in Form
> von maximal 20 File-Handles enthalten.
> Laesst sich dies ohne weiteres umgehen, oder ist die Sache
> 'fest'-verdrahtet ?
> Ansonsten ist der Extender genau das Bindeglied, was ich
> lange gesucht hatte (OS/2 - emx0.8h/RSX - DOS) :-)

Bei RSX3a kann man einfach int86() benutzen, um die Handles raufzusetzen
(DOS Funktion: set handles limit, ah=0x67). Hier kann die Anzahl beliebig sein.
Die C-Lib kann aber nur einen Process mit 40 Handles verwalten.

Bei RSX4 wird jeder Process bis zu 40 Handles benutzen koennen.
Es gibt dann einen Option wie bei EMX ( -hXX ).



> How many file handles can I use with RSX3a ?

The default value is 20. You can increase this value with int86() AX=0x67.
RSX and the EMX C Library can handle 40 files per process.

RSX4 has the option "-hxxxx", where xxxx are the number of handles.

-------------------------------------------------------------------------------

(10) RSX packages

> Do you know of a way to use gcc to create native windows 3.1 apps?
> I need Objective-C for Windows, but there is no such thing available
> right now except djgpp.


I wrote 3 packages (ftp.uni-bielefeld.de):
   - RSX5, to run EMX and DJGPP programs with DPMI
   - RSXWIN, to run text-mode EMX programs in Windows 3.1 window.
   - RSXWDK (RSX Window Development Kit) to build full 32bit window apps.
     The next version 2 will also support DJGPP.


EMX+GCC contains Objective-C. With RSX or RSXWIN you can run this under
Windows in a DOS-BOX or in a window.
With RSXWDK you can build full 32bit window apps.

