[comp.os.msdos.programmer] XMS vs EMS

jfjr@mbunix.mitre.org (Freedman) (01/31/91)

In article <1991Jan30.134859.22160@linus.mitre.org> jfjr@mbunix.mitre.org (Freedman) writes:

>   I have a Compaq 386/20e running DOS 3.3 with 4 megs of memory.
>I have the Clarkson packet drivers installed and I am building
>a TCP/IP analysis tool. One of the things I would like to do
>is to sit on the net and just receive and record all packets
>(time stamp them) for a while. I can receive and I have
>a millisecond timer (thanks for the help folks). The packets
>can come at me fast - up to 1.5k a packet with 2-3 millisecond
>separation-. My receiver runs at interrupt level as does my timer.
>Both EMS and XMS involve some fiddling around at interrupt level.
>I am concerned about stepping on my own feet with either approach.
>I am not concerned with portability or price. Just performance.
>full protected mode might be nice but I have to support the
>packet drivers too. I can get more memory or fancier hardware
>if I really need it(I think;) ).

  As a follow up - anybody have any product recommendations?

                         Jerry Freedman,Jr


fodder


fodder

cd5340@mars.njit.edu (Charlap) (01/31/91)

I'd go with XMS, since EMS appears to be slowly on its way out.  It seems
quite logical that the packet drivers will soon be available in full
protected mode, and when that happens, it will be much easier to convert
your program over to that format  (which, I assume, would be the most
preferable in this situation)

--- Dave (cd5340@mars.njit.edu)

brandis@inf.ethz.ch (Marc Brandis) (01/31/91)

In article <2184@njitgw.njit.edu> cd5340@mars.njit.edu (Charlap) writes:
>I'd go with XMS, since EMS appears to be slowly on its way out.  It seems
>quite logical that the packet drivers will soon be available in full
>protected mode, and when that happens, it will be much easier to convert
>your program over to that format  (which, I assume, would be the most
>preferable in this situation)
>
>--- Dave (cd5340@mars.njit.edu)

Although it is true that EMS is on its way out, I do not think that this 
advice really helps. As I understand the original question, the problem is to
store multiple megabytes of data to memory at the rate they come from the
driver, which is about 700 kBytes/s. Once the driver is running in protected
mode, this is as simple as writing it continously to a large block of memory,
so there is no problem at all. 

But at the moment the problem is: how can that much data received in real
mode be moved to some kind of additional memory in a simple way. And here I
would say EMS is the simpler solution. Getting interrupts in protected mode
and routing them to real mode within certain time limits is a messy business.
Current DOS extenders are not great in time-critical interrupt handling stuff,
so you probably would have to write your own.

On the other hand, with EMS, the interrupt driven driver can just receive into a
large circular buffer in conventional memory and this buffer can be copied
to EMS in the background (speak: between interrupts). If the buffer is large
enough you are much less likely to run into timing problems. 

If a compare the efforts required to implement the EMS solution to the ones
required for a XMS solution, I would go for EMS. Once he has a driver running
in protected mode he can get rid of all the code he has written for receiving
the data and managing the buffer, no matter whether he goes for EMS or XMS. 
So, keep it as simple as possible.


Marc-Michael Brandis
Computer Systems Laboratory, ETH-Zentrum (Swiss Federal Institute of Technology)
CH-8092 Zurich, Switzerland
email: brandis@inf.ethz.ch

leonard@qiclab.scn.rain.com (Leonard Erickson) (02/16/91)

Do recall that every time you switch *from* protected mode, the CPU gets
reset. At the data rates you are talking about, that guarantees lost
interrupts. We had a 286 doing hispeed serial i/o with no handshaking.
It works fine as long as *nothing* uses extended RAM.

-- 
Leonard Erickson			leonard@qiclab.uucp
personal:	CIS: [70465,203]	70465.203@compuserve.com
business:	CIS: [76376,1107]	76376.1107@compuserve.com

brandis@inf.ethz.ch (Marc Brandis) (02/18/91)

In article <1991Feb15.204811.6327@qiclab.scn.rain.com> leonard@qiclab.scn.rain.com (Leonard Erickson) writes:
>
>Do recall that every time you switch *from* protected mode, the CPU gets
>reset. 

This is true for the 286, but not for the 386. On a 20 MHz 386, you can 
switch back to real mode in about 10 microseconds if you trim down the code.
The processor reset is not required, you can just clear a bit in CR0.


Marc-Michael Brandis
Computer Systems Laboratory, ETH-Zentrum (Swiss Federal Institute of Technology)
CH-8092 Zurich, Switzerland
email: brandis@inf.ethz.ch