Port-sgimips archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Porting NetBSD to SGI Fuel?



Hello!

I investigate mips64 toolchain on my Fuel.

-----------------------------------------------

>> hinv
System  SGI-IP35
1 900 MHz IP35 Processors
Main memory size: 4096 Mbytes
Graphics Controller
Integral Fast Ethernet
IOC3 serial port
USB (OHCI interface)
Integral SCSI controller 0: Version Qlogic 12160
    Disk drive: unit 3 on SCSI Controller 0, (dksc(0,3,0))
Integral SCSI controller 1: Version Qlogic 12160
    CDROM: unit 6 on SCSI Controller 1, (cdrom(1,6,7))

-----------------------------------------------

I modified sgimips/stand/boot64/Makefile.

# diff -u Makefile.orig Makefile
--- Makefile.orig       2018-09-18 19:01:58.375814480 +0000
+++ Makefile    2018-09-18 18:53:19.402383481 +0000
@@ -3,7 +3,7 @@
 PROG=  ip30boot
 NOMAN= # defined

-SRCS=  start.S boot.c bootinfo.c conf.c devopen.c putchar.c getchar.c \
+SRCS=  start64.S boot.c bootinfo.c conf.c devopen.c putchar.c getchar.c \
        getopt.c disk.c arcbios_calls.S


@@ -39,7 +39,7 @@
 # loader plenty of breathing room.  Load the boot loader starting at
 # the second page of RAM.

-LOAD_ADDRESS_IP30?=    0xa800000020080000
+LOAD_ADDRESS_IP30?=    0xa800000001200000

 ### find out what to use for libkern
 KERN_AS=       library
@@ -77,4 +77,3 @@

 .include <bsd.klinks.mk>
 .include <bsd.prog.mk>
-

1) I was wondering why start.S compile insted of start64.S.
2) LOAD_ADDRESS_IP30? is adapted from OpenBSD.

-----------------------------------------------

Run build.sh.

# ./build.sh -j 16 -O ../obj.sgimips64 -T ../tools.sgimips64 -m
sgimips64 -U -u release
# file ip30boot
ip30boot: ELF 64-bit MSB executable, MIPS, MIPS-III version 1 (SYSV),
statically linked, not stripped

# /usr/obj.sgimips64//tools/binutils/build/binutils/size -A ip30boot
ip30boot  :
section            size                   addr
.text             46112   12105675798390767616
.text.startup      1152   12105675798390813728
.rodata            5264   12105675798390814880
.MIPS.options      2120   12105675798390820144
.MIPS.abiflags       24   12105675798390822264
.data               512   12105675798390822288
.sbss              1216   12105675798390822800
.bss                728   12105675798390824016
.pdr               5184                      0
.gnu.attributes      16                      0
.comment             33                      0
.ident               62                      0
Total             62423

-----------------------------------------------

Loading NetBSD/sgimips bootloader.

>> bootp()ip30boot
Obtaining ip30boot from server xserve
55184+1944 entry: 0xa800000001200000

A 000: *** TLB Refill Exception on node 0
A 000: *** EPC: 0xc00000001fc47e58 (0xc00000001fc47e58)
A 000: *** Press ENTER to continue.
A 000: POD IOC3 Unc> btrace
  FUNCTION:                       CALLED FROM:
    0xc00000001fc47d44              0xfffffffffffffff8
Exception terminated trace
A 000: POD IOC3 Unc>

---------------------------------------------------

Umm...
I investigate OpenBSD/sgi bootloader.

---------------------------------------------------

# file boot64
boot64: ELF 64-bit MSB relocatable, MIPS, MIPS-III version 1 (SYSV),
not stripped

# /usr/obj.sgimips64//tools/binutils/build/binutils/size -A boot64
boot64  :
section           size    addr
.text            37680       0
.MIPS.options     1640   37680
.rodata           3952       0
.rodata.str1.8    1656       0
.data              320       0
.bss              3760       0
.pdr              3616       0
.mdebug.abi64        0       0
Total            52624

---------------------------------------------------

Loading OpenBSD/sgi bootloader.

>> bootp()boot64
Obtaining boot64 from server xserve
1024+37680+3952+1656+320 entry: 0xa8000000012f4000

OpenBSD/sgi-IP27 ARCBios boot version 1.8
arg 0: bootp()boot64
arg 1: ConsoleIn=/dev/tty/ioc30
arg 2: ConsoleOut=/dev/tty/ioc30
arg 3: SystemPartition=dksc(0,1,8)
arg 4: OSLoader=sash
arg 5: OSLoadPartition=dksc(0,1,0)
arg 6: OSLoadFilename=unix
Boot: dksc(0,1,0)unix

---------------------------------------------------

It work correctly.

---------------------------------------------------

I think that Fuel's ARCBIOS cannot handle NetBSD/sgimips bootloader's
binary section.

NetBSD
55184+1944 entry: 0xa800000001200000

OpenBSD
1024+37680+3952+1656+320 entry: 0xa8000000012f4000

What is the cause of this problem.
1) ldscript
2) compile option
3) mips64 toolchain

--
Naruaki Etomi


Home | Main Index | Thread Index | Old Index