NetBSD/dreamcast: How to use NetBSD/dreamcast
- Introduction
- Requirements
- Make a Bootable Kernel CD
- Prepare the NFS Server & Filesystem
- Try it Out
- You're done!
Introduction (top)
“I Just Bought a Dreamcast to Run NetBSD. What do I do now?”Getting NetBSD up and running on the Sega Dreamcast is pretty easy, as long as you know what's involved. This document is aimed at the NetBSD newbie as well as the DC/NetBSD newbie. However, a familiarity with some flavor of UNIX is recommended. Information for this document has been culled from the port-dreamcast mailing list archive, Marcus Comstedt's homepage at http://mc.pp.se/dc/, BeTips.net http://www.betips.net, Josh Tolbert's Dreamcast How-to, and personal trial and error.
This HOWTO will focus on netbooting your Dreamcast, since you need a writable filesystem to do anything useful with the system. As booting from a CD can be useful for test purposes -- and since some people might want to do it “just for the fun of it” -- brief instructions on that setup are included as well.
Requirements (top)
You will need the following:
- Dreamcast console (it is recommended that you use a unit manufactured September 2000 or earlier (some have reported that newer ones work as well, so check the mailing list archive to be sure))
- Dreamcast keyboard
- OPTIONAL - Dreamcast mouse (as of this writing there is no driver for it. Maybe you could write one?)
- a PC running Windows
- a PC running NetBSD (Linux or any other *BSD should work, too. BeOS does not work for step 3)
- Blank CD-R's (CD-RW's cannot be read by the Dreamcast)
- Bootable NetBSD kernel from Josh's site (or a mirror).
- “mkhybrid” and a CD burning program (I used CD Burner under BeOS, but you'll most likely use “cdrecord”)
Make a Bootable Kernel CD (top)
- Extract the kernel to a convenient location. You should now have to files, audio.raw and kernel.raw.
- Burn the audio.raw track as audio first, making sure that you
leave the disk open for more sessions. Under cdrecord, this is done
with:
# cdrecord dev=0,1,0 -multi -audio audio.raw
Obviously, you need to replace dev=0,1,0 with the appropriate device for your system, found with cdrecord -scanbus. - Burn the kernel.raw file as data. This is done under cdrecord as:
# cdrecord dev=0,1,0 -multi -xa1 netbsd-kernel.raw
In cdrecord 2.01 the option "-xa1" has been renamed to "-xa". The man page for cdrecord should show which option you need to create the CD-R in XA mode 2 form 1, 2048 bytes per sector. If neither of those options works for your version of cdrecord, you might want to try "-xa2" too.
To burn the test CDs:
- Burn the image you downloaded using DiscJuggler. If you get boot messages when you put this in the Dreamcast and power up, you know your system is ready to roll; please report this to the mailing list if your machine was made after September 2002.
- If you wish to create a filesystem on CD and test it out:
- Grab the HPCSH tarballs from http://www.NetBSD.org and untar them in a convenient location.
- Run
# sh MAKEDEV all
in/home/dreamcast/dev/ - Use mkhybrid to burn a CD of this distribution:
# mkhybrid -o DCBSD.img -V DCNetBSD -a -r /home/dreamcast/
-Vis for volume label,-ameans all files in the directory, and-ris for Rock Ridge extensions (not necessarily required, but not harmful). - Put your DiscJuggler CD in the Dreamcast and power up. When prompted for the root FS, type “gdrom”; hit “Enter” when it asks about the dump device.
- Swap the boot CD for your freshly made filesystem CD
- Type in “cd9660” at the filesystem prompt; this should put you into single user mode.
Prepare the NFS Server & Filesystem (top)
- Fetch the world files from Josh's site.
- Untar them into a conveniently exportable directory on your *BSD/Linux PC.
- Set up your
/etc/exports(man exports(5) for more info on this file's syntax). An example can be found on Josh's site. Make sure that you've:- Set
-maproot=0, otherwise the Dreamcast won't have permissions to mount the filesystem. - Specified a network or host the share is accessible to; otherwise you could end up making it writable to the world, a Really Bad Thing.
- Set
- Make sure mountd and nfsd are running; a simple
ps aux | grep '(mount|nfs)'d
will show if they're currently up. If they're not, run “mountd” and “nfsd” as root to start them now; to ensure they start at boot-time in the future, edit/etc/rc.confso thatnfs_server=YES,lockd=YES, andstatd=YES. - Set up your
/etc/dhcpd.conf(man dhcpd.conf(5) for more info on this file's syntax). An example can be found a Josh's site, or alternatively at Alex Kirk's site. Things to keep in mind when configuringdhcpd.conf:- You MUST specify the Dreamcast's MAC Address in the host section. This can be found by looking at your BBA; it's on the sticker.
- Your root-path option should be wherever your world files were extracted.
- Options such as domain-name-servers aren't strictly necessary, but tend to make life easier.
- Make sure dhcpd is running; turn it on with
# sh /etc/rc.d/dhcpd start
if it's not on. To ensure that DHCP is running whenever your box is, edit/etc/rc.confso thatdhcpd=YES. - Run the MAKEDEV script in
/home/dreamcast/dev/. This will create your console, as well as other needed devices.# sh MAKEDEV all
- Create a swapfile for the Dreamcast. You may pick any size you wish,
but practical considerations say 32-64MB works best (much smaller and
it's not helpful, much larger and it takes excessive physical RAM to
maintain). Make sure it put it in the directory you're exporting as
the Dreamcast's root.
# dd if=/dev/zero of=swap bs=32k count=1024
(for 32MB) - Edit
/home/dreamcast/etc/fstab(or wherever you've placed the Dreamcast root) to mount the appropriate filesystems:192.168.2.69:/home/alex/dreamcast/dc / nfs rw,auto 0 0 /swap none swap sw 0 0 /kern /kern kernfs rw /proc /proc procfs rw 0 0 /dev/gdrom0c /mnt/gdrom cd9660 ro,noauto 0 0
Try it Out (top)
- Put your CD into the Dreamcast and power up. If you made the CD correctly, a familiar NetBSD bootup sequence will begin. If you've done this with a Dreamcast manufactured after September 2000, please notify the mailing list.
- If you run into problems, chances are your
/etc/exportsor/etc/dhcpd.confare messed up. You'll want to first double-check them for stupid mistakes -- we all make them, don't feel bad. If you've got a specific error message with no description, look in/usr/src/sys/sys/errno.hfor a brief explanation. - If you're really stuck, browse the mailing list archives. They're quite helpful. If you want to search them, your best bet is to use Google's Advanced Search; restrict the domain to mail-index.NetBSD.org and make sure that you include “dreamcast” in your query.
- That failing, post to the list itself. Please be detailed, and include relevant error messages/configuration files/logfiles (if they're small).
![[NetBSD Logo]](../../images/NetBSD-headerlogo.png)