Subject: Re: NetBSD/Dreamcast, hang when spawning init over NFS.
To: None <port-dreamcast@netbsd.org>
From: Christian Groessler <cpg@aladdin.de>
List: port-dreamcast
Date: 01/29/2002 01:16:45
Hi,
On 01/27/2002 06:14:30 PM EST Miles Nordin wrote:
>
>>>>>> "cg" == Christian Groessler <cpg@aladdin.de>
>
> cg> Update: I tried the 20010117-hpcsh-sh3el-coff snapshot, and
> cg> there booting over NFS works.
>
> cg> I now also got the 20010610 elf snapshot booting. My error was
> cg> that I used the MAKEDEV script which is inside the
> cg> snapshot. After running the dreamcast MAKEDEV script it
> cg> worked.
>
>great. Since you are one of the few people who have actually gotten a
>Dreamcast to boot single-user, maybe you can answer two questions:
FWIW, it's not only single-user mode, but full multi-user mode :-)
>
>1. Which kernel did you use?
It's my own cross compiled -current kernel from CVS last week (and now
from today). I've put it up for those interested on
ftp://ftp.groessler.org/pub/chris/dreamcast/netbsd
Take the 1ST_READ.BIN.bz2 if you want to burn it onto a CD.
No guarantees that it won't blow up your house :-)
I've attached at the end of the mail the instructions on how to cross
compile the kernel yourself. At least how I did it, I hope I haven't
forgotten something.
>2. Where do you get ``the dreamcast MAKEDEV''? If I were looking for
> this, I would look in the Dreamcast snapshots, but apparently that
> is wrong.
No, if you have the source installed on /usr/src (preferably a recent
-current from CVS), it's /usr/src/etc/etc.dreamcast/MAKEDEV.
>As for assembling a ``working snapshot,'' maybe you should just
>combine the kernel, userland, and ``dreamcast MAKEDEV'' you used in
>one place so that others don't have to go hunting all over the place
>for them like a bunch of warez kiddies.
I would do this, but I'm not satisfied with the snapshot I use.
(ftp://ftp.netbsd.org/pub/NetBSD/arch/hpcsh/snapshot/20010610-hpcsh-sh3el-elf)
It doesn't seem to support shared libraries (no /usr/libexec/ld.elf_so
and all things linked statically), but more important, the C compiler
doesn't work, it complains about a missing crtbegin.o.
I'm waiting for the new toolchain to work with dreamcast, then I will
provide a snapshot if requested.
>It might be good to mirror Marcus's IP Slave and netcat.c on the
>official FTP site as well.
Also the scramble.c program, which is needed to create bootable CDs.
>If you can help me get my Dreamcast working, I will write and submit a
>patch for the FAQ as Mr. Brownlee suggested, and I'll try to write
>politely.
What exactly is your problem?
regards,
chris
PS: cross compile a dreamcast kernel:
You need a recent -current, e.g. on /usr/src
To build a SH ELF cross-compiler go into a scratch build directory
and type (set prefix where you like the compiler to install):
/usr/src/gnu/dist/toolchain/configure --target=sh-elf --prefix=/opt/shgcc
Then
"make" and
"make install"
If you have a problem in some directory (iirc I had in gdb and
libf2c), simply remove those dirs or rename them (I did a 'mv gdb
gdb.weg') and try again. gdb and fortran aren't needed to compile the
kernel.
Then /usr/sbin/config your dreamcast kernel (inside
/usr/src/sys/arch/dreamcast/conf) and use the following script instead
of make to build (after adapting to your environmet):
------------------
#!/bin/sh
MACHINE=dreamcast export MACHINE
MACHINE_ARCH=shle export MACHINE_ARCH
WHICH=sh-elf
LOCAL=/opt/shgcc
BINDIR=$LOCAL/bin
PATH=$PATH:$BINDIR export PATH
GCC_EXEC_PREFIX=$WHICH
AR=$BINDIR/$WHICH-ar export AR
AS="$BINDIR/$WHICH-as -little" export AS
CC="$BINDIR/$WHICH-gcc -ml" export CC
CPP=`$CC -print-prog-name=cpp` export CPP
CXX=$BINDIR/$WHICH-c++ export CXX
FC=$BINDIR/$WHICH-f77 export FC
LD="$BINDIR/$WHICH-ld -EL" export LD
NM=$BINDIR/$WHICH-nm export NM
RANLIB=$BINDIR/$WHICH-ranlib export RANLIB
SIZE=$BINDIR/$WHICH-size export SIZE
ADDR2LINE=$BINDIR/$WHICH-addr2line export ADDR2LINE
GASP=$BINDIR/$WHICH-gasp export GASP
OBJCOPY=$BINDIR/$WHICH-objcopy export OBJCOPY
OBJDUMP=$BINDIR/$WHICH-objdump export OBJDUMP
STRINGS=$BINDIR/$WHICH-strings export STRINGS
STRIP=$BINDIR/$WHICH-strip export STRIP
#MKPROFILE=no export MKPROFILE
#MKMAN=no export MKMAN
MKLINT=no export MKLINT
HOSTED_CC=cc export HOSTED_CC
#BSDSRCDIR=/net/scharfzahn/tmp/netbsd-1.4.2/usr/src export BSDSRCDIR
BSDSRCDIR=/net/swamp/zeug/netbsd-chkout export BSDSRCDIR
MAKE=make export MAKE
#MAKE="make -f ${DESTDIR}/usr/share/mk/sys.mk -f Makefile"; export MAKE
#MAKEFLAGS="-I ${DESTDIR}/usr/share/mk" ; export MAKEFLAGS
set -x
exec $MAKE "$@"
------------------
I've found this script somewhere on some NetBSD ml some time ago,
sorry I cannot remember who the original author was.