/*
* HOME(PROJECTS) || RESUME || LINKS || ABOUT */

CloudDOS

For the October 2019 Retrochallenge, this will be an attempt to run a version or emulation of DOS, running a web server, in AWS.


Pregame

Late Septempber 2019

I am looking around for different software resources to make this work.




Begin

October 2, 2019

I started by installing FREEDOS in QEMU. This went pretty smoothly, until I was time to set up networking. I installed both FDNET and MTCP using FDIMPLES, and I could not get the network card to work. I was using ne2k emulation, both PCI and ISA modes, and I could not get DHCP to work. I was using the -net user option, which puts the emulated PC on its own network and runs a virtual DHCP server, but it wasn't working for me. I tried RTL2139, but for some reason FDNET.BAT was trying to load a driver that didn't get installed. Maybe freedoes doesn't ship with rtl drivers? Looking in the FDOS\NETWORK directory, I did find that in addition to NE2000.COM, freedos came with PCNTPK.COM, which I Googled around to find they are for PCNet cards. So I tried qemu pcnet emuation, and that seemed to work.

qemu-system-x86_64  -m 64 -hda doshdd.img -cdrom FD12LGCY.iso   -net user -net nic,model=pcnet -curses

Above, I am using an option called curses, that emulates VGA text mode in the console. This is because my goal is to run this in AWS, and I will not have graphics. I could run in VNC, but that is not necessary. I was finally greeted with an IP address:

mTCP DHCP Client by M Brutman (mbbrutman@gmail.com) (C)opyright 2008-2013
  Version: May 23 2013

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 = 10.0.2.15
NETMASK = 255.255.255.0
GATEWAY = 10.0.2.2
NAMESERVER = 10.0.2.3
LEASE_TIME = 86400 seconds

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

Done processing startup files C:\FDCONFIG.SYS and C:\AUTOEXEC.BAT

Type HELP to get support on commands and navigation.

Welcome to the FreeDOS 1.2 operating system (http://www.freedos.org)

C:\>
C:\>cd mtcp
C:\MTCP>htget -o a.htm http://mwsherman.com
mTCP HTGet by M Brutman (mbbrutman@gmail.com) (C)opyright 2011-2013
  Version: May 23 2013

Server return code: 200 OK

C:\MTCP>head -N 10 a.htm
<html><head><style>




.header {

        box-shadow: 10px 10px;
}

Perfect... Freedos is up and running and connected to the internet. I also tried the hostfwd option with NC (mTCP's netcat), and was able to get a port on my host machine successfully forwarded to the VM. But will it run in aws?


mark@ip-172-31-17-205:~$ qemu-system-i386  -m 64 -hda doshdd.img   -net user,hostfwd=tcp::8000-:80  -net nic,model=pcnet  -curses

I got an ip address... so there was one thing to try...

mark@ip-172-31-17-205:~$ qemu-system-i386  -m 64 -hda doshdd.img   -net user,hostfwd=tcp::8000-:80  -net nic,model=pcnet  -curses

It got an ip address... So what happens if I do this?

In amazon qemu:

C:\>cd mtcp                                                                      
C:\MTCP>nc -listen 80                                                            
mTCP Netcat by M Brutman (mbbrutman@gmail.com) (C)opyright 2007-2013             
  Version: May 23 2013                                                           
                                                                                 
Waiting for a connection on port 80. Press [ESC] to abort.                       
                                                                                 
Connection received from 76.235.21.58:44312                                      
                                                                                 
Hello DOS     
                                                                   

at home:

[mark@octothingy ~]$ nc mwsherman.com 8000
Hello DOS

HTTPSERV

My original plan, was after getting MTCP working, I was going to implement a simple www server. But, it turns out recent versions of MTCP already have a web server... I downloaded that newest version MTCP, and ran HTTPSERV on a folder containing a simple text file. It seems to work just fine!

Try These:


HI page server from freedos
MTCP status page from freedos

What Next?

This happened a lot quicker, and easier, than I thought it would. I have a simple DOS-based HTTP web server running in AWS. I think I would like to package it all up a bit nicer, release a disk image. I have a few ideas. Maybe instead of a disk image file, use a FAT-formatted EBS volume. Can you even have FAT-formatted EBS? And maybe work it out so all you need to specify is a disk volume containing your application for use on the 'D' drive, and an autoexec.bat file.