BACKGROUND Paula (G8PZT) has received a number of requests asking for a Linux version of her Xrouter (DOS) software, or information on getting Xrouter to work in the Linux Dos Emulator (DosEmu). This document is based on the experiences of Stewart Wilkinson (G0LGS) and Robert Day (G1LOA) had in getting Xrouter to run in DosEmu at GB7BM (West Bromwich). The Linux Dos Emulator (see http:// http://sourceforge.net/projects/dosemu) is quite a versatile program that allows you to run a DOS operating System (most variants have been used) within Linux. DosEmu allows for many possible configurations, much of which is well beyond the scope of this document. SOFTWARE USED for TESTING at GB7BM RedHat 7.3 / Mandrake 9.0 Kernel 2.4.19 Dosemu 1.0.1 (dosemu-1.0.1-1.i386.rpm from http://sourceforge.net/projects/dosemu) MSDOS V5.00 and V6.22 XRouter versions from 1.76c to 1.81a (see http://www.g8pzt.myby.co.uk/software) INSTALLATION & CONFIGURATION Initial DosEmu Configuration. The Dosemu 1.0.1-1 RPM was chosen because it was easy to install (compared to the newer Source / Binary Distributions). It was installed using the command: rpm -Uvh dosemu-1.0.1-1.i386.rpm Edit /etc/dosemu.conf and set the default image location: $_hdimage = "msdos" This tells Dos Emu it will use a folder (or image) in the /var/lib/dosemu folder called 'msdos'. Initial DOS Configuration. The easiest method of setting up DOS would have been to copy the files from an already installed DOS system to create an 'image' to be used to run DOS and Xrouter (or many other DOS Applications), but as we only had the original installation media and no spare partition on the system to install DOS we manually copied & expanded the files required. In /var/lib/dosemu create a folder 'msdos'. Copy the following files from the DOS Install Media to the /var/lib/dosemu/msdos folder: io.sys msdos.sys command.com Start the Dos Emulator: using: dos or xdos In the Dos Emulator create a typical MSDOS directory structure (on the available C: Drive) ie: mkdir dos mkdir tmp From the DOS install Media (Typically 2, 3 or 4 Disks), copy or expand the most used DOS programs to the 'dos' folder. Create suitable config.sys and autoexec.bat files in the DosEmu C:ie: config.sys: FILES=30 BUFFERS=15,0 FCBS=4,0 LASTDRIVE=Z DEVICE=C:.EXE autoexec.bat: @ECHO OFF PROMPT $p$g PATH C:;C:;C: SET TEMP=C: Wraning: Editing config.sys, autoexec.bat or other DOS files outside DosEmu may strip the CRLF terminators required by DOS, however they may be replaced by the 'unix2dos' program. Note: It appears to NOT be necessary to load keyboard configuration program (KEYB) in the DosEmu session. In Linux create a symbolic link in the /var/lib/dosemu/msdos folder point to the /var/lib/dosemu/commands folder: cd /var/lib/dosemu/msdos ln -s ../commands emu Exit DosEmu by running C:. In Xdos you can press Ctrl-Alt-PgDown if exitemu fails, but if you used 'dos' then you may have to terminate the program from another session. Restart DosEmu and confirm that it starts up normally. In DosEmu: Create the directory structure required for Xrouter and copy the required files from the Xrouter distribution (ZIP). The final configuration of Xrouter is much like configuring it in MSDOS, but access to hardware devices (or emulations thereof) will be restricted by the DosEmu configuration. DosEmu Memory Configuration. The global /etc/dosemu.conf file contains a number of lines the determine the size and type of memory that the Emulator will make available for DOS and its applications, these include: $_xms = (off) $_ems = (off) #$_ems_frame = (0xe000) $_dpmi = (off) $_dosmem = (900) # list of segment values/ranges such as # "0xc8000 range 0xcc000,0xcffff" $_hardware_ram = "" All memory values (when specified) are given in KBytes, you will notice that the above sets '$_dosmem = (900)', this allowed us to make more 'conventional' memory available to Xrouter (and any other Dos application) than would normally be available if you ran the program in plain DOS. (However doing this only seems to work with both XMS and EMS turned off - because the area's used overlap). Hardware Devices used within Xrouter Simulated Serial Ports: These are useful to link to Linux itself (ie: Linux Node) or perhaps to another DosEmu session, using either AX25 (KISS), or SLIP protocols. Physical Serial Ports: Used for attaching KISS TNC's, other external devices or perhaps a link to another system. Providing DosEmu with access to Simulated or Physical Serial ports is achieved by editing /etc/dosemu.conf (or ~/.dosemurc or any other file specified using the -f parameter) to specify the linux device that will be used to pass data when Xrouter accesses a COM port, some possible values are: $_com1 = "/dev/ttys0" ; First Serial Port device. $_com2 = "/dev/ptysa" ; Primary of a pseudo device 'sa'. $_com3 = "/dev/ttysb" ; Secondary of a pseudo device 'sb'. $_com4 = "/dev/ttyS3" ; Fourth Serial Port device. Note: If using any of the pseudo devices then you must arrange to open the Primary side before opening the slave side (i.e: running 'kissattach' with '/dev/ptysb' in linux before starting DosEmu with the above example). Direct access to a 4 Port Baycom USCC Card at I/O addresses 0330 - 0337 using IRQ 5 is possible using the dosemu.conf lines: $_irqpassing = "5" $_ports = "range 0x330,(0x330+7)" Linking Xrouter to the Linux Node for AX25 and TCP/IP Traffic. Perhaps the easiest method of passing all types of AX25 and TCP/IP traffic between Linux / Linux Node and Xrouter is to use a KISS link between Linux and the DosEmu session. This is done by adding a further AX25 port to your Linux node (using kissattach), and setting up the appropriate Netrom and TCP/IP routing. Linking Xrouter to the Linux Kernel for TCP/IP only Traffic. It is also possible to setup a TCP/IP only connection between the Linux Kernel (using a SLIP interface) and Xrouter. (The linux kernel will need SLIP support included). For this a simple script such as: #!/bin/sh slattach -s 38400 -p slip /dev/ptyse & sleep 2 ifconfig sl0 44.131.130.129 netmask 255.255.255.255 mtu 1500 up route add -host 44.131.130.130 dev sl0 route add -net 44.131.91.0/25 gw 44.131.130.130 dev sl0 xdos -f ~/.dosemu_xrouter > /dev/null 2> /dev/null ifconfig sl0 down sleep 10 killall -TERM slattach This sets up a SLIP connection using the ptyse and ttyse pseudo devices. Passing Traffic from a Linux AX25 interface to Xrouter using 'rxecho' or 'kissnetd'. There are at least two methods of passing AX25 traffic from a Linux AX25 Interface (such as a KISS TNC on the Computers Serial port) to the DosEmu session, whilst still allowing the same traffic to be seen by the Linux AX25 system. The first method is to use the 'rxecho' program to simply 'copy' all or selected traffic between two or more Linux AX25 ports. The behavior of the 'rxecho' program is controlled by the file /etc/ax25/rxecho.conf, the lines: 1 5 * 5 1 * With these 'rxecho' would copy all traffic between the Linux AX25 ports 1 & 5 (both ways). whilst: 1 5 GB7BM-8 5 1 * would only copy traffic intended for GB7BM-8 from port 1 to port 5, but all traffic from port 5 to port 1. Whilst is is possible to use rxecho to copy 2 or more ports to one other port, ie: 1 5 * 2 5 * it is perhaps not practical to do so, as the traffic received on one port can only be copied one other, therefore no return path would be possible, that is traffic from port 5 could not be copied to both ports 1 and 2. The second method is to use the Linux 'kissnetd' program to create an 'AX25 Net' over a collection of Serial or Peusdo Serial devices, however trying to use kissnetd at GB7BM was not very successful (frames were dropped & corrupted). Using Multiple DosEmu sessions for different DOS applications. It is possible to have several different DosEmu sessions, each running different applications, and using different serial port devices, however some things must remain the same in all sessions (refer to the DosEmu documents). The DosEmu documentation says that one of these restrictions is the use of the '$_ports = "xxx" ' line, however despite no port being specified in the global /etc/dosemu.conf on GB7BM we managed to use this line in our ~/.dosemu_xrouter file which looks like: # Title in the top bar of the window $_X_title = "XRouter in MSDOS 6.22" # This is a modified msdos image $_hdimage = "xrout" # Serial Ports $_com1 = "/dev/ttyse" $_com2 = "" $_com3 = "" $_com4 = "" # Baycom SCC I/O ports $_ports = "range 0x330,(0x330+7)" # IRQ 5 is required by SCC Card $_irqpassing = "5" # sound support on/off $_sound = (off) Starting a DosEmu session using the above file is simply a matter of using the command: xdos -f ~/.dosemu_xrouter by Stewart Wilkinson (G0LGS) and Robert Day (G1LOA) Page of 5