This is G o o g l e's cache of http://clockworkorangebbs.org/dosemu.html.
G o o g l e's cache is the snapshot that we took of the page as we crawled the web.
The page may have changed since that time. Click here for the current page without highlighting.
Google is not affiliated with the authors of this page nor responsible for its content. |
|
DOSEMU with DOS doors HOWTO
By Jim Howarth
Before you try my HOWTO, give this a try --> woehtemu.tar.gz
My HOWTO will work, but its not as nice as the setup above. I haven't
used this perticular one, but it uses a method that I also use for any
new doors I set up.
DISCLAIMER:
This works for me. It may not for you. If your computer blows up, blame
your deity of choice, they put you here to fsck it up anyway. This text
will assume you know how to use linux. It will assume that you have a
brain. Use it first. Don't email me for help, I don't have time to write
this let alone help every sysop who needs my help. Don't want to sound
like a jerk, just don't have the time. Oh... don't expect too much in
the way of grammar and spelling.. ;)
GRATUITUS BBS ADVERTISEMENT:
.----..--. .----..----..-.--..-. .-..----..----..-.--.
| __|| | | | || __|| _|| |^| || | || |_|| _|
| || `-.| | || || || || | || || |
`----'`----'`----'`----'`-'--'`-----'`----'`-'--'`-'--'
.----..----..----..--.-..----..----. .----..----..----.
| | || |_|| | || || __|| .-' | |_|| |_|| __|
| | || || || || ` || `--. | | || | ||-- |
`----'`-'--'`--'-'`-'--'`----'`----' `----'`----'`----'
-/\- C L O C K W O R K O R A N G E B B S . O R G -/\-
fidonet - adventurenet - justaxnet - micronet
TradeWars 2002 (5000 Sectors) -/- Legend Of The Red Dragon
telnet: clockworkorangebbs.org -/- http://clockworkorangebbs.org
----------------------------------------------------------------------------
CONTENTS:
----------------------------------------------------------------------------
DOSEMU
Where to get it and install it
What is it and why do I need a copy of DOS?
What version do I need?
Setting up your doors
What you need to know first
AUTOEXEC.XXX is your friend!
CONFIG.SYS
The DOSEMU configuration file
The command line
Sample Lord Batchfile
----------------------------------------------------------------------------
DOSEMU
----------------------------------------------------------------------------
Where to get it and install it?
-------------------------------
DOSEMU is easy to get... 99% of all distros come with it, but you're
going to need to get the latest stable copy if you want to take advantage
of some of its newest toys (virtual comports being the biggie). First,
hop on to http://www.dosemu.org and leech the latest stable release.
Compile it... and play with it a bit. Load up some doors and stuff..
READ THE DOCS AND THE MAN PAGES (man dos) for gods sake... many a time
I've been too lazy and made an ass out of myself when asking for help.
They don't say RTFM for nuthin' ya know. Next, make sure you have a copy
of MSDOS 6.22, you can try other DOS alternatives, but I have yet to find
a good one that has worked. MSDOS was one of the only good things to come
out of ol' MS.
What is it and why do I need a copy of DOS?
-------------------------------------------
DOSEMU is quite simply a machine emulator. Linux has its own way of
dealing with your machine on a hardware level. Since you need to run DOS
on top of Linux you will need to translate the Linux operating environment
into one that DOS can understand.
For example:
COM1 in linux is /dev/ttyS0
COM2 in linux is /dev/ttyS1
Your soundcard in DOS is.. well.. your soundcard... in linux as always
it has a device 'file' like /dev/sound or /dev/dsp or something similar
(I don't claim to be an expert).
Now.. since DOSEMU simply emulates a raw computer, you will need a copy
of DOS to run on it so you can use--you guessed it.. DOS. I suggest
MSDOS. Its reliable 99% of the time and it's easy to find. If you don't
already have a copy, check at a computer store that has an old software
bin or *COUGH*#oldwarez*COUGH*efnet*COUGH*... regardless.. its not hard
to find. :) Microsoft really should be selling it on special order still,
but they aren't. I'd gladly pay $30 bucks or so for a shrink-wrapped copy
if I could.
Once you have DOSEMU, follow the install instructions; have your DOS disks
available and just follow the instructions. Once you have it up and
running make sure your favourite DOS editor is on it (DOSEMU comes with
one, but its uh.. nasty)
What version do I need?
-----------------------
At the time I wrote this, the latest stable version was/is 1.0.1. In
order to get the virtual comm ports running you will need this patch.
Apply it and they will work. Someone buggered them up in the official
release and some guy (forget the name) was nice enough to send this patch.
If the current version is newer then what is in this text then grab it and
test and see if the stuff below works. If it does then you're laughing,
if not, get 1.0.1 (it will be on ftp.dosemu.org if you dig) and apply the
patch below. You could always run a development version as well.. it may
work too.
http://clockworkorangebbs.org/patch-1.0.1-missing-vmodem.gz
Next you need to ungzip it into the root dosemu directory and then run the
following command to patch it:
patch --strip=0 -i patch-1.0.1-missing-vmodem
This _should_ patch it.. if not.. uhh.. ask someone else :)
-------------------------------------------------------------------------------
Setting up your doors
-------------------------------------------------------------------------------
What you need to know first
---------------------------
1. You need to know DOSEMU, make sure you have played around a bit. Play
some old games or putter around with a DOS door or bbs program, make
sure it's working.
2. You need to know how to install your doors under DOS. If you don't
know yet, then find out. I'm assuming you're already a sysop in this
text.
3. You need to know simple batch file programming.. you know.. .BAT files
AUTOEXEC.XXX is your friend!
----------------------------
AUTOEXEC.BAT you say? Of course.. you don't want your users loading up
DOS and then having to load the door themselves do you? That would be BAD.
So, essentially what you will be doing is creating a batch file for each
door. Put it in the doors directory and call it whatever you like.
Next, create an AUTOEXEC.BAT file for each door. For each autoexec, use
the last three characters in the filename to decipher each door.
For example:
For LoRD... AUTOEXEC.LRD
For Tradewars... AUTOEXEC.TWS
etc...
In that autoexec you want to run any environment commands needed for DOS
and the final two lines will be the following
CALL
EXITEMU
The CALL line simply calls the door batch file.. and the EXITEMU line
exits out of DOSEMU when it's done.
You place each of these files on your regular hdimage. Or whatever drive
you have configured as your "C" drive. I use the same hdimage created
when I installed DOSEMU, use what is best for you.
CONFIG.SYS
----------
Keep this file the same for all doors... or don't.. your choice, whatever
works. Keep in mind you have 640K of memory for EACH dosemu session.
The DOSEMU configuration file
-----------------------------
Ahhh.. the hell that is dosemu.conf :) Don't worry folks.. it's not too
bad.
First and foremost, just like the autoexec.bat files, you need one of
these for each door, named accordingly... I used dosemu.lord and
dosemu.tw to keep with the above example scheme.
Below is a list of each thing you need to change, all others are omitted.
Set this for whatever you have as a CPU
$_cpu = "80586" # CPU showing to DOS, valid values: "80[345]86"
# or "emulated" for non-native CPU (386 in this case)
This is how much memory you want dedicated to this instance of DOSEMU.
640 K is more then enough... if you have 64 megs of ram you can easily run
64+ DOSEMU sessions...
$_dosmem = (640) # in Kbyte, < 640
Set these for your AUTOEXEC.XXX batch file and CONFIG.XXX extensions.
$_emusys = "SYS" # empty or 3 char., config.sys -> config.XXX
$_emubat = "LRD" # empty or 3 char., autoexec.bat ->
Set this to whatever... I used 40 so it wouldn't hog all of my cpu.
Honestly though, I don't know what is ideal. This seems to work well for
my setup.
$_hogthreshold = (40) # 0 == all CPU power to DOSEMU
This may be needed for some of your doors.. I doubt it does anything for
doors that use standard IRQ's and since you're just going to have each
node running on COM1 or 2 or whatever, it's doubtful you need to define
this.
$_irqpassing = "3 4" # list of IRQ number (2-15) to pass to DOS
# "3 8 10"
Make sure this points to the proper HD Image.
$_hdimage = "hdimage.first"
Set these to virtual to cause all output from the door to go through the
virtual comport and be routed to STDOUT, which is how your users will see
the game displayed to screen without the status bars, etc.
$_com1 = "virtual" # e.g. "/dev/mouse" or "/dev/cua0"
$_com2 = "" # e.g. "/dev/modem" or "/dev/cua1"
$_com3 = "" # dito "/dev/cua2"
$_com4 = "" # dito "/dev/cua3"
That's it for your dosemu.conf file... not much to worry about there. I
highly suggest you read up a bit on what can be defined here so you can
set it up properly for your needs.
The Command Line
----------------
You need only one command to envoke DOSEMU and this is it:
dos -f
The '-f' switch causes DOSEMU to load the configuration file provided in
the commandline.
Sample LoRD Batchfile
---------------------
The following batchfile runs on my system... I use Mystic as my BBS
program and I have it pass the commandline of /bin/sh
/home/bbs/scr/lord.sh %3 (the %3 passes the node number to the script as a
switch/argument). Below is the full batchfile... after that I will break
it down line by line for you.
-----------8<------------------------------------
#!/bin/bash
NODE=$1
todos < /mbbs/temp$NODE/DOOR.SYS > /mbbs/temp$NODE/DOOR.SY1
mv /mbbs/temp$NODE/DOOR.SY1 /mbbs/temp$NODE/DOOR.SYS
rm /home/bbs/doors/lord/ld.bat
NODE=$1
echo -e "\r@echo off \r" >> /home/bbs/doors/lord/ld.bat
echo -e "call start.bat $NODE \r" >> /home/bbs/doors/lord/ld.bat
cd /home/bbs/cfg
dos -I 'keystroke"\r"' -f dosemu.lord1 2>/dev/null >/dev/null
-----------8<------------------------------------
Line #01 is the 'hashbang' line that tells the shell you use (/bin/sh)
that this script is to be parsed using the 'bash' shell.
01: #!/bin/bash
02:
Line #03.... I'm a sucker for extra steps. $1 is the node number that was
passed to the script from Mystic. I could have used $1 throughout, but I
like things to be more human readable so I assigned the value of $1 to the
variable $NODE for use throughout the script.
03: NODE=$1
04:
Line #05 uses a small program found with most linux distros called "todos"
which simply will take a UNIX textfile and convert it to a DOS text file.
Because Mystic is currently writing the dropfiles using a UNIX format and
the door is a DOS door, we need to make the file readable under DOS. This
line takes the DOOR.SYS and writes it to DOOR.SY1 (todos won't overwrite
the file you're converting for some reason).
05: todos < /mbbs/temp$NODE/DOOR.SYS > /mbbs/temp$NODE/DOOR.SY1
Line #06 simply moves the DOOR.SY1 file to DOOR.SYS (ie. overwrites the
UNIX style dropfile with the new DOS style dropfile). Note the $NODE
variable used in lines #05 and #06..
06: mv /mbbs/temp$NODE/DOOR.SY1 /mbbs/temp$NODE/DOOR.SYS
Line #07 is a cleanup line. It simply removes the ld.bat file that is
about to be recreated for this session.
07: rm /home/bbs/doors/lord/ld.bat
08:
Lines #09 and #10 create the ld.bat file. Because I run a multinode
system I need to be able to create the ld.bat file for each time someone
goes into the door. This just simpliflies things. I suppose I should add
in some checks so that I don't have two users enter at the exact same
time, but well.. I'm lazy and don't really know how. :)
09: echo -e "\r@echo off \r" >> /home/bbs/doors/lord/ld.bat
10: echo -e "call start.bat $NODE \r" >> /home/bbs/doors/lord/ld.bat
11:
Lines #12 and #13 are pretty self explanatory... go into the directory
where all the DOSEMU config files are and then start up DOSEMU using the
lord config file and pipe it.
12: cd /home/bbs/cfg
13: dos -I 'keystroke"\r"' -f dosemu.lord1 2>/dev/null >/dev/null
That's it folks...
Revision 1 - 10/15/2000 - Created the DOSEMU-BBSDOORS-HOWTO
Revision 2 - 10/16/2000 - Fixed some spelling, grammar and some
redundancies. Proofreading courtesy of my
lovely, talented, stupendous, sexy wife. :)
Revision 3 - 12/27/2000 - Added redirection of all DOSEMU messages to
/dev/null
Revision 4 - 03/11/2001 - Added patch commandline
Revision 5 - 06/05/2001 - Added link to Reap's setup pack