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


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










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

(1) GRAPHIC programs under OS2

> ... 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

RSX3a returns a linear address from memaccess(). This address and the base
of the selector are in the range from A0000L to C0000L for example.

DOS hosts like Qemm, 386Max and Windows 3.1 have the same physical
address here. So you touch the screen. OS2 not.

RSX4 uses the DPMI-sevice "Segment to Selector" and gets the base address
from this selector. Hope that this way fixes the OS/2 problem.
Please, send a mail to me.


Other way:

I read that OS/2 wants selectors like B800. So you need far pointers!
Try this:

static inline set_gs_b800(void)
{
    __asm__ ( "movw $0xB800, %%gs");
}

static inline void set_video_word(unsigned int offset, unsigned short value)
{
    __asm__ __volatile__ (
	"movw %0, %%gs:%1"
	: /* no output */
	: "r" ((unsigned short) value) , "r" (offset)
	);
}

static inline unsigned short get_video_word(unsigned int offset)
{
    unsigned short _ret;
    __asm__ __volatile__ (
	"movw %%gs:%1, %0"
	: "=r" (_ret)
	: "r" (offset)
	);
    return _ret;
}


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

(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) 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 this).
The memory information from Windows in always too big.

A *permanent* swapfile is recommend.

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

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

(5) 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.

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

(6) 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


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

(7) 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"

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.


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

(8) 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.

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

(9) 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):
1) RSX, to run EMX/GCC and DJGPP programs with DPMI
2) RSXWIN, to run text-mode EMX/GCC programs in Windows 3.1 window.
3) RSXWDK (Rsx Window Development Kit) to build full 32bit window apps.

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.

