Tech Support > Computers & Technology > Networking > Source code for controlling ethernet card in DOS?
Source code for controlling ethernet card in DOS?
Posted by Jonas.L.Larsson@gmail.com on October 26th, 2007


We control machines with PC-machines, DOS, C/C++ and lightbus I/O-
card.
We are using the 'main' IRQ to get a interrupt where we do stuff that
are time 'dependant'.
It's hard to use ordinary drivers and interrupt when we 'disturb' the
system like we do.
We would like to add a ethernet card (LAN RTL8100D) and, for starters,
communicate between two computers. (No real network)
Does anyone know of some source code for easy, direct access to the
ethernet card? Without interrupts? Polling.
Do you think it's impossible to achieve?
We do not have very much RAM left either. :-)

Posted by R.Wieser on October 29th, 2007


<Jonas.L.Larsson@gmail.com> schreef in berichtnieuws
1193390099.892815.42420@y42g2000hsy.googlegroups.c om...

<snip>

There is none I know of. Packet-driver software is tailored to specific
hardware. If you would want to "poll" that card you would need software
again tailored to that specific hardware. And as your request is quite
un-common probably noone has taken the time to write and publish such code.

But maybe you could simply use such packet-driver software and make sure
that the time spend in the interrupt (when receiving a packet) is as short
as you can get it. For example, by simply letting the driver-software store
the packet-data into a buffer, and than set a flag that the buffer is full.
Than you can poll that flag any way you like.

The "no interrupt" part ? Not impossible perhaps, just not feasible (you
would (probably) need to disassemble the cards packet-driver to know how to
address the hardware, and than write your own driver).

I don't know what "not very much" means, but a file-transfer program that
relies on a packet-driver can be smaller than 5 KByte (inclusive the used
packet-buffer). It won't be fast, but will definitily work.

Regards,
Rudy Wieser




Posted by Patrick Klos on October 29th, 2007


In article <1193390099.892815.42420@y42g2000hsy.googlegroups. com>,
<Jonas.L.Larsson@gmail.com> wrote:
What do you mean by "main IRQ"? There is no "main IRQ".

How "time dependent"? Are you worried about milliseconds or microseconds?
How many? And why is your code so time dependent?

We need details. What do you mean when you say "we disturb the system
like we do"? Interrupt processing doesn't "disturb" the system - it's the
normal way hardware is dealt with.

You mean 2 machines/cards connected with a cross-over cable? No hubs or
switches, right?

And how did you pick your ethernet card? There are plenty of cards that
are probably easier to write code for than the RTL8100. Is that what's on
your motherboard??

Sure, if you can find the programmer's guide for the RTL8100 (check
Realtek's web site).

How much RAM does your system have, and how much is used? Are you using
a 16-bit DOS? Have you tried setting up EMM or other such tricks?

Patrick
========= For LAN/WAN Protocol Analysis, check out PacketView Pro! =========
Patrick Klos Email: patrick@klos.com
Klos Technologies, Inc. Web: http://www.klos.com/
================================================== ==========================