Subject: port-dreamcast not a hoax. sniff.
To: None <port-dreamcast@netbsd.org>
From: Miles Nordin <carton@Ivy.NET>
List: port-dreamcast
Date: 01/28/2002 22:37:23
My folks have one of those giant flat Sony CRT's.  When set for
DRC=progressive and Pic Mode=pro it looks almost as good as a real
640x480 monitor, without ringing around character edges and such.
These new TeeVee's don't even seem to benefit from ``S-Video''.  The
right and left edges are placed perfectly on this NTSC set.  However,
it still chops off the top and bottom lines of the 80x30 text, and the
hardware address printed by IP Slave is unreadable.


so, here is a NetBSD ``snapshot'' what worked for me, explained in
disgusting Linux ``HOWTO'' format.

Hardware:
 Sega Dreamcast ``HKT-3020'' console, US NTSC manufactured June, 2000
 Sega BBA Ethernet from Lik-Sang
 Sega Maple Bus keyboard


Step 1.  Make the IP Slave boot CD.

I used a Ricoh MP6200S burner with cdrecord 1.9 and its included
mkisofs 1.13.

To make the CD, you will need two files: the IP.BIN bootblock and the
1IPLOAD.BIN executable.  Get both in a single tarball at:

 http://mc.pp.se/dc/ipslave.html

Instructions for making the CD are at:

 http://mc.pp.se/dc/cdr.html

I succeeded on the first try, but finding someone with a non-Sony SCSI
CD burner was a nightmare.  Everyone has IDE or FireWire burners now,
and both Sony burners I tried did not work with cdrecord at all,
multi-session or otherwise.


Step 2.  Prepare the host.

I understand Christian used an hpcsh3 ELF snapshot which is more
recent, but I will report the snapshots that actually worked for me.

Extract this to the NFS export directory:

 ftp://ftp.netbsd.org/pub/NetBSD/arch/sh3/snapshot/19991231-coff/

When I tried to boot this COFF snapshot with the newer kernel I will
tell you to use later, I got an error 8 (executable format error)
loading /sbin/init.  So replace all the COFF binary files with the ELF
binaries in this off-the-cuff so-called snapshot:

 ftp://ftp.netbsd.org/pub/NetBSD/arch/sh3/snapshot/20010227-dreamcast-elf-test/

As per Christian's observation, replace dev/MAKEDEV in your host's
export directory with a Dreamcast MAKEDEV, which you can get here:

 http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/basesrc/etc/etc.dreamcast/MAKEDEV?rev=1.8&content-type=text/plain

Run the MAKEDEV script on the host:

# cd [...]/dev
# ./MAKEDEV all

Then, you need to set up a dhcp and NFS server.  There is probably a
better canonical documentation of this elsewhere, but here are
the config files I used, which you'll need to modify:

/etc/exports
-----8<-----
/usr	-alldirs -maproot=root 192.168.0.10
-----8<-----

/etc/dhcpd.conf
-----8<-----
# Notes:
# To set up dhcpd, install this file and ensure that /var/db/dhcpd.leases 
# exists.  
option domain-name "nat";
option domain-name-servers balthasar.nat; # if we use symbolic hostnames, all 
					# IPaddrs of multihomed hosts are 
					# returned.
default-lease-time 172800;		# 2 days
max-lease-time 172800;			# 2 days
dynamic-bootp-lease-length 14400;	# 4 hours -- we are conscious of 
					# using BOOTP dynamically and will 
					# promptly make other arrangements.
get-lease-hostnames true;		# DNS lookup for dynamic IP's
use-host-decl-names true;		# take fixed-ip hostname from the 
					# host <x> declaration


subnet 192.168.0.0 netmask 255.255.255.0 {
	range dynamic-bootp 192.168.0.70 192.168.0.79; # 10 names
	option subnet-mask 255.255.255.0;
	option broadcast-address 192.168.0.255;
	option routers 192.168.0.1;
}

host dc {
	hardware ethernet 00:d0:f1:02:e3:d0;
	next-server 192.168.0.1;
	option root-path "/usr/export/nbnfs/dc";
	fixed-address 192.168.0.10;
}

-----8<-----

I also run a nameserver on the host, but I think you can get away
without this, although dhcpd may be slower and syslog some warnings.
Using the bogus TLD .nat for bogus IP addresses is a mixed blessing.
It documents itself nicely and has no authority problems while
disconnected from the 'net, but the bogus hostname shows up in my
message-id's.  <shrug>


Step 3.  Send the kernel to the target.

The IP Slave will not request an IP address for itself, and mine has
not statefully ``learned'' its address as I've heard suggested.  so,
enter the IP and hardware addresses of the Dreamcast as follows, on
the host:

# arp -s 192.168.0.10 00:d0:f1:02:e3:d0

Be sure to type the :s.

The portal filesystem trick in the FAQ is really cool, but I found
netcat easier than compiling a new kernel.  Get netcat from shady.com:

 http://www.shady.com/downloads/netcat/netcat.c

and build it the usual way, 'gcc -o netcat netcat.c'.

I used this kernel:

 ftp://ftp.netbsd.org/pub/NetBSD/arch/dreamcast/netbsd.1.5R

Send the kernel to the Dreamcast as follows:

$ ./netcat -h 192.168.0.10 -p 4711 < netbsd.1.5R

There are some other kernels in the 20010227-dreamcast-elf-test
directory.  I think one of them is a serial console and the other is
wscons.  netbsd-DCUSZEROTEST worked for me as wscons.  These kernels
might be a better choice---I don't know.  It was very nice of whoever
uploaded these kernels to post a config file along with them.


Future work

I plan to use the IP.BIN bootblock creator

 http://mc.pp.se/dc/files/makeip.tar.gz

and the bootcode scrambler

 http://mc.pp.se/dc/files/scramble.c

on Marcus's software page

 http://mc.pp.se/dc/sw.html

to get the Dreamcast to boot a NetBSD kernel right off a CD.

Also, one can load other things besides NetBSD with the IP Slave.  I
successfully uploaded ghettoplayvorbis.elf with netcat and IP Slave.

Now, what's this ``LAN Adapter'' I've been hearing so much about?