<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>satori code &#187; Dos</title>
	<atom:link href="http://satoricode.com/category/dos/feed/" rel="self" type="application/rss+xml" />
	<link>http://satoricode.com</link>
	<description>Michael Trelinski&#039;s Technology Blog</description>
	<lastBuildDate>Fri, 26 Feb 2010 19:13:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Running a DOS-based BBS through Linux and Telnet</title>
		<link>http://satoricode.com/2010/02/24/running-a-dos-based-bbs-through-linux-and-telnet/</link>
		<comments>http://satoricode.com/2010/02/24/running-a-dos-based-bbs-through-linux-and-telnet/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 23:19:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Dos]]></category>
		<category><![CDATA[bbs]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[telnet]]></category>
		<category><![CDATA[dos bbs]]></category>

		<guid isPermaLink="false">http://satoricode.com/?p=14</guid>
		<description><![CDATA[Since social networking has gotten OUT OF FREAKING CONTROL, a certain nostalgia has dwelled deep within me to reconnect to my roots of BBSing.
Some sites like BBS Corner claim that BBSes are even stronger now than they were in the past, in due, part to the internet and not having to dial long distance, and because [...]]]></description>
			<content:encoded><![CDATA[<p>Since social networking has gotten OUT OF FREAKING CONTROL, a certain nostalgia has dwelled deep within me to reconnect to my roots of BBSing.</p>
<p>Some sites like <a title="BBS Corner" href="http://www.bbscorner.com/">BBS Corner</a> claim that BBSes are even stronger now than they were in the past, in due, part to the internet and not having to dial long distance, and because most of us are broadband and can get speedier connections to telnet boards or it&#8217;s much more feasible to operate multinode setups on newer hardware.</p>
<p>What I will discuss, is a very simplistic way to get your BBS online (in a headless fashion) without an over-engineered solution such as <a title="VmodemD" href="http://freshmeat.net/projects/vmodemd">VmodemD</a> or using predefined DosBox instances.  If you have a router, you&#8217;ll have to learn how to port forward on your own.  This is outside the scope of this blog.  Although there is nothing WRONG with using VmodemD or the online example of how to get a <a title="multinode Renegade BBS setup over telnet in linux" href="http://www.instructables.com/id/Renegade-BBS-in-Ubuntu-Linux-Telnet-Multi-Node/">multinode Renegade BBS setup over telnet in linux</a> I find them to be over-engineered solutions.  I have tested this with Renegade BBS and Oblivion/2 BBS, but I suspect it will work with just about any DOS (non win32 dos) BBS software.</p>
<p>There&#8217;s one caveat: perhaps it&#8217;s just <a title="SyncTerm's" href="http://syncterm.bbsdev.net/">SyncTerm</a>&#8217;s implementation of Z-modem or Y-modem-g (SEXYZ), but I still haven&#8217;t gotten a reliable file transfer to work right, yet.  But who really cares?  Zmodem is basically a way of transferring files without TCP/IP&#8217;s error-correction state, which tends to mimic TCP/IP (which you don&#8217;t need since you&#8217;re using TCP/IP, right? This will just slow things down) and Y-modem-g, well, I still haven&#8217;t really find a free solution for that.  Bah, I digress, here&#8217;s how it goes (online door games will work this method, too, such as <a title="LORD" href="http://en.wikipedia.org/wiki/Legend_of_the_Red_Dragon">LORD</a>, and <a title="Pimpwars" href="http://www.bbsdocumentary.com/library/PROGRAMS/DOORS/PIMPWARS/">Pimpwars</a>, etc&#8230;) nothing:</p>
<p>I&#8217;ll assume you&#8217;re using Ubuntu linux, but it doesn&#8217;t really matter.  Grab yourself a copy of dosemu 1.4.0 and install it (install the latest &#8220;freedos&#8221;, as well).  Make sure you can run dosemu before you proceed any further.  Also, I will not be covering how to do that, since you could just RTFM for dosemu.</p>
<p>1) I find it easy to have two copies of dosemu&#8217;s config: 1 for local use (installing things, configuring, maintenance, etc), and a mirror of this same one, with 1 minor detail changed &#8211; scroll down all the way to Serial Port Settings and change this line:</p>
<div id="_mcePaste">$_com1 = &#8220;virtual&#8221;</div>
<div>Save and exit.  This file will be used for the BBS/telnet script you will write in the next few steps.</div>
<div>2) load up dosemu with your first config file:</div>
<div>dosemu -n -f /etc/dosemu/dosemu.conf-vanilla (or something similar)</div>
<div><strong>Install</strong> your environment as your normally would, like pkzip/pkunzip, fossil driver (bnu/X00 &#8211; I prefer BNU), share.exe, exitemu, etc&#8230;</div>
<div>VERY IMPORTANT &#8211; Make sure the last line of your autoexec.bat is: unix -e</div>
<div>config.sys should be similar to this:</div>
<div>
<div>rem config.sys for DOSEMU + FreeDOS</div>
<div>rem note that the initial &#8220;D:&#8221; is set to &#8220;Z:&#8221; at the end</div>
<div>SWITCHES=/F</div>
<div>DOS=UMB,HIGH</div>
<div>dosdata=umb</div>
<div>lastdrive=Z</div>
<div>files=40</div>
<div>stacks=0</div>
<div>buffers=10</div>
<div>devicehigh=c:\dosemu\ems.sys</div>
<div>shellhigh=c:\command.com /e:1024 /p</div>
</div>
<div>At this point, you should be able to type &#8220;exitemu&#8221; and it should exit your dosemu instance.  If it does not, you did not properly install freedos or the other required dosemu utilities.  This is a required utility.</div>
<div>3) Now you need to make a batch file to load your BBS with:</div>
<div>example C:\BBS.BAT</div>
<div>
<div>@echo off</div>
<div>break off</div>
<div>break=off</div>
<div>c:</div>
<div>cd\WHEREVER_YOU_PUT_SHARE.EXE</div>
<div>SHARE.EXE</div>
<div>cd\WHEREVER_YOU_PUT_BNU.COM</div>
<div>bnu.com /L0:57600,8N1 /F</div>
<div>SET DSZLOG=C:\OBV2\DSZLOG.%1</div>
<div>cd\OBV2</div>
<div>obv.exe -b 57600 -A -N %1</div>
<div>exitemu</div>
</div>
<div>Save that file and exit.  You will have to configure your BBS software for each node to use COM1 before attempting anything further.  Yes, I know it sounds ludicrous, but it works, trust me.</div>
<div>4) Install telnetd/in.telnetd with xinetd</div>
<div>5) Make sure your /etc/services line with port 23 tcp / telnet is uncommented</div>
<div>6) Make your /etc/xinetd.d/telnet match this:</div>
<div># default: off</div>
<div># description: An xinetd internal service which echo&#8217;s characters back to</div>
<div># clients.</div>
<div># This is the tcp version.</div>
<div>service telnet</div>
<div>{</div>
<div><span style="white-space: pre;"> </span>disable<span style="white-space: pre;"> </span>= no</div>
<div><span style="white-space: pre;"> </span>port<span style="white-space: pre;"> </span>= 23</div>
<div><span style="white-space: pre;"> </span>socket_type<span style="white-space: pre;"> </span>= stream</div>
<div><span style="white-space: pre;"> </span>protocol<span style="white-space: pre;"> </span>= tcp</div>
<div><span style="white-space: pre;"> </span>user<span style="white-space: pre;"> </span>= some valid user to run as</div>
<div><span style="white-space: pre;"> </span>wait<span style="white-space: pre;"> </span>= no</div>
<div><span style="white-space: pre;"> </span>server <span style="white-space: pre;"> </span>= /usr/sbin/in.telnetd</div>
<div><span style="white-space: pre;"> </span>server_args<span style="white-space: pre;"> </span>= -n -h -L /usr/sbin/bbs</div>
<div>}</div>
<div>7)  Now, create /usr/sbin/bbs similarly to this:</div>
<div>#!/bin/bash</div>
<div>export HOME=/home/some valid user to run as/</div>
<div>unset DISPLAY</div>
<div>total=10</div>
<div>current_sessions=`ps aux | grep in.telnetd | grep bbs | grep -v grep | wc -l`</div>
<div>if [ $current_sessions -ge $total ]; then</div>
<div><span style="white-space: pre;"> </span>echo &#8220;Too many connections, please try again later.&#8221;</div>
<div><span style="white-space: pre;"> </span>sleep 2</div>
<div><span style="white-space: pre;"> </span>echo &#8220;Goodbye.&#8221;</div>
<div><span style="white-space: pre;"> </span>sleep 1</div>
<div>else</div>
<div><span style="white-space: pre;"> </span>NODE=1</div>
<div>       for i in `seq 1 $total` ; do</div>
<div>                if [ -e "/tmp/bbsnode$i" ] ;</div>
<div>                then</div>
<div>                        DUMMY=1</div>
<div>                else</div>
<div>                        let NODE=$i</div>
<div>                        touch /tmp/bbsnode$i</div>
<div>                        break</div>
<div>                fi</div>
<div>        done</div>
<div><span style="white-space: pre;"> </span>echo &#8220;Loading MYBBS [node $NODE/$total]&#8230;&#8221;</div>
<div><span style="white-space: pre;"> </span>sleep 2</div>
<div><span style="white-space: pre;"> </span>/usr/local/bin/dosemu.bin -n -f /etc/dosemu/dosemu.conf-BBS -E &#8220;C:\BBS.bat $NODE&#8221;</div>
<div><span style="white-space: pre;"> </span>echo &#8220;Goodbye.&#8221;</div>
<div>        rm -rf /tmp/bbsnode$NODE</div>
<div><span style="white-space: pre;"> </span>sleep 1</div>
<div>fi</div>
<div> <img src='http://satoricode.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> Give that script execute permissions: sudo chmod +x /usr/sbin/bbs</div>
<div>9) Restart xinetd: sudo /etc/init.d/xinetd restart</div>
<div>10) Try it out, take it for a test spin: telnet localhost</div>
<div>Debugging:</div>
<div>You might want to make sure you can run the BBS in LOCAL mode with your vanilla dosemu conf file first if it&#8217;s not working.</div>
<div>Feel free to leave comments or suggestions.</div>
<div>If you&#8217;ve spotted the obvious denial of service attack that can be done on this computer (with determining how many active nodes there are), I&#8217;m more than welcome to hear any ideas on how to fix it, but so far it seems to work pretty well!</div>
<div>Ciao!</div>
]]></content:encoded>
			<wfw:commentRss>http://satoricode.com/2010/02/24/running-a-dos-based-bbs-through-linux-and-telnet/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
