NetBSD/Dreamcast Setup Guide
So you're interested in running NetBSD on your Sega Dreamcast
console? This guide should help you get your Dreamcast up and running
NetBSD quickly. This guide assumes the usage of a NetBSD machine
for services required by the Dreamcast to run from a remote file
system.
What you'll need:
Optional things that make life nicer:
- Dreamcast keyboard or adapter (such as the "Total Control 5,"
available through Lik-sang,
Lan Kwei and others) to allow
use of a PS/2 keyboard on a Dreamcast
- Dreamcast VGA converter (also available through Lik-sang, Lan Kwei and others) to use
your Dreamcast on a standard VGA monitor
- Dreamcast mouse or adapter (also available through Lik-sang, Lan Kwei and others) to allow
use of a PS/2 mouse on a Dreamcast
What you'll need to do:
- Make a working IP
Upload Slave CD. This is essential; without the IP Upload Slave you can't
send a kernel to the Dreamcast. Details on making a bootable Dreamcast
CD can be found at Marcus
Comstedt's Dreamcast Software site.
- Download dreamcast-world.tar.gz,
unpack the file and prepare the install:
- Find a good place for your Dreamcast's file system to live.
/mnt/exports/dc is a logical location. Note that this location is
going to be exported via NFS, which generally requires the top-level
NFS location to be a local file system mount point.
cp dreamcast-world.tar.gz /mnt/exports/dc
cd /mnt/exports/dc
tar -xvzpf dreamcast-world.tar.gz
rm dreamcast-world.tar.gz
Make sure you use tar's p option as root to preserver file
permissions.
- Create the swap file.
dd if=/dev/zero of=.swap bs=32k count=1024
chmod 600 .swap
This will create a 32M file /.swap for the Dreamcast to use as swap
and give the file good, safe permissions. If out-of-memory problems
occur, bump up the size of the swap file to 64M by using 64k for
the bs value when you make the swap file with dd.
- Fix up some of the Dreamcast's config files in /mnt/exports/dc/etc.
Pay special attention to fstab (you'll probably need to change the
IP the root file system is being mounted from), rc.conf (hostname,
ifconfig_rtk0, defaultroute) and resolv.conf (search, nameserver).
mk.conf could be updated as well.
- Set up the host machine. This requires configuring NFS and DHCP
servers, installing netcat, copying scripts to the right places and
editing those scripts to taste.
- Make sure DHCP and NFS servers are set to start on boot. On a
NetBSD machine, starting DHCP and NFS at boot are accomplished by
turning on some things in /etc/rc.conf:
dhcpd=YES
rpcbind=YES
nfs_server=YES
mountd=YES
lockd=YES
statd=YES
- Set up /etc/exports on the host PC. /etc/exports is what the
NFS server reads to find out what file systems to export. The
Dreamcast's file system resides on a single NFS share, so a single-line
/etc/exports would look like this:
/mnt/exports/dc -maproot=root dreamcast
"/mnt/exports/dc" is the path to your NFS share. "-maproot=root"
is required to properly map files to the root user on the Dreamcast
and "dreamcast" is the hostname of the machine we want to allow
connections from, the Dreamcast.
- Set up /etc/dhcpd.conf and /var/db/dhcpd.leases. To create
/var/db/dhcpd.leases, which is required by dhcpd, just
touch /var/db/dhcpd.leases
as root and the file is ready. /etc/dhcpd.conf will need to be
customized for your network configuration, but could look similar
to this dhcpd.conf (<1K, MD5). Lots of things in dhcpd.conf will need to be changed depending
on your network setup.
- Install netcat. On a NetBSD machine, execute the following
commands to install netcat if you have the pkgsrc system working.
cd /usr/pkgsrc/net/netcat
make install
- Install the scripts. On a NetBSD machine, dreamcast.sh can go in /etc/rc.d and dreamcast-upload.sh can go in
/usr/pkg/bin. If you put dreamcast-upload.sh in /usr/pkg/bin,
the only variables that should need to be changed in dreamcast.sh are HOSTNAME and MAC_ADDRESS.
In dreamcast-upload.sh, HOSTNAME,
PATH_TO_FILE and possibly FILENAME may need to be changed if you
deviate from the install path and files used in this guide.
To start the scripts at boot, I added
/etc/rc.d/dreamcast.sh start
to my Dreamcast's /etc/rc.local.
- You may want to reboot the host PC to make sure everything
starts up correctly. Check /var/log/messages for errors and watch
the console for messages.
- Try it out! Once you're confident the host PC and the Dreamcast's
files are ready to go, stick the IP Upload Slave CD in
the Dreamcast, make sure it's connected to the LAN and turn on the
Dreamcast. If everything has went well, you'll be greeted by some
boot messages and eventually a login
prompt.
What you'll get:
- A fresh, full, clean, base install of NetBSD-1.6L with only the
necessary changes to allow NetBSD to run
- A NetBSD/Dreamcast kernel chock full of drivers for just about
all of the hardware NetBSD/Dreamcast currently supports, various
practical file system support (NFS, CD9660, MFS, no FFS) and
support for both ELF and COFF binaries
- root, toor and "testuser" accounts, all with the password
"testuser"
- The "testuser" user is in the wheel group, so you can su once
you log in
- No installed pkgsrc tree or other packages
- A slow (but not brutally so), unique piece of hardware running
NetBSD
Things you should do after NetBSD/Dreamcast is running:
- Change the passwords for root and toor
- Create a new user and add that user to the wheel group
- Delete the "testuser" user
- Consider trying an alternate kernel from a selection of pre-built kernels that don't
include drivers for hardware you may not have or binary types you
may not care to support. Using a smaller kernel can save you some
valuable system RAM, and when you only have 16M RAM to work with
saving RAM is always a good thing. The default kernel you start
with is rather large.
- Whatever else you want with the machine; installing the pkgsrc
tree and installing some software might be a good place to start
- Let hemi@puresimplicity.net
or port-dreamcast@netbsd.org
know if you come up with any ideas to improve either this guide or
NetBSD/Dreamcast in general
What's left to do?
There's lots of areas in NetBSD/Dreamcast that could use work.
Find part of the project that interests you and give the project a
hand. Some of the more "technical" issues are things like:
- POSIX threads seem to break things badly. Every test of pthreads
during ./configure crashes the machine
- wscons doesn't play nice with XFree or with multiple consoles
- General help. Every open-source project can use contributors
Credits
The people and organizations that have helped me along the way with
my NetBSD/Dreamcast exploits:
- Marcus Comstedt,
whose code, diagrams and concise description of the process of
booting a Dreamcast (available on his Dreamcast Programming site) made the
whole deal possible
- Andy R., for
the corrections and additions to this page
- Many members of the port-dreamcast@NetBSD.org
(archive) mailing list that rooted me on, filled in some of the
fuzzy areas of the NetBSD/Dreamcast process and generally put up
with my annoying questions
- Many, many people on lots of different IRC channels, some for
technical help and some for just being there.
Page created 20030105 23:46.
Page modified 20070419 09:38.
Comments? Suggestions? Send them to hemi@puresimplicity.net.