CVS commit: src/sys/arch/i386/stand/lib

2024-06-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  1 01:30:00 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: Makefile

Log Message:
i386: stand: G/C `I386_INCLUDE_DOS` leftover

Anyway, `I386_INCLUDE_DISK` is enabled for dosboot.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/i386/stand/lib/Makefile

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/i386/stand/lib/Makefile
diff -u src/sys/arch/i386/stand/lib/Makefile:1.52 src/sys/arch/i386/stand/lib/Makefile:1.53
--- src/sys/arch/i386/stand/lib/Makefile:1.52	Sat Jun 29 13:46:40 2024
+++ src/sys/arch/i386/stand/lib/Makefile	Mon Jul  1 01:29:59 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.52 2024/06/29 13:46:40 rin Exp $
+#	$NetBSD: Makefile,v 1.53 2024/07/01 01:29:59 rin Exp $
 
 S?=	${.CURDIR}/../../../..
 
@@ -29,12 +29,9 @@ SRCS+= biosgetsystime.S cpufunc.S bootme
 SRCS+= realprot.S message.S message32.S dump_eax.S pvcopy.S putstr.S putstr32.S
 SRCS+= rasops.c vbe.c biosvbe.S
 .if (${I386_INCLUDE_DISK} == "yes")
-SRCS+= biosdisk.c biosdisk_ll.c bios_disk.S
+SRCS+= biosdisk.c biosdisk_ll.c bios_disk.S diskbuf.c
 CWARNFLAGS.gcc+=	${CC_WNO_ADDRESS_OF_PACKED_MEMBER}
 .endif
-.if (${I386_INCLUDE_DISK} == "yes") || (${I386_INCLUDE_DOS} == "yes")
-SRCS+= diskbuf.c
-.endif
 .if (${I386_INCLUDE_PS2} == "yes")
 SRCS+= biosmca.S biosmemps2.S
 .endif



CVS commit: src/sys/arch/i386/stand/lib

2024-06-30 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul  1 01:30:00 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: Makefile

Log Message:
i386: stand: G/C `I386_INCLUDE_DOS` leftover

Anyway, `I386_INCLUDE_DISK` is enabled for dosboot.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/i386/stand/lib/Makefile

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



CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 13:52:40 UTC 2024

Modified Files:
src/sys/arch/i386/stand: Makefile.booters
src/sys/arch/i386/stand/pxeboot: Makefile

Log Message:
i386: stand: Tiny clean up for `start_pxeboot.o`, NFC


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/i386/stand/Makefile.booters
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/i386/stand/pxeboot/Makefile

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



CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 13:52:40 UTC 2024

Modified Files:
src/sys/arch/i386/stand: Makefile.booters
src/sys/arch/i386/stand/pxeboot: Makefile

Log Message:
i386: stand: Tiny clean up for `start_pxeboot.o`, NFC


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/i386/stand/Makefile.booters
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/i386/stand/pxeboot/Makefile

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/i386/stand/Makefile.booters
diff -u src/sys/arch/i386/stand/Makefile.booters:1.100 src/sys/arch/i386/stand/Makefile.booters:1.101
--- src/sys/arch/i386/stand/Makefile.booters:1.100	Sat Jun 29 13:46:40 2024
+++ src/sys/arch/i386/stand/Makefile.booters	Sat Jun 29 13:52:39 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.booters,v 1.100 2024/06/29 13:46:40 rin Exp $
+#	$NetBSD: Makefile.booters,v 1.101 2024/06/29 13:52:39 rin Exp $
 
 NOLIBCSANITIZER=
 NOSANITIZER=
@@ -26,9 +26,6 @@ I386_STAND_DIR?= $S/arch/i386/stand
 
 .PATH: ${I386_STAND_DIR}/lib
 
-.PATH: ${I386_STAND_DIR}/lib/crt/pxe
-PXESTART= start_pxe.o
-
 CPPFLAGS+= -nostdinc -I${.OBJDIR} -I$S -I${I386_STAND_DIR}/lib -I$S/lib/libsa
 CPPFLAGS+= -D_STANDALONE
 LDFLAGS+=  -nostdlib

Index: src/sys/arch/i386/stand/pxeboot/Makefile
diff -u src/sys/arch/i386/stand/pxeboot/Makefile:1.29 src/sys/arch/i386/stand/pxeboot/Makefile:1.30
--- src/sys/arch/i386/stand/pxeboot/Makefile:1.29	Sat Jun 29 07:52:16 2024
+++ src/sys/arch/i386/stand/pxeboot/Makefile	Sat Jun 29 13:52:39 2024
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.29 2024/06/29 07:52:16 rin Exp $
+#	$NetBSD: Makefile,v 1.30 2024/06/29 13:52:39 rin Exp $
 
 S=	${.CURDIR}/../../../..
 
 BASE?= pxeboot_ia32
 PROG= ${BASE}.bin
 NEWVERSWHAT=	"PXE Boot"
-STARTFILE=	${PXESTART}
+STARTFILE=	start_pxe.o
 RELOC=		0x0
 
 .if (${BASE} != "pxeboot_ia32")



CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 13:46:40 UTC 2024

Modified Files:
src/sys/arch/i386/stand: Makefile.booters
src/sys/arch/i386/stand/dosboot: Makefile devopen.c dosfile.c dosfile.h
src/sys/arch/i386/stand/lib: Makefile libi386.h

Log Message:
i386: stand: Adjust for DOS-routine migration


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/i386/stand/Makefile.booters
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/stand/dosboot/Makefile
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/dosboot/devopen.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/dosboot/dosfile.c \
src/sys/arch/i386/stand/dosboot/dosfile.h
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/i386/stand/lib/Makefile
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/i386/stand/lib/libi386.h

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/i386/stand/Makefile.booters
diff -u src/sys/arch/i386/stand/Makefile.booters:1.99 src/sys/arch/i386/stand/Makefile.booters:1.100
--- src/sys/arch/i386/stand/Makefile.booters:1.99	Sat Jun 29 13:18:18 2024
+++ src/sys/arch/i386/stand/Makefile.booters	Sat Jun 29 13:46:40 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.booters,v 1.99 2024/06/29 13:18:18 rin Exp $
+#	$NetBSD: Makefile.booters,v 1.100 2024/06/29 13:46:40 rin Exp $
 
 NOLIBCSANITIZER=
 NOSANITIZER=
@@ -26,9 +26,6 @@ I386_STAND_DIR?= $S/arch/i386/stand
 
 .PATH: ${I386_STAND_DIR}/lib
 
-.PATH: ${I386_STAND_DIR}/lib/crt/dos
-DOSSTART= start_dos.o doscommain.o
-
 .PATH: ${I386_STAND_DIR}/lib/crt/pxe
 PXESTART= start_pxe.o
 

Index: src/sys/arch/i386/stand/dosboot/Makefile
diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.37 src/sys/arch/i386/stand/dosboot/Makefile:1.38
--- src/sys/arch/i386/stand/dosboot/Makefile:1.37	Sat Jun 29 08:05:13 2024
+++ src/sys/arch/i386/stand/dosboot/Makefile	Sat Jun 29 13:46:40 2024
@@ -1,14 +1,16 @@
-#	$NetBSD: Makefile,v 1.37 2024/06/29 08:05:13 rin Exp $
+#	$NetBSD: Makefile,v 1.38 2024/06/29 13:46:40 rin Exp $
 
 S=	${.CURDIR}/../../../..
 
 BASE= dosboot
 PROG= ${BASE}.com
 NEWVERSWHAT=	"DOS Boot"
-STARTFILE=	${DOSSTART}
+STARTFILE=	start_dos.o doscommain.o
 RELOC=		0x100
 
-SRCS= main.c devopen.c exec.c exec_multiboot1.c exec_multiboot2.c
+SRCS=	main.c devopen.c exec.c
+SRCS+=	dosfile.c dos_file.S
+SRCS+=	exec_multiboot1.c exec_multiboot2.c
 
 #CPPFLAGS+= -DSLOW	# for libz; no longer available
 CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
@@ -27,7 +29,6 @@ CFLAGS+= -Wall -Wmissing-prototypes -Wst
 CPPFLAGS+= -DSTACK_START=0x1
 SAMISCCPPFLAGS+= -DHEAP_START=0x2 -DHEAP_LIMIT=0x5
 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_INCLUDE_NET=no SA_ENABLE_LS_OP=yes
-I386MISCMAKEFLAGS= I386_INCLUDE_DOS=yes
 
 # DOS command line arguments are located at 0x.
 COPTS.doscommain.c+= -fno-delete-null-pointer-checks

Index: src/sys/arch/i386/stand/dosboot/devopen.c
diff -u src/sys/arch/i386/stand/dosboot/devopen.c:1.11 src/sys/arch/i386/stand/dosboot/devopen.c:1.12
--- src/sys/arch/i386/stand/dosboot/devopen.c:1.11	Sat Mar 14 15:36:07 2009
+++ src/sys/arch/i386/stand/dosboot/devopen.c	Sat Jun 29 13:46:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: devopen.c,v 1.11 2009/03/14 15:36:07 dsl Exp $	 */
+/*	$NetBSD: devopen.c,v 1.12 2024/06/29 13:46:40 rin Exp $	 */
 
 /*
  * Copyright (c) 1996
@@ -32,9 +32,10 @@
 
 #include 
 #include 
-#include 
 #include 
 
+#include "dosfile.h"
+
 struct devsw devsw[] = {
 	{"disk", biosdisk_strategy, biosdisk_open, biosdisk_close, biosdisk_ioctl},
 };

Index: src/sys/arch/i386/stand/dosboot/dosfile.c
diff -u src/sys/arch/i386/stand/dosboot/dosfile.c:1.1 src/sys/arch/i386/stand/dosboot/dosfile.c:1.2
--- src/sys/arch/i386/stand/dosboot/dosfile.c:1.1	Sat Jun 29 13:45:14 2024
+++ src/sys/arch/i386/stand/dosboot/dosfile.c	Sat Jun 29 13:46:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: dosfile.c,v 1.1 2024/06/29 13:45:14 rin Exp $	 */
+/*	$NetBSD: dosfile.c,v 1.2 2024/06/29 13:46:40 rin Exp $	 */
 
 /*
  * Copyright (c) 1996
@@ -37,11 +37,6 @@
 #include "diskbuf.h"
 #include "dosfile.h"
 
-extern int dosopen(const char *);
-extern void dosclose(int);
-extern int dosread(int, char *, int);
-extern int dosseek(int, int, int);
-
 struct dosfile {
 	int doshandle, off;
 };
Index: src/sys/arch/i386/stand/dosboot/dosfile.h
diff -u src/sys/arch/i386/stand/dosboot/dosfile.h:1.1 src/sys/arch/i386/stand/dosboot/dosfile.h:1.2
--- src/sys/arch/i386/stand/dosboot/dosfile.h:1.1	Sat Jun 29 13:45:14 2024
+++ src/sys/arch/i386/stand/dosboot/dosfile.h	Sat Jun 29 13:46:40 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: dosfile.h,v 1.1 2024/06/29 13:45:14 rin Exp $	*/
+/*	$NetBSD: dosfile.h,v 1.2 2024/06/29 13:46:40 rin Exp $	*/
 
 /*
  * Copyright (c) 1996
@@ -26,4 +26,10 @@
  *
  */
 
+void dosclose(int);
+int dosopen(const char *);
+int dosread(int, char *, int);
+int dosseek(int, int, int);
+extern int doserrno;	/* in dos_file.S */
+
 FS_DEF(dos);

Index: src/sys/arch/i386/stand/lib/Makefile

CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 13:46:40 UTC 2024

Modified Files:
src/sys/arch/i386/stand: Makefile.booters
src/sys/arch/i386/stand/dosboot: Makefile devopen.c dosfile.c dosfile.h
src/sys/arch/i386/stand/lib: Makefile libi386.h

Log Message:
i386: stand: Adjust for DOS-routine migration


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/arch/i386/stand/Makefile.booters
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/stand/dosboot/Makefile
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/dosboot/devopen.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/dosboot/dosfile.c \
src/sys/arch/i386/stand/dosboot/dosfile.h
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/i386/stand/lib/Makefile
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/i386/stand/lib/libi386.h

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



CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 13:45:14 UTC 2024

Added Files:
src/sys/arch/i386/stand/dosboot: dos_file.S doscommain.c dosfile.c
dosfile.h start_dos.S
Removed Files:
src/sys/arch/i386/stand/lib: dos_file.S dosfile.c dosfile.h
src/sys/arch/i386/stand/lib/crt/dos: doscommain.c start_dos.S

Log Message:
i386: stand: Migrate DOS support routines from `lib` to `dosboot`


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/stand/dosboot/dos_file.S \
src/sys/arch/i386/stand/dosboot/doscommain.c \
src/sys/arch/i386/stand/dosboot/dosfile.c \
src/sys/arch/i386/stand/dosboot/dosfile.h \
src/sys/arch/i386/stand/dosboot/start_dos.S
cvs rdiff -u -r1.6 -r0 src/sys/arch/i386/stand/lib/dos_file.S
cvs rdiff -u -r1.19 -r0 src/sys/arch/i386/stand/lib/dosfile.c
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/lib/dosfile.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/i386/stand/lib/crt/dos/doscommain.c
cvs rdiff -u -r1.10 -r0 src/sys/arch/i386/stand/lib/crt/dos/start_dos.S

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



CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 13:45:14 UTC 2024

Added Files:
src/sys/arch/i386/stand/dosboot: dos_file.S doscommain.c dosfile.c
dosfile.h start_dos.S
Removed Files:
src/sys/arch/i386/stand/lib: dos_file.S dosfile.c dosfile.h
src/sys/arch/i386/stand/lib/crt/dos: doscommain.c start_dos.S

Log Message:
i386: stand: Migrate DOS support routines from `lib` to `dosboot`


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/stand/dosboot/dos_file.S \
src/sys/arch/i386/stand/dosboot/doscommain.c \
src/sys/arch/i386/stand/dosboot/dosfile.c \
src/sys/arch/i386/stand/dosboot/dosfile.h \
src/sys/arch/i386/stand/dosboot/start_dos.S
cvs rdiff -u -r1.6 -r0 src/sys/arch/i386/stand/lib/dos_file.S
cvs rdiff -u -r1.19 -r0 src/sys/arch/i386/stand/lib/dosfile.c
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/lib/dosfile.h
cvs rdiff -u -r1.6 -r0 src/sys/arch/i386/stand/lib/crt/dos/doscommain.c
cvs rdiff -u -r1.10 -r0 src/sys/arch/i386/stand/lib/crt/dos/start_dos.S

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

Added files:

Index: src/sys/arch/i386/stand/dosboot/dos_file.S
diff -u /dev/null src/sys/arch/i386/stand/dosboot/dos_file.S:1.1
--- /dev/null	Sat Jun 29 13:45:14 2024
+++ src/sys/arch/i386/stand/dosboot/dos_file.S	Sat Jun 29 13:45:14 2024
@@ -0,0 +1,203 @@
+/*	$NetBSD: dos_file.S,v 1.1 2024/06/29 13:45:14 rin Exp $	*/
+	
+/* extracted from Tor Egge's patches for NetBSD boot */
+
+#include 
+
+/*
+# MSDOS call "INT 0x21 Function 0x3d" to open a file.
+# Call with	%ah = 0x3d
+# 		%al = 0x0  (access and sharing modes)
+#		%ds:%dx = ASCIZ filename
+#		%cl = attribute mask of files to look for
+*/
+
+	.globl _C_LABEL(doserrno)
+_C_LABEL(doserrno):	.long 1
+
+ENTRY(dosopen)
+	.code32
+	pushl	%ebp
+	movl	%esp, %ebp
+	pushl	%edx
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	
+	movl	0x8(%ebp), %edx		# File name.
+
+	call	_C_LABEL(prot_to_real)	# enter real mode
+	.code16
+
+	push	%ds
+	movl	%edx, %eax
+	shrl	$4, %eax
+	mov	%ds, %si
+	add	%si, %ax
+	mov	%ax, %ds
+	and	$0xf, %dx
+
+	movb	$0x3d, %ah		# Open existing file.
+	movb	$0x0 , %al		# ro
+
+	sti
+	int	$0x21
+	cli
+	pop	%ds
+
+	jnc	ok1
+	mov	%ax, _C_LABEL(doserrno)
+	movl	$-1, %edx
+	jmp err1
+ok1:
+	movl	$0,%edx
+	mov	%ax, %dx
+err1:
+	calll	_C_LABEL(real_to_prot) # back to protected mode
+	.code32
+
+	movl	%edx, %eax		# return value in %eax
+
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%edx
+	popl	%ebp
+	ret
+
+ENTRY(dosread)
+	.code32
+	pushl	%ebp
+	movl	%esp, %ebp
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	pushl	%esi
+	pushl	%edi
+	
+	movl	0x8(%ebp), %ebx		# File handle
+	movl	0xc(%ebp), %edx		# Buffer.
+	movl	0x10(%ebp), %ecx	# Bytes to read
+
+	call	_C_LABEL(prot_to_real)	# enter real mode
+	.code16
+
+	push	%ds
+	movl	%edx, %eax
+	shrl	$4, %eax
+	mov	%ds, %si
+	add	%si, %ax
+	mov	%ax, %ds
+	and	$0xf, %dx
+
+	movb	$0x3f, %ah		# Read from file or device
+
+	sti
+	int	$0x21
+	cli
+	pop	%ds
+
+	jnc	ok2
+	mov	%ax, _C_LABEL(doserrno)
+	movl	$-1, %edx
+	jmp	err2
+ok2:
+	movl	$0,%edx
+	mov	%ax, %dx
+err2:
+	calll	_C_LABEL(real_to_prot)	# back to protected mode
+	.code32
+
+	movl	%edx, %eax		# return value in %eax
+
+	popl	%edi
+	popl	%esi
+	popl	%edx
+	popl	%ecx
+	popl	%ebx
+	popl	%ebp
+	ret
+
+ENTRY(dosclose)
+	.code32
+	pushl %ebp
+	movl  %esp, %ebp
+	pushl	%ebx
+	pushl	%esi
+	pushl	%edi
+	
+	movl	0x8(%ebp), %ebx		# File handle
+
+	call	_C_LABEL(prot_to_real)	# enter real mode
+	.code16
+
+	movb	$0x3e, %ah		# Close file.
+
+	sti
+	int	$0x21
+	cli
+
+	jnc	ok3
+	mov	%ax, _C_LABEL(doserrno)
+	movl	$-1, %ebx
+	jmp	err3
+ok3:
+	movl	$0, %ebx
+err3:
+	calll	_C_LABEL(real_to_prot) # back to protected mode
+	.code32
+
+	movl	%ebx, %eax		# return value in %eax
+
+	popl	%edi
+	popl	%esi
+	popl	%ebx
+	popl	%ebp
+	ret
+
+ENTRY(dosseek)
+	.code32
+	pushl	%ebp
+	movl	%esp, %ebp
+	pushl	%ebx
+	pushl	%ecx
+	pushl	%edx
+	pushl	%esi
+	pushl	%edi
+	
+	movl	0x8(%ebp), %ebx		# File handle
+	movl	0xc(%ebp), %ecx		# Offset
+	movl	0x10(%ebp) , %edx	# whence
+
+	call	_C_LABEL(prot_to_real)	# enter real mode
+	.code16
+
+	movb	$0x42, %ah		# Seek
+	movb	%dl, %al		# whence
+	mov	%cx, %dx		#offs lo
+	shrl	$0x10, %ecx		#offs hi
+
+	sti
+	int	$0x21
+	cli
+
+	jnc	ok4
+	mov	%ax, _C_LABEL(doserrno)
+	movl	$-1, %edx
+	jmp	err4
+ok4:
+	shll	$0x10, %edx	#new ofs hi
+	mov	%ax, %dx	#new ofs lo
+err4:
+	calll	_C_LABEL(real_to_prot) # back to protected mode
+	.code32
+
+	movl	%edx, %eax		# return value in %eax
+
+	popl	%edi
+	popl	%esi
+	popl	%edx
+	popl	%ecx
+	popl	%ebx
+	popl	%ebp
+	ret
Index: src/sys/arch/i386/stand/dosboot/doscommain.c
diff -u /dev/null src/sys/arch/i386/stand/dosboot/doscommain.c:1.1
--- /dev/null	Sat Jun 29 13:45:14 2024
+++ src/sys/arch/i386/stand/dosboot/doscommain.c	Sat Jun 29 13:45:14 2024
@@ -0,0 +1,119 @@
+/*	$NetBSD: doscommain.c,v 1.1 2024/06/29 13:45:14 rin Exp $	*/
+
+/*
+ * Copyright (c) 1996
+ *	Matthias 

CVS commit: src/sys/arch/i386/stand/mbr

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 13:22:08 UTC 2024

Modified Files:
src/sys/arch/i386/stand/mbr: Makefile.mbr
Removed Files:
src/sys/arch/i386/stand/mbr: gpt.S
src/sys/arch/i386/stand/mbr/mbr_gpt: Makefile
src/sys/arch/i386/stand/mbr/mbr_gpt_com0: Makefile

Log Message:
i386: stand: G/C `mbr_gpt*`; unhooked since 2011 in prefer of `gptmbr`


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/stand/mbr/Makefile.mbr
cvs rdiff -u -r1.3 -r0 src/sys/arch/i386/stand/mbr/gpt.S
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/mbr/mbr_gpt/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/mbr/mbr_gpt_com0/Makefile

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



CVS commit: src/sys/arch/i386/stand/mbr

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 13:22:08 UTC 2024

Modified Files:
src/sys/arch/i386/stand/mbr: Makefile.mbr
Removed Files:
src/sys/arch/i386/stand/mbr: gpt.S
src/sys/arch/i386/stand/mbr/mbr_gpt: Makefile
src/sys/arch/i386/stand/mbr/mbr_gpt_com0: Makefile

Log Message:
i386: stand: G/C `mbr_gpt*`; unhooked since 2011 in prefer of `gptmbr`


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/stand/mbr/Makefile.mbr
cvs rdiff -u -r1.3 -r0 src/sys/arch/i386/stand/mbr/gpt.S
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/mbr/mbr_gpt/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/mbr/mbr_gpt_com0/Makefile

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/i386/stand/mbr/Makefile.mbr
diff -u src/sys/arch/i386/stand/mbr/Makefile.mbr:1.21 src/sys/arch/i386/stand/mbr/Makefile.mbr:1.22
--- src/sys/arch/i386/stand/mbr/Makefile.mbr:1.21	Wed Jul 25 23:45:32 2018
+++ src/sys/arch/i386/stand/mbr/Makefile.mbr	Sat Jun 29 13:22:08 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mbr,v 1.21 2018/07/25 23:45:32 kamil Exp $
+#	$NetBSD: Makefile.mbr,v 1.22 2024/06/29 13:22:08 rin Exp $
 
 S=		${.CURDIR}/../../../../..
 
@@ -45,7 +45,6 @@ CLEANFILES+=	${PROG}.tmp
 LOADADDR=	0x8800
 
 AFLAGS.mbr.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
-AFLAGS.gpt.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
 
 ${PROG}: ${OBJS}
 	${_MKTARGET_LINK}



CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 13:18:18 UTC 2024

Modified Files:
src/sys/arch/i386/stand: Makefile.booters

Log Message:
i386: stand: Drop `*.rom` support; only used for netboot


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/i386/stand/Makefile.booters

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



CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 13:18:18 UTC 2024

Modified Files:
src/sys/arch/i386/stand: Makefile.booters

Log Message:
i386: stand: Drop `*.rom` support; only used for netboot


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/sys/arch/i386/stand/Makefile.booters

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/i386/stand/Makefile.booters
diff -u src/sys/arch/i386/stand/Makefile.booters:1.98 src/sys/arch/i386/stand/Makefile.booters:1.99
--- src/sys/arch/i386/stand/Makefile.booters:1.98	Sat Jun 29 07:52:16 2024
+++ src/sys/arch/i386/stand/Makefile.booters	Sat Jun 29 13:18:18 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.booters,v 1.98 2024/06/29 07:52:16 rin Exp $
+#	$NetBSD: Makefile.booters,v 1.99 2024/06/29 13:18:18 rin Exp $
 
 NOLIBCSANITIZER=
 NOSANITIZER=
@@ -86,16 +86,6 @@ ${BASE}.sym: ${STARTFILE} ${OBJS} ${LIBS
 	${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \
 	${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list
 
-CLEANFILES+= ${BASE}.rom ${BASE}.rom.tmp
-${BASE}.rom: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
-	${_MKTARGET_LINK}
-	${CC} -o ${BASE}.sym ${LDFLAGS} -Wl,-Ttext,${RELOC} \
-	${STARTFILE} ${OBJS} ${LIBLIST} >${BASE}.list
-	${OBJCOPY} -O binary ${BASE}.sym ${BASE}.rom.tmp
-	${GENPROM} ${ROM_SIZE} < ${BASE}.rom.tmp > ${BASE}.rom || \
-	( rm -f ${BASE}.rom && false )
-	rm -f ${BASE}.rom.tmp
-
 CLEANFILES+= ${BASE}.com
 ${BASE}.com: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386}
 	${_MKTARGET_LINK}



CVS commit: src/sys/arch/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 08:30:49 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: libi386.h

Log Message:
libi386.h: Drop `I386_INCLUDE_BUS` support

This is what I intended for this commit:

https://mail-index.netbsd.org/source-changes/2024/06/29/msg151996.html

Instead, I removed libi386.h by mistake :(


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/i386/stand/lib/libi386.h

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/i386/stand/lib/libi386.h
diff -u src/sys/arch/i386/stand/lib/libi386.h:1.51 src/sys/arch/i386/stand/lib/libi386.h:1.52
--- src/sys/arch/i386/stand/lib/libi386.h:1.51	Sat Jun 29 08:28:07 2024
+++ src/sys/arch/i386/stand/lib/libi386.h	Sat Jun 29 08:30:49 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: libi386.h,v 1.51 2024/06/29 08:28:07 rin Exp $	*/
+/*	$NetBSD: libi386.h,v 1.52 2024/06/29 08:30:49 rin Exp $	*/
 
 /*
  * Copyright (c) 1996
@@ -149,11 +149,6 @@ __compactcall int biosdisk_getextinfo(in
 int get_harddrives(void);
 void biosdisk_probe(void);
 
-int pcibios_cfgread(unsigned int, int, int *);
-int pcibios_cfgwrite(unsigned int, int, int);
-int pcibios_finddev(int, int, int, unsigned int *);
-int pcibios_present(int *);
-
 void dosclose(int);
 int dosopen(char *);
 int dosread(int, char *, int);



CVS commit: src/sys/arch/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 08:30:49 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: libi386.h

Log Message:
libi386.h: Drop `I386_INCLUDE_BUS` support

This is what I intended for this commit:

https://mail-index.netbsd.org/source-changes/2024/06/29/msg151996.html

Instead, I removed libi386.h by mistake :(


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/i386/stand/lib/libi386.h

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



CVS commit: src/sys/arch/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 08:28:07 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: libi386.h

Log Message:
libi386.h: Restore rev 1.48


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/i386/stand/lib/libi386.h

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/i386/stand/lib/libi386.h
diff -u src/sys/arch/i386/stand/lib/libi386.h:1.50 src/sys/arch/i386/stand/lib/libi386.h:1.51
--- src/sys/arch/i386/stand/lib/libi386.h:1.50	Sat Jun 29 08:23:01 2024
+++ src/sys/arch/i386/stand/lib/libi386.h	Sat Jun 29 08:28:07 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: libi386.h,v 1.50 2024/06/29 08:23:01 rin Exp $	*/
+/*	$NetBSD: libi386.h,v 1.51 2024/06/29 08:28:07 rin Exp $	*/
 
 /*
  * Copyright (c) 1996
@@ -54,7 +54,6 @@ int biosvideomode(void);
 #else
 #define getextmem() getextmemx()
 #endif
-void printmemlist(void);
 void reboot(void);
 void gateA20(void);
 



CVS commit: src/sys/arch/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 08:28:07 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: libi386.h

Log Message:
libi386.h: Restore rev 1.48


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/i386/stand/lib/libi386.h

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



CVS commit: src/sys/arch/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 08:23:01 UTC 2024

Added Files:
src/sys/arch/i386/stand/lib: libi386.h

Log Message:
i386: stand: Restore libi386.h,v 1.47, which I removed accidentally


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.50 src/sys/arch/i386/stand/lib/libi386.h

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

Added files:

Index: src/sys/arch/i386/stand/lib/libi386.h
diff -u /dev/null src/sys/arch/i386/stand/lib/libi386.h:1.50
--- /dev/null	Sat Jun 29 08:23:01 2024
+++ src/sys/arch/i386/stand/lib/libi386.h	Sat Jun 29 08:23:01 2024
@@ -0,0 +1,176 @@
+/*	$NetBSD: libi386.h,v 1.50 2024/06/29 08:23:01 rin Exp $	*/
+
+/*
+ * Copyright (c) 1996
+ *	Matthias Drochner.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef	__I386_STAND_LIBI386_H__
+#define	__I386_STAND_LIBI386_H__
+
+typedef unsigned long physaddr_t;
+
+/* this is in startup code */
+void vpbcopy(const void *, void *, size_t);
+void pvbcopy(const void *, void *, size_t);
+void pbzero(void *, size_t);
+physaddr_t vtophys(void *);
+
+ssize_t pread(int, void *, size_t);
+void startprog(physaddr_t, uint32_t, uint32_t *, physaddr_t);
+void multiboot(physaddr_t, physaddr_t, physaddr_t, uint32_t);
+
+int exec_netbsd(const char *, physaddr_t, int, int, void (*)(void));
+int exec_multiboot(const char *, char *);
+
+void delay(int);
+int getbasemem(void);
+int getextmemx(void);
+int getextmem1(void);
+int biosvideomode(void);
+#ifdef CONSERVATIVE_MEMDETECT
+#define getextmem() getextmem1()
+#else
+#define getextmem() getextmemx()
+#endif
+void printmemlist(void);
+void reboot(void);
+void gateA20(void);
+
+void clear_pc_screen(void);
+void initio(int);
+#define CONSDEV_PC 0
+#define CONSDEV_COM0 1
+#define CONSDEV_COM1 2
+#define CONSDEV_COM2 3
+#define CONSDEV_COM3 4
+#define CONSDEV_COM0KBD 5
+#define CONSDEV_COM1KBD 6
+#define CONSDEV_COM2KBD 7
+#define CONSDEV_COM3KBD 8
+#define CONSDEV_AUTO (-1)
+int iskey(int);
+char awaitkey(int, int);
+void wait_sec(int);
+
+/* multiboot */
+struct multiboot_package;
+struct multiboot_package_priv;
+
+struct multiboot_package {
+	int			 mbp_version;
+	struct multiboot_header	*mbp_header;
+	const char		*mbp_file;
+	char			*mbp_args;
+	u_long			 mbp_basemem;
+	u_long			 mbp_extmem;
+	u_long			 mbp_loadaddr;
+	u_long			*mbp_marks;
+	struct multiboot_package_priv*mbp_priv;
+	struct multiboot_package*(*mbp_probe)(const char *);
+	int			(*mbp_exec)(struct multiboot_package *);
+	void			(*mbp_cleanup)(struct multiboot_package *);
+};
+
+struct multiboot_package *probe_multiboot1(const char *);
+struct multiboot_package *probe_multiboot2(const char *);
+
+/* this is in "user code"! */
+int parsebootfile(const char *, char **, char **, int *, int *, const char **);
+
+#ifdef XMS
+physaddr_t ppbcopy(physaddr_t, physaddr_t, int);
+int checkxms(void);
+physaddr_t xmsalloc(int);
+#endif
+
+/* parseutils.c */
+char *gettrailer(char *);
+int parseopts(const char *, int *);
+int parseboot(char *, char **, int *);
+
+/* menuutils.c */
+struct bootblk_command {
+	const char *c_name;
+	void (*c_fn)(char *);
+};
+void bootmenu(void);
+void docommand(char *);
+
+/* in "user code": */
+void command_help(char *);
+extern const struct bootblk_command commands[];
+
+/* asm bios/dos calls */
+__compactcall int biosdisk_extread(int, void *);
+int biosdisk_read(int, int, int, int, int, void *);
+__compactcall int biosdisk_reset(int);
+
+__compactcall int biosgetrtc(u_long *);
+int biosgetsystime(void);
+int comgetc(int);
+void cominit(int);
+__compactcall int computc(int, int);
+int comstatus(int);
+int congetc(void);
+int conisshift(void);
+int coniskey(void);
+__compactcall void 

CVS commit: src/sys/arch/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 08:23:01 UTC 2024

Added Files:
src/sys/arch/i386/stand/lib: libi386.h

Log Message:
i386: stand: Restore libi386.h,v 1.47, which I removed accidentally


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.50 src/sys/arch/i386/stand/lib/libi386.h

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



CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 08:05:14 UTC 2024

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile
Removed Files:
src/sys/arch/i386/stand/libsa: getopt.c

Log Message:
i386: stand: Switch to libsa/getopt, NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/i386/stand/dosboot/Makefile
cvs rdiff -u -r1.5 -r0 src/sys/arch/i386/stand/libsa/getopt.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/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 08:05:14 UTC 2024

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile
Removed Files:
src/sys/arch/i386/stand/libsa: getopt.c

Log Message:
i386: stand: Switch to libsa/getopt, NFCI


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/i386/stand/dosboot/Makefile
cvs rdiff -u -r1.5 -r0 src/sys/arch/i386/stand/libsa/getopt.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/i386/stand/dosboot/Makefile
diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.36 src/sys/arch/i386/stand/dosboot/Makefile:1.37
--- src/sys/arch/i386/stand/dosboot/Makefile:1.36	Mon Nov  6 07:09:08 2023
+++ src/sys/arch/i386/stand/dosboot/Makefile	Sat Jun 29 08:05:13 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.36 2023/11/06 07:09:08 rin Exp $
+#	$NetBSD: Makefile,v 1.37 2024/06/29 08:05:13 rin Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -21,8 +21,6 @@ CPPFLAGS+= -DNO_MULTIBOOT2 # keep the bi
 #CFLAGS= -O2 -fomit-frame-pointer -fno-defer-pop
 CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes -Wno-main
 
-# XXX should go into library
-SRCS+= getopt.c
 .PATH: ${.CURDIR}/../libsa
 
 # XXX these should depend on the size of the image



CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:52:16 UTC 2024

Modified Files:
src/sys/arch/i386/stand: Makefile.booters
src/sys/arch/i386/stand/efiboot: Makefile.efiboot
src/sys/arch/i386/stand/pxeboot: Makefile
Removed Files:
src/sys/arch/i386/stand/libsa: nfs.c

Log Message:
i386: stand: Retire its own nfs.c, and switch to libsa/nfs.c. NFC


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/i386/stand/Makefile.booters
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.21 -r0 src/sys/arch/i386/stand/libsa/nfs.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/i386/stand/pxeboot/Makefile

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/i386/stand/Makefile.booters
diff -u src/sys/arch/i386/stand/Makefile.booters:1.97 src/sys/arch/i386/stand/Makefile.booters:1.98
--- src/sys/arch/i386/stand/Makefile.booters:1.97	Sat Jun 29 07:38:07 2024
+++ src/sys/arch/i386/stand/Makefile.booters	Sat Jun 29 07:52:16 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.booters,v 1.97 2024/06/29 07:38:07 rin Exp $
+#	$NetBSD: Makefile.booters,v 1.98 2024/06/29 07:52:16 rin Exp $
 
 NOLIBCSANITIZER=
 NOSANITIZER=
@@ -59,6 +59,7 @@ LIBZ=		${ZLIB}
 ### find out what to use for libsa
 SA_AS=		library
 SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes"
+SAMISCCPPFLAGS+=-DLIBSA_NFS_IMPLICIT_MOUNT
 .include "${S}/lib/libsa/Makefile.inc"
 LIBSA=		${SALIB}
 

Index: src/sys/arch/i386/stand/efiboot/Makefile.efiboot
diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.22 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.23
--- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.22	Mon Jul 24 01:56:59 2023
+++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot	Sat Jun 29 07:52:16 2024
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.efiboot,v 1.22 2023/07/24 01:56:59 rin Exp $
+# $NetBSD: Makefile.efiboot,v 1.23 2024/06/29 07:52:16 rin Exp $
 
 S=		${.CURDIR}/../../../../..
 
@@ -21,9 +21,7 @@ LIBI386SRCS= biosdisk.c bootinfo.c booti
 LIBI386SRCS+= comio_direct.c
 LIBI386SRCS+= diskbuf.c exec.c menuutils.c parseutils.c pread.c
 LIBI386SRCS+= exec_multiboot1.c exec_multiboot2.c
-# use our own nfs implementation
-LIBSASRCS+= nfs.c
-SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} ${LIBSASRCS}
+SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS}
 
 .include 
 
@@ -86,6 +84,7 @@ GNUEFIARCH?= ${MACHINE_CPU}
 CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH}
 CPPFLAGS+= -I${EFIDIR}/inc/protocol
 
+SAMISCCPPFLAGS+= -DLIBSA_NFS_IMPLICIT_MOUNT
 SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT
 SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT
 SAMISCCPPFLAGS+= -D"cdb2devb(bno)=(bno)"

Index: src/sys/arch/i386/stand/pxeboot/Makefile
diff -u src/sys/arch/i386/stand/pxeboot/Makefile:1.28 src/sys/arch/i386/stand/pxeboot/Makefile:1.29
--- src/sys/arch/i386/stand/pxeboot/Makefile:1.28	Fri Sep 27 08:57:10 2019
+++ src/sys/arch/i386/stand/pxeboot/Makefile	Sat Jun 29 07:52:16 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.28 2019/09/27 08:57:10 gson Exp $
+#	$NetBSD: Makefile,v 1.29 2024/06/29 07:52:16 rin Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -15,9 +15,6 @@ RELOC=		0x0
 
 SRCS= main.c dev_net.c devopen.c conf.c 
 SRCS+=exec.c exec_multiboot1.c exec_multiboot2.c pxe.c pxe_call.S
-# use our own nfs implementation
-.PATH: ${.CURDIR}/../libsa
-SRCS+= nfs.c
 
 .include 
 



CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:52:16 UTC 2024

Modified Files:
src/sys/arch/i386/stand: Makefile.booters
src/sys/arch/i386/stand/efiboot: Makefile.efiboot
src/sys/arch/i386/stand/pxeboot: Makefile
Removed Files:
src/sys/arch/i386/stand/libsa: nfs.c

Log Message:
i386: stand: Retire its own nfs.c, and switch to libsa/nfs.c. NFC


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/i386/stand/Makefile.booters
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.21 -r0 src/sys/arch/i386/stand/libsa/nfs.c
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/i386/stand/pxeboot/Makefile

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



CVS commit: src/sys/arch/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:43:26 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: Makefile
Removed Files:
src/sys/arch/i386/stand/lib: bios_pci.S biospci.c isadma.c isadmavar.h
isapnp.c isapnpvar.h libi386.h pcivar.h
src/sys/arch/i386/stand/lib/test: pci_user.c

Log Message:
i386: stand: G/C `I386_INCLUDE_BUS`; only used by netboot


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/i386/stand/lib/Makefile
cvs rdiff -u -r1.6 -r0 src/sys/arch/i386/stand/lib/bios_pci.S
cvs rdiff -u -r1.5 -r0 src/sys/arch/i386/stand/lib/biospci.c \
src/sys/arch/i386/stand/lib/isapnp.c
cvs rdiff -u -r1.2 -r0 src/sys/arch/i386/stand/lib/isadma.c \
src/sys/arch/i386/stand/lib/isadmavar.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/lib/isapnpvar.h \
src/sys/arch/i386/stand/lib/pcivar.h
cvs rdiff -u -r1.48 -r0 src/sys/arch/i386/stand/lib/libi386.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/lib/test/pci_user.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/i386/stand/lib/Makefile
diff -u src/sys/arch/i386/stand/lib/Makefile:1.50 src/sys/arch/i386/stand/lib/Makefile:1.51
--- src/sys/arch/i386/stand/lib/Makefile:1.50	Sat Jun 29 07:24:38 2024
+++ src/sys/arch/i386/stand/lib/Makefile	Sat Jun 29 07:43:25 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.50 2024/06/29 07:24:38 rin Exp $
+#	$NetBSD: Makefile,v 1.51 2024/06/29 07:43:25 rin Exp $
 
 S?=	${.CURDIR}/../../../..
 
@@ -8,7 +8,6 @@ NOPROFILE=# defined
 
 I386_INCLUDE_DISK?= yes
 I386_INCLUDE_DOS?= no
-I386_INCLUDE_BUS?= no
 I386_INCLUDE_PS2?= yes
 
 AFLAGS.realprot.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:}
@@ -40,9 +39,6 @@ SRCS+= dosfile.c dos_file.S
 .if (${I386_INCLUDE_DISK} == "yes") || (${I386_INCLUDE_DOS} == "yes")
 SRCS+= diskbuf.c
 .endif
-.if (${I386_INCLUDE_BUS} == "yes")
-SRCS+= biospci.c bios_pci.S isapnp.c isadma.c
-.endif
 .if (${I386_INCLUDE_PS2} == "yes")
 SRCS+= biosmca.S biosmemps2.S
 .endif



CVS commit: src/sys/arch/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:43:26 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: Makefile
Removed Files:
src/sys/arch/i386/stand/lib: bios_pci.S biospci.c isadma.c isadmavar.h
isapnp.c isapnpvar.h libi386.h pcivar.h
src/sys/arch/i386/stand/lib/test: pci_user.c

Log Message:
i386: stand: G/C `I386_INCLUDE_BUS`; only used by netboot


To generate a diff of this commit:
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/i386/stand/lib/Makefile
cvs rdiff -u -r1.6 -r0 src/sys/arch/i386/stand/lib/bios_pci.S
cvs rdiff -u -r1.5 -r0 src/sys/arch/i386/stand/lib/biospci.c \
src/sys/arch/i386/stand/lib/isapnp.c
cvs rdiff -u -r1.2 -r0 src/sys/arch/i386/stand/lib/isadma.c \
src/sys/arch/i386/stand/lib/isadmavar.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/lib/isapnpvar.h \
src/sys/arch/i386/stand/lib/pcivar.h
cvs rdiff -u -r1.48 -r0 src/sys/arch/i386/stand/lib/libi386.h
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/lib/test/pci_user.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/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:40:19 UTC 2024

Removed Files:
src/sys/arch/i386/stand/lib/netif: 3c509.c 3c509.h 3c590.c 3c90xb.c
Makefile.inc am7990.c dp8390.c dp8390.h elink3.c etherdrv.h
i82557.c lance.h ne.c ne.h netif_small.c netif_small.h
pcnet_isapnp.c pcnet_pci.c wd80x3.c
src/sys/arch/i386/stand/lib/test: ether_bpf.c

Log Message:
i386: stand: G/C `netif` with its test; only used by netboot


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r0 src/sys/arch/i386/stand/lib/netif/3c509.c \
src/sys/arch/i386/stand/lib/netif/etherdrv.h \
src/sys/arch/i386/stand/lib/netif/wd80x3.c
cvs rdiff -u -r1.7 -r0 src/sys/arch/i386/stand/lib/netif/3c509.h \
src/sys/arch/i386/stand/lib/netif/ne.c
cvs rdiff -u -r1.15 -r0 src/sys/arch/i386/stand/lib/netif/3c590.c \
src/sys/arch/i386/stand/lib/netif/3c90xb.c
cvs rdiff -u -r1.6 -r0 src/sys/arch/i386/stand/lib/netif/Makefile.inc \
src/sys/arch/i386/stand/lib/netif/dp8390.c \
src/sys/arch/i386/stand/lib/netif/dp8390.h
cvs rdiff -u -r1.8 -r0 src/sys/arch/i386/stand/lib/netif/am7990.c \
src/sys/arch/i386/stand/lib/netif/pcnet_isapnp.c \
src/sys/arch/i386/stand/lib/netif/pcnet_pci.c
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/lib/netif/elink3.c
cvs rdiff -u -r1.11 -r0 src/sys/arch/i386/stand/lib/netif/i82557.c
cvs rdiff -u -r1.2 -r0 src/sys/arch/i386/stand/lib/netif/lance.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/i386/stand/lib/netif/ne.h
cvs rdiff -u -r1.12 -r0 src/sys/arch/i386/stand/lib/netif/netif_small.c
cvs rdiff -u -r1.5 -r0 src/sys/arch/i386/stand/lib/netif/netif_small.h
cvs rdiff -u -r1.10 -r0 src/sys/arch/i386/stand/lib/test/ether_bpf.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/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:40:19 UTC 2024

Removed Files:
src/sys/arch/i386/stand/lib/netif: 3c509.c 3c509.h 3c590.c 3c90xb.c
Makefile.inc am7990.c dp8390.c dp8390.h elink3.c etherdrv.h
i82557.c lance.h ne.c ne.h netif_small.c netif_small.h
pcnet_isapnp.c pcnet_pci.c wd80x3.c
src/sys/arch/i386/stand/lib/test: ether_bpf.c

Log Message:
i386: stand: G/C `netif` with its test; only used by netboot


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r0 src/sys/arch/i386/stand/lib/netif/3c509.c \
src/sys/arch/i386/stand/lib/netif/etherdrv.h \
src/sys/arch/i386/stand/lib/netif/wd80x3.c
cvs rdiff -u -r1.7 -r0 src/sys/arch/i386/stand/lib/netif/3c509.h \
src/sys/arch/i386/stand/lib/netif/ne.c
cvs rdiff -u -r1.15 -r0 src/sys/arch/i386/stand/lib/netif/3c590.c \
src/sys/arch/i386/stand/lib/netif/3c90xb.c
cvs rdiff -u -r1.6 -r0 src/sys/arch/i386/stand/lib/netif/Makefile.inc \
src/sys/arch/i386/stand/lib/netif/dp8390.c \
src/sys/arch/i386/stand/lib/netif/dp8390.h
cvs rdiff -u -r1.8 -r0 src/sys/arch/i386/stand/lib/netif/am7990.c \
src/sys/arch/i386/stand/lib/netif/pcnet_isapnp.c \
src/sys/arch/i386/stand/lib/netif/pcnet_pci.c
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/lib/netif/elink3.c
cvs rdiff -u -r1.11 -r0 src/sys/arch/i386/stand/lib/netif/i82557.c
cvs rdiff -u -r1.2 -r0 src/sys/arch/i386/stand/lib/netif/lance.h
cvs rdiff -u -r1.3 -r0 src/sys/arch/i386/stand/lib/netif/ne.h
cvs rdiff -u -r1.12 -r0 src/sys/arch/i386/stand/lib/netif/netif_small.c
cvs rdiff -u -r1.5 -r0 src/sys/arch/i386/stand/lib/netif/netif_small.h
cvs rdiff -u -r1.10 -r0 src/sys/arch/i386/stand/lib/test/ether_bpf.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/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:38:07 UTC 2024

Modified Files:
src/sys/arch/i386/stand: Makefile.booters
Removed Files:
src/sys/arch/i386/stand/genprom: Makefile genprom.c

Log Message:
i386: stand: G/C `genprom`; used only by netboot


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/i386/stand/Makefile.booters
cvs rdiff -u -r1.10 -r0 src/sys/arch/i386/stand/genprom/Makefile
cvs rdiff -u -r1.8 -r0 src/sys/arch/i386/stand/genprom/genprom.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/i386/stand/Makefile.booters
diff -u src/sys/arch/i386/stand/Makefile.booters:1.96 src/sys/arch/i386/stand/Makefile.booters:1.97
--- src/sys/arch/i386/stand/Makefile.booters:1.96	Sat Jun  3 08:52:56 2023
+++ src/sys/arch/i386/stand/Makefile.booters	Sat Jun 29 07:38:07 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.booters,v 1.96 2023/06/03 08:52:56 lukem Exp $
+#	$NetBSD: Makefile.booters,v 1.97 2024/06/29 07:38:07 rin Exp $
 
 NOLIBCSANITIZER=
 NOSANITIZER=
@@ -26,11 +26,6 @@ I386_STAND_DIR?= $S/arch/i386/stand
 
 .PATH: ${I386_STAND_DIR}/lib
 
-ROMSTART= start_rom.o
-GENPROMDIR= ${I386_STAND_DIR}/genprom
-GENPROMOBJDIR!= cd ${GENPROMDIR} && ${PRINTOBJDIR}
-GENPROM= ${GENPROMOBJDIR}/genprom
-
 .PATH: ${I386_STAND_DIR}/lib/crt/dos
 DOSSTART= start_dos.o doscommain.o
 



CVS commit: src/sys/arch/i386/stand

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:38:07 UTC 2024

Modified Files:
src/sys/arch/i386/stand: Makefile.booters
Removed Files:
src/sys/arch/i386/stand/genprom: Makefile genprom.c

Log Message:
i386: stand: G/C `genprom`; used only by netboot


To generate a diff of this commit:
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/i386/stand/Makefile.booters
cvs rdiff -u -r1.10 -r0 src/sys/arch/i386/stand/genprom/Makefile
cvs rdiff -u -r1.8 -r0 src/sys/arch/i386/stand/genprom/genprom.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/i386/stand/netboot

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:36:04 UTC 2024

Removed Files:
src/sys/arch/i386/stand/netboot: Makefile Makefile.netboot conf.c
dev_net.c dev_net.h devopen.c main.c start_rom.S version
src/sys/arch/i386/stand/netboot/3c509: Makefile
src/sys/arch/i386/stand/netboot/3c590: Makefile
src/sys/arch/i386/stand/netboot/3c90xb: Makefile
src/sys/arch/i386/stand/netboot/i82557: Makefile
src/sys/arch/i386/stand/netboot/ne2000_isa: Makefile
src/sys/arch/i386/stand/netboot/pcnet_isapnp: Makefile
src/sys/arch/i386/stand/netboot/pcnet_pci: Makefile
src/sys/arch/i386/stand/netboot/wd80x3: Makefile

Log Message:
i386: netboot: Removed; unhooked since 2012 in prefer of pxeboot

netboot has its own NIC drivers and boots machine without help of PXE BIOS.
It had not been built nor received maintenance during the last decade.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r0 src/sys/arch/i386/stand/netboot/Makefile
cvs rdiff -u -r1.11 -r0 src/sys/arch/i386/stand/netboot/Makefile.netboot
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/netboot/conf.c
cvs rdiff -u -r1.16 -r0 src/sys/arch/i386/stand/netboot/dev_net.c
cvs rdiff -u -r1.3 -r0 src/sys/arch/i386/stand/netboot/dev_net.h \
src/sys/arch/i386/stand/netboot/start_rom.S
cvs rdiff -u -r1.8 -r0 src/sys/arch/i386/stand/netboot/devopen.c \
src/sys/arch/i386/stand/netboot/version
cvs rdiff -u -r1.18 -r0 src/sys/arch/i386/stand/netboot/main.c
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/3c509/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/3c590/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/3c90xb/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/i82557/Makefile
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/netboot/ne2000_isa/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/pcnet_isapnp/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/pcnet_pci/Makefile
cvs rdiff -u -r1.2 -r0 src/sys/arch/i386/stand/netboot/wd80x3/Makefile

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



CVS commit: src/sys/arch/i386/stand/netboot

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:36:04 UTC 2024

Removed Files:
src/sys/arch/i386/stand/netboot: Makefile Makefile.netboot conf.c
dev_net.c dev_net.h devopen.c main.c start_rom.S version
src/sys/arch/i386/stand/netboot/3c509: Makefile
src/sys/arch/i386/stand/netboot/3c590: Makefile
src/sys/arch/i386/stand/netboot/3c90xb: Makefile
src/sys/arch/i386/stand/netboot/i82557: Makefile
src/sys/arch/i386/stand/netboot/ne2000_isa: Makefile
src/sys/arch/i386/stand/netboot/pcnet_isapnp: Makefile
src/sys/arch/i386/stand/netboot/pcnet_pci: Makefile
src/sys/arch/i386/stand/netboot/wd80x3: Makefile

Log Message:
i386: netboot: Removed; unhooked since 2012 in prefer of pxeboot

netboot has its own NIC drivers and boots machine without help of PXE BIOS.
It had not been built nor received maintenance during the last decade.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r0 src/sys/arch/i386/stand/netboot/Makefile
cvs rdiff -u -r1.11 -r0 src/sys/arch/i386/stand/netboot/Makefile.netboot
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/netboot/conf.c
cvs rdiff -u -r1.16 -r0 src/sys/arch/i386/stand/netboot/dev_net.c
cvs rdiff -u -r1.3 -r0 src/sys/arch/i386/stand/netboot/dev_net.h \
src/sys/arch/i386/stand/netboot/start_rom.S
cvs rdiff -u -r1.8 -r0 src/sys/arch/i386/stand/netboot/devopen.c \
src/sys/arch/i386/stand/netboot/version
cvs rdiff -u -r1.18 -r0 src/sys/arch/i386/stand/netboot/main.c
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/3c509/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/3c590/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/3c90xb/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/i82557/Makefile
cvs rdiff -u -r1.4 -r0 src/sys/arch/i386/stand/netboot/ne2000_isa/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/pcnet_isapnp/Makefile
cvs rdiff -u -r1.1 -r0 src/sys/arch/i386/stand/netboot/pcnet_pci/Makefile
cvs rdiff -u -r1.2 -r0 src/sys/arch/i386/stand/netboot/wd80x3/Makefile

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



CVS commit: src/sys/arch/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:24:38 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: Makefile libi386.h
Removed Files:
src/sys/arch/i386/stand/lib: printmemlist.c

Log Message:
i386: stand: G/C unused `printmemlist`, NFC


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/i386/stand/lib/Makefile
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/i386/stand/lib/libi386.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/i386/stand/lib/printmemlist.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/i386/stand/lib/Makefile
diff -u src/sys/arch/i386/stand/lib/Makefile:1.49 src/sys/arch/i386/stand/lib/Makefile:1.50
--- src/sys/arch/i386/stand/lib/Makefile:1.49	Sat Jun  3 08:52:57 2023
+++ src/sys/arch/i386/stand/lib/Makefile	Sat Jun 29 07:24:38 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.49 2023/06/03 08:52:57 lukem Exp $
+#	$NetBSD: Makefile,v 1.50 2024/06/29 07:24:38 rin Exp $
 
 S?=	${.CURDIR}/../../../..
 
@@ -23,7 +23,7 @@ CPPFLAGS= -I$S/lib/libsa ${I386CPPFLAGS}
 
 SRCS= pcio.c conio.S comio.S comio_direct.c biosvideomode.S
 SRCS+= getsecs.c biosgetrtc.S biosdelay.S biosreboot.S gatea20.c
-SRCS+= biosmem.S getextmemx.c biosmemx.S printmemlist.c
+SRCS+= biosmem.S getextmemx.c biosmemx.S
 SRCS+= pread.c menuutils.c parseutils.c
 SRCS+= bootinfo.c bootinfo_biosgeom.c bootinfo_memmap.c
 SRCS+= startprog.S multiboot.S

Index: src/sys/arch/i386/stand/lib/libi386.h
diff -u src/sys/arch/i386/stand/lib/libi386.h:1.47 src/sys/arch/i386/stand/lib/libi386.h:1.48
--- src/sys/arch/i386/stand/lib/libi386.h:1.47	Fri Oct 18 01:24:51 2019
+++ src/sys/arch/i386/stand/lib/libi386.h	Sat Jun 29 07:24:38 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: libi386.h,v 1.47 2019/10/18 01:24:51 manu Exp $	*/
+/*	$NetBSD: libi386.h,v 1.48 2024/06/29 07:24:38 rin Exp $	*/
 
 /*
  * Copyright (c) 1996
@@ -54,7 +54,6 @@ int biosvideomode(void);
 #else
 #define getextmem() getextmemx()
 #endif
-void printmemlist(void);
 void reboot(void);
 void gateA20(void);
 



CVS commit: src/sys/arch/i386/stand/lib

2024-06-29 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sat Jun 29 07:24:38 UTC 2024

Modified Files:
src/sys/arch/i386/stand/lib: Makefile libi386.h
Removed Files:
src/sys/arch/i386/stand/lib: printmemlist.c

Log Message:
i386: stand: G/C unused `printmemlist`, NFC


To generate a diff of this commit:
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/i386/stand/lib/Makefile
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/i386/stand/lib/libi386.h
cvs rdiff -u -r1.2 -r0 src/sys/arch/i386/stand/lib/printmemlist.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/i386/stand

2024-01-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jan  6 21:26:43 UTC 2024

Modified Files:
src/sys/arch/i386/stand/efiboot: efidisk.c efidisk.h
src/sys/arch/i386/stand/lib: biosdisk.c exec.c

Log Message:
In efiboot
- create bootinfo information only once.
- add fake biosgeom entries so that the kernel can distinguish between
  hard drives (with geom) and CD-ROM (without).


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/stand/efiboot/efidisk.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/efiboot/efidisk.h
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/i386/stand/lib/biosdisk.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/i386/stand/lib/exec.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/i386/stand/efiboot/efidisk.c
diff -u src/sys/arch/i386/stand/efiboot/efidisk.c:1.10 src/sys/arch/i386/stand/efiboot/efidisk.c:1.11
--- src/sys/arch/i386/stand/efiboot/efidisk.c:1.10	Sun May 14 09:07:54 2023
+++ src/sys/arch/i386/stand/efiboot/efidisk.c	Sat Jan  6 21:26:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: efidisk.c,v 1.10 2023/05/14 09:07:54 riastradh Exp $	*/
+/*	$NetBSD: efidisk.c,v 1.11 2024/01/06 21:26:43 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -38,9 +38,12 @@
 #include "biosdisk_ll.h"
 #include "devopen.h"
 #include "efidisk.h"
+#include "bootinfo.h"
 
 static struct efidiskinfo_lh efi_disklist;
 static int nefidisks;
+static struct btinfo_biosgeom *bibg;
+static size_t bibg_len;
 
 #define MAXDEVNAME 39 /* "NAME=" + 34 char part_name */
 
@@ -158,6 +161,23 @@ next:
 		if (edi->bootdev)
 			boot_biosdev = edi->dev;
 	}
+
+	bibg_len = sizeof(*bibg) + nefidisks * sizeof(struct bi_biosgeom_entry);
+	bibg = alloc(bibg_len);
+	if (bibg == NULL)
+		return;
+
+	bibg->num = nefidisks;
+
+	i = 0;
+	TAILQ_FOREACH(edi, _disklist, list) {
+		if (edi->type == BIOSDISK_TYPE_HD) {
+			memset(>disk[i], 0, sizeof(bibg->disk[i]));
+			bibg->disk[i].dev = edi->dev;
+			bibg->disk[i].flags = BI_GEOM_INVALID;
+		}
+		++i;
+	}
 }
 
 static void
@@ -383,3 +403,10 @@ efidisk_get_efi_system_partition(int dev
 	*partition = i;
 	return 0;
 }
+
+void
+efidisk_getbiosgeom()
+{
+	BI_ADD(bibg, BTINFO_BIOSGEOM, bibg_len);
+}
+

Index: src/sys/arch/i386/stand/efiboot/efidisk.h
diff -u src/sys/arch/i386/stand/efiboot/efidisk.h:1.3 src/sys/arch/i386/stand/efiboot/efidisk.h:1.4
--- src/sys/arch/i386/stand/efiboot/efidisk.h:1.3	Mon Apr  2 09:44:18 2018
+++ src/sys/arch/i386/stand/efiboot/efidisk.h	Sat Jan  6 21:26:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: efidisk.h,v 1.3 2018/04/02 09:44:18 nonaka Exp $	*/
+/*	$NetBSD: efidisk.h,v 1.4 2024/01/06 21:26:43 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -41,3 +41,4 @@ TAILQ_HEAD(efidiskinfo_lh, efidiskinfo);
 
 const struct efidiskinfo *efidisk_getinfo(int);
 int efidisk_get_efi_system_partition(int, int *);
+void efidisk_getbiosgeom(void);

Index: src/sys/arch/i386/stand/lib/biosdisk.c
diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.60 src/sys/arch/i386/stand/lib/biosdisk.c:1.61
--- src/sys/arch/i386/stand/lib/biosdisk.c:1.60	Mon Oct  2 00:02:33 2023
+++ src/sys/arch/i386/stand/lib/biosdisk.c	Sat Jan  6 21:26:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosdisk.c,v 1.60 2023/10/02 00:02:33 manu Exp $	*/
+/*	$NetBSD: biosdisk.c,v 1.61 2024/01/06 21:26:43 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998
@@ -1198,11 +1198,13 @@ out:
 static void
 add_biosdisk_bootinfo(void)
 {
+#ifndef EFIBOOT
 	if (bootinfo == NULL) {
 		return;
 	}
 	BI_ADD(_disk, BTINFO_BOOTDISK, sizeof(bi_disk));
 	BI_ADD(_wedge, BTINFO_BOOTWEDGE, sizeof(bi_wedge));
+#endif
 	return;
 }
 #endif

Index: src/sys/arch/i386/stand/lib/exec.c
diff -u src/sys/arch/i386/stand/lib/exec.c:1.79 src/sys/arch/i386/stand/lib/exec.c:1.80
--- src/sys/arch/i386/stand/lib/exec.c:1.79	Thu Apr 20 00:42:24 2023
+++ src/sys/arch/i386/stand/lib/exec.c	Sat Jan  6 21:26:43 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.79 2023/04/20 00:42:24 manu Exp $	 */
+/*	$NetBSD: exec.c,v 1.80 2024/01/06 21:26:43 mlelstv Exp $	 */
 
 /*
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -108,6 +108,8 @@
 #endif
 #ifdef EFIBOOT
 #include "efiboot.h"
+#include "biosdisk.h"
+#include "efidisk.h"
 #undef DEBUG	/* XXX */
 #endif
 
@@ -498,6 +500,10 @@ exec_netbsd(const char *file, physaddr_t
 		goto out;
 	}
 #ifdef EFIBOOT
+	BI_ADD(_disk, BTINFO_BOOTDISK, sizeof(bi_disk));
+	BI_ADD(_wedge, BTINFO_BOOTWEDGE, sizeof(bi_wedge));
+	efidisk_getbiosgeom();
+
 	efi_load_start = marks[MARK_START];
 
 	/* adjust to the real load address */



CVS commit: src/sys/arch/i386/stand

2024-01-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sat Jan  6 21:26:43 UTC 2024

Modified Files:
src/sys/arch/i386/stand/efiboot: efidisk.c efidisk.h
src/sys/arch/i386/stand/lib: biosdisk.c exec.c

Log Message:
In efiboot
- create bootinfo information only once.
- add fake biosgeom entries so that the kernel can distinguish between
  hard drives (with geom) and CD-ROM (without).


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/stand/efiboot/efidisk.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/efiboot/efidisk.h
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/i386/stand/lib/biosdisk.c
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/i386/stand/lib/exec.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/i386/stand/libsa

2023-12-14 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Dec 14 08:06:23 UTC 2023

Modified Files:
src/sys/arch/i386/stand/libsa: nfs.c

Log Message:
Align again with libsa (NFS_NOSYMLINK fix).


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/stand/libsa/nfs.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/i386/stand/libsa

2023-12-14 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Thu Dec 14 08:06:23 UTC 2023

Modified Files:
src/sys/arch/i386/stand/libsa: nfs.c

Log Message:
Align again with libsa (NFS_NOSYMLINK fix).


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/stand/libsa/nfs.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/i386/stand/libsa/nfs.c
diff -u src/sys/arch/i386/stand/libsa/nfs.c:1.20 src/sys/arch/i386/stand/libsa/nfs.c:1.21
--- src/sys/arch/i386/stand/libsa/nfs.c:1.20	Tue Dec 12 09:16:17 2023
+++ src/sys/arch/i386/stand/libsa/nfs.c	Thu Dec 14 08:06:23 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs.c,v 1.20 2023/12/12 09:16:17 mlelstv Exp $	*/
+/*	$NetBSD: nfs.c,v 1.21 2023/12/14 08:06:23 mlelstv Exp $	*/
 
 /*-
  *  Copyright (c) 1993 John Brezak
@@ -597,9 +597,9 @@ nfs_open(const char *path, struct open_f
 	char namebuf[NFS_MAXPATHLEN + 1];
 	char linkbuf[NFS_MAXPATHLEN + 1];
 	int nlinks = 0;
+	n_long fa_type;
 #endif
 	int error = 0;
-	n_long fa_type;
 
 #ifdef NFS_DEBUG
  	if (debug)



CVS commit: src/sys/arch/i386/stand/libsa

2023-12-12 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Dec 12 09:16:17 UTC 2023

Modified Files:
src/sys/arch/i386/stand/libsa: nfs.c

Log Message:
Merge with generic libsa NFS code to minimize differences and to learn NFSv3.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/i386/stand/libsa/nfs.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/i386/stand/libsa

2023-12-12 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Tue Dec 12 09:16:17 UTC 2023

Modified Files:
src/sys/arch/i386/stand/libsa: nfs.c

Log Message:
Merge with generic libsa NFS code to minimize differences and to learn NFSv3.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/i386/stand/libsa/nfs.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/i386/stand/libsa/nfs.c
diff -u src/sys/arch/i386/stand/libsa/nfs.c:1.19 src/sys/arch/i386/stand/libsa/nfs.c:1.20
--- src/sys/arch/i386/stand/libsa/nfs.c:1.19	Sun Dec 25 06:09:09 2011
+++ src/sys/arch/i386/stand/libsa/nfs.c	Tue Dec 12 09:16:17 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: nfs.c,v 1.19 2011/12/25 06:09:09 tsutsui Exp $	*/
+/*	$NetBSD: nfs.c,v 1.20 2023/12/12 09:16:17 mlelstv Exp $	*/
 
 /*-
  *  Copyright (c) 1993 John Brezak
@@ -28,6 +28,16 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+/*
+ * XXX Does not currently implement:
+ * XXX
+ * XXX LIBSA_NO_FS_CLOSE
+ * XXX LIBSA_NO_FS_SEEK
+ * XXX LIBSA_NO_FS_WRITE
+ * XXX LIBSA_NO_FS_SYMLINK (does this even make sense?)
+ * XXX LIBSA_FS_SINGLECOMPONENT (does this even make sense?)
+ */
+
 #include 
 #include 
 #include 
@@ -43,6 +53,7 @@
 
 #include "rpcv2.h"
 #include "nfsv2.h"
+#include "nfsv3.h"
 
 #include 
 #include "net.h"
@@ -50,40 +61,11 @@
 #include "nfs.h"
 #include "rpc.h"
 
-/* Define our own NFS attributes. */
-struct nfsv2_fattrs {
-	n_long	fa_type;
-	n_long	fa_mode;
-	n_long	fa_nlink;
-	n_long	fa_uid;
-	n_long	fa_gid;
-	n_long	fa_size;
-	n_long	fa_blocksize;
-	n_long	fa_rdev;
-	n_long	fa_blocks;
-	n_long	fa_fsid;
-	n_long	fa_fileid;
-	struct nfsv2_time fa_atime;
-	struct nfsv2_time fa_mtime;
-	struct nfsv2_time fa_ctime;
-};
-
-
-struct nfs_read_args {
-	u_char	fh[NFS_FHSIZE];
-	n_long	off;
-	n_long	len;
-	n_long	xxx;			/* XXX what's this for? */
-};
+/* Storage for any filehandle (including length for V3) */
+#define NFS_FHSTORE (NFS_FHSIZE < NFS_V3FHSIZE ? NFS_V3FHSIZE + 4: NFS_FHSIZE)
 
 /* Data part of nfs rpc reply (also the largest thing we receive) */
 #define NFSREAD_SIZE 1024
-struct nfs_read_repl {
-	n_long	errno;
-	struct	nfsv2_fattrs fa;
-	n_long	count;
-	u_char	data[NFSREAD_SIZE];
-};
 
 #ifndef NFS_NOSYMLINK
 struct nfs_readlnk_repl {
@@ -93,36 +75,88 @@ struct nfs_readlnk_repl {
 };
 #endif
 
+static inline uint64_t
+getnquad(n_long x[2]) {
+	return (uint64_t)ntohl(x[0]) << 32 | ntohl(x[1]);
+}
+
+static inline void
+setnquad(n_long x[2], uint64_t v)
+{
+	x[0] = htonl((n_long)(v >> 32));
+	x[1] = htonl((n_long)(v & 0x));
+}
+
 struct nfs_iodesc {
 	struct	iodesc	*iodesc;
 	off_t	off;
-	u_char	fh[NFS_FHSIZE];
-	struct nfsv2_fattrs fa;	/* all in network order */
+	int	version;
+	u_char	fh[NFS_FHSTORE];
+	union {
+		/* all in network order */
+		struct nfsv2_fattr v2;
+		struct nfsv3_fattr v3;
+	} u_fa;
 };
 
-int	nfs_getrootfh(struct iodesc *, char *, u_char *);
+static inline size_t
+fhstore(int version, u_char *fh)
+{
+	size_t len;
+
+	switch (version) {
+	case NFS_VER2:
+		len = NFS_FHSIZE;
+		break;
+	case NFS_VER3:
+		len = fh[0] << 24 | fh[1] << 16 | fh[2] << 8 | fh[3];
+		if (len > NFS_V3FHSIZE)
+			len = NFS_V3FHSIZE;
+		len = 4 + roundup(len, 4);
+		break;
+	default:
+		len = 0;
+		break;
+	}
+
+	return len;
+}
+
+static inline size_t
+fhcopy(int version, u_char *src, u_char *dst)
+{
+	size_t len = fhstore(version, src);
+	memcpy(dst, src, len);
+	return len;
+}
+
+#define setfh(d, s) fhcopy((d)->version, (s), (d)->fh)
+#define getfh(d, s) fhcopy((d)->version, (d)->fh, (s))
+
+
+struct nfs_iodesc nfs_root_node;
+
+int	nfs_getrootfh(struct iodesc *, char *, u_char *, int *);
 int	nfs_lookupfh(struct nfs_iodesc *, const char *, int,
 	struct nfs_iodesc *);
-#ifndef NFS_NOSYMLINK
 int	nfs_readlink(struct nfs_iodesc *, char *);
-#endif
 ssize_t	nfs_readdata(struct nfs_iodesc *, off_t, void *, size_t);
 
 /*
  * Fetch the root file handle (call mount daemon)
- * Return zero or error number.
+ * On error, return non-zero and set errno.
  */
 int
-nfs_getrootfh(struct iodesc *d, char *path, u_char *fhp)
+nfs_getrootfh(struct iodesc *d, char *path, u_char *fhp, int *versionp)
 {
-	size_t len;
+	int len;
 	struct args {
 		n_long	len;
 		char	path[FNAME_SIZE];
 	} *args;
 	struct repl {
 		n_long	errno;
-		u_char	fh[NFS_FHSIZE];
+		u_char	fh[NFS_FHSTORE];
 	} *repl;
 	struct {
 		n_long	h[RPC_HEADER_WORDS];
@@ -136,32 +170,42 @@ nfs_getrootfh(struct iodesc *d, char *pa
 
 #ifdef NFS_DEBUG
 	if (debug)
-		printf("nfs_getrootfh: %s\n", path);
+		printf("%s: %s\n", __func__, path);
 #endif
 
 	args = 
 	repl = 
 
-	memset(args, 0, sizeof(*args));
+	(void)memset(args, 0, sizeof(*args));
 	len = strlen(path);
-	if (len > sizeof(args->path))
+	if ((size_t)len > sizeof(args->path))
 		len = sizeof(args->path);
 	args->len = htonl(len);
-	memcpy(args->path, path, len);
+	(void)memcpy(args->path, path, len);
 	len = 4 + roundup(len, 4);
 
-	cc = 

CVS commit: src/sys/arch/i386/stand/bootxx

2023-12-08 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Dec  8 16:29:04 UTC 2023

Modified Files:
src/sys/arch/i386/stand/bootxx: pbr.S

Log Message:
Replace several magic numbers with macro to describe GPT's hybrid MBR boot.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/i386/stand/bootxx/pbr.S

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/i386/stand/bootxx/pbr.S
diff -u src/sys/arch/i386/stand/bootxx/pbr.S:1.23 src/sys/arch/i386/stand/bootxx/pbr.S:1.24
--- src/sys/arch/i386/stand/bootxx/pbr.S:1.23	Wed May 11 14:58:00 2022
+++ src/sys/arch/i386/stand/bootxx/pbr.S	Fri Dec  8 16:29:04 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: pbr.S,v 1.23 2022/05/11 14:58:00 andvar Exp $	*/
+/*	$NetBSD: pbr.S,v 1.24 2023/12/08 16:29:04 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 2003,2004 The NetBSD Foundation, Inc.
@@ -71,6 +71,10 @@
 #define MBR_AFTERBPB	62		/* BPB size in floppy master BR */
 #endif
 
+#define GPT_MAGIC	0x54504721	/* '!GPT' magic on hybrid MBR boot */
+#define GPT_ENTRY_OFF	20		/* GPT part entry in handover struct */
+#define GPT_ENT_LBA_OFF	32		/* ent_lba_start in struct gpt_ent */
+
 #ifdef TERSE_ERROR
 /*
  * Error codes. Done this way to save space.
@@ -127,7 +131,7 @@ start0:
 	mov	%cx, %sp
 	mov	%cx, %es
 #ifndef BOOT_FROM_FAT
-	cmpl	$0x54504721, %eax	/* did a GPT hybrid MBR start us? */
+	cmpl	$GPT_MAGIC, %eax	/* did a GPT hybrid MBR start us? */
 	je	boot_gpt
 #endif
 	mov	%cx, %ds
@@ -366,8 +370,9 @@ chs_read:
 
 #ifndef BOOT_FROM_FAT
 boot_gpt:
-	movl	(20+32+0)(%si), %ebp
-	movl	(20+32+4)(%si), %edi
+	/* DS:SI has a pointer to the hybrid MBR handover structure */
+	movl	(GPT_ENTRY_OFF+GPT_ENT_LBA_OFF+0)(%si), %ebp
+	movl	(GPT_ENTRY_OFF+GPT_ENT_LBA_OFF+4)(%si), %edi
 	movw	%cx, %ds
 	movl	%ebp, lba_sector + 0
 	movl	%edi, lba_sector + 4



CVS commit: src/sys/arch/i386/stand/bootxx

2023-12-08 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Dec  8 16:29:04 UTC 2023

Modified Files:
src/sys/arch/i386/stand/bootxx: pbr.S

Log Message:
Replace several magic numbers with macro to describe GPT's hybrid MBR boot.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/i386/stand/bootxx/pbr.S

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



CVS commit: src/sys/arch/i386/stand/dosboot

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 07:09:08 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Drop no-longer-available -DSLOW for libz

It should be lost during merge from upstream.

We may introduce a similar hack again, if it is *really* required;
inflate_fast() may be dropped by using slow path unconditionally.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/i386/stand/dosboot/Makefile

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/i386/stand/dosboot/Makefile
diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.35 src/sys/arch/i386/stand/dosboot/Makefile:1.36
--- src/sys/arch/i386/stand/dosboot/Makefile:1.35	Mon Nov  6 07:02:17 2023
+++ src/sys/arch/i386/stand/dosboot/Makefile	Mon Nov  6 07:09:08 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2023/11/06 07:02:17 rin Exp $
+#	$NetBSD: Makefile,v 1.36 2023/11/06 07:09:08 rin Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -10,7 +10,7 @@ RELOC=		0x100
 
 SRCS= main.c devopen.c exec.c exec_multiboot1.c exec_multiboot2.c
 
-CPPFLAGS+= -DSLOW	# for libz
+#CPPFLAGS+= -DSLOW	# for libz; no longer available
 CPPFLAGS+= -DCOMPAT_386BSD_MBRPART
 CPPFLAGS+= -DXMS
 CPPFLAGS+= -DLIBSA_ENABLE_LS_OP



CVS commit: src/sys/arch/i386/stand/dosboot

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 07:09:08 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Drop no-longer-available -DSLOW for libz

It should be lost during merge from upstream.

We may introduce a similar hack again, if it is *really* required;
inflate_fast() may be dropped by using slow path unconditionally.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/i386/stand/dosboot/Makefile

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



CVS commit: src/sys/arch/i386/stand/dosboot

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 07:02:17 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Do not page-align data segment

4K alignment is too heavy burden for COM executable with 64K limit :)

Fix binary size overflow for clang/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/i386/stand/dosboot/Makefile

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/i386/stand/dosboot/Makefile
diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.34 src/sys/arch/i386/stand/dosboot/Makefile:1.35
--- src/sys/arch/i386/stand/dosboot/Makefile:1.34	Mon Nov  6 06:53:52 2023
+++ src/sys/arch/i386/stand/dosboot/Makefile	Mon Nov  6 07:02:17 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.34 2023/11/06 06:53:52 rin Exp $
+#	$NetBSD: Makefile,v 1.35 2023/11/06 07:02:17 rin Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -34,6 +34,9 @@ I386MISCMAKEFLAGS= I386_INCLUDE_DOS=yes
 # DOS command line arguments are located at 0x.
 COPTS.doscommain.c+= -fno-delete-null-pointer-checks
 
+# Do not page-align data segment.
+LDFLAGS+= -Wl,-N
+
 VERSIONFILE= ${.CURDIR}/version
 
 .include 



CVS commit: src/sys/arch/i386/stand/dosboot

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 07:02:17 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Do not page-align data segment

4K alignment is too heavy burden for COM executable with 64K limit :)

Fix binary size overflow for clang/amd64.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/i386/stand/dosboot/Makefile

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



CVS commit: src/sys/arch/i386/stand/dosboot

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 06:53:52 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Allow NULL dereference to fetch command line arguments

DOS command line arguments are provided as struct psp at 0x;
see doscommain.c.

Recent versions of gcc and clang are clever enough to optimize code
block involving NULL dereference into ud2 insn.

Sprinkle -fno-delete-null-pointer-checks to doscommain.c to
prevent this behavior.

Note that dosboot.com for netbsd-9 and later was broken due to
this ``over optimization''. gcc 5.5.0 and clang 4.0.0 in netbsd-8
generate correct codes without this workaround.

XXX
Are there still use cases for dosboot.com? Does anyone want to
boot NetBSD from real-mode DOS in 2023?


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/i386/stand/dosboot/Makefile

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



CVS commit: src/sys/arch/i386/stand/dosboot

2023-11-05 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Nov  6 06:53:52 UTC 2023

Modified Files:
src/sys/arch/i386/stand/dosboot: Makefile

Log Message:
x86/dosboot: Allow NULL dereference to fetch command line arguments

DOS command line arguments are provided as struct psp at 0x;
see doscommain.c.

Recent versions of gcc and clang are clever enough to optimize code
block involving NULL dereference into ud2 insn.

Sprinkle -fno-delete-null-pointer-checks to doscommain.c to
prevent this behavior.

Note that dosboot.com for netbsd-9 and later was broken due to
this ``over optimization''. gcc 5.5.0 and clang 4.0.0 in netbsd-8
generate correct codes without this workaround.

XXX
Are there still use cases for dosboot.com? Does anyone want to
boot NetBSD from real-mode DOS in 2023?


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/i386/stand/dosboot/Makefile

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/i386/stand/dosboot/Makefile
diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.33 src/sys/arch/i386/stand/dosboot/Makefile:1.34
--- src/sys/arch/i386/stand/dosboot/Makefile:1.33	Mon Sep 23 13:42:36 2019
+++ src/sys/arch/i386/stand/dosboot/Makefile	Mon Nov  6 06:53:52 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.33 2019/09/23 13:42:36 christos Exp $
+#	$NetBSD: Makefile,v 1.34 2023/11/06 06:53:52 rin Exp $
 
 S=	${.CURDIR}/../../../..
 
@@ -31,6 +31,9 @@ SAMISCCPPFLAGS+= -DHEAP_START=0x2 -D
 SAMISCMAKEFLAGS= SA_USE_CREAD=yes SA_INCLUDE_NET=no SA_ENABLE_LS_OP=yes
 I386MISCMAKEFLAGS= I386_INCLUDE_DOS=yes
 
+# DOS command line arguments are located at 0x.
+COPTS.doscommain.c+= -fno-delete-null-pointer-checks
+
 VERSIONFILE= ${.CURDIR}/version
 
 .include 



CVS commit: src/sys/arch/i386/stand/lib

2023-10-01 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Mon Oct  2 00:02:34 UTC 2023

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
Fix build with -DNO_GPT


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib

2023-10-01 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Mon Oct  2 00:02:34 UTC 2023

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
Fix build with -DNO_GPT


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib/biosdisk.c
diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.59 src/sys/arch/i386/stand/lib/biosdisk.c:1.60
--- src/sys/arch/i386/stand/lib/biosdisk.c:1.59	Thu Sep 28 15:46:55 2023
+++ src/sys/arch/i386/stand/lib/biosdisk.c	Mon Oct  2 00:02:33 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosdisk.c,v 1.59 2023/09/28 15:46:55 manu Exp $	*/
+/*	$NetBSD: biosdisk.c,v 1.60 2023/10/02 00:02:33 manu Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998
@@ -328,7 +328,6 @@ guid_is_equal(const struct uuid *a, cons
 	return (memcmp(a, b, sizeof(*a)) == 0 ? true : false);
 }
 
-#ifndef NO_GPT
 static void
 part_name_utf8(const uint16_t *utf16_src, size_t utf16_srclen,
 	   char *utf8_dst, size_t utf8_dstlen)
@@ -351,7 +350,6 @@ part_name_utf8(const uint16_t *utf16_src
 
 	return;
 }
-#endif
 
 static int
 check_gpt(struct biosdisk *d, daddr_t rf_offset, daddr_t sector)
@@ -1562,14 +1560,17 @@ next_disk:
 			if (d->part[part].fstype == FS_UNUSED)
 continue;
 
+#ifndef NO_GPT
 			if (first_bootme == -1 &&
 			d->part[part].attr & GPT_ENT_ATTR_BOOTME)
 first_bootme = part;
+#endif
 
 			if (first_ffs == -1 &&
 			(d->part[part].fstype == FS_BSDFFS ||
 			 d->part[part].fstype == FS_BSDLFS))
 first_ffs = part;
+
 			if (part == target_part) {
 *biosdev = raidframe[i].biosdev;
 *offset = raidframe[i].offset



CVS commit: src/sys/arch/i386/stand/lib

2023-09-28 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Sep 28 15:46:55 UTC 2023

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
Align the behavior of different boot methods in RAIDframe

We enforce the documented and paritally implemented behavior when
looking for the kernel in RAID 1 sets without a partition name given.
We search for:
- A GPT partition with bootme attribute set
- A FFS or LFS patititon
- The first partition


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib/biosdisk.c
diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.58 src/sys/arch/i386/stand/lib/biosdisk.c:1.59
--- src/sys/arch/i386/stand/lib/biosdisk.c:1.58	Tue May  3 10:09:40 2022
+++ src/sys/arch/i386/stand/lib/biosdisk.c	Thu Sep 28 15:46:55 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosdisk.c,v 1.58 2022/05/03 10:09:40 jmcneill Exp $	*/
+/*	$NetBSD: biosdisk.c,v 1.59 2023/09/28 15:46:55 manu Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998
@@ -105,6 +105,7 @@
 struct biosdisk {
 	struct biosdisk_ll ll;
 	daddr_t boff;
+	daddr_t size;
 	charbuf[BIOSDISK_BUFSIZE];
 #if !defined(NO_DISKLABEL) || !defined(NO_GPT)
 	struct biosdisk_partition part[BIOSDISKNPART];
@@ -666,6 +667,7 @@ read_label(struct biosdisk *d, daddr_t o
 	dflt_lbl.d_npartitions = 8;
 
 	d->boff = 0;
+	d->size = 0;
 
 	if (d->ll.type != BIOSDISK_TYPE_HD)
 		/* No label on floppy and CD */
@@ -1208,7 +1210,7 @@ add_biosdisk_bootinfo(void)
 #endif
 
 #ifndef NO_GPT
-static daddr_t
+static void
 raidframe_part_offset(struct biosdisk *d, int part)
 {
 	struct biosdisk raidframe;
@@ -1221,8 +1223,10 @@ raidframe_part_offset(struct biosdisk *d
 
 	rf_offset = d->part[part].offset + RF_PROTECTED_SECTORS;
 	rf_size = d->part[part].size;
-	if (read_gpt(, rf_offset, rf_size) != 0)
-		return RF_PROTECTED_SECTORS;
+	if (read_gpt(, rf_offset, rf_size) != 0) {
+		d->boff += RF_PROTECTED_SECTORS;
+		return;
+	}
 
 	candidate = 0;
 	for (i = 0; i < BIOSDISKNPART; i++) {
@@ -1231,12 +1235,20 @@ raidframe_part_offset(struct biosdisk *d
 		if (raidframe.part[i].fstype == FS_UNUSED)
 			continue;
 #ifndef NO_GPT
-		if (raidframe.part[i].attr & GPT_ENT_ATTR_BOOTME)
+		if (raidframe.part[i].attr & GPT_ENT_ATTR_BOOTME) {
 			candidate = i;
+			break;
+		}
 #endif
+		if (raidframe.part[i].fstype == FS_BSDFFS ||
+		raidframe.part[i].fstype == FS_BSDLFS) {
+			if (candidate == 0)
+candidate = i;
+		}
 	}
 
-	return RF_PROTECTED_SECTORS + raidframe.part[candidate].offset;
+	d->boff += RF_PROTECTED_SECTORS + raidframe.part[candidate].offset;
+	d->size = raidframe.part[candidate].size;
 }
 #endif
 
@@ -1285,17 +1297,18 @@ biosdisk_open(struct open_file *f, ...)
 	}
 
 	d->boff = d->part[partition].offset;
+	d->size = d->part[partition].size;
 
 	if (d->part[partition].fstype == FS_RAID)
 #ifndef NO_GPT
-		d->boff += raidframe_part_offset(d, partition);
+		raidframe_part_offset(d, partition);
 #else
 		d->boff += RF_PROTECTED_SECTORS;
 #endif
 
 #ifdef _STANDALONE
-	bi_wedge.startblk = d->part[partition].offset;
-	bi_wedge.nblks = d->part[partition].size;
+	bi_wedge.startblk = d->boff;
+	bi_wedge.nblks = d->size;
 #endif
 
 nolabel:
@@ -1389,6 +1402,8 @@ next_disk:
 
 #ifndef NO_RAIDFRAME
 	for (i = 0; i < raidframe_count; i++) {
+		int first_bootme = -1;
+		int first_ffs = -1;
 		int candidate = -1;
 
 		if ((d = alloc_biosdisk(raidframe[i].biosdev)) == NULL) {
@@ -1402,12 +1417,20 @@ next_disk:
 			goto next_raidframe;
 
 		for (part = 0; part < BIOSDISKNPART; part++) {
-			bool bootme = d->part[part].attr & GPT_ENT_ATTR_BOOTME;
 			if (d->part[part].size == 0)
 continue;
 			if (d->part[part].fstype == FS_UNUSED)
 continue;
 
+			if (first_bootme == -1 && 
+			d->part[part].attr & GPT_ENT_ATTR_BOOTME)
+first_bootme = part;
+
+			if (first_ffs == -1 && 
+			(d->part[part].fstype == FS_BSDFFS ||
+			 d->part[part].fstype == FS_BSDLFS))
+first_ffs = part;
+
 			if (d->part[part].part_name != NULL &&
 			strcmp(d->part[part].part_name, name) == 0) {
 *biosdev = raidframe[i].biosdev;
@@ -1418,11 +1441,13 @@ next_disk:
 ret = 0;
 goto out;
 			}
-			if (strcmp(raidframe[i].parent_name, name) == 0) {
-if (candidate == -1 || bootme)
-	candidate = part;
-continue;
-			}
+		}
+
+		if (strcmp(raidframe[i].parent_name, name) == 0) {
+			if (first_bootme != -1)
+candidate = first_bootme;
+			else if (first_ffs != -1)
+candidate = first_ffs;
 		}
 
 		if (candidate != -1) {
@@ -1514,6 +1539,10 @@ next_disk:
 	}
 
 	for (i = 0; i < raidframe_count; i++) {
+		int first_bootme = -1;
+		int first_ffs = -1;
+		int candidate = -1;
+
 		if (raidframe[i].last_unit != target_unit)
 			continue;
 
@@ -1532,6 +1561,15 @@ next_disk:
 continue;
 			if (d->part[part].fstype == 

CVS commit: src/sys/arch/i386/stand/lib

2023-09-28 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Sep 28 15:46:55 UTC 2023

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
Align the behavior of different boot methods in RAIDframe

We enforce the documented and paritally implemented behavior when
looking for the kernel in RAID 1 sets without a partition name given.
We search for:
- A GPT partition with bootme attribute set
- A FFS or LFS patititon
- The first partition


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/efiboot

2023-09-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Sep 14 03:05:15 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: eficons.c

Log Message:
efiboot/x86: eficons.c: Explicitly include params.h for howmany()

NFC for -current and netbsd-10, but necessary for netbsd-[89] to
pull up raw IO serial port support (PR port-amd64/57523).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/stand/efiboot/eficons.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/i386/stand/efiboot

2023-09-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Thu Sep 14 03:05:15 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: eficons.c

Log Message:
efiboot/x86: eficons.c: Explicitly include params.h for howmany()

NFC for -current and netbsd-10, but necessary for netbsd-[89] to
pull up raw IO serial port support (PR port-amd64/57523).


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/stand/efiboot/eficons.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/i386/stand/efiboot/eficons.c
diff -u src/sys/arch/i386/stand/efiboot/eficons.c:1.13 src/sys/arch/i386/stand/efiboot/eficons.c:1.14
--- src/sys/arch/i386/stand/efiboot/eficons.c:1.13	Mon Jul 24 01:56:59 2023
+++ src/sys/arch/i386/stand/efiboot/eficons.c	Thu Sep 14 03:05:15 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: eficons.c,v 1.13 2023/07/24 01:56:59 rin Exp $	*/
+/*	$NetBSD: eficons.c,v 1.14 2023/09/14 03:05:15 rin Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -26,6 +26,7 @@
  * SUCH DAMAGE.
  */
 
+#include 
 #include 
 #include 
 



CVS commit: src/sys/arch/i386/stand/bootxx

2023-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 30 18:46:52 UTC 2023

Modified Files:
src/sys/arch/i386/stand/bootxx/bootxx_msdos: Makefile
src/sys/arch/i386/stand/bootxx/bootxx_ustarfs: Makefile

Log Message:
Override these two booters with -Oz for clang since it produces smaller code
here.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/sys/arch/i386/stand/bootxx/bootxx_ustarfs/Makefile

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/i386/stand/bootxx/bootxx_msdos/Makefile
diff -u src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile:1.4 src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile:1.5
--- src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile:1.4	Wed Jan 22 01:13:18 2020
+++ src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile	Wed Aug 30 14:46:51 2023
@@ -1,7 +1,11 @@
-# $NetBSD: Makefile,v 1.4 2020/01/22 06:13:18 martin Exp $
+# $NetBSD: Makefile,v 1.5 2023/08/30 18:46:51 christos Exp $
+
+NOMAN=yes
+.include 
 
 PROG=	bootxx_msdos
 FS=	dosfs
 CPPFLAGS=-DBOOT_FROM_FAT -DTERSE_ERROR -DSA_DOSFS_NO_BIG_PART_SUPPORT
 
 .include <../Makefile.bootxx>
+OPT_SIZE.clang += -Oz

Index: src/sys/arch/i386/stand/bootxx/bootxx_ustarfs/Makefile
diff -u src/sys/arch/i386/stand/bootxx/bootxx_ustarfs/Makefile:1.3 src/sys/arch/i386/stand/bootxx/bootxx_ustarfs/Makefile:1.4
--- src/sys/arch/i386/stand/bootxx/bootxx_ustarfs/Makefile:1.3	Wed Nov 18 16:02:16 2009
+++ src/sys/arch/i386/stand/bootxx/bootxx_ustarfs/Makefile	Wed Aug 30 14:46:52 2023
@@ -1,7 +1,11 @@
-# $NetBSD: Makefile,v 1.3 2009/11/18 21:02:16 dsl Exp $
+# $NetBSD: Makefile,v 1.4 2023/08/30 18:46:52 christos Exp $
+
+NOMAN=yes
+.include 
 
 FS=ustarfs
 
 BOOTXX_SECTORS=16
 
 .include <../Makefile.bootxx>
+OPT_SIZE.clang += -Oz



CVS commit: src/sys/arch/i386/stand/bootxx

2023-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 30 18:46:52 UTC 2023

Modified Files:
src/sys/arch/i386/stand/bootxx/bootxx_msdos: Makefile
src/sys/arch/i386/stand/bootxx/bootxx_ustarfs: Makefile

Log Message:
Override these two booters with -Oz for clang since it produces smaller code
here.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/sys/arch/i386/stand/bootxx/bootxx_ustarfs/Makefile

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



CVS commit: src/sys/arch/i386/stand

2023-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 30 18:45:46 UTC 2023

Modified Files:
src/sys/arch/i386/stand: Makefile.inc

Log Message:
Merge the OPT_SIZE flags. -Oz is not always producing smaller code that -Os,
so default to -Os for both, and we'll override where needed.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/stand/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/i386/stand/Makefile.inc
diff -u src/sys/arch/i386/stand/Makefile.inc:1.18 src/sys/arch/i386/stand/Makefile.inc:1.19
--- src/sys/arch/i386/stand/Makefile.inc:1.18	Sat Jan 26 23:56:46 2019
+++ src/sys/arch/i386/stand/Makefile.inc	Wed Aug 30 14:45:46 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.18 2019/01/27 04:56:46 dholland Exp $
+#	$NetBSD: Makefile.inc,v 1.19 2023/08/30 18:45:46 christos Exp $
 
 NOLIBCSANITIZER=
 NOSANITIZER=
@@ -10,8 +10,6 @@ NOMAN=
 BINDIR=	/usr/mdec
 
 OPT_SIZE.gcc=	-Os -ffreestanding -fomit-frame-pointer -fno-unwind-tables \
-		-fno-asynchronous-unwind-tables -fno-exceptions -mno-sse
-OPT_SIZE.clang=	-Oz -ffreestanding -fomit-frame-pointer -DNDEBUG \
-		-fno-stack-protector -mno-sse \
-		-mstack-alignment=4 \
-		-fno-unwind-tables
+		-fno-asynchronous-unwind-tables -fno-exceptions -mno-sse \
+		-fno-stack-protector
+OPT_SIZE.clang=	${OPT_SIZE.gcc} -mstack-alignment=4  -DNDEBUG



CVS commit: src/sys/arch/i386/stand

2023-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 30 18:45:46 UTC 2023

Modified Files:
src/sys/arch/i386/stand: Makefile.inc

Log Message:
Merge the OPT_SIZE flags. -Oz is not always producing smaller code that -Os,
so default to -Os for both, and we'll override where needed.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/stand/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/i386/stand/lib

2023-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 30 18:44:48 UTC 2023

Modified Files:
src/sys/arch/i386/stand/lib: Makefile.inc

Log Message:
Explicitly pass COPTS


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/i386/stand/lib/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/i386/stand/lib/Makefile.inc
diff -u src/sys/arch/i386/stand/lib/Makefile.inc:1.19 src/sys/arch/i386/stand/lib/Makefile.inc:1.20
--- src/sys/arch/i386/stand/lib/Makefile.inc:1.19	Wed Jun 13 12:03:10 2018
+++ src/sys/arch/i386/stand/lib/Makefile.inc	Wed Aug 30 14:44:48 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.19 2018/06/13 16:03:10 christos Exp $
+#	$NetBSD: Makefile.inc,v 1.20 2023/08/30 18:44:48 christos Exp $
 #
 #	Configuration variables (default values are below):
 #
@@ -26,6 +26,7 @@ I386MAKE= \
 	MAKEOBJDIR=${I386DST} ${MAKE} \
 	CC=${CC:q} CFLAGS=${CFLAGS:q} \
 	AS=${AS:q} AFLAGS=${AFLAGS:q} \
+	COPTS=${COPTS:q} \
 	LD=${LD:q} STRIP=${STRIP:q} \
 	MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:q} \
 	I386CPPFLAGS=${CPPFLAGS:S@^-I.@-I../../.@g:q} \



CVS commit: src/sys/arch/i386/stand/lib

2023-08-30 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Aug 30 18:44:48 UTC 2023

Modified Files:
src/sys/arch/i386/stand/lib: Makefile.inc

Log Message:
Explicitly pass COPTS


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/i386/stand/lib/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/i386/stand/lib

2023-08-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Aug  4 07:21:57 UTC 2023

Modified Files:
src/sys/arch/i386/stand/lib: exec_multiboot2.c

Log Message:
x86/multiboot2: Fix short read for 64-bit ELF headers

XXX document this
At the moment, this cannot affect NetBSD/amd64, as we have not
supported multiboot for kernel side.

Found by GCC12.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/lib/exec_multiboot2.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/i386/stand/lib/exec_multiboot2.c
diff -u src/sys/arch/i386/stand/lib/exec_multiboot2.c:1.5 src/sys/arch/i386/stand/lib/exec_multiboot2.c:1.6
--- src/sys/arch/i386/stand/lib/exec_multiboot2.c:1.5	Wed Jul 21 23:16:08 2021
+++ src/sys/arch/i386/stand/lib/exec_multiboot2.c	Fri Aug  4 07:21:57 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_multiboot2.c,v 1.5 2021/07/21 23:16:08 jmcneill Exp $ */
+/* $NetBSD: exec_multiboot2.c,v 1.6 2023/08/04 07:21:57 rin Exp $ */
 
 /*
  * Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -976,7 +976,10 @@ mbi_elf_sections(struct multiboot_packag
 {
 	size_t len = 0;
 	struct multiboot_tag_elf_sections *mbt = buf;
-	Elf_Ehdr ehdr;
+	union {
+		Elf32_Ehdr e32;
+		Elf64_Ehdr e64;
+	} ehdr;
 	int class;
 	Elf32_Ehdr *ehdr32 = NULL;
 	Elf64_Ehdr *ehdr64 = NULL;
@@ -991,21 +994,21 @@ mbi_elf_sections(struct multiboot_packag
 	/*
 	 * Check this is a ELF header
 	 */
-	if (memcmp(_ident, ELFMAG, SELFMAG) != 0)
+	if (memcmp(_ident, ELFMAG, SELFMAG) != 0)
 		goto out;
 
-	class = ehdr.e_ident[EI_CLASS];
+	class = ehdr.e32.e_ident[EI_CLASS];
 
 	switch (class) {
 	case ELFCLASS32:
-		ehdr32 = (Elf32_Ehdr *)
+		ehdr32 = 
 		shnum = ehdr32->e_shnum;
 		shentsize = ehdr32->e_shentsize;
 		shstrndx = ehdr32->e_shstrndx;
 		shoff = ehdr32->e_shoff;
 		break;
 	case ELFCLASS64:
-		ehdr64 = (Elf64_Ehdr *)
+		ehdr64 = 
 		shnum = ehdr64->e_shnum;
 		shentsize = ehdr64->e_shentsize;
 		shstrndx = ehdr64->e_shstrndx;



CVS commit: src/sys/arch/i386/stand/lib

2023-08-04 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Aug  4 07:21:57 UTC 2023

Modified Files:
src/sys/arch/i386/stand/lib: exec_multiboot2.c

Log Message:
x86/multiboot2: Fix short read for 64-bit ELF headers

XXX document this
At the moment, this cannot affect NetBSD/amd64, as we have not
supported multiboot for kernel side.

Found by GCC12.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/lib/exec_multiboot2.c

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



Re: CVS commit: src/sys/arch/i386/stand/efiboot

2023-07-24 Thread Rin Okuyama

On 2023/07/24 16:14, matthew green wrote:

"Rin Okuyama" writes:

Module Name:src
Committed By:   rin
Date:   Mon Jul 24 01:56:59 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: Makefile.efiboot eficons.c
Added Files:
src/sys/arch/i386/stand/efiboot: eficpufunc.c eficpufunc.h

Log Message:
efiboot/x86: Add serial console support via raw I/O port access


thanks!  this makes efiboot capable of replacing bios on many
of my test systems that can use serial console (and often do.)


Thank you too for your feedback! I'm glad to hear that :)

rin


re: CVS commit: src/sys/arch/i386/stand/efiboot

2023-07-24 Thread matthew green
"Rin Okuyama" writes:
> Module Name:  src
> Committed By: rin
> Date: Mon Jul 24 01:56:59 UTC 2023
>
> Modified Files:
>   src/sys/arch/i386/stand/efiboot: Makefile.efiboot eficons.c
> Added Files:
>   src/sys/arch/i386/stand/efiboot: eficpufunc.c eficpufunc.h
>
> Log Message:
> efiboot/x86: Add serial console support via raw I/O port access

thanks!  this makes efiboot capable of replacing bios on many
of my test systems that can use serial console (and often do.)


.mrg.


CVS commit: src/sys/arch/i386/stand/efiboot

2023-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul 24 01:56:59 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: Makefile.efiboot eficons.c
Added Files:
src/sys/arch/i386/stand/efiboot: eficpufunc.c eficpufunc.h

Log Message:
efiboot/x86: Add serial console support via raw I/O port access

Unfortunately, some (most?) UEFI implementations do not support
com ports by ``Serial I/O Protocol''.

``PNP0501-0'' and friends are not recognized also.

In this case, if user explicitly requires to switch to serial
console by ``consdev'' command, try to use raw I/O port access.

Ugly, but what FreeBSD does, at least.

Proposed as PR port-amd64/57523


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/stand/efiboot/eficons.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/stand/efiboot/eficpufunc.c \
src/sys/arch/i386/stand/efiboot/eficpufunc.h

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



CVS commit: src/sys/arch/i386/stand/efiboot

2023-07-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jul 24 01:56:59 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: Makefile.efiboot eficons.c
Added Files:
src/sys/arch/i386/stand/efiboot: eficpufunc.c eficpufunc.h

Log Message:
efiboot/x86: Add serial console support via raw I/O port access

Unfortunately, some (most?) UEFI implementations do not support
com ports by ``Serial I/O Protocol''.

``PNP0501-0'' and friends are not recognized also.

In this case, if user explicitly requires to switch to serial
console by ``consdev'' command, try to use raw I/O port access.

Ugly, but what FreeBSD does, at least.

Proposed as PR port-amd64/57523


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/stand/efiboot/eficons.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/stand/efiboot/eficpufunc.c \
src/sys/arch/i386/stand/efiboot/eficpufunc.h

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/i386/stand/efiboot/Makefile.efiboot
diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.21 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.22
--- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.21	Sat Jun  3 08:52:56 2023
+++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot	Mon Jul 24 01:56:59 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.efiboot,v 1.21 2023/06/03 08:52:56 lukem Exp $
+# $NetBSD: Makefile.efiboot,v 1.22 2023/07/24 01:56:59 rin Exp $
 
 S=		${.CURDIR}/../../../../..
 
@@ -14,9 +14,11 @@ AFLAGS.start.S= ${${ACTIVE_CC} == "clang
 
 SOURCES= start.S boot.c conf.c devopen.c dev_net.c self_reloc.c panic.c
 SOURCES+= efiboot.c efichar.c eficons.c efidelay.c efidev.c
+SOURCES+= eficpufunc.c
 SOURCES+= efidisk.c efidisk_ll.c efigetsecs.c efimemory.c
 SOURCES+= efinet.c efipxe.c
 LIBI386SRCS= biosdisk.c bootinfo.c bootinfo_biosgeom.c bootmenu.c
+LIBI386SRCS+= comio_direct.c
 LIBI386SRCS+= diskbuf.c exec.c menuutils.c parseutils.c pread.c
 LIBI386SRCS+= exec_multiboot1.c exec_multiboot2.c
 # use our own nfs implementation

Index: src/sys/arch/i386/stand/efiboot/eficons.c
diff -u src/sys/arch/i386/stand/efiboot/eficons.c:1.12 src/sys/arch/i386/stand/efiboot/eficons.c:1.13
--- src/sys/arch/i386/stand/efiboot/eficons.c:1.12	Thu Oct 28 06:13:13 2021
+++ src/sys/arch/i386/stand/efiboot/eficons.c	Mon Jul 24 01:56:59 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: eficons.c,v 1.12 2021/10/28 06:13:13 kim Exp $	*/
+/*	$NetBSD: eficons.c,v 1.13 2023/07/24 01:56:59 rin Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -29,6 +29,8 @@
 #include 
 #include 
 
+#include 
+
 #include "efiboot.h"
 
 #include "bootinfo.h"
@@ -60,6 +62,8 @@ static u_char serbuf[16];
 static int serbuf_read = 0;
 static int serbuf_write = 0;
 
+static int raw_com_addr = 0;
+
 static void eficons_init_video(void);
 static void efi_switch_video_to_text_mode(void);
 
@@ -76,6 +80,12 @@ static int efi_com_putc(int);
 static int efi_com_status(int);
 static int efi_com_waitforinputevent(uint64_t);
 
+static int raw_com_init(int, int);
+static int raw_com_getc(void);
+static int raw_com_putc(int);
+static int raw_com_status(int);
+static int raw_com_waitforinputevent(uint64_t);
+
 static int efi_find_gop_mode(char *);
 
 static int iodev;
@@ -134,11 +144,8 @@ ok:
 	case CONSDEV_COM3:
 		iodev = dev;
 		btinfo_console.addr = ioport;
-		if (btinfo_console.addr == 0) {
-			if (!efi_valid_com(iodev))
-goto nocom;
+		if (btinfo_console.addr == 0)
 			btinfo_console.addr = getcomaddr(iodev - CONSDEV_COM0);
-		}
 		if (speed != 0)
 			btinfo_console.speed = speed;
 		efi_com_init(btinfo_console.addr, btinfo_console.speed);
@@ -149,8 +156,6 @@ ok:
 	case CONSDEV_COM2KBD:
 	case CONSDEV_COM3KBD:
 		iodev = dev - CONSDEV_COM0KBD + CONSDEV_COM0;
-		if (!efi_valid_com(iodev))
-			goto nocom;
 		btinfo_console.addr = getcomaddr(iodev - CONSDEV_COM0);
 
 		efi_cons_putc('0' + iodev - CONSDEV_COM0);
@@ -869,7 +874,7 @@ efi_com_init(int addr, int speed)
 		return 0;
 
 	if (!efi_valid_com(iodev))
-		return 0;
+		return raw_com_init(addr, speed);
 
 	serio = serios[iodev - CONSDEV_COM0];
 
@@ -885,6 +890,7 @@ efi_com_init(int addr, int speed)
 		}
 	}
 
+	raw_com_addr = 0;
 	default_comspeed = speed;
 	internal_getchar = efi_com_getc;
 	internal_putchar = efi_com_putc;
@@ -1019,3 +1025,65 @@ efi_com_waitforinputevent(uint64_t timeo
 		return ETIMEDOUT;
 	return EINVAL;
 }
+
+static int
+raw_com_init(int addr, int speed)
+{
+
+	if (addr == 0 || speed <= 0)
+		return 0;
+
+	speed = cominit_d(addr, speed);
+
+	raw_com_addr = addr;
+	default_comspeed = speed;
+	internal_getchar = raw_com_getc;
+	internal_putchar = raw_com_putc;
+	internal_iskey = raw_com_status;
+	internal_waitforinputevent = raw_com_waitforinputevent;
+
+	return speed;
+}
+
+static int
+raw_com_getc(void)
+{
+
+	if (raw_com_addr == 0)
+		panic("%s: Invalid serial port", 

Re: CVS commit: src/sys/arch/i386/stand/bootxx

2023-06-29 Thread Greg Troxel
Emmanuel Dreyfus  writes:

> On Thu, Jun 29, 2023 at 08:43:36PM -0400, Greg Troxel wrote:
>> > Primary bootstrap is now able to read a GPT inside RAIDframe.
>> did you also update documentation?
>
> We do not have any documentation specific to primary bootstrap. 
> x86/boot(8) domuent the behavior with no detail about primary
> and secondary bootstrap distinct roles.
>
> The change makes primary bootstrap behavior in line with secondary
> bootstrap and with what is already documented in x86/boot(8). Hence
> there is no documentation update, we could consider it as a bug fix, 
> since the previosu behavior did not match x86/boot(8) documentation.

Thank you for explaining.  That sounds fine then.


Re: CVS commit: src/sys/arch/i386/stand/bootxx

2023-06-29 Thread Emmanuel Dreyfus
On Thu, Jun 29, 2023 at 08:43:36PM -0400, Greg Troxel wrote:
> > Primary bootstrap is now able to read a GPT inside RAIDframe.
> did you also update documentation?

We do not have any documentation specific to primary bootstrap. 
x86/boot(8) domuent the behavior with no detail about primary
and secondary bootstrap distinct roles.

The change makes primary bootstrap behavior in line with secondary
bootstrap and with what is already documented in x86/boot(8). Hence
there is no documentation update, we could consider it as a bug fix, 
since the previosu behavior did not match x86/boot(8) documentation.

-- 
Emmanuel Dreyfus
m...@netbsd.org


Re: CVS commit: src/sys/arch/i386/stand/bootxx

2023-06-29 Thread Greg Troxel
"Emmanuel Dreyfus"  writes:

> Log Message:
> Primary bootstrap is now able to read a GPT inside RAIDframe.

did you also update documentation?


CVS commit: src/sys/arch/i386/stand/bootxx

2023-06-29 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Jun 29 14:18:58 UTC 2023

Modified Files:
src/sys/arch/i386/stand/bootxx: boot1.c

Log Message:
Primary bootstrap is now able to read a GPT inside RAIDframe.

Previously, primary bootstrap was able to boot on RAID-1 RAIDframe set
with the limitation that the FFS filesystem had to start at bloc 0 in the
RAID. That allowed inner RAID partitionning with a disklabel, but not with
a GPT.

When booting on a RAID-1 RAIDframe, primary bootstrap now first try a
filesystem at bloc 0 of the RAID as before. On failure, it tries to
read a GPT and load secondary bootstrap from, by priority;
1) the first partition with the bootme attribute set
2) the first partition of type FFS, LFS, CCD or CGD
3) the first partition present in the GPT


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/stand/bootxx/boot1.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/i386/stand/bootxx/boot1.c
diff -u src/sys/arch/i386/stand/bootxx/boot1.c:1.21 src/sys/arch/i386/stand/bootxx/boot1.c:1.22
--- src/sys/arch/i386/stand/bootxx/boot1.c:1.21	Thu Jun 24 01:23:16 2021
+++ src/sys/arch/i386/stand/bootxx/boot1.c	Thu Jun 29 14:18:58 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot1.c,v 1.21 2021/06/24 01:23:16 gutteridge Exp $	*/
+/*	$NetBSD: boot1.c,v 1.22 2023/06/29 14:18:58 manu Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,15 +30,17 @@
  */
 
 #include 
-__RCSID("$NetBSD: boot1.c,v 1.21 2021/06/24 01:23:16 gutteridge Exp $");
+__RCSID("$NetBSD: boot1.c,v 1.22 2023/06/29 14:18:58 manu Exp $");
 
 #include 
 #include 
 #include 
 
 #include 
+#include 
 #include 
 #include 
+#include 
 #include 	/* For RF_PROTECTED_SECTORS */
 
 #define XSTR(x) #x
@@ -49,6 +51,9 @@ static daddr_t bios_sector;
 static struct biosdisk_ll d;
 
 const char *boot1(uint32_t, uint64_t *);
+#ifndef NO_GPT
+static daddr_t gpt_lookup(daddr_t);
+#endif
 extern void putstr(const char *);
 
 extern struct disklabel ptn_disklabel;
@@ -90,6 +95,17 @@ boot1(uint32_t biosdev, uint64_t *sector
 	fd = ob();
 	if (fd != -1)
 		goto done;
+
+#ifndef NO_GPT
+	/*
+	 * Test for a GPT inside the RAID
+	 */
+	bios_sector += gpt_lookup(bios_sector);
+	fd = ob();
+	if (fd != -1)
+		goto done;
+#endif
+
 	/*
 	 * Nothing at the start of the MBR partition, fallback on
 	 * partition 'a' from the disklabel in this MBR partition.
@@ -144,3 +160,146 @@ blkdevstrategy(void *devdata, int flag, 
 
 	return 0;
 }
+
+#ifndef NO_GPT
+static int
+is_unused(struct gpt_ent *ent)
+{
+	const struct uuid unused = GPT_ENT_TYPE_UNUSED;
+
+	return (memcmp(ent->ent_type, , sizeof(unused)) == 0);
+}
+
+static int
+is_bootable(struct gpt_ent *ent)
+{
+	/* GPT_ENT_TYPE_NETBSD_RAID omitted as we are already in a RAID */
+	const struct uuid bootable[] = {
+		GPT_ENT_TYPE_NETBSD_FFS,
+		GPT_ENT_TYPE_NETBSD_LFS,
+		GPT_ENT_TYPE_NETBSD_CCD,
+		GPT_ENT_TYPE_NETBSD_CGD,
+	};
+	int i;
+
+	for (i = 0; i < sizeof(bootable) / sizeof(*bootable); i++) {
+		if (memcmp(ent->ent_type, [i],
+		sizeof(struct uuid)) == 0)
+			return 1;
+	}
+
+	return 0;
+}
+
+static daddr_t
+gpt_lookup(daddr_t sector)
+{
+	char buf[BIOSDISK_DEFAULT_SECSIZE];
+	struct mbr_sector *pmbr;	
+	const char gpt_hdr_sig[] = GPT_HDR_SIG;
+	struct gpt_hdr *hdr;
+	struct gpt_ent *ent;
+	uint32_t nents;
+	uint32_t entsz;
+	uint32_t entries_per_sector;
+	uint32_t sectors_per_entry;
+	uint64_t firstpart_lba = 0;
+	uint64_t bootable_lba = 0;
+	uint64_t bootme_lba = 0;
+	int i, j;
+
+	/*
+	 * Look for a PMBR
+	 */
+	if (readsects(, sector, 1, buf, 1) != 0)
+		return 0;
+
+	pmbr = (struct mbr_sector *)buf;
+
+	if (pmbr->mbr_magic != htole16(MBR_MAGIC))
+		return 0;
+
+	if (pmbr->mbr_parts[0].mbrp_type != MBR_PTYPE_PMBR)
+		return 0;
+
+	sector++; /* skip PMBR */
+
+	/*
+	 * Look for a GPT header
+	 * Space is scarce, we do not check CRC.
+	 */
+	if (readsects(, sector, 1, buf, 1) != 0)
+		return 0;
+
+	hdr = (struct gpt_hdr *)buf;
+
+	if (memcmp(gpt_hdr_sig, hdr->hdr_sig, sizeof(hdr->hdr_sig)) != 0)
+		return 0;
+
+	if (hdr->hdr_revision != htole32(GPT_HDR_REVISION))
+		return 0;
+
+	if (le32toh(hdr->hdr_size) > BIOSDISK_DEFAULT_SECSIZE)
+		return 0;
+
+	nents = le32toh(hdr->hdr_entries);
+	entsz = le32toh(hdr->hdr_entsz);
+
+	sector++; /* skip GPT header */
+
+	/*
+	 * Read partition table
+	 *
+	 * According to UEFI specification section 5.3.2, entries
+	 * are 128 * (2^n) bytes long. The most common scenario is
+	 * 128 bytes (n = 0) where there are 4 entries per sector.
+	 * If n > 2, then entries spans multiple sectors, but they
+	 * remain sector-aligned.
+	 */
+	entries_per_sector = BIOSDISK_DEFAULT_SECSIZE / entsz;
+	if (entries_per_sector == 0)
+		entries_per_sector = 1;
+
+	sectors_per_entry = entsz / BIOSDISK_DEFAULT_SECSIZE;
+	if (sectors_per_entry == 0)
+		sectors_per_entry = 1;
+
+	for (i = 0; i < nents; i += entries_per_sector) {
+	

CVS commit: src/sys/arch/i386/stand/bootxx

2023-06-29 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Thu Jun 29 14:18:58 UTC 2023

Modified Files:
src/sys/arch/i386/stand/bootxx: boot1.c

Log Message:
Primary bootstrap is now able to read a GPT inside RAIDframe.

Previously, primary bootstrap was able to boot on RAID-1 RAIDframe set
with the limitation that the FFS filesystem had to start at bloc 0 in the
RAID. That allowed inner RAID partitionning with a disklabel, but not with
a GPT.

When booting on a RAID-1 RAIDframe, primary bootstrap now first try a
filesystem at bloc 0 of the RAID as before. On failure, it tries to
read a GPT and load secondary bootstrap from, by priority;
1) the first partition with the bootme attribute set
2) the first partition of type FFS, LFS, CCD or CGD
3) the first partition present in the GPT


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/stand/bootxx/boot1.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/i386/stand/efiboot

2023-06-20 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jun 20 07:46:03 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: devopen.c

Log Message:
``int i'' is used only for SUPPORT_NFS || SUPPORT_TFTP.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/stand/efiboot/devopen.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/i386/stand/efiboot

2023-06-20 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jun 20 07:46:03 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: devopen.c

Log Message:
``int i'' is used only for SUPPORT_NFS || SUPPORT_TFTP.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/stand/efiboot/devopen.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/i386/stand/efiboot/devopen.c
diff -u src/sys/arch/i386/stand/efiboot/devopen.c:1.13 src/sys/arch/i386/stand/efiboot/devopen.c:1.14
--- src/sys/arch/i386/stand/efiboot/devopen.c:1.13	Mon Dec 27 12:19:27 2021
+++ src/sys/arch/i386/stand/efiboot/devopen.c	Tue Jun 20 07:46:03 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: devopen.c,v 1.13 2021/12/27 12:19:27 simonb Exp $	 */
+/*	$NetBSD: devopen.c,v 1.14 2023/06/20 07:46:03 rin Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -154,13 +154,13 @@ devopen(struct open_file *f, const char 
 	const char *xname = NULL;
 	int unit, partition;
 	int biosdev;
-	int i, error;
+	int error;
 #if defined(SUPPORT_NFS) || defined(SUPPORT_TFTP)
 	struct devdesc desc;
 	const struct netboot_fstab *nf;
 	char *filename;
 	size_t fsnamelen;
-	int n;
+	int i, n;
 #endif
 
 	error = parsebootfile(fname, , , , ,



CVS commit: src/sys/arch/i386/stand/efiboot/bootia32

2023-06-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jun 19 04:30:27 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot/bootia32: efibootia32.c

Log Message:
whitespace -> tab, blank line, no binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.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/i386/stand/efiboot/bootia32/efibootia32.c
diff -u src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c:1.7 src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c:1.8
--- src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c:1.7	Sun May 14 09:07:54 2023
+++ src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c	Mon Jun 19 04:30:27 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: efibootia32.c,v 1.7 2023/05/14 09:07:54 riastradh Exp $	*/
+/*	$NetBSD: efibootia32.c,v 1.8 2023/06/19 04:30:27 rin Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -57,16 +57,15 @@ efi_md_init(void)
 	startprog32 = (void *)(u_long)addr;
 	CopyMem(startprog32, startprog32_start, startprog32_size);
 
-addr = EFI_ALLOCATE_MAX_ADDRESS;
-sz = EFI_SIZE_TO_PAGES(multiboot32_size);
-status = uefi_call_wrapper(BS->AllocatePages, 4, AllocateMaxAddress,
-EfiLoaderData, sz, );
-if (EFI_ERROR(status))
-panic("%s: AllocatePages() failed: %d page(s): %" PRIxMAX,
-__func__, sz, (uintmax_t)status);
-multiboot32 = (void *)(u_long)addr;
-CopyMem(multiboot32, multiboot32_start, multiboot32_size);
-
+	addr = EFI_ALLOCATE_MAX_ADDRESS;
+	sz = EFI_SIZE_TO_PAGES(multiboot32_size);
+	status = uefi_call_wrapper(BS->AllocatePages, 4, AllocateMaxAddress,
+	EfiLoaderData, sz, );
+	if (EFI_ERROR(status))
+		panic("%s: AllocatePages() failed: %d page(s): %" PRIxMAX,
+		__func__, sz, (uintmax_t)status);
+	multiboot32 = (void *)(u_long)addr;
+	CopyMem(multiboot32, multiboot32_start, multiboot32_size);
 }
 
 /* ARGSUSED */



CVS commit: src/sys/arch/i386/stand/efiboot/bootia32

2023-06-18 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Jun 19 04:30:27 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot/bootia32: efibootia32.c

Log Message:
whitespace -> tab, blank line, no binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.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/i386/stand/efiboot

2023-05-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May 14 09:07:54 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: boot.c efidisk.c efimemory.c
src/sys/arch/i386/stand/efiboot/bootia32: efibootia32.c

Log Message:
x86/efiboot: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/stand/efiboot/boot.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/efiboot/efidisk.c \
src/sys/arch/i386/stand/efiboot/efimemory.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.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/i386/stand/efiboot/boot.c
diff -u src/sys/arch/i386/stand/efiboot/boot.c:1.22 src/sys/arch/i386/stand/efiboot/boot.c:1.23
--- src/sys/arch/i386/stand/efiboot/boot.c:1.22	Thu Apr 20 00:42:24 2023
+++ src/sys/arch/i386/stand/efiboot/boot.c	Sun May 14 09:07:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.22 2023/04/20 00:42:24 manu Exp $	*/
+/*	$NetBSD: boot.c,v 1.23 2023/05/14 09:07:54 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -483,7 +483,7 @@ command_dev(char *arg)
 	if (*arg == '\0') {
 		efi_disk_show();
 		efi_net_show();
-	
+
 		if (default_part_name != NULL)
 			printf("default NAME=%s\n", default_part_name);
 		else
@@ -647,7 +647,7 @@ void
 command_reloc(char *arg)
 {
 	char *ep;
-	
+
 	if (*arg == '\0') {
 		switch (efi_reloc_type) {
 		case RELOC_NONE:

Index: src/sys/arch/i386/stand/efiboot/efidisk.c
diff -u src/sys/arch/i386/stand/efiboot/efidisk.c:1.9 src/sys/arch/i386/stand/efiboot/efidisk.c:1.10
--- src/sys/arch/i386/stand/efiboot/efidisk.c:1.9	Tue Dec 17 01:37:52 2019
+++ src/sys/arch/i386/stand/efiboot/efidisk.c	Sun May 14 09:07:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: efidisk.c,v 1.9 2019/12/17 01:37:52 manu Exp $	*/
+/*	$NetBSD: efidisk.c,v 1.10 2023/05/14 09:07:54 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -70,9 +70,9 @@ dealloc_biosdisk_part(struct biosdisk_pa
 			part[i].part_name = NULL;
 		}
 	}
-	
+
 	dealloc(part, sizeof(*part) * nparts);
-	
+
 	return;
 }
 
@@ -194,7 +194,6 @@ efi_raidframe_probe(struct efi_raidframe
 	return;
 }
 
-
 void
 efi_disk_show(void)
 {
@@ -293,7 +292,7 @@ efi_disk_show(void)
 		raidframe[i].size,
 		, ))
 			continue;
-			
+
 		first = 1;
 		for (j = 0; j < nparts; j++) {
 			bool bootme = part[j].attr & GPT_ENT_ATTR_BOOTME;
Index: src/sys/arch/i386/stand/efiboot/efimemory.c
diff -u src/sys/arch/i386/stand/efiboot/efimemory.c:1.9 src/sys/arch/i386/stand/efiboot/efimemory.c:1.10
--- src/sys/arch/i386/stand/efiboot/efimemory.c:1.9	Fri Sep 13 02:19:45 2019
+++ src/sys/arch/i386/stand/efiboot/efimemory.c	Sun May 14 09:07:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: efimemory.c,v 1.9 2019/09/13 02:19:45 manu Exp $	*/
+/*	$NetBSD: efimemory.c,v 1.10 2023/05/14 09:07:54 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -221,7 +221,7 @@ efi_memory_get_memmap(struct bi_memmap_e
 
 		next = NextMemoryDescriptor(md, DescriptorSize);
 	}
-	
+
 	*memmapp = memmap;
 	*num = NoEntries;
 	return 0;

Index: src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c
diff -u src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c:1.6 src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c:1.7
--- src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c:1.6	Thu Apr 20 00:42:24 2023
+++ src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c	Sun May 14 09:07:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: efibootia32.c,v 1.6 2023/04/20 00:42:24 manu Exp $	*/
+/*	$NetBSD: efibootia32.c,v 1.7 2023/05/14 09:07:54 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -60,7 +60,7 @@ efi_md_init(void)
 addr = EFI_ALLOCATE_MAX_ADDRESS;
 sz = EFI_SIZE_TO_PAGES(multiboot32_size);
 status = uefi_call_wrapper(BS->AllocatePages, 4, AllocateMaxAddress,
-EfiLoaderData, sz, ); 
+EfiLoaderData, sz, );
 if (EFI_ERROR(status))
 panic("%s: AllocatePages() failed: %d page(s): %" PRIxMAX,
 __func__, sz, (uintmax_t)status);



CVS commit: src/sys/arch/i386/stand/efiboot

2023-05-14 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun May 14 09:07:54 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: boot.c efidisk.c efimemory.c
src/sys/arch/i386/stand/efiboot/bootia32: efibootia32.c

Log Message:
x86/efiboot: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/i386/stand/efiboot/boot.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/efiboot/efidisk.c \
src/sys/arch/i386/stand/efiboot/efimemory.c
cvs rdiff -u -r1.6 -r1.7 \
src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.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/i386/stand/efiboot

2023-05-09 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Wed May 10 00:49:17 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: version

Log Message:
Raise the version for new feature (here reloc command)
Suggested by Masanobu SAITOH


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/version

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/i386/stand/efiboot/version
diff -u src/sys/arch/i386/stand/efiboot/version:1.2 src/sys/arch/i386/stand/efiboot/version:1.3
--- src/sys/arch/i386/stand/efiboot/version:1.2	Sat Aug  3 08:13:36 2019
+++ src/sys/arch/i386/stand/efiboot/version	Wed May 10 00:49:17 2023
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.2 2019/08/03 08:13:36 nonaka Exp $
+$NetBSD: version,v 1.3 2023/05/10 00:49:17 manu Exp $
 
 NOTE ANY CHANGES YOU MAKE TO THE EFI BOOTLOADER HERE.  The format of this
 file is important - make sure the entries are appended on end, last item
@@ -6,3 +6,4 @@ is taken as the current.
 
 1.0:	Initial version.
 1.1:	Add CD/DVD-ROM, serial, PXE boot and UEFI memory map compaction support.
+1.2:	Add reloc command



CVS commit: src/sys/arch/i386/stand/efiboot

2023-05-09 Thread Emmanuel Dreyfus
Module Name:src
Committed By:   manu
Date:   Wed May 10 00:49:17 UTC 2023

Modified Files:
src/sys/arch/i386/stand/efiboot: version

Log Message:
Raise the version for new feature (here reloc command)
Suggested by Masanobu SAITOH


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/version

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



CVS commit: src/sys/arch/i386/stand

2023-01-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 18 12:28:55 UTC 2023

Modified Files:
src/sys/arch/i386/stand: Makefile.booters

Log Message:
Fix the clang build by setting -z noseparate-code


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/i386/stand/Makefile.booters

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/i386/stand/Makefile.booters
diff -u src/sys/arch/i386/stand/Makefile.booters:1.94 src/sys/arch/i386/stand/Makefile.booters:1.95
--- src/sys/arch/i386/stand/Makefile.booters:1.94	Sun Sep  6 03:20:28 2020
+++ src/sys/arch/i386/stand/Makefile.booters	Wed Jan 18 07:28:54 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.booters,v 1.94 2020/09/06 07:20:28 mrg Exp $
+#	$NetBSD: Makefile.booters,v 1.95 2023/01/18 12:28:54 christos Exp $
 
 NOLIBCSANITIZER=
 NOSANITIZER=
@@ -77,7 +77,7 @@ cleandir distclean: .WAIT cleanlibdir
 cleanlibdir:
 	-rm -rf lib
 
-LDFLAGS+=-Wl,-M -Wl,-e,start 	# -N does not work properly.
+LDFLAGS+=-Wl,-z,noseparate-code -Wl,-M -Wl,-e,start 	# -N does not work properly.
 
 LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA}
 



CVS commit: src/sys/arch/i386/stand

2023-01-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan 18 12:28:55 UTC 2023

Modified Files:
src/sys/arch/i386/stand: Makefile.booters

Log Message:
Fix the clang build by setting -z noseparate-code


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/i386/stand/Makefile.booters

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



CVS commit: src/sys/arch/i386/stand/efiboot

2022-12-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 25 22:14:05 UTC 2022

Modified Files:
src/sys/arch/i386/stand/efiboot: Makefile.efiboot

Log Message:
Fix broken flag -nocombreloc, 2.34 did not complain for not understanding it,
but 2.39 wants -z nocombreloc. Is it really needed?


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/i386/stand/efiboot/Makefile.efiboot

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



CVS commit: src/sys/arch/i386/stand/efiboot

2022-12-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Dec 25 22:14:05 UTC 2022

Modified Files:
src/sys/arch/i386/stand/efiboot: Makefile.efiboot

Log Message:
Fix broken flag -nocombreloc, 2.34 did not complain for not understanding it,
but 2.39 wants -z nocombreloc. Is it really needed?


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/i386/stand/efiboot/Makefile.efiboot

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/i386/stand/efiboot/Makefile.efiboot
diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.19 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.20
--- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.19	Thu Nov 18 11:17:40 2021
+++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot	Sun Dec 25 17:14:05 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.efiboot,v 1.19 2021/11/18 16:17:40 manu Exp $
+# $NetBSD: Makefile.efiboot,v 1.20 2022/12/25 22:14:05 christos Exp $
 
 S=		${.CURDIR}/../../../../..
 
@@ -41,8 +41,8 @@ BINMODE=444
 .PATH:	${.CURDIR}/../../libsa
 
 LDSCRIPT?= ${.CURDIR}/ldscript
-LDFLAGS+= --no-dynamic-linker --noinhibit-exec
-LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared -nocombreloc
+LDFLAGS+= --no-dynamic-linker --noinhibit-exec -z nocombreloc
+LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared
 CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR}/.. -I$S/lib/libsa
 CPPFLAGS+= -I${.OBJDIR}
 CPPFLAGS+= -I${.CURDIR}/../../lib



CVS commit: src/sys/arch/i386/stand/lib

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 14:29:45 UTC 2022

Modified Files:
src/sys/arch/i386/stand/lib: exec.c

Log Message:
i386/stand: Handle 9.99.100 by taking four, not two, digits.

We haven't used the revision part of __NetBSD_Version__ = MMmmrrpp00
in almos two decades so we're apparently reclaiming it as MMmm00.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/i386/stand/lib/exec.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/i386/stand/lib/exec.c
diff -u src/sys/arch/i386/stand/lib/exec.c:1.77 src/sys/arch/i386/stand/lib/exec.c:1.78
--- src/sys/arch/i386/stand/lib/exec.c:1.77	Sun May 30 05:59:23 2021
+++ src/sys/arch/i386/stand/lib/exec.c	Wed Sep 21 14:29:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: exec.c,v 1.77 2021/05/30 05:59:23 mlelstv Exp $	 */
+/*	$NetBSD: exec.c,v 1.78 2022/09/21 14:29:45 riastradh Exp $	 */
 
 /*
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -684,7 +684,7 @@ module_base_path(char *buf, size_t bufsi
 		"/stand/%s/%d.%d.%d/modules", machine,
 		netbsd_version / 1,
 		netbsd_version / 100 % 100,
-		netbsd_version / 100 % 100);
+		netbsd_version / 100 % 1);
 	} else if (netbsd_version != 0) {
 		/* release */
 		snprintf(buf, bufsize,



CVS commit: src/sys/arch/i386/stand/lib

2022-09-21 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Sep 21 14:29:45 UTC 2022

Modified Files:
src/sys/arch/i386/stand/lib: exec.c

Log Message:
i386/stand: Handle 9.99.100 by taking four, not two, digits.

We haven't used the revision part of __NetBSD_Version__ = MMmmrrpp00
in almos two decades so we're apparently reclaiming it as MMmm00.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/i386/stand/lib/exec.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/i386/stand

2022-06-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun  8 21:43:45 UTC 2022

Modified Files:
src/sys/arch/i386/stand/boot: boot2.c
src/sys/arch/i386/stand/efiboot: boot.c

Log Message:
Do not use default entry's parameters for for plain "boot" command

Go back to the "menu" instead of you want that.

Patch from RVP in PR 56862, ok uwe@


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/i386/stand/boot/boot2.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/stand/efiboot/boot.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/i386/stand/boot/boot2.c
diff -u src/sys/arch/i386/stand/boot/boot2.c:1.78 src/sys/arch/i386/stand/boot/boot2.c:1.79
--- src/sys/arch/i386/stand/boot/boot2.c:1.78	Tue Sep  7 11:41:31 2021
+++ src/sys/arch/i386/stand/boot/boot2.c	Wed Jun  8 21:43:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot2.c,v 1.78 2021/09/07 11:41:31 nia Exp $	*/
+/*	$NetBSD: boot2.c,v 1.79 2022/06/08 21:43:45 wiz Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -488,10 +488,6 @@ command_boot(char *arg)
 	} else {
 		int i;
 
-#ifndef SMALL
-		if (howto == 0)
-			bootdefault();
-#endif
 		for (i = 0; i < NUMNAMES; i++) {
 			bootit(names[i][0], howto);
 			bootit(names[i][1], howto);

Index: src/sys/arch/i386/stand/efiboot/boot.c
diff -u src/sys/arch/i386/stand/efiboot/boot.c:1.20 src/sys/arch/i386/stand/efiboot/boot.c:1.21
--- src/sys/arch/i386/stand/efiboot/boot.c:1.20	Tue Sep  7 11:41:31 2021
+++ src/sys/arch/i386/stand/efiboot/boot.c	Wed Jun  8 21:43:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.20 2021/09/07 11:41:31 nia Exp $	*/
+/*	$NetBSD: boot.c,v 1.21 2022/06/08 21:43:45 wiz Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -453,8 +453,6 @@ command_boot(char *arg)
 	} else {
 		int i;
 
-		if (howto == 0)
-			bootdefault();
 		for (i = 0; i < NUMNAMES; i++) {
 			bootit(names[i][0], howto);
 			bootit(names[i][1], howto);



CVS commit: src/sys/arch/i386/stand

2022-06-08 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Jun  8 21:43:45 UTC 2022

Modified Files:
src/sys/arch/i386/stand/boot: boot2.c
src/sys/arch/i386/stand/efiboot: boot.c

Log Message:
Do not use default entry's parameters for for plain "boot" command

Go back to the "menu" instead of you want that.

Patch from RVP in PR 56862, ok uwe@


To generate a diff of this commit:
cvs rdiff -u -r1.78 -r1.79 src/sys/arch/i386/stand/boot/boot2.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/stand/efiboot/boot.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/i386/stand/lib

2022-05-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue May  3 10:09:40 UTC 2022

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib/biosdisk.c
diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.57 src/sys/arch/i386/stand/lib/biosdisk.c:1.58
--- src/sys/arch/i386/stand/lib/biosdisk.c:1.57	Tue Dec 28 00:37:16 2021
+++ src/sys/arch/i386/stand/lib/biosdisk.c	Tue May  3 10:09:40 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosdisk.c,v 1.57 2021/12/28 00:37:16 simonb Exp $	*/
+/*	$NetBSD: biosdisk.c,v 1.58 2022/05/03 10:09:40 jmcneill Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998
@@ -544,7 +544,7 @@ ingest_label(struct biosdisk *d, struct 
 		d->part[part].size = lp->d_partitions[part].p_size;
 	}
 }
-	
+
 static int
 check_label(struct biosdisk *d, daddr_t sector)
 {
@@ -787,7 +787,6 @@ read_partitions(struct biosdisk *d, dadd
 #endif
 #ifndef NO_DISKLABEL
 	error = read_label(d, offset);
-	
 #endif
 	return error;
 }
@@ -893,7 +892,7 @@ biosdisk_probe(void)
 
 		if (read_partitions(d, 0, 0) != 0)
 			goto next_disk;
-			
+
 		for (part = 0; part < BIOSDISKNPART; part++) {
 			if (d->part[part].size == 0)
 continue;
@@ -969,7 +968,7 @@ next_disk:
 		raidframe[i].offset + RF_PROTECTED_SECTORS,
 		raidframe[i].size) != 0)
 			goto next_raidrame;
-			
+
 		first = 1;
 		for (part = 0; part < BIOSDISKNPART; part++) {
 #ifndef NO_GPT
@@ -1240,7 +1239,7 @@ raidframe_part_offset(struct biosdisk *d
 	return RF_PROTECTED_SECTORS + raidframe.part[candidate].offset;
 }
 #endif
-	
+
 int
 biosdisk_open(struct open_file *f, ...)
 /* struct open_file *f, int biosdev, int partition */
@@ -1356,7 +1355,7 @@ biosdisk_find_name(const char *fname, in
 
 		if (read_partitions(d, 0, 0) != 0)
 			goto next_disk;
-			
+
 		for (part = 0; part < BIOSDISKNPART; part++) {
 			if (d->part[part].size == 0)
 continue;
@@ -1401,7 +1400,7 @@ next_disk:
 		raidframe[i].offset + RF_PROTECTED_SECTORS,
 		raidframe[i].size) != 0)
 			goto next_raidframe;
-			
+
 		for (part = 0; part < BIOSDISKNPART; part++) {
 			bool bootme = d->part[part].attr & GPT_ENT_ATTR_BOOTME;
 			if (d->part[part].size == 0)
@@ -1499,7 +1498,7 @@ biosdisk_find_raid(const char *name, int
 
 		if (read_partitions(d, 0, 0) != 0)
 			goto next_disk;
-			
+
 		for (part = 0; part < BIOSDISKNPART; part++) {
 			if (d->part[part].size == 0)
 continue;
@@ -1527,7 +1526,7 @@ next_disk:
 		raidframe[i].offset + RF_PROTECTED_SECTORS,
 		raidframe[i].size) != 0)
 			goto next_raidframe;
-			
+
 		for (part = 0; part < BIOSDISKNPART; part++) {
 			if (d->part[part].size == 0)
 continue;



CVS commit: src/sys/arch/i386/stand/lib

2022-05-03 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Tue May  3 10:09:40 UTC 2022

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib

2022-04-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Apr  1 19:02:12 UTC 2022

Modified Files:
src/sys/arch/i386/stand/lib: realprot.S

Log Message:
s/potected/protected and s/investication/investigation/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/lib/realprot.S

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/i386/stand/lib/realprot.S
diff -u src/sys/arch/i386/stand/lib/realprot.S:1.11 src/sys/arch/i386/stand/lib/realprot.S:1.12
--- src/sys/arch/i386/stand/lib/realprot.S:1.11	Tue Dec 24 19:00:56 2013
+++ src/sys/arch/i386/stand/lib/realprot.S	Fri Apr  1 19:02:12 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: realprot.S,v 1.11 2013/12/24 19:00:56 jakllsch Exp $	*/
+/*	$NetBSD: realprot.S,v 1.12 2022/04/01 19:02:12 andvar Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -188,7 +188,7 @@ ENTRY(real_to_prot)
  *
  * It is speculated that the CPU is prefetching and decoding branch
  * targets and not invalidating this buffer on the long jump.
- * Further investication indicates that the caching of return addresses
+ * Further investigation indicates that the caching of return addresses
  * is most likely the problem.
  *
  * Previous versions just used some extra call/ret and a few NOPs, these
@@ -229,7 +229,7 @@ ENTRY(prot_to_real)
 	.code16
 	movl	%cr0, %eax
 	and 	$~CR0_PE, %eax
-	movl	%eax, %cr0		/* Disable potected mode */
+	movl	%eax, %cr0		/* Disable protected mode */
 
 	/* Jump far indirect to load real mode %cs */
 	ljmp	*%cs:toreal



CVS commit: src/sys/arch/i386/stand/lib

2022-04-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Fri Apr  1 19:02:12 UTC 2022

Modified Files:
src/sys/arch/i386/stand/lib: realprot.S

Log Message:
s/potected/protected and s/investication/investigation/ in comments.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/lib/realprot.S

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



CVS commit: src/sys/arch/i386/stand/bootxx

2022-03-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Mar  6 18:35:43 UTC 2022

Modified Files:
src/sys/arch/i386/stand/bootxx: bootxx.S

Log Message:
pass errno through switch to protected mode.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/bootxx/bootxx.S

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/i386/stand/bootxx/bootxx.S
diff -u src/sys/arch/i386/stand/bootxx/bootxx.S:1.11 src/sys/arch/i386/stand/bootxx/bootxx.S:1.12
--- src/sys/arch/i386/stand/bootxx/bootxx.S:1.11	Thu Jul 11 03:49:51 2019
+++ src/sys/arch/i386/stand/bootxx/bootxx.S	Sun Mar  6 18:35:43 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: bootxx.S,v 1.11 2019/07/11 03:49:51 msaitoh Exp $	*/
+/*	$NetBSD: bootxx.S,v 1.12 2022/03/06 18:35:43 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -79,6 +79,7 @@ boot_params:/* space for patchable v
 	push	%edx
 	call	_C_LABEL(boot1)		/* C code to load /boot */
 	add	$8, %esp
+	movw	errno, %dx
 	call	prot_to_real
 	.code16
 
@@ -94,7 +95,7 @@ boot_params:/* space for patchable v
 
 boot_fail:
 	push	%ax			/* error string from boot1 */
-	movw	errno, %ax
+	movw	%dx, %ax
 	aam/* largest errno is < 100 */
 	addw	$('0' << 8) | '0', %ax	/* to ascii */
 	rorw	$8, %ax



CVS commit: src/sys/arch/i386/stand/bootxx

2022-03-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Sun Mar  6 18:35:43 UTC 2022

Modified Files:
src/sys/arch/i386/stand/bootxx: bootxx.S

Log Message:
pass errno through switch to protected mode.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/bootxx/bootxx.S

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



CVS commit: src/sys/arch/i386/stand/lib

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Dec 28 00:37:16 UTC 2021

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
In biosdisk_findpartition() check if part_name isn't NULL before
assigning *part_name.

Thanks to manu@ for the pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Dec 28 00:37:16 UTC 2021

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
In biosdisk_findpartition() check if part_name isn't NULL before
assigning *part_name.

Thanks to manu@ for the pointer.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib/biosdisk.c
diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.56 src/sys/arch/i386/stand/lib/biosdisk.c:1.57
--- src/sys/arch/i386/stand/lib/biosdisk.c:1.56	Tue Dec 28 00:34:30 2021
+++ src/sys/arch/i386/stand/lib/biosdisk.c	Tue Dec 28 00:37:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosdisk.c,v 1.56 2021/12/28 00:34:30 simonb Exp $	*/
+/*	$NetBSD: biosdisk.c,v 1.57 2021/12/28 00:37:16 simonb Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998
@@ -1028,7 +1028,8 @@ biosdisk_findpartition(int biosdev, dadd
 {
 #if defined(NO_DISKLABEL) && defined(NO_GPT)
 	*partition = 0;
-	*part_name = NULL;
+	if (part_name)
+		*part_name = NULL;
 	return 0;
 #else
 	int i;
@@ -1047,7 +1048,8 @@ biosdisk_findpartition(int biosdev, dadd
 
 	/* default to first partition */
 	*partition = 0;
-	*part_name = NULL;
+	if (part_name)
+		*part_name = NULL;
 
 	/* Look for netbsd partition that is the dos boot one */
 	d = alloc_biosdisk(biosdev);



Re: CVS commit: src/sys/arch/i386/stand/efiboot

2021-12-27 Thread Simon Burge
Emmanuel Dreyfus wrote:

> In src/sys/arch/i386/stand/lib/biosdisk.c
> int
> biosdisk_findpartition(int biosdev, daddr_t sector,
>int *partition, const char **part_name)
> {
> (...)
> /* default ot first partition */
> *partition = 0;
> *part_name = NULL;
>
> part_name is NULL, *part_name crashes. How do you avoid that?

Aha, I have this elsewhere in my zfs tree:

*partition = 0;
-   *part_name = NULL;
+   if (part_name)
+   *part_name = NULL;

I'll commit that now (as well as the same check for the
NO_DISKLABEL && NO_GPT case.  Thanks for the digging!

Cheers,
Simon.


CVS commit: src/sys/arch/i386/stand/lib

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Dec 28 00:34:30 UTC 2021

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
Fix a tyop.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Tue Dec 28 00:34:30 UTC 2021

Modified Files:
src/sys/arch/i386/stand/lib: biosdisk.c

Log Message:
Fix a tyop.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib/biosdisk.c
diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.55 src/sys/arch/i386/stand/lib/biosdisk.c:1.56
--- src/sys/arch/i386/stand/lib/biosdisk.c:1.55	Sun May 30 05:59:23 2021
+++ src/sys/arch/i386/stand/lib/biosdisk.c	Tue Dec 28 00:34:30 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: biosdisk.c,v 1.55 2021/05/30 05:59:23 mlelstv Exp $	*/
+/*	$NetBSD: biosdisk.c,v 1.56 2021/12/28 00:34:30 simonb Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998
@@ -1045,7 +1045,7 @@ biosdisk_findpartition(int biosdev, dadd
 	printf("looking for partition device %x, sector %"PRId64"\n", biosdev, sector);
 #endif
 
-	/* default ot first partition */
+	/* default to first partition */
 	*partition = 0;
 	*part_name = NULL;
 



CVS commit: src/sys/arch/i386/stand/efiboot

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Dec 27 12:19:27 UTC 2021

Modified Files:
src/sys/arch/i386/stand/efiboot: devopen.c

Log Message:
Revert rev 1.12 of devopen.c.  This had the unintented side effect
of breaking opens on non-root filesystems (eg trying to open/read
"esp:/EFI/NetBSD/boot.cfg" on the EFI system partition).

Ok manu@.  Original problem to be re-addressed.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/stand/efiboot/devopen.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/i386/stand/efiboot/devopen.c
diff -u src/sys/arch/i386/stand/efiboot/devopen.c:1.12 src/sys/arch/i386/stand/efiboot/devopen.c:1.13
--- src/sys/arch/i386/stand/efiboot/devopen.c:1.12	Thu Nov 18 16:18:13 2021
+++ src/sys/arch/i386/stand/efiboot/devopen.c	Mon Dec 27 12:19:27 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: devopen.c,v 1.12 2021/11/18 16:18:13 manu Exp $	 */
+/*	$NetBSD: devopen.c,v 1.13 2021/12/27 12:19:27 simonb Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -288,9 +288,8 @@ neterr:
 	 * biosdisk
 	 */
 	if (strcmp(devname, "esp") == 0) {
-		const char *part_name = NULL;
 		bios2dev(boot_biosdev, boot_biossector, , ,
-		, _name);
+		, NULL);
 		if (efidisk_get_efi_system_partition(boot_biosdev, ))
 			return ENXIO;
 	}



CVS commit: src/sys/arch/i386/stand/efiboot

2021-12-27 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Mon Dec 27 12:19:27 UTC 2021

Modified Files:
src/sys/arch/i386/stand/efiboot: devopen.c

Log Message:
Revert rev 1.12 of devopen.c.  This had the unintented side effect
of breaking opens on non-root filesystems (eg trying to open/read
"esp:/EFI/NetBSD/boot.cfg" on the EFI system partition).

Ok manu@.  Original problem to be re-addressed.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/stand/efiboot/devopen.c

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



Re: CVS commit: src/sys/arch/i386/stand/efiboot

2021-12-27 Thread Simon Burge
Emmanuel Dreyfus wrote:

> On Mon, Dec 27, 2021 at 01:08:15PM +1100, Simon Burge wrote:
> > What crash did this fix?  All the use of part_name by the
> > called functions should check if it is NULL before trying
> > to assign anything to *part_name.
>
> I do not recall the details now, but I had a crash because
> of this. Please revert my change, I will get back to it when
> I find some time.

Thanks.  I'll revert that now.

If you have a way of preproducing this, I'm happy to have a look.

Cheers,
Simon.


Re: CVS commit: src/sys/arch/i386/stand/efiboot

2021-12-26 Thread Emmanuel Dreyfus
On Mon, Dec 27, 2021 at 01:08:15PM +1100, Simon Burge wrote:
> What crash did this fix?  All the use of part_name by the
> called functions should check if it is NULL before trying
> to assign anything to *part_name.

I do not recall the details now, but I had a crash because
of this. Please revert my change, I will get back to it when
I find some time.

-- 
Emmanuel Dreyfus
m...@netbsd.org


  1   2   3   4   5   6   7   >