Pages

Thursday, April 12, 2012

Basic networking with FreeDOS

Setting up a network with FreeDOS can be a little bit frustrating when you don't know how to do it (just like me). Here is a short description how I installed my network under FreeDOS. I am using my old 386 again with a 3COM EtherLink III (3C509B) ISA NIC. 

Installing all software and drivers:

Before you begin you need to download a couple of additional software. The first software you need is the MSCLIENT software. The software can be downloaded from ftp://ftp.microsoft.com/bussys/Clients/MSCLIENT/. Download both packages, DSK3-1.EXE and DSK3-2.EXE. These packages contains the MS-DOS LAN-Manager and several drivers (various NIC's and the protocol driver).
The second software you need is the "Packet Driver to NDIS Converter", it can be download from http://www.shikadi.net/files/network/ndis2pd/dis_pkt9.zip.
Copy all three files to C:\INSTALL on your FreeDOS machine. Then change into that directory and begin to extract the MSCLIENT software. Start both exe files, these are self-extracting zip files:

C:\>cd \INSTALL
C:\INSTALL>DSK3-2.EXE
  Inflating: AM2100.DO_    -AV
  Inflating: AVEXTRA.TXT   -AV
...

When you try to run the second self-extracting exe file it will ask you to overwrite existing files, in case just type y:

C:\INSTALL>DSK3-2.EXE
...
PKSFX: (W18) Warning! AVEXTRA.TXT already exists.  Overwrite (y/n)?y
  Inflating: AVEXTRA.TXT   -AV
...

Finally extract the dis_pkt9.zip package:

C:\INSTALL>unzip DIS_PKT9.ZIP
Archive:  DIS_PKT9.ZIP
  exploding: ./DIS_PKT9.DOC         
  exploding: ./DIS_PKT9.ASM         
  exploding: ./DIS_PKT9.DOS

Next create your self a directory where you can store the minimum of files you need, eg. C:\TOOLS\NET:

C:\INSTALL>md \TOOLS
C:\INSTALL>md \TOOLS\NET

Now copy all needed files (LAN Manager, drivers etc) to C:\TOOLS\NET:

C:\INSTALL>copy DIS_PKT9.DOS ELNK3.DO_ EXPAND.EXE NETBIND.COM PROTMAN.DO_ PROTMAN.EX_ \TOOLS\NET2\
DIS_PKT9.DOS => \TOOLS\NET2\DIS_PKT9.DOS
ELNK3.DO_ => \TOOLS\NET2\ELNK3.DO_
EXPAND.EXE => \TOOLS\NET2\EXPAND.EXE
NETBIND.COM => \TOOLS\NET2\NETBIND.COM
PROTMAN.DO_ => \TOOLS\NET2\PROTMAN.DO_
PROTMAN.EX_ => \TOOLS\NET2\PROTMAN.EX_

If you have another NIC than me then copy the right driver for your hardware. Eg. for a NE2000 NIC copy the file NE2000.DO_.
The files that are ending with a trailing _ need to extract. To do so change into the C:\TOOLS\NET directory and run the expand tool which you have copied before:

C:\INSTALL>cd \TOOLS\NET
C:\TOOLS\NET>expand -r ELNK3.DO_ PROTMAN.DO_ PROTMAN.EX_
...
Expanding elnk3.do_ to elnk3.dos.
elnk3.do_: 9606 bytes expanded to 13014 bytes, 35% increase.
...

The files with the trailing _ can be removed now:

C:\TOOLS\NET>del ELNK3.DO_ PROTMAN.DO_ PROTMAN.EX_

Finally you are ready to configure your system. First open C:\FDCONFIG.SYS and add the drivers:

C:\TOOLS\NET>edit \FDCONFIG.SYS
...
DEVICEHIGH=C:\TOOLS\NET\PROTMAN.DOS /I:C:\TOOLS\NET
DEVICEHIGH=C:\TOOLS\NET\ELNK3.DOS
DEVICEHIGH=C:\TOOLS\NET\DIS_PKT9DOS
...

The first line will load the protocol driver. The option /I:C:\TOOLS\NET will tell the driver to look into C:\TOOLS\NET for the configuration file PROTOCOL.INI (I will show you this file later). The second line loads the driver for the NIC itself. The third line loads the TCP/IP driver. Next you need to edit C:\AUTOEXEC.BAT to load the LAN Manager during booting:

C:\TOOLS\NET>edit \AUTOEXEC.BAT
...
REM NETWORK
C:\TOOLS\NET\NETBIND.COM
...

Now create the configuration file for the protocol driver:

C:\TOOLS\NET>edit PROTOCOL.INI
[PROTMAN]
drivername=PROTMAN$

[NIC_ELNK3]
drivername=ELNK3$

[PKTDRV]
drivername=PKTDRV$
bindings=NIC_ELNK3
intvec=0x60
chainvec=0x68

So far that good, reboot your machine now and watch for some lines like this during booting:

...
3Com DOS EtherLink III Network Driver v2.0
MAC/DIS to Packet Driver converter loaded. Verison 1.09
...
MS-DOS LAN Manager v2.1 Netbind
...

If you see these messages (or similar depending on your hardware) then your machine is ready for basic networking.

Configuring a static IP:

To configure a static IP cange into the C:\FDOS directory and edit the MTCP.CFG file like this:

C:\>cd FDOS
C:\FDOS>edit MTCP.CFG
PACKETINT 0x60
IPADDR 192.168.1.99
NETMASK 255.255.255.192
GATEWAY 192.168.1.73
NAMESERVER 192.168.1.73
MTU 1500

Configuring a dynamic IP (dhcp):

To get an IP (and all other network settings) via DHCP run the dhcp command:

C:\>dhcp
mTCP DHCP Client by M Brutman (mbbrutman@gmail.com) (C)opyright 2008-2011
  Version: Oct 29 2011

Timeout per request: 10 seconds, Retry attempts: 3
Sending DHCP requests, Press [ESC] to abort.

DHCP request sent, attempt 1: Offer received, Acknowledged

Good news everyone!

IPADDR = 192.168.1.125
NETMASK = 255.255.255.192
GATEWAY = 192.168.1.73
NAMESERVER = 192.168.1.73
LEASE_TIME = 86400 seconds

Settings written to 'C:\FDOS\MTCP.CFG '

There you go. Your FreeDOS is now ready to use simple client applications like telnet or ftp (no more floppy disk changing).

Links:

http://sourceforge.net/apps/mediawiki/freedos/index.php?title=Networking_FreeDOS