CVS commit: [netbsd-6] src/sys/arch/x68k/stand

2012-11-24 Thread Julian Coleman
Module Name:src
Committed By:   jdc
Date:   Sat Nov 24 20:20:29 UTC 2012

Modified Files:
src/sys/arch/x68k/stand/boot [netbsd-6]: dp8390.c dp8390.h if_ne.c ne.c
src/sys/arch/x68k/stand/boot_ufs [netbsd-6]: boot.S
src/sys/arch/x68k/stand/libsa [netbsd-6]: clock.c sdcd.c
src/sys/arch/x68k/stand/netboot [netbsd-6]: Makefile boot.c conf.c
src/sys/arch/x68k/stand/xxboot [netbsd-6]: boot.S bootmain.c version
xx.c
src/sys/arch/x68k/stand/xxboot/cdboot_cd9660 [netbsd-6]: Makefile
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1 [netbsd-6]: Makefile
src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2 [netbsd-6]: Makefile
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1 [netbsd-6]: Makefile
src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2 [netbsd-6]: Makefile
Removed Files:
src/sys/arch/x68k/stand/bootlogo [netbsd-6]: MANIFEST netbsd.xpm
setbootimg.c xpm2bootimg.c

Log Message:
Pull up revisions:
  src/sys/arch/x68k/stand/boot_ufs/boot.S revision 1.10
  src/sys/arch/x68k/stand/boot/dp8390.c revision 1.2
  src/sys/arch/x68k/stand/boot/dp8390.h revision 1.2
  src/sys/arch/x68k/stand/boot/if_ne.c revision 1.2
  src/sys/arch/x68k/stand/boot/ne.c revision 1.2
  src/sys/arch/x68k/stand/libsa/clock.c revision 1.2
  src/sys/arch/x68k/stand/netboot/Makefile revision 1.2
  src/sys/arch/x68k/stand/netboot/boot.c revision 1.2
  src/sys/arch/x68k/stand/netboot/conf.c revision 1.2
  src/sys/arch/x68k/stand/bootlogo/MANIFEST delete
  src/sys/arch/x68k/stand/bootlogo/netbsd.xpm delete
  src/sys/arch/x68k/stand/bootlogo/setbootimg.c delete
  src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c delete
  src/sys/arch/x68k/stand/xxboot/boot.S revisions 1.2,1.3
  src/sys/arch/x68k/stand/xxboot/bootmain.c revisions 1.2,1.3,1.4
  src/sys/arch/x68k/stand/xxboot/xx.c revision 1.2
  src/sys/arch/x68k/stand/xxboot/xxboot_ffsv1/Makefile revisions 1.2,1.3,1.4
  src/sys/arch/x68k/stand/xxboot/xxboot_ffsv2/Makefile revisions 1.2,1.3,1.4
  src/sys/arch/x68k/stand/xxboot/xxboot_lfsv1/Makefile revisions 1.2,1.3,1.4
  src/sys/arch/x68k/stand/xxboot/xxboot_lfsv2/Makefile revisions 1.2,1.3,1.4
  src/sys/arch/x68k/stand/xxboot/version revision 1.2
  src/sys/arch/x68k/stand/xxboot/cdboot_cd9660/Makefile revision 1.2
  src/sys/arch/x68k/stand/libsa/sdcd.c revision 1.14
(requested by tsutsui in ticket #707).

Fix typo in comment. s/d1/d0/

Remove my local RCS IDs.

Remove x68k/stand/bootlogo/ directory.
It was a tool before the bootloader becomes multi-stage (>10 years ago),
and it does not work anymore today.

Pull fixes in comments from x68k/stand/boot_ufs/boot.S rev 1.9 and 1.10.

Use a correct function name in .globl decl.

- fix comments
- use proper uintNN_t types
- use ANSI function decls
- remove unnecessary function decl
- remove __P()
- misc KNF and cosmetics

- use declarations in 
- remove __P() and some KNF
- remove extern variable decl
- use uintNN_t type

Set *file for FS_OPS() pathname properly in devopen().
Now bootxx_ffsv1 (and other bootxx ufs variants) work properly.

XXX: cd9660_open() in sys/lib/libsa/cd9660.c seems to open a file in
 the first entry of root directory if specified path is empty.
 Not sure if it's intentional behavoir.

Appease warning "nbmake: ${TOUCHPROG} expands to empty string".

Fix previous; no need to echo dummy command.

Make xxboot for ufs variants actually functional:
- set bootdev properly even on SCSI HD and floppy boot
  per SDBOOT/FDBOOT/CDBOOT defines in each Makefile
- always print xxboot name and version
- use IOCS PRINT calls instead of printf to avoid size overflow in DEBUG case
- wrap debug stuff with #ifdef XXBOOT_DEBUG
- bump version to denote changes
Mostly taken from old boot_ufs.

XXX: xxboot_lfs[12] are untested.

Make sure to initialize partition offset in cdopen(),
i.e. fix an uninitialized auto variable which happened
to be zero on XM6i emulator.

Now cdboot also works on real X68030.


To generate a diff of this commit:
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/arch/x68k/stand/boot/dp8390.c \
src/sys/arch/x68k/stand/boot/dp8390.h \
src/sys/arch/x68k/stand/boot/if_ne.c src/sys/arch/x68k/stand/boot/ne.c
cvs rdiff -u -r1.9 -r1.9.10.1 src/sys/arch/x68k/stand/boot_ufs/boot.S
cvs rdiff -u -r1.1 -r0 src/sys/arch/x68k/stand/bootlogo/MANIFEST \
src/sys/arch/x68k/stand/bootlogo/netbsd.xpm
cvs rdiff -u -r1.4 -r0 src/sys/arch/x68k/stand/bootlogo/setbootimg.c
cvs rdiff -u -r1.5 -r0 src/sys/arch/x68k/stand/bootlogo/xpm2bootimg.c
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/arch/x68k/stand/libsa/clock.c
cvs rdiff -u -r1.11.8.1 -r1.11.8.2 src/sys/arch/x68k/stand/libsa/sdcd.c
cvs rdiff -u -r1.2.2.2 -r1.2.2.3 src/sys/arch/x68k/stand/netboot/Makefile \
src/sys/arch/x68k/stand/netboot/boot.c \
src/sys/arch/x68k/stand/netboot/conf.c
cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/sys/arch/x68k/stand/xxboot/boot.S
cvs rdiff -u -r1.4.2.2 -r1.4.2.3 src/sys/arch/x68k/stand/xxboot/bootmain.c
cvs rdiff -u -r1.

CVS commit: [netbsd-6] src/sys/arch/x68k/stand/mboot

2012-04-09 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Apr  9 18:10:10 UTC 2012

Modified Files:
src/sys/arch/x68k/stand/mboot [netbsd-6]: mboot.c

Log Message:
Pull up following revision(s) (requested by isaki in ticket #172):
sys/arch/x68k/stand/mboot/mboot.c: revision 1.11
sys/arch/x68k/stand/mboot/mboot.c: revision 1.12
Print my progname in error messages.
It makes easy to find who displayed it.
Oops, One more message.


To generate a diff of this commit:
cvs rdiff -u -r1.9.8.1 -r1.9.8.2 src/sys/arch/x68k/stand/mboot/mboot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x68k/stand/mboot/mboot.c
diff -u src/sys/arch/x68k/stand/mboot/mboot.c:1.9.8.1 src/sys/arch/x68k/stand/mboot/mboot.c:1.9.8.2
--- src/sys/arch/x68k/stand/mboot/mboot.c:1.9.8.1	Mon Apr  9 18:08:31 2012
+++ src/sys/arch/x68k/stand/mboot/mboot.c	Mon Apr  9 18:10:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mboot.c,v 1.9.8.1 2012/04/09 18:08:31 riz Exp $	*/
+/*	$NetBSD: mboot.c,v 1.9.8.2 2012/04/09 18:10:10 riz Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@ bootmain(int scsiid)
 		return 0;
 
 	if (IOCS_S_READCAP(scsiid, &cap) < 0) {
-		IOCS_B_PRINT("Error in reading.\r\n");
+		IOCS_B_PRINT(BOOT ": Error in reading.\r\n");
 		return 0;
 	}
 	size = cap.size >> 9;
@@ -58,12 +58,12 @@ bootmain(int scsiid)
 	{
 		long *label = (void*) 0x3000;
 		if (IOCS_S_READ(0, 1, scsiid, size, label) < 0) {
-			IOCS_B_PRINT("Error in reading.\r\n");
+			IOCS_B_PRINT(BOOT ": Error in reading.\r\n");
 			return 0;
 		}
 		if (label[0] != 0x58363853 ||
 		label[1] != 0x43534931) {
-			IOCS_B_PRINT("Invalid disk.\r\n");
+			IOCS_B_PRINT(BOOT ": Invalid disk.\r\n");
 			return 0;
 		}
 	}
@@ -74,12 +74,12 @@ bootmain(int scsiid)
 		unsigned char *t;
 
 		if (IOCS_S_READ(2<<(2-size), size?2:1, scsiid, size, label) < 0) {
-			IOCS_B_PRINT("Error in reading.\r\n");
+			IOCS_B_PRINT(BOOT ": Error in reading.\r\n");
 			return 0;
 		}
 		t = label->dosparts[0].dp_typname;
 		if (t[0] != 'X' || t[1] != '6' || t[2] != '8' || t[3] != 'K') {
-			IOCS_B_PRINT("Invalid disk.\r\n");
+			IOCS_B_PRINT(BOOT ": Invalid disk.\r\n");
 			return 0;
 		}
 
@@ -108,11 +108,11 @@ bootmain(int scsiid)
 		   size,
 		   (void*) 0x2400);
 			if (r < 0) {
-IOCS_B_PRINT ("Error in reading.\r\n");
+IOCS_B_PRINT(BOOT ": Error in reading.\r\n");
 return 0;
 			}
 			if (*((char*) 0x2400) != 0x60) {
-IOCS_B_PRINT("Invalid disk.\r\n");
+IOCS_B_PRINT(BOOT ": Invalid disk.\r\n");
 return 0;
 			}
 			__asm volatile ("movl %0,%%d4\n\t"
@@ -123,7 +123,7 @@ bootmain(int scsiid)
   : "d4");
 			return 0;
 		}
-		IOCS_B_PRINT ("No bootable partition.\r\n");
+		IOCS_B_PRINT(BOOT ": No bootable partition.\r\n");
 		return 0;
 	}
 



CVS commit: [netbsd-6] src/sys/arch/x68k/stand

2012-04-09 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Mon Apr  9 18:08:32 UTC 2012

Modified Files:
src/sys/arch/x68k/stand [netbsd-6]: Makefile
src/sys/arch/x68k/stand/mboot [netbsd-6]: Makefile mboot.c

Log Message:
Pull up following revision(s) (requested by isaki in ticket #171):
sys/arch/x68k/stand/mboot/mboot.c: revision 1.10
sys/arch/x68k/stand/mboot/Makefile: revision 1.16
sys/arch/x68k/stand/Makefile: revision 1.9
Use common library libiocs.a.  suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
  its expansion corrupted (from somewhere after branching netbsd-5).
  This solves PR#46293 by using the common library.
  This problem was reported by Y.Sugahara at NetBSD booth at
  Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
  IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.
mboot now depends on libiocs. noticed by tsutsui@.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.8.162.1 src/sys/arch/x68k/stand/Makefile
cvs rdiff -u -r1.15 -r1.15.20.1 src/sys/arch/x68k/stand/mboot/Makefile
cvs rdiff -u -r1.9 -r1.9.8.1 src/sys/arch/x68k/stand/mboot/mboot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/x68k/stand/Makefile
diff -u src/sys/arch/x68k/stand/Makefile:1.8 src/sys/arch/x68k/stand/Makefile:1.8.162.1
--- src/sys/arch/x68k/stand/Makefile:1.8	Sun Jan 27 01:07:00 2002
+++ src/sys/arch/x68k/stand/Makefile	Mon Apr  9 18:08:32 2012
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.8 2002/01/27 01:07:00 minoura Exp $
+#	$NetBSD: Makefile,v 1.8.162.1 2012/04/09 18:08:32 riz Exp $
 
-SUBDIR= mboot newdisk aout2hux libdos libiocs .WAIT loadbsd # common
-SUBDIR+= libsa .WAIT boot boot_ufs boot_ustar installboot
+SUBDIR= newdisk aout2hux libdos libiocs .WAIT loadbsd # common
+SUBDIR+= libsa .WAIT mboot boot boot_ufs boot_ustar installboot
 
 .include 

Index: src/sys/arch/x68k/stand/mboot/Makefile
diff -u src/sys/arch/x68k/stand/mboot/Makefile:1.15 src/sys/arch/x68k/stand/mboot/Makefile:1.15.20.1
--- src/sys/arch/x68k/stand/mboot/Makefile:1.15	Mon Jan 12 07:56:31 2009
+++ src/sys/arch/x68k/stand/mboot/Makefile	Mon Apr  9 18:08:31 2012
@@ -1,4 +1,7 @@
-#	$NetBSD: Makefile,v 1.15 2009/01/12 07:56:31 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.15.20.1 2012/04/09 18:08:31 riz Exp $
+
+NOMAN=		# defined
+.include 
 
 BOOT=		mboot
 VERSION=	0.1
@@ -10,7 +13,6 @@ TEXTSZ=		1024
 PROG=		${BOOT}
 BINDIR=		/usr/mdec
 BINMODE=	444
-NOMAN=		# defined
 STRIPFLAG=
 
 STRIP?=		/usr/bin/strip
@@ -20,17 +22,19 @@ KERN!=		cd ${.CURDIR}/../../../..; pwd
 
 CPPFLAGS+=	-D_STANDALONE
 CPPFLAGS+=	-nostdinc -I${KERN} -I${.CURDIR} -I.
-#CPPFLAGS+=	-I${.CURDIR}/../libiocs
+CPPFLAGS+=	-I${.CURDIR}/../libiocs
 CPPFLAGS+=	-DTEXTADDR="0x${TEXT}" 
 CPPFLAGS+=	-DBOOT=\"${BOOT}\" -DBOOT_VERS=\"${VERSION}\"
 CFLAGS=		-Wno-main -Os -m68000
 
 LINKFLAGS=	-N -static -Ttext ${TEXT}
+LIBIOCS!=	cd ${.CURDIR}/../libiocs && ${PRINTOBJDIR}
+LDLIBS+=	${LIBIOCS}/libiocs.a
 
 .include "../Makefile.booters"
 
 realall: ${PROG}
-${BOOT}:	${OBJS}
+${BOOT}:	${OBJS} ${LDLIBS}
 	${_MKTARGET_LINK}
 	${LD} ${LINKFLAGS} -o ${BOOT}.x ${OBJS} ${LDLIBS}
 #	${STRIP} ${BOOT}.x

Index: src/sys/arch/x68k/stand/mboot/mboot.c
diff -u src/sys/arch/x68k/stand/mboot/mboot.c:1.9 src/sys/arch/x68k/stand/mboot/mboot.c:1.9.8.1
--- src/sys/arch/x68k/stand/mboot/mboot.c:1.9	Sat Oct  1 15:59:01 2011
+++ src/sys/arch/x68k/stand/mboot/mboot.c	Mon Apr  9 18:08:31 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mboot.c,v 1.9 2011/10/01 15:59:01 chs Exp $	*/
+/*	$NetBSD: mboot.c,v 1.9.8.1 2012/04/09 18:08:31 riz Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -32,105 +32,14 @@
 #include 
 #include 
 
-int bootmain(int);
-
-struct iocs_readcap {
-	unsigned long	block;
-	unsigned long	size;
-};
-static inline int
-IOCS_BITSNS (int row)
-{
-	register unsigned int reg_d0 __asm ("%d0");
-
-	__asm volatile ("movel %1,%%d1\n\t"
-			  "movel #0x04,%0\n\t"
-			  "trap #15"
-			  : "=d" (reg_d0)
-			  : "ri" ((int) row)
-			  : "%d1");
-
-	return reg_d0;
-}
-static inline void
-IOCS_B_PRINT (const char *str)
-{
-	__asm volatile ("moval %0,%%a1\n\t"
-			  "movel #0x21,%%d0\n\t"
-			  "trap #15\n\t"
-			  :
-			  : "a" ((int) str)
-			  : "%a1", "%d0");
-	return;
-}
-static inline int
-IOCS_S_READCAP (int id, struct iocs_readcap *cap)
-{
-	register int reg_d0 __asm ("%d0");
+#include "iocs.h"
 
-	__asm volatile ("moveml %%d4,%%sp@-\n\t"
-			  "movel %2,%%d4\n\t"
-			  "moval %3,%%a1\n\t"
-			  "movel #0x25,%%d1\n\t"
-			  "movel #0xf5,%%d0\n\t"
-			  "trap #15\n\t"
-			  "moveml %%sp@+,%%d4"
-			  : "=d" (reg_d0), "=m" (*cap)
-			  : "ri" (id), "g" ((int) cap)
-			  : "%d1", "%a1");
-
-	return reg_d0;
-}
-static inline int
-IOCS_S_READ (int pos, int blk, int id, int size, void *buf)
-{
-	register int reg_d0 __asm ("%d0");
-
-	__