First post, by mike_canada
I have a computer running linux that can download the google homepage in like a couple of seconds using an ordinary web browser. I have slightly modified the steps I took in the DOSBOX networking how-to to achieve internet in DOSBOX. My script to start DOSBOX with networking enabled is below:
#!/bin/bash
#turn on IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
#force-close apps in case dosbox got terminated prematurely
kill -9 $(pidof socat) > /dev/null
kill -9 $(pidof slattach) > /dev/null
kill -9 $(pidof dosbox) > /dev/null
killall socat > /dev/null
killall slattach > /dev/null
killall dosbox > /dev/null
#make a line
socat -4 PTY,link="/tmp/dbnet",raw,echo=0 TCP4-LISTEN:8001 &
sleep 1
slattach -vdL -s 9600 -p slip "/tmp/dbnet" &
sleep 1
ifconfig sl0 192.168.7.1 dstaddr 192.168.7.2 netmask 255.255.255.252 mtu 576 txqueuelen 576 up
#empty IPtables. My PC is not a real server.
iptables -t nat -F
#last param here = local ip address to my internet router
iptables -t nat -A POSTROUTING -s 192.168.7.0/30 -j SNAT --to-source 192.168.0.102
dosbox
sleep 1
kill -9 $(pidof slattach) > /dev/null
kill -9 $(pidof socat) > /dev/null
I attached my DOSBOX config file relevant to the problem.
So DosBox runs fine. Host PC reports:
slattach: tty_open: looking for lock
slattach: tty_open: trying to open /tmp/dbnet
slattach: tty_open: /tmp/dbnet (fd=4)
slattach: tty_set_speed: 9600
slattach: tty_set_databits: 8
slattach: tty_set_stopbits: 1
slattach: tty_set_parity: N
slip started on /tmp/dbnet interface sl0
DOSBox version 0.74
Copyright 2002-2010 DOSBox Team, published under GNU GPL.
---
CONFIG:Loading primary settings from config file /root/.dosbox/dosbox-0.74.conf
MIXER:Got different values from SDL: freq 22050, blocksize 705
MIDI:Opened device:oss
Serial2: Connected to 127.0.0.1
DOS keyboard layout loaded with main language code US for layout us
MAPPER: Loading mapper settings from /root/.dosbox/mapper-0.74.map
And client reports:
But when I try to use the internet (with mTCP's HTGET) in DOSBOX, ping works fine but trying to download a webpage takes forever at best. Here's another screenshot:
So it takes 1 second to load the first part (what you see), then about 30 seconds for the rest of the content to appear, then another 20 seconds to supposedly close the connection. then I get:
"NULL assignment detected"
and the program closes.
Why would the internet take so long in DOSBOX?
I tried maximum priority settings, and even played with CPU cycles. and the only difference I noticed with CPU cycles is the timings from mTCP's ping utility. When I make the cycles down to the low hundreds, ping reported higher response times in the 100 mS instead of 60mS.
This is mTCP for dos here: http://www.brutman.com/mTCP/
and I am using the latest version.