Subject: compiling mips/locore_r4000.S
To: None <port-pmax@NetBSD.ORG>
From: Albert Chin-A-Young <china@lystra.org>
List: port-pmax
Date: 04/21/1998 22:27:34
I'm running 1.3.1 and pulled down the latest /usr/src/sys last night
to try and build -current. I have the following error when compiling
arch/mips/mips/locore_r4000.S:

taod% make
cc -x assembler-with-cpp -traditional-cpp -D_LOCORE -I.
-I../../../../arch -I../../../.. -nostdinc -DMIPS1 -DMIPS3 -DDDB
-DDDB_ONPANIC="0" -DCOMPAT_43 -DKTRACE -DNKMEMCLUSTERS=1024 -DNTP
-DFIFO -DNFSSERVER -DQUOTA -DINET -DGATEWAY -DMULTICAST -DCOMPAT_12
-DCOMPAT_13 -DCOMPAT_ULTRIX -DHZ=256 -DMAXUSERS=64 -D_KERNEL
-D__pmax__ -Dpmax -G 0 -c ../../../../arch/mips/mips/locore.S
../../../../arch/mips/mips/locore_r4000.S: Assembler messages:
../../../../arch/mips/mips/locore_r4000.S:2304: Error: illegal operands `mfc0'
../../../../arch/mips/mips/locore_r4000.S:2321: Error: illegal operands `mfc0'
../../../../arch/mips/mips/locore_r4000.S:2335: Error: illegal operands `mtc0'

The reason for the errors is that MIPS_COP_0_COMPARE and
MIPS_COP_0_COUNT are not defined in arch/mips/include/cpuregs.h.
Removing the functions using these variables got locore_r4000.S to
compile. Then the final link showed that dec_3min.c and machdep.c used
mips3_cycle_count (part of locore_r4000.S). Uh oh :) As I don't have a
3MIN, I put mips3_cycle_count back in with some 'nop's.

Next was a problem with arch/pmax/tc/asic.c. The following diff fixed
the problem:

*** asic.c.orig	Sun Apr 19 06:11:49 1998
--- asic.c	Tue Apr 21 21:25:36 1998
***************
*** 94,104 ****
  #endif /* DEC_MAXINE */
  
  #if defined(DEC_3MAX)
! struct ioasic_dev kn02_ioasic_devs[] = {
  /* 0 */	{ "dc",		0x200000, 0, C(7), },
! /* 0 */	{ "mc146818",	0x280000, 0, C(0), },
! const int n3max_ioasic_devs  =  ARRAY_SIZEOF(3max_ioasic_devs);
  };
  #endif /* DEC_3MAX */
  #endif /* pmax */
  
--- 94,104 ----
  #endif /* DEC_MAXINE */
  
  #if defined(DEC_3MAX)
! struct ioasicdev_attach_args kn02_ioasic_devs[] = {
  /* 0 */	{ "dc",		0x200000, 0, C(7), },
! /* 1 */	{ "mc146818",	0x280000, 0, C(0), },
  };
+ const int nkn02_ioasic_devs  =  ARRAY_SIZEOF(kn02_ioasic_devs);
  #endif /* DEC_3MAX */
  #endif /* pmax */
  
I also had to comment out, from the arch/pmax/conf/GENERIC file:
	options DEC_5100
	include "arch/pmax/conf/builtin.5100"

With that I achieved a successful compile on the 5000/260 under 1.3.1.
Now, let's see if it boots!

-- 
albert chin (china@lystra.org)			NeXTMail accepted