Subject: Kernel 2.6 for R4600 Indy

From: Stuart Longland <[email-masked]>
Date: Thu, 23 Sep 2004 23:54:19 +1000

Hi All,
	I've been trying to get Linux 2.6 going on my Indy for some time now.
However, I've had little success.  The machine works just fine under
Linux 2.4.26.

	The kernel config is attached.  Basically I've tried both booting a
MIPS32 kernel as well as a MIPS64 kernel.  In all cases, I've used the
same kernel parameters.  (root=/dev/hda3, and sometimes I put
init=/bin/sh or single there too.)

	Using a MIPS32 config, the kernel boots, mounts the / filesystem, but
then dies claiming it can't find /sbin/init.

	Using a MIPS64 config (built using gas-abi=o32 as suggested by Kumba),
it doesn't even get that far:

- From arcboot/SGI PROM:
(Arcboot version 0.3.8.2)
- -------------------------------8<--------------------------------------
Loading program segment 2 at 0x88002000, offset=0x0, size= 0x0 328085
Zeroing memory at 0x0032a085, size = 0x1bba3

Exception: <vector=Normal>
Status register: 0x30004803<CU1,CU0,IM7,IM4,IPL=???,MODE=KERNEL,EXL,IE>
Cause register: 0x8010<CE=0,IP8,EXC=RADE>
Exception PC: 0x830f018, Exception RA: 0x88804514
Read address error exception, bad address: 0x830f018
Local I/O interrupt register 1: 0x80 <VR/GIO2>
  Saved user regs in hex (&gpda 0xa8740e48, &_regs 0xa8741048):
  arg: a8740000 88002000 88001fe0 18
  tmp: a8740000 3 8880e0b4 830f018 8880e0b0 887fe8ec 887fe5e4 4
  sve: a8740000 3 400000 800000 16 3f80 0 10000000
  t8 a8740000 t9 ffffffff at ffffffff v0 ffffffff v1 ffffffff k1 830f018
  gp a8740000 f0 ffffffff sp ffffffff ra ffffffff

PANIC: Unexpected exception

[Press reset or ENTER to restart.]
- ------------------------------->8--------------------------------------

	Now, according to the Linux-MIPS website:
- -------------------------------8<--------------------------------------
*Self-compiled kernels crash when booting.*

When I build my own kernel, it crashes. On an Indy the crash message
looks like the following (the same problem hits other machines as well
but may look completely different):

 Exception: <vector=UTLB Miss>
 Status register: 0x300004803<CU1,CU0,IM4,IPL=???,MODE=KERNEL,EXL,IE>
 Cause register: 0x8008<CE=0,IP8,EXC=RMISS>
 Exception PC: 0x881385cc, Exception RA: 0x88002614
 exception, bad address: 0x47c4
 Local I/O interrupt register 1: 0x80 <VR/GIO2>
 Saved user regs in hex (&gpda 0xa8740e48, &_regs 0xa8741048):
   arg: 7 8bfff938 8bfffc4d 880025dc
   tmp: 8818c14c 8818c14c 10 881510c4 14 8bfad9e0 0 48
   sve: 8bfdf3e8 8bfffc40 8bfb2720 8bfff938 a8747420 9fc56394 0 9fc56394
   t8 48 t9 8bfffee66 at 1 v0 0 v1 8bfff890 k1 bad11bad
   gp 881dfd90 fp 9fc4be88 sp 8bfff8b8 ra 88002614

 PANIC: Unexpected exception

This problem is caused by a still unfixed bug in Binutils newer than
version 2.7. As a workaround, change the following line in
arch/mips/Makefile from:

       LINKFLAGS       = -static -N
to:
       LINKFLAGS       = -static
- ------------------------------->8--------------------------------------

	This looks scaringly similar to what I've already struck.  Certainly
the Status Register is almost identical.  I've also had it come up UTLB
Miss as well.

	It seems though, the fix is more illusive.  Looking at
arch/mips/Makefile, there's no LINKFLAGS line.  The closest thing I see
is LDFLAGS_vmlinux:

LDFLAGS_vmlinux                 += -G 0 -static -n

The binutils/gcc versions I'm using are cross compillers generated using
crossdev:

MIPS32 binutils:
GNU assembler 2.14.90.0.8 20040114
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `mips-unknown-linux-gnu'.

MIPS64 binutils:
GNU assembler 2.14.90.0.8 20040114
Copyright 2002 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `mips64-unknown-linux-gnu'.

MIPS32 gcc:
mips-unknown-linux-gnu-gcc (GCC) 3.3.3 20040217 (Gentoo Linux 3.3.3,
propolice-3.3-7)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

MIPS64 gcc:
mips64-unknown-linux-gnu-gcc (GCC) 3.3.3 20040217 (Gentoo Linux 3.3.3,
propolice-3.3-7)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

	Has this bug actually been fixed?  It seems the documentation here is a
little lacking as to what to change.

The machine's specs:
CPU: R4600 SC 133MHz [1]
RAM: 256MB 72pin EDO
HDD: 9.1GB IBM
OS:  Gentoo Linux/MIPS 1.4

	Apologies if this has been answered before... but I'm a bit of a newbie
when it comes to Linux/MIPS.[2]  Is there anything I missed when setting
this all up?

Reguards,
- --
+-------------------------------------------------------------+
| Stuart Longland -oOo- http://stuartl.longlandclan.hopto.org |
| Atomic Linux Project     -oOo-    http://atomicl.berlios.de |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| I haven't lost my mind - it's backed up on a tape somewhere |
+-------------------------------------------------------------+
Footnotes:
1. A brief look at the MIPS Technologies website had me thinking that
only R5k and above are 64-bit, the R4k were 32-bit.  But it seems that
these too are 64-bit capable.
2. I'll admit though... I've learned more about the innards of a
computer playing with the Indy and Qube I own then I have from the last
two years of university study.

---

From: "Stephen P. Becker" <[email-masked]>
Date: Thu, 23 Sep 2004 11:00:12 -0400

> it doesn't even get that far:

This is certainly wrong.  What you really want is gas-abi=o64.  Take a 
look at the O2 minimum patchset at http://www.total-knowledge.com, as 
the arch/mips/Makefile changes are what you need.  Using a 64-bit kernel 
on your indy is pointless unless you want to run n32 userland anyhow.

As of this moment (may change in the future), 2.4 kernels are much 
better for ip22 anyhow.  Serial console, indycam, and sound all work 
properly in 2.4.  In 2.6, serial console is broken, there is no indycam 
support, and I'm running into some issues with sound where the cpu usage 
runs way up.

Steve

---

From: Florian Lohoff <[email-masked]>
Date: Thu, 23 Sep 2004 17:48:55 +0200

> it doesn't even get that far:

There is still a lot left broken - The attached patch fixes some obvious
stuff with address space and mibs abi.

Missing is a fix for ip22zilog.c which seems to be broken. 

With this fix the machines goes userspace (reverse engineered by sound
of hard disk) but seems to die somewhere. Probably the same bug as seen
on other archs - die on first fork.

Flo
-- 
Florian Lohoff                  [email-masked]             +49-171-2280134
                        Heisenberg may have been here.
Index: arch/mips/Makefile
===================================================================
RCS file: /home/flo/linux-mips-cvs/linux/arch/mips/Makefile,v
retrieving revision 1.176
diff -u -r1.176 Makefile
--- arch/mips/Makefile	19 Sep 2004 00:15:05 -0000	1.176
+++ arch/mips/Makefile	22 Sep 2004 23:54:24 -0000
@@ -35,7 +35,7 @@
 endif
 ifdef CONFIG_MIPS64
 gcc-abi			= 64
-gas-abi			= 32
+gas-abi			= o64
 tool-prefix		= $(64bit-tool-prefix)
 UTS_MACHINE		:= mips64
 endif
@@ -107,7 +107,7 @@
 	break; \
 done; \
 if test "$(gcc-abi)" != "$(gas-abi)"; then \
-	gas_abi="-Wa,-$(gas-abi) -Wa,-mgp$(gcc-abi)"; \
+	gas_abi="-Wa,-mabi=$(gas-abi) -Wa,-mgp$(gcc-abi)"; \
 fi; \
 if test "$$gcc_opt" = -march= && test -n "$$gcc_abi"; then \
 	$(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
Index: arch/mips/lib-64/dump_tlb.c
===================================================================
RCS file: /home/flo/linux-mips-cvs/linux/arch/mips/lib-64/dump_tlb.c,v
retrieving revision 1.2
diff -u -r1.2 dump_tlb.c
--- arch/mips/lib-64/dump_tlb.c	11 Feb 2004 15:05:44 -0000	1.2
+++ arch/mips/lib-64/dump_tlb.c	23 Sep 2004 01:19:10 -0000
@@ -190,7 +190,7 @@
 	pgd = pgd_offset(current->mm, addr);
 	pmd = pmd_offset(pgd, addr);
 	pte = pte_offset(pmd, addr);
-	paddr = (KSEG1 | (unsigned int) pte_val(*pte)) & PAGE_MASK;
+	paddr = (CKSEG1 | (unsigned int) pte_val(*pte)) & PAGE_MASK;
 	paddr |= (addr & ~PAGE_MASK);
 
 	return paddr;
Index: arch/mips/mm/c-r4k.c
===================================================================
RCS file: /home/flo/linux-mips-cvs/linux/arch/mips/mm/c-r4k.c,v
retrieving revision 1.89
diff -u -r1.89 c-r4k.c
--- arch/mips/mm/c-r4k.c	24 Aug 2004 16:02:25 -0000	1.89
+++ arch/mips/mm/c-r4k.c	23 Sep 2004 01:11:27 -0000
@@ -49,7 +49,7 @@
 #define R4600_HIT_CACHEOP_WAR_IMPL					\
 do {									\
 	if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x())		\
-		*(volatile unsigned long *)KSEG1;			\
+		*(volatile unsigned long *)CKSEG1;			\
 	if (R4600_V1_HIT_CACHEOP_WAR)					\
 		__asm__ __volatile__("nop;nop;nop;nop");		\
 } while (0)
@@ -983,7 +983,7 @@
 	case CPU_R4000MC:
 	case CPU_R4400SC:
 	case CPU_R4400MC:
-		probe_scache_kseg1 = (probe_func_t) (KSEG1ADDR(&probe_scache));
+		probe_scache_kseg1 = (probe_func_t) (CKSEG1ADDR(&probe_scache));
 		sc_present = probe_scache_kseg1(config);
 		if (sc_present)
 			c->options |= MIPS_CPU_CACHE_CDEX_S;
Index: arch/mips/sgi-ip22/ip22-setup.c
===================================================================
RCS file: /home/flo/linux-mips-cvs/linux/arch/mips/sgi-ip22/ip22-setup.c,v
retrieving revision 1.39
diff -u -r1.39 ip22-setup.c
--- arch/mips/sgi-ip22/ip22-setup.c	20 Aug 2004 10:03:22 -0000	1.39
+++ arch/mips/sgi-ip22/ip22-setup.c	23 Sep 2004 00:56:44 -0000
@@ -76,7 +76,7 @@
 #endif
 
 	/* Set EISA IO port base for Indigo2 */
-	set_io_port_base(KSEG1ADDR(0x00080000));
+	set_io_port_base(CKSEG1ADDR(0x00080000));
 
 	/* ARCS console environment variable is set to "g?" for
 	 * graphics console, it is set to "d" for the first serial
Index: drivers/net/sgiseeq.c
===================================================================
RCS file: /home/flo/linux-mips-cvs/linux/drivers/net/sgiseeq.c,v
retrieving revision 1.61
diff -u -r1.61 sgiseeq.c
--- drivers/net/sgiseeq.c	31 Jul 2004 01:47:50 -0000	1.61
+++ drivers/net/sgiseeq.c	23 Sep 2004 01:02:06 -0000
@@ -169,7 +169,7 @@
 			buffer = (unsigned long) kmalloc(PKT_BUF_SZ, GFP_KERNEL);
 			if (!buffer)
 				return -ENOMEM;
-			sp->tx_desc[i].buf_vaddr = KSEG1ADDR(buffer);
+			sp->tx_desc[i].buf_vaddr = CKSEG1ADDR(buffer);
 			sp->tx_desc[i].tdma.pbuf = CPHYSADDR(buffer);
 		}
 		sp->tx_desc[i].tdma.cntinfo = TCNTINFO_INIT;
@@ -183,7 +183,7 @@
 			buffer = (unsigned long) kmalloc(PKT_BUF_SZ, GFP_KERNEL);
 			if (!buffer)
 				return -ENOMEM;
-			sp->rx_desc[i].buf_vaddr = KSEG1ADDR(buffer);
+			sp->rx_desc[i].buf_vaddr = CKSEG1ADDR(buffer);
 			sp->rx_desc[i].rdma.pbuf = CPHYSADDR(buffer);
 		}
 		sp->rx_desc[i].rdma.cntinfo = RCNTINFO_INIT;
@@ -374,7 +374,7 @@
 	 */
 	while ((td->tdma.cntinfo & (HPCDMA_XIU | HPCDMA_ETXD)) ==
 	      (HPCDMA_XIU | HPCDMA_ETXD))
-		td = (struct sgiseeq_tx_desc *)(long) KSEG1ADDR(td->tdma.pnext);
+		td = (struct sgiseeq_tx_desc *)(long) CKSEG1ADDR(td->tdma.pnext);
 	if (td->tdma.cntinfo & HPCDMA_XIU) {
 		hregs->tx_ndptr = CPHYSADDR(td);
 		hregs->tx_ctrl = HPC3_ETXCTRL_ACTIVE;
@@ -671,11 +671,11 @@
 	sp->mode = SEEQ_RCMD_RBCAST;
 
 	sp->rx_desc = (struct sgiseeq_rx_desc *)
-	              KSEG1ADDR(ALIGNED(&sp->srings->rxvector[0]));
+	              CKSEG1ADDR(ALIGNED(&sp->srings->rxvector[0]));
 	dma_cache_wback_inv((unsigned long)&sp->srings->rxvector,
 	                    sizeof(sp->srings->rxvector));
 	sp->tx_desc = (struct sgiseeq_tx_desc *)
-	              KSEG1ADDR(ALIGNED(&sp->srings->txvector[0]));
+	              CKSEG1ADDR(ALIGNED(&sp->srings->txvector[0]));
 	dma_cache_wback_inv((unsigned long)&sp->srings->txvector,
 	                    sizeof(sp->srings->txvector));
 
Index: drivers/video/console/newport_con.c
===================================================================
RCS file: /home/flo/linux-mips-cvs/linux/drivers/video/console/newport_con.c,v
retrieving revision 1.9
diff -u -r1.9 newport_con.c
--- drivers/video/console/newport_con.c	6 Aug 2004 00:33:29 -0000	1.9
+++ drivers/video/console/newport_con.c	23 Sep 2004 01:21:54 -0000
@@ -290,7 +290,7 @@
 
 	if (!sgi_gfxaddr)
 		return NULL;
-	npregs = (struct newport_regs *) (KSEG1 + sgi_gfxaddr);
+	npregs = (struct newport_regs *) (CKSEG1ADDR(sgi_gfxaddr));
 	npregs->cset.config = NPORT_CFG_GD0;
 
 	if (newport_wait()) {
Index: include/asm-mips/addrspace.h
===================================================================
RCS file: /home/flo/linux-mips-cvs/linux/include/asm-mips/addrspace.h,v
retrieving revision 1.13
diff -u -r1.13 addrspace.h
--- include/asm-mips/addrspace.h	30 Nov 2003 01:52:25 -0000	1.13
+++ include/asm-mips/addrspace.h	23 Sep 2004 01:08:48 -0000
@@ -38,16 +38,6 @@
 #endif
 
 /*
- * Memory segments (32bit kernel mode addresses)
- * These are the traditional names used in the 32-bit universe.
- */
-#define KUSEG			0x00000000
-#define KSEG0			0x80000000
-#define KSEG1			0xa0000000
-#define KSEG2			0xc0000000
-#define KSEG3			0xe0000000
-
-/*
  * Returns the kernel segment base of a given address
  */
 #define KSEGX(a)		((_ACAST32_ (a)) & 0xe0000000)
@@ -58,18 +48,7 @@
 #define CPHYSADDR(a)		((_ACAST32_ (a)) & 0x1fffffff)
 #define XPHYSADDR(a)            ((_ACAST64_ (a)) & 0x000000ffffffffff)
 
-/*
- * Map an address to a certain kernel segment
- */
-#define KSEG0ADDR(a)		(CPHYSADDR(a) | KSEG0)
-#define KSEG1ADDR(a)		(CPHYSADDR(a) | KSEG1)
-#define KSEG2ADDR(a)		(CPHYSADDR(a) | KSEG2)
-#define KSEG3ADDR(a)		(CPHYSADDR(a) | KSEG3)
-
-#define CKSEG0ADDR(a)		(CPHYSADDR(a) | CKSEG0)
-#define CKSEG1ADDR(a)		(CPHYSADDR(a) | CKSEG1)
-#define CKSEG2ADDR(a)		(CPHYSADDR(a) | CKSEG2)
-#define CKSEG3ADDR(a)		(CPHYSADDR(a) | CKSEG3)
+#ifdef CONFIG_MIPS64
 
 /*
  * Memory segments (64bit kernel mode addresses)
@@ -85,6 +64,44 @@
 #define CKSSEG			0xffffffffc0000000
 #define CKSEG3			0xffffffffe0000000
 
+#define CKSEG0ADDR(a)		(CPHYSADDR(a) | CKSEG0)
+#define CKSEG1ADDR(a)		(CPHYSADDR(a) | CKSEG1)
+#define CKSEG2ADDR(a)		(CPHYSADDR(a) | CKSEG2)
+#define CKSEG3ADDR(a)		(CPHYSADDR(a) | CKSEG3)
+
+#else
+
+#define CKSEG0ADDR(a)		(CPHYSADDR(a) | KSEG0)
+#define CKSEG1ADDR(a)		(CPHYSADDR(a) | KSEG1)
+#define CKSEG2ADDR(a)		(CPHYSADDR(a) | KSEG2)
+#define CKSEG3ADDR(a)		(CPHYSADDR(a) | KSEG3)
+
+/*
+ * Map an address to a certain kernel segment
+ */
+#define KSEG0ADDR(a)		(CPHYSADDR(a) | KSEG0)
+#define KSEG1ADDR(a)		(CPHYSADDR(a) | KSEG1)
+#define KSEG2ADDR(a)		(CPHYSADDR(a) | KSEG2)
+#define KSEG3ADDR(a)		(CPHYSADDR(a) | KSEG3)
+
+/*
+ * Memory segments (32bit kernel mode addresses)
+ * These are the traditional names used in the 32-bit universe.
+ */
+#define KUSEG			0x00000000
+#define KSEG0			0x80000000
+#define KSEG1			0xa0000000
+#define KSEG2			0xc0000000
+#define KSEG3			0xe0000000
+
+#define CKUSEG			0x00000000
+#define CKSEG0			0x80000000
+#define CKSEG1			0xa0000000
+#define CKSEG2			0xc0000000
+#define CKSEG3			0xe0000000
+
+#endif
+
 /*
  * Cache modes for XKPHYS address conversion macros
  */
Index: include/asm-mips/r4kcache.h
===================================================================
RCS file: /home/flo/linux-mips-cvs/linux/include/asm-mips/r4kcache.h,v
retrieving revision 1.22
diff -u -r1.22 r4kcache.h
--- include/asm-mips/r4kcache.h	5 Jan 2004 01:56:01 -0000	1.22
+++ include/asm-mips/r4kcache.h	23 Sep 2004 01:09:47 -0000
@@ -26,7 +26,7 @@
  *  - We need a properly sign extended address for 64-bit code.  To get away
  *    without ifdefs we let the compiler do it by a type cast.
  */
-#define INDEX_BASE	((int) KSEG0)
+#define INDEX_BASE	CKSEG0
 
 #define cache_op(op,addr)						\
 	__asm__ __volatile__(						\
--- include/asm-mips/mach-ip22/spaces.h	2004-09-21 12:59:52.000000000 +0200
+++ include/asm-mips/mach-ip22/spaces.h	2004-09-23 01:52:01.000000000 +0200
@@ -0,0 +1,55 @@
+/*
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1994 - 1999, 2000, 03, 04 Ralf Baechle
+ * Copyright (C) 2000, 2002  Maciej W. Rozycki
+ * Copyright (C) 1990, 1999, 2000 Silicon Graphics, Inc.
+ */
+#ifndef _ASM_MACH_SPACES_H
+#define _ASM_MACH_SPACES_H
+
+#include <linux/config.h>
+
+#ifdef CONFIG_MIPS32
+
+#define CAC_BASE		0x80000000
+#define IO_BASE			0xa0000000
+#define UNCAC_BASE		0xa0000000
+#define MAP_BASE		0xc0000000
+
+/*
+ * This handles the memory map.
+ * We handle pages at KSEG0 for kernels with 32 bit address space.
+ */
+#define PAGE_OFFSET		0x80000000UL
+
+/*
+ * Memory above this physical address will be considered highmem.
+ */
+#ifndef HIGHMEM_START
+#define HIGHMEM_START		0x20000000UL
+#endif
+
+#endif /* CONFIG_MIPS32 */
+
+#ifdef CONFIG_MIPS64
+#define PAGE_OFFSET	0xffffffff80000000UL
+
+#ifndef HIGHMEM_START
+#define HIGHMEM_START		(1UL << 59UL)
+#endif
+
+#define CAC_BASE		0xffffffff80000000
+#define IO_BASE			0xffffffffa0000000
+#define UNCAC_BASE		0xffffffffa0000000
+#define MAP_BASE		0xffffffffc0000000
+
+#define TO_PHYS(x)		(             ((x) & TO_PHYS_MASK))
+#define TO_CAC(x)		(CAC_BASE   | ((x) & TO_PHYS_MASK))
+#define TO_UNCAC(x)		(UNCAC_BASE | ((x) & TO_PHYS_MASK))
+
+#endif /* CONFIG_MIPS64 */
+
+#endif /* __ASM_MACH_GENERIC_SPACES_H */

---

From: Stuart Longland <[email-masked]>
Date: Fri, 24 Sep 2004 10:16:37 +1000

> on your indy is pointless unless you want to run n32 userland anyhow.

Ahh yes... sorry, it was after midnight (GMT+10) and my mind must've
been elsewhere -- I meant o64.  I was planning on moving to either n32
or n64 userland eventually, but I won't do that unless I can get a
64-bit kernel going.

> support, and I'm running into some issues with sound where the cpu usage

Right.  Luckily I've got a framebuffer that Linux can talk to and I
haven't got an indycam.  But the sound issue may be a problem, I was
thinking at one point to use this box as a jukebox, but at the moment
I'm experimenting with mips64 to see what it can do.

I'll have a look at those patches & the O2 documentation, that should
give me some leads into sorting out the issue.  It would be nice to see
if I can squeeze better performance out of the aging beast.
- --
+-------------------------------------------------------------+
| Stuart Longland -oOo- http://stuartl.longlandclan.hopto.org |
| Atomic Linux Project     -oOo-    http://atomicl.berlios.de |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| I haven't lost my mind - it's backed up on a tape somewhere |
+-------------------------------------------------------------+

---

From: Florian Lohoff <[email-masked]>
Date: Fri, 24 Sep 2004 11:07:03 +0200

> or n64 userland eventually, but I won't do that unless I can get a

The 64 bit kernel should work so far - With the ip22zilog.c fixes
tsbogend just committed the console begins to work again.

Includeing the patch i sent earlier my R5k Indy boots fine a 64bit
current cvs head and goes into userspace. 

Using the "soo to be" rtc and statfs64 fixes everything seems to be
fine for o32 userspace.

Flo

---

From: "Stephen P. Becker" <[email-masked]>
Date: Fri, 24 Sep 2004 09:05:17 -0400

> or n64 userland eventually, but I won't do that unless I can get a

Heh...I hope you are prepared for a significant slowdown if you end up 
trying to run n64 userland on such a machine.

Steve

---

From: Robin Humble <[email-masked]>
Date: Fri, 24 Sep 2004 09:17:34 -0400

>trying to run n64 userland on such a machine.

why's that?

cheers,
robin

---

From: "Stephen P. Becker" <[email-masked]>
Date: Fri, 24 Sep 2004 09:27:44 -0400

>>trying to run n64 userland on such a machine.

Mostly, 64-bit binaries are much larger than 32-bit.  Consider that the 
scsi controller in an Indy gets about 2mb/sec throughput MAX (on a good 
day).  Also, Indys don't support a large enough memory configuration 
that 64-bit would be worth it anyhow.

What you would *really* want on such a machine would be n32 userland. 
You get full 64-bit instructions, but the binaries aren't huge.

Steve

---

From: Robin Humble <[email-masked]>
Date: Fri, 24 Sep 2004 09:43:34 -0400

>scsi controller in an Indy gets about 2mb/sec throughput MAX (on a good 

/usr/bin/e* on i386 vs x86_64 is 17432 vs 12440 kB => about 40% bigger.
so indeed that's a fair bit larger :-)

I didn't think it was quite as bad as 2MB/s though, maybe 4. I'll dig my
Indys out of storage and give them a whirl.

>that 64-bit would be worth it anyhow.

indeed they don't.
do you get access to more registers or more efficient instruction sets
like you do on x86_64?

>You get full 64-bit instructions, but the binaries aren't huge.

fair enough.

cheers,
robin

---

From: "Stephen P. Becker" <[email-masked]>
Date: Fri, 24 Sep 2004 11:13:18 -0400

>>You get full 64-bit instructions, but the binaries aren't huge.

Yeah, that is what n32 is for.  You get more registers, but pointers are 
still 32-bit.  You still need a mips64 CHOST to build n32 binaries, however.

Steve

---

From: Stuart Longland <[email-masked]>
Date: Sat, 25 Sep 2004 01:42:50 +1000

> Using the "soo to be" rtc and statfs64 fixes everything seems to be

Tried the patch, for some reason 'patch' couldn't find some of the
files, and was expecting me to enter the paths in by hand... but once I
did that, it applied cleanly[1].

I still get much the same message from the PROM though:
- -------------------------------8<--------------------------------------
arcsboot: ARCS Linux ext2fs loader 0.3.8.2

Loading new from scsi(0)disk(1)rdisk(0)partition(0)
Allocated 0xe0 bytes for segments
Loading 64-bit executable
Loading program segment 2 at 0x88004000, offset=0x0 4000, size = 0x0 35b140
Loading program segment 3 at 0x88360020, offset=0x0 360020, size= 0x0 1c065
Zeroing memory at 0x8837c085 size = 0x21feb

Exception: <vector=Normal>
Status register: 0x30004803<CU1,CU0,IM7,IM4,IPL=???,MODE=KERNEL,EXL,IE>
Cause register: 0x8010<CE=0,IP8,EXC=RADE>
Exception PC: 0x830f018, Exception RA: 0x88804514
Read address error exception, bad address: 0x830f018
Local I/O interrupt register 1: 0x80 <VR/GIO2>
  Saved user regs in hex (&gpda 0xa8740e48, &_regs 0xa8741048):
  arg: a8740000 88002000 88001fe0 18
  tmp: a8740000 2 8880e0b4 8360020 8880e0b0 887fe53c 887fe234 9fc55064
  sve: a8740000 3 400000 8000000 16 3f80 0 10000000
  t8 a8740000 t9 ffffffff at ffffffff v0 ffffffff v1 ffffffff k1 8360020
  gp a8740000 f0 ffffffff sp ffffffff ra ffffffff

Bypassing arcboot, I get:
- -------------------------------8<--------------------------------------
>> boot -f newlinux root=/dev/sda3

Status register: 0x30004803<CU1,CU0,IM7,IM4,IPL=???,MODE=KERNEL,EXL,IE>
Cause register: 0x8008<CE=0,IP8,EXC=RMISS>
Exception PC: 0x9fc31644, Exception RA: 0x9fc3161c
exception, bad address: 0x8
Local I/O interrupt register 1: 0x80 <VR/GIO2>
  Saved user regs in hex (&gpda 0xa8740e48, &_regs 0xa8741048):
  arg: a8740000 0 0 887fe878
  tmp: a8740000 0 887fec2c 2d 887fe8d8 887fec20 a8746d10 9fc55064
  sve: a8740000 3 400000 8000000 16 3f80 0 10000000
  t8 a8740000 t9 ffffffff at ffffffff v0 ffffffff v1 ffffffff k1 0
  gp a8740000 f0 ffffffff sp ffffffff ra ffffffff

The latter one is very much like the one mentioned on the website I
quoted earlier... but as I mentioned then, the fix doesn't seem to apply
to the latest code.

I can't rule out it being something with my config though.  Has someone
got a working config for mips64 on this class of machine?  (even a
binary)  Seeing as it works on R5k, could we be dealing with an R4x00
bug here?
- --
+-------------------------------------------------------------+
| Stuart Longland -oOo- http://stuartl.longlandclan.hopto.org |
| Atomic Linux Project     -oOo-    http://atomicl.berlios.de |
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
| I haven't lost my mind - it's backed up on a tape somewhere |
+-------------------------------------------------------------+
1. except the Makefile and spaces.h files... it for some reason tried
patching linux/{Makefile,spaces.h} not linux/arch/... etc...

---

From: Florian Lohoff <[email-masked]>
Date: Fri, 24 Sep 2004 18:44:30 +0200

> did that, it applied cleanly[1].

The last file has a bogus path (Hand crafted patch) and needs the first 
path element removed IIRC.

> PANIC: Unexpected exception

This should be a crash in free_bootmem_core because of the non correct
spaces.h

Flo

---

From: Ladislav Michl <[email-masked]>
Date: Thu, 23 Sep 2004 16:51:08 +0200

> (Arcboot version 0.3.8.2)

If that's more than two hours old CVS kernel then it's my fault, already fixed.
[snip]

> when it comes to Linux/MIPS.[2]  Is there anything I missed when setting

We have both Indy and O2 running there, but you'll have to wait a bit
until patches appear in CVS.

Regards,
	ladis