I was recently sent an email, requesting information on how to get DOSBox to support certain screen resolutions – the problem being that the proprietary DOS application uses direct screen writes, and, sadly, DOSBox’s CGA driver just can’t handle it. It comes out looking like an Apple ][ color monitor had the fits.

After a few hours of muddling through code, I had a revelation: QEMU. It’s leaps above DosBox in emulation – heck, I use it to test my custom BartPE builds (anti-Spyware/Virus/Cleanup/Backup) images.

Finding that there is already a MacOS X port sent me off to do my “good deed”. The first major problem being that qemu is not only eclectic command-line fu, but it is dynamically linked.

I created a stock MacOS X .app directory structure, wrote a shell script, moved things around, and after a bit of twiddling with install_name_tool, and the magic of dirname, my application was ready.

I installed FreeDOS to a 10M virtual disk, put the SignWriter application on it, setup a CONFIG.SYS and an AUTOEXEC.BAT… stuffed it, and viola!

SignWriter under MacOS X

The glories of monochrome CGA, half sized, running on my ancient PowerBook. Now accessable by a single icon click. Full screen mode is achieved with Ctrl-Shift-F. Via la Mac revolution!

If you haven’t heard about it, you will. Ubuntu Linux is a rather streamlined distribution, based on Debian. Out of the box, it comes with Open Office, GNOME, and more toys than you can shake a stick at.

What follows is a rather brief howto to make ndiswrapper and wpa_supplicant work with Ubuntu Linux. It’s not for the faint of heart.

First, you’re going to need your kernel sources, which Ubuntu doesn’t offer by default. Since I didn’t have a wired network to plug into, I burned all of the following to a CD, then did my work on the machine I was going to set up. (which I am now posting from yay!).

Get the kernel sources which match your installation. Open a terminal, then run

%uname -r

You should see something like:

2.6.8.1-2-386

This means you’re using kernel 2.6.8.1. Get linux-kernel-headers-`uname -r` from your local Ubuntu mirror.

Now, get your Windows XP drivers. You can’t have a .EXE. You need the .inf, .sys files, and the like. Figure how to get them, and copy them to a safe place. I like /etc/ndis, because I’m lazy.

%sudo mkdir /etc/ndis; sudo cp /media/cdrom0/xpdrivers/* /etc/ndis

Now, get ndiswrapper.

Copy it to some location, either ~/src, /usr/src, whatever – it’s not for me to judge your administrative beliefs.

%mkdir ~/src; gzip -dc /media/cdrom0/ndiswrapper-0.11.tar.gz | (cd ~/src; tar xvf -) %cd ndiswrapper-0.11 %make %sudo make install

Now, install your ndiswrapper support (the XP drivers)
%sudo ndiswrapper -i /etc/ndis/WHATEVER.inf

If the system has a card that works with one of the loaded drivers, you should see the following message in the system log (dmesg):

wlan0: ndiswrapper ethernet device xx:xx:xx:xx:xx:xx

Use iwconfig to configure the wireless adaptor. First, locate the wireless interface:

%sudo iwconfig

This will print the wireless interface (e.g., wlan0).

Add it to your boot-time loadable modules with:

%sudo ndiswrapper -m

If you are using WEP, you’re basically done. Read the README in the ndiswrapper distribution to set your ESSID, key, etc. Those of us in WPA-PSK land… read on.

You need WPA? Not a problem!

Download wpa_supplicant.

Untar it as we have above…

%gzip -dc /media/cdrom0/wpa_supplicant-0.2.5.tar.gz | (cd ~/src; tar xvf -)

Now, we need to add configuration support for ndiswrapper. These steps are very important – if you fail to do this, it won’t work. Finally, build and install wpa_supllicant with ndiswrapper support:

%cd ~/src/wpa_supplicant-0.2.5 %make mkconfig %echo “CONFIG_DRIVER_NDISWRAPPER=y” >> .config %make %sudo cp wpa_cli wpa_supplicant /usr/local/bin

Now, make a WPA configuration file for wpa_supplicant. Let’s call this file /etc/wpa_supplicant.conf Note that my example is for WPA-PSK. There are other forms of WPA. You can find them outlined in the README within the wpa_supplicant
package.

%sudo vi /etc/wpa_supplicant.conf

I’ll assume you know vi, or replace it with an editor of your choice.

The config is rather simple:

ctrl_interface=/var/run/wpa_supplicant

network={ ssid=”MYSSID” # Or whatever your SSID is psk=”NO MORE SECRETS” # Or whatever your password is key_mgmt=WPA-PSK proto=WPA
}

Save this file and exit.

Now start up dhcp (if you use dhcp), and wpa_supplicant.

dhclient wlan0 & wpa_supplicant -Dndiswrapper -iwlan0 -c/etc/wpa_supplicant.conf -dd

This will spew a load of stuff to the screen. Don’t worry. Give it about a minute or so and you should be on the network!

If not, check your SSID and any errors from dhclient and wpa_supplicant. It might be easier to start the two in seperate terminals.

The killer – how to make it work automagically with Ubuntu and Debian:

Edit /etc/network/interfaces and add the following:

auto wlan0 iface wlan0 inet dhcp wireless_mode managed pre-up modprobe ndiswrapper || true pre-up /usr/local/bin/wpa_supplicant -Dndiswrapper -B -i$IFACE -c/etc/wpa_supplicant.conf name Wireless LAN card netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255 gateway 192.168.1.1 dns-nameservers 192.168.0.1 wireless_essid YOUR_SSID

Note that I have a modprobe for ndiswrapper, just in case it didn’t load. The pre-up script calls wpa_supplicant, as we have above, with it’s configuration, which will then finally load the dhcp client.

Your wireless network will now work with ‘ifup wlan0’.

Welcome to wireless networking with non-native drivers, WPA encryption, and it’ll work automagicially. Note that you will most likely have to rebuild ndiswrapper when you upgrade your kernel, until it becomes ‘stock’. Aparrently, recent versions of Ubuntu do have ndiswrapper installed, but that does little good if you’re not already on the ‘net.

[Edit: This guide, written in September, 2004, is now out of date.

It has been brought to my attention that wpa_supplicant is now installable from the Ubuntu “universe”. To enable the universe repository, merely edit /etc/apt/sources.list and remove the hashs before the line reading:

deb http://archive.ubuntu.com/ubuntu warty universe

Then, execute:

apt-get install wpa_supplicant

Also of note is that Ubuntu is now distributing ACX100, an open source driver whic hattempts to provide native support for Texas Instruments ACX100/ACX110 based wireless cards. You will have to manuall remove this driver if you have an ACX100/ACX110 card, as it will result in ndiswrapper not working. A simple way to fix this is to add ‘pre-up rmmod acx_pci’ to your interfaces.

Happy Ubuntu-ing!]

Thanks to a head’s up by the DOSBox team, I’ve managed to keep semi-recent on DOSBox development. Guess what? 0.62 has been released. Joy of joys!

Here’s a bit of a blurb from their front page:

* Improved x86 dynamic core, more stable.
  • The usual cpu/fpu emulation fixes and speedups.
  • Soundblaster 16 and opl3 emulation added.
  • Internal mixer updated with interpolation and volume support.
  • Intelligent MPU-401 emulation added.
  • ISO/Disk image mounting support.
  • Custom chipset emulation for cga,tandy hercules modes.
  • Improved pc-speaker emulation.
  • Improved GUS emulation.
  • Added a keymapper.
  • VGA/VESA Bios fixes.
  • IPX networking support.
  • A zillion internal dos fixes/updates.
  • New ddraw rendering output and new render functions.
  • Raw adlib/midi capturing.

It took a bit more work than I expected – they’ve shifted to SDL_sound; and of course, by default it doesn’t compile thanks to a broken libtool and a few other things.

However, Here’s DOSBox 0.62, AltiVec optimized, and ready to roll!