CVS commit: src/sys/arch/vax/boot

2023-01-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 29 17:00:12 UTC 2023

Modified Files:
src/sys/arch/vax/boot: Makefile.inc

Log Message:
Make a vax bootloader work on 8MB VAXen.

64KB (0x80 - 0x7f) is not enough for the bootloader itself
and more spaces are required for heap on loading a kernel.
 https://mail-index.netbsd.org/port-vax/2023/01/24/msg004149.html

"Go ahead" from ragge@.  Should be pulled up to netbsd-10 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/vax/boot/Makefile.inc

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



CVS commit: src/sys/arch/vax/boot

2023-01-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 29 17:00:12 UTC 2023

Modified Files:
src/sys/arch/vax/boot: Makefile.inc

Log Message:
Make a vax bootloader work on 8MB VAXen.

64KB (0x80 - 0x7f) is not enough for the bootloader itself
and more spaces are required for heap on loading a kernel.
 https://mail-index.netbsd.org/port-vax/2023/01/24/msg004149.html

"Go ahead" from ragge@.  Should be pulled up to netbsd-10 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/vax/boot/Makefile.inc

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/vax/boot/Makefile.inc
diff -u src/sys/arch/vax/boot/Makefile.inc:1.18 src/sys/arch/vax/boot/Makefile.inc:1.19
--- src/sys/arch/vax/boot/Makefile.inc:1.18	Thu Mar 22 08:58:56 2018
+++ src/sys/arch/vax/boot/Makefile.inc	Sun Jan 29 17:00:12 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.18 2018/03/22 08:58:56 ragge Exp $
+#	$NetBSD: Makefile.inc,v 1.19 2023/01/29 17:00:12 tsutsui Exp $
 
 NOSSP=
 NOFORTIFY=
@@ -7,7 +7,7 @@ NODEBUG=
 
 .include 
 
-RELOC=0x7f
+RELOC=0x7d
 .PATH:	${.CURDIR}/../../vax ${.CURDIR}/../common
 
 CPPFLAGS+=-I.



CVS commit: src/sys/arch/vax/boot

2022-04-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Apr 25 15:06:34 UTC 2022

Modified Files:
src/sys/arch/vax/boot/boot: rom.c vaxstand.h
src/sys/arch/vax/boot/xxboot: bootxx.c

Log Message:
libsa now needs ioctl support to handle media with large sectors.
Provide dummy functions.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/boot/boot/rom.c \
src/sys/arch/vax/boot/boot/vaxstand.h
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/vax/boot/xxboot/bootxx.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/vax/boot/boot/rom.c
diff -u src/sys/arch/vax/boot/boot/rom.c:1.10 src/sys/arch/vax/boot/boot/rom.c:1.11
--- src/sys/arch/vax/boot/boot/rom.c:1.10	Mon May 22 16:59:32 2017
+++ src/sys/arch/vax/boot/boot/rom.c	Mon Apr 25 15:06:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: rom.c,v 1.10 2017/05/22 16:59:32 ragge Exp $ */
+/*	$NetBSD: rom.c,v 1.11 2022/04/25 15:06:34 mlelstv Exp $ */
 /*
  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -102,3 +102,8 @@ romstrategy (void *f, int func, daddr_t 
 	return 0;
 }
 
+int
+romioctl(struct open_file *f, u_long cmd, void *data)
+{
+	return ENOTTY;
+}
Index: src/sys/arch/vax/boot/boot/vaxstand.h
diff -u src/sys/arch/vax/boot/boot/vaxstand.h:1.10 src/sys/arch/vax/boot/boot/vaxstand.h:1.11
--- src/sys/arch/vax/boot/boot/vaxstand.h:1.10	Mon Mar 19 15:43:45 2018
+++ src/sys/arch/vax/boot/boot/vaxstand.h	Mon Apr 25 15:06:34 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: vaxstand.h,v 1.10 2018/03/19 15:43:45 ragge Exp $ */
+/*	$NetBSD: vaxstand.h,v 1.11 2022/04/25 15:06:34 mlelstv Exp $ */
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -58,7 +58,8 @@ int	ctuopen(struct open_file *, int, int
 int	tmscpopen(struct open_file *, int, int, int, int),
 	tmscpstrategy(void *, int, daddr_t, size_t, void *, size_t *);
 int	romopen(struct open_file *, int, int, int, int),
-	romstrategy(void *, int, daddr_t, size_t, void *, size_t *);
+	romstrategy(void *, int, daddr_t, size_t, void *, size_t *),
+	romioctl(struct open_file *, u_long, void *);
 int	mfmopen(struct open_file *, int, int, int, int),
 	mfmstrategy(void *, int, daddr_t, size_t, void *, size_t *);
 int	sdopen(struct open_file *),

Index: src/sys/arch/vax/boot/xxboot/bootxx.c
diff -u src/sys/arch/vax/boot/xxboot/bootxx.c:1.38 src/sys/arch/vax/boot/xxboot/bootxx.c:1.39
--- src/sys/arch/vax/boot/xxboot/bootxx.c:1.38	Tue May  1 07:03:47 2018
+++ src/sys/arch/vax/boot/xxboot/bootxx.c	Mon Apr 25 15:06:34 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: bootxx.c,v 1.38 2018/05/01 07:03:47 ragge Exp $ */
+/* $NetBSD: bootxx.c,v 1.39 2022/04/25 15:06:34 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
@@ -298,6 +298,12 @@ romstrategy(void *sc, int func, daddr_t 
 	return 0;
 }
 
+int
+romioctl(struct open_file *f, u_long cmd, void *data)
+{
+	return ENOTTY;
+}
+
 /*
  * The 11/750 boot ROM for Massbus disks doesn't seen to have layout info
  * for all RP disks (not RP07 at least) so therefore a very small and dumb



CVS commit: src/sys/arch/vax/boot

2022-04-25 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Mon Apr 25 15:06:34 UTC 2022

Modified Files:
src/sys/arch/vax/boot/boot: rom.c vaxstand.h
src/sys/arch/vax/boot/xxboot: bootxx.c

Log Message:
libsa now needs ioctl support to handle media with large sectors.
Provide dummy functions.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/boot/boot/rom.c \
src/sys/arch/vax/boot/boot/vaxstand.h
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/vax/boot/xxboot/bootxx.c

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



CVS commit: src/sys/arch/vax/boot/boot

2019-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 28 21:11:23 UTC 2019

Modified Files:
src/sys/arch/vax/boot/boot: mfm.c

Log Message:
Rewrite the floppy selection logic, and fix an always false condition.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/vax/boot/boot/mfm.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/vax/boot/boot/mfm.c
diff -u src/sys/arch/vax/boot/boot/mfm.c:1.15 src/sys/arch/vax/boot/boot/mfm.c:1.16
--- src/sys/arch/vax/boot/boot/mfm.c:1.15	Mon May 22 12:59:32 2017
+++ src/sys/arch/vax/boot/boot/mfm.c	Mon Oct 28 17:11:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: mfm.c,v 1.15 2017/05/22 16:59:32 ragge Exp $	*/
+/*	$NetBSD: mfm.c,v 1.16 2019/10/28 21:11:23 christos Exp $	*/
 /*
  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -139,6 +139,15 @@ mfm_rxprepare(void)
 	return error;
 }
 
+static int
+mfm_is_ready(int cnt, int error)
+{
+	if (error == 0 && (sreg.udc_dstat & UDC_DS_READY) == UDC_DS_READY)
+		return 1;
+	printf("diskette not ready(%d): %#x/%#x\n", cnt, error, sreg.udc_dstat);
+	return 0;
+}
+
 int
 mfm_rxselect(int unit)
 {
@@ -165,42 +174,40 @@ mfm_rxselect(int unit)
 	 */
 	error = mfm_command(DKC_CMD_DRSEL_RX33 | unit);
 
-	if ((error != 0) || ((sreg.udc_dstat & UDC_DS_READY) == 0)) {
-		printf("\nfloppy-drive not ready (new floppy inserted?)\n\n");
+	if (mfm_is_ready(0, error))
+		return 0;
 
-		creg.udc_rtcnt &= ~UDC_RC_INVRDY;	/* clear INVRDY-flag */
-		error = mfm_command(DKC_CMD_DRSEL_RX33 | unit);
-		if ((error != 0) || ((sreg.udc_dstat & UDC_DS_READY) == 0)) {
-			printf("diskette not ready(1): %x/%x\n",
-			   error, sreg.udc_dstat);
-			printf("floppy-drive offline?\n");
-			return (-1);
-		}
-		if (sreg.udc_dstat & UDC_DS_TRK00)
-			error = mfm_command(DKC_CMD_STEPIN_FDD);
-		else
-			error = mfm_command(DKC_CMD_STEPOUT_FDD);
+	printf("\nfloppy-drive not ready (new floppy inserted?)\n\n");
 
-		/*
-		 * now ready should be 0, cause INVRDY is not set
-		 * (retrying a command makes this fail...)
-		 */
-		if ((error != 0) || ((sreg.udc_dstat & UDC_DS_READY) == 1)) {
-			printf("diskette not ready(2): %x/%x\n",
-			   error, sreg.udc_dstat);
-		}
-		creg.udc_rtcnt |= UDC_RC_INVRDY;
-		error = mfm_command(DKC_CMD_DRSEL_RX33 | unit);
+	/* clear INVRDY-flag and try again */
+	creg.udc_rtcnt &= ~UDC_RC_INVRDY;
+	error = mfm_command(DKC_CMD_DRSEL_RX33 | unit);
 
-		if ((error != 0) || ((sreg.udc_dstat & UDC_DS_READY) == 0)) {
-			printf("diskette not ready(3): %x/%x\n",
-			   error, sreg.udc_dstat);
-			printf("no floppy inserted or floppy-door open\n");
-			return (-1);
-		}
-		printf("floppy-drive reselected.\n");
+	if (!mfm_is_ready(1, error)) {
+		printf("floppy-drive offline?\n");
+		return -1;
+   
 	}
-	return (error);
+	if (sreg.udc_dstat & UDC_DS_TRK00)
+		error = mfm_command(DKC_CMD_STEPIN_FDD);
+	else
+		error = mfm_command(DKC_CMD_STEPOUT_FDD);
+
+	/*
+	 * now ready should be 0, cause INVRDY is not set
+	 * (retrying a command makes this fail...)
+	 */
+	mfm_is_ready(2, error);
+
+	creg.udc_rtcnt |= UDC_RC_INVRDY;
+	error = mfm_command(DKC_CMD_DRSEL_RX33 | unit);
+	if (!mfm_is_ready(3, error)) {
+		printf("no floppy inserted or floppy-door open\n");
+		return -1;
+	}
+
+	printf("floppy-drive reselected.\n");
+	return error;
 }
 
 int



CVS commit: src/sys/arch/vax/boot/boot

2019-10-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Oct 28 21:11:23 UTC 2019

Modified Files:
src/sys/arch/vax/boot/boot: mfm.c

Log Message:
Rewrite the floppy selection logic, and fix an always false condition.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/vax/boot/boot/mfm.c

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