Subject: First tries with a custom toolchain to build NetBSD/mips64
To: None <port-mips@netbsd.org>
From: Richard Braun <syn@sceen.net>
List: port-mips
Date: 08/03/2004 14:52:32
--J/dobhs11T7y2rNN
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi,

I have built a custom toolchain using binutils 2.15 and gcc 3.3.4 which
can crosscompile to 64 bits MIPS processors. My problem is that I'm not
sure it really works. I have compile

http://linux.junsun.net/porting-howto/src/barebone.tar.gz

with some modifications in the Makefile and barebone.lds and I get objects
with this signature :
$ file barebone.elf=20
barebone.elf: ELF 64-bit MSB MIPS32 executable, MIPS, version 1 (SYSV),
statically linked, not stripped

In Makefile :
CROSS_COMPILE =3D mips64-elf-
CFLAGS =3D -mabi=3D64 -mips64 -O -G 0 -mno-abicalls -fno-pic -Wall \
         -DRAMSIZE=3D${RAMSIZE}

and in barebone.lds :
OUTPUT_FORMAT("elf64-bigmips")
OUTPUT_ARCH(mips)
ENTRY(_start)

First, I wonder why there is "MIPS32 executable". Next, here is what I get
when netbooting barebone.elf :
>> boot -f bootp():netbsd                      =20
Setting $netaddr to 192.168.0.3 (from server )
Obtaining netbsd from server                 =20
4000                        =20
Exception: <vector=3DNormal>
Status register: 0x34045083<CU1,CU0,FR,CH,IM7,IM5,IPL=3D???,KX,MODE=3DKERNE=
L,EXL,IE>
Cause register: 0x8014<CE=3D0,IP8,EXC=3DWADE>                              =
       =20
Exception PC: 0xffffffff9fc8de8c, Exception RA: 0xffffffff9fc7aba4
Write address error exception, bad address: 0xa0040000           =20
HEART ISR :      0x4000000000000<TIMER>              =20
HEART IMSR:      0x0                  =20
  VID 0's saved user regs in hex (gpda=3D0xa800000020f1fad8):
  arg: a800000020f6ae74 a0040000 10 a800000020f00030      =20
       101402435080002 408880003c1da00f c01001137bdfff0 801000e00000000
  tmp: 4080600000000000 4080900000000000 4080980000000000 400880002401fff8
  sve: a800000020f27fd8 e50 150 a0040000                                 =
=20
       a800000020f2e6d0 a800000020f29f04 fa0 a800000020f6d080
  t8 ffffffff9fc5f3d4 t9 20f20590 at ffffffffffffffc0       =20
  v0 a800000020f6af74 v1 0 k1 ffffffffbad11bad      =20
  gp 0 fp ffffffffffffffff sp a800000020ffd960 ra ffffffff9fc7aba4
                                                                 =20
PANIC: Unexpected exception

[Press reset or ENTER to restart.]

The host is :
>> hinv                =20
                   System: IP30
                Processor: 250 Mhz R10000, with FPU
     Primary I-cache size: 32 Kbytes              =20
     Primary D-cache size: 32 Kbytes
     Secondary cache size: 1024 Kbytes
              Memory size: 256 Mbytes=20
                  Network: ef0 ethernet (100/10 base-T)
                SCSI Disk: scsi(0)disk(1)             =20
                    Audio: RAD Audio Processor
                 Graphics: SI

I'm looking for people able to understand these kinds of debug messages, and
also good resources on MIPS assembly.

Thanks :-).

--=20
Richard Braun

--J/dobhs11T7y2rNN
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)

iD8DBQFBD4qQBlWsEPLYRi8RAo6iAKCHY01IU7dS6O7upzgJtcIIDImjCACfRJzp
wUAW+/xPkMS5HfggZ2BQV7g=
=oXVl
-----END PGP SIGNATURE-----

--J/dobhs11T7y2rNN--