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/include

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 22:35:28 UTC 2024

Modified Files:
src/sys/arch/i386/include: asm.h

Log Message:
i386/asm.h: Respect _NETBSD_REVISIONID.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/i386/include/asm.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/include/asm.h
diff -u src/sys/arch/i386/include/asm.h:1.44 src/sys/arch/i386/include/asm.h:1.45
--- src/sys/arch/i386/include/asm.h:1.44	Sat Apr 25 15:26:17 2020
+++ src/sys/arch/i386/include/asm.h	Sun Jun  9 22:35:27 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.44 2020/04/25 15:26:17 bouyer Exp $	*/
+/*	$NetBSD: asm.h,v 1.45 2024/06/09 22:35:27 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -181,11 +181,18 @@
 #define	ASMSTR		.asciz
 
 #ifdef __ELF__
-#define RCSID(x)	.pushsection ".ident","MS",@progbits,1;		\
+#define _IDENTSTR(x)	.pushsection ".ident","MS",@progbits,1;		\
 			.asciz x;	\
 			.popsection
 #else
-#define RCSID(x)	.text; .asciz x
+#define _IDENTSTR(x)	.text; .asciz x
+#endif
+#ifdef _NETBSD_REVISIONID
+#define	RCSID(_s)			  \
+	_IDENTSTR(_s);			  \
+	_IDENTSTR("$" "NetBSD: " __FILE__ " " _NETBSD_REVISIONID " $")
+#else
+#define	RCSID(_s)			_IDENTSTR(_s)
 #endif
 
 #ifdef NO_KERNEL_RCSIDS



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

2024-06-09 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jun  9 22:35:28 UTC 2024

Modified Files:
src/sys/arch/i386/include: asm.h

Log Message:
i386/asm.h: Respect _NETBSD_REVISIONID.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/i386/include/asm.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/conf

2024-05-13 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon May 13 21:50:47 UTC 2024

Modified Files:
src/sys/arch/i386/conf: LEGACY

Log Message:
also exclude DRM_LEGACY from the ISA kernel


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/conf/LEGACY

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/conf/LEGACY
diff -u src/sys/arch/i386/conf/LEGACY:1.3 src/sys/arch/i386/conf/LEGACY:1.4
--- src/sys/arch/i386/conf/LEGACY:1.3	Sun Apr 28 08:12:44 2024
+++ src/sys/arch/i386/conf/LEGACY	Mon May 13 21:50:47 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: LEGACY,v 1.3 2024/04/28 08:12:44 nia Exp $
+#	$NetBSD: LEGACY,v 1.4 2024/05/13 21:50:47 nia Exp $
 
 # LEGACY kernel -- includes vga@isa and pcdisplay@isa for pre-PCI
 # systems, due to significant pain making them fail to attach when
@@ -24,3 +24,5 @@ no radeondrmkmsfb*	at radeonfbbus?  
 
 no nouveau*		at pci?
 no nouveaufb*		at nouveaufbbus?
+
+no options		DRM_LEGACY



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

2024-05-13 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Mon May 13 21:50:47 UTC 2024

Modified Files:
src/sys/arch/i386/conf: LEGACY

Log Message:
also exclude DRM_LEGACY from the ISA kernel


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/conf/LEGACY

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/eisa

2024-05-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed May  1 16:28:33 UTC 2024

Modified Files:
src/sys/arch/i386/eisa: eisa_machdep.c

Log Message:
Make eisa_machdep build without NIOAPIC > 0 by extracting irq definition.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/i386/eisa/eisa_machdep.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/eisa/eisa_machdep.c
diff -u src/sys/arch/i386/eisa/eisa_machdep.c:1.41 src/sys/arch/i386/eisa/eisa_machdep.c:1.42
--- src/sys/arch/i386/eisa/eisa_machdep.c:1.41	Sat Jun 18 22:11:00 2022
+++ src/sys/arch/i386/eisa/eisa_machdep.c	Wed May  1 16:28:33 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: eisa_machdep.c,v 1.41 2022/06/18 22:11:00 andvar Exp $	*/
+/*	$NetBSD: eisa_machdep.c,v 1.42 2024/05/01 16:28:33 andvar Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.41 2022/06/18 22:11:00 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: eisa_machdep.c,v 1.42 2024/05/01 16:28:33 andvar Exp $");
 
 #include "ioapic.h"
 
@@ -160,7 +160,15 @@ const char *
 eisa_intr_string(eisa_chipset_tag_t ec, eisa_intr_handle_t ih, char *buf,
 size_t len)
 {
-	if (ih == 0 || APIC_IRQ_LEGACY_IRQ(ih) >= NUM_LEGACY_IRQS || ih == 2)
+	int irq; 
+	
+#if NIOAPIC > 0
+	irq = APIC_IRQ_LEGACY_IRQ(ih);
+#else
+	irq = (int) ih;
+#endif
+
+	if (ih == 0 || irq >= NUM_LEGACY_IRQS || ih == 2)
 		panic("eisa_intr_string: bogus handle 0x%" PRIx64, ih);
 
 #if NIOAPIC > 0
@@ -168,11 +176,11 @@ eisa_intr_string(eisa_chipset_tag_t ec, 
 		snprintf(buf, len, "apic %d int %d (irq %d)",
 		APIC_IRQ_APIC(ih),
 		APIC_IRQ_PIN(ih),
-		APIC_IRQ_LEGACY_IRQ(ih));
+		irq);
 	else
-		snprintf(buf, len, "irq %d",  APIC_IRQ_LEGACY_IRQ(ih));
+		snprintf(buf, len, "irq %d",  irq);
 #else
-	snprintf(buf, len, "irq %d", APIC_IRQ_LEGACY_IRQ(ih));
+	snprintf(buf, len, "irq %d", irq);
 #endif
 	return buf;
 }



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

2024-05-01 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Wed May  1 16:28:33 UTC 2024

Modified Files:
src/sys/arch/i386/eisa: eisa_machdep.c

Log Message:
Make eisa_machdep build without NIOAPIC > 0 by extracting irq definition.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/i386/eisa/eisa_machdep.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/conf

2024-04-28 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Apr 28 08:12:44 UTC 2024

Modified Files:
src/sys/arch/i386/conf: LEGACY

Log Message:
i386: disable DRMKMS drivers in LEGACY kernel (this is for ISA)


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

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/conf

2024-04-28 Thread Nia Alarie
Module Name:src
Committed By:   nia
Date:   Sun Apr 28 08:12:44 UTC 2024

Modified Files:
src/sys/arch/i386/conf: LEGACY

Log Message:
i386: disable DRMKMS drivers in LEGACY kernel (this is for ISA)


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

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/conf/LEGACY
diff -u src/sys/arch/i386/conf/LEGACY:1.2 src/sys/arch/i386/conf/LEGACY:1.3
--- src/sys/arch/i386/conf/LEGACY:1.2	Mon Jul 17 21:12:29 2023
+++ src/sys/arch/i386/conf/LEGACY	Sun Apr 28 08:12:44 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: LEGACY,v 1.2 2023/07/17 21:12:29 riastradh Exp $
+#	$NetBSD: LEGACY,v 1.3 2024/04/28 08:12:44 nia Exp $
 
 # LEGACY kernel -- includes vga@isa and pcdisplay@isa for pre-PCI
 # systems, due to significant pain making them fail to attach when
@@ -15,3 +15,12 @@ options 	ATA_DOWNGRADE_MODE
 
 # XXX we could turn off all sorts of other modern features in this
 # configuration, but that is left for future work.
+
+no i915drmkms*		at pci?
+no intelfb*		at intelfbbus?  
+
+no radeon*		at pci?
+no radeondrmkmsfb*	at radeonfbbus?
+
+no nouveau*		at pci?
+no nouveaufb*		at nouveaufbbus?



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

2024-04-22 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Apr 22 22:47:00 UTC 2024

Modified Files:
src/sys/arch/i386/i386: i386_mainbus.c

Log Message:
Add (defined(MPBIOS) || NACPICA > 0) check around mp_pci_childdetached().
Fixes the build without MPBIOS or ACPI. Modified patch from Paolo Pisati in
current-users@.

While here:
Remove obsolete  include with its guard.
Add comments for multiple endifs for better readability.


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

2024-04-22 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Mon Apr 22 22:47:00 UTC 2024

Modified Files:
src/sys/arch/i386/i386: i386_mainbus.c

Log Message:
Add (defined(MPBIOS) || NACPICA > 0) check around mp_pci_childdetached().
Fixes the build without MPBIOS or ACPI. Modified patch from Paolo Pisati in
current-users@.

While here:
Remove obsolete  include with its guard.
Add comments for multiple endifs for better readability.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/i386/i386_mainbus.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/i386/i386_mainbus.c
diff -u src/sys/arch/i386/i386/i386_mainbus.c:1.6 src/sys/arch/i386/i386/i386_mainbus.c:1.7
--- src/sys/arch/i386/i386/i386_mainbus.c:1.6	Sat Aug  7 16:18:55 2021
+++ src/sys/arch/i386/i386/i386_mainbus.c	Mon Apr 22 22:47:00 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386_mainbus.c,v 1.6 2021/08/07 16:18:55 thorpej Exp $	*/
+/*	$NetBSD: i386_mainbus.c,v 1.7 2024/04/22 22:47:00 andvar Exp $	*/
 /*	NetBSD: mainbus.c,v 1.104 2018/12/02 08:19:44 cherry Exp 	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i386_mainbus.c,v 1.6 2021/08/07 16:18:55 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i386_mainbus.c,v 1.7 2024/04/22 22:47:00 andvar Exp $");
 
 #include 
 #include 
@@ -87,12 +87,9 @@ __KERNEL_RCSID(0, "$NetBSD: i386_mainbus
 #include 
 #if defined(PCI_ADDR_FIXUP)
 #include 
-#endif
-#endif
-#ifdef __HAVE_PCI_MSI_MSIX
-#include 
-#endif /* __HAVE_PCI_MSI_MSIX */
-#endif
+#endif /* PCI_ADDR_FIXUP */
+#endif /* PCI_BUS_FIXUP */
+#endif /* NPCI > 0 */
 
 void	i386_mainbus_childdetached(device_t, device_t);
 int	i386_mainbus_match(device_t, cfdata_t, void *);
@@ -178,7 +175,7 @@ i386_mainbus_childdetached(device_t self
 	if (sc->sc_pci == child)
 		sc->sc_pci = NULL;
 
-#if NPCI > 0
+#if NPCI > 0 && (defined(MPBIOS) || NACPICA > 0)
 	mp_pci_childdetached(self, child);
 #endif
 }



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", 

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

2023-07-22 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 22 15:19:18 UTC 2023

Modified Files:
src/sys/arch/i386/conf: XEN3PAE_DOMU

Log Message:
i386/XEN3PAE_DOMU: Pass -g to build debug data like GENERIC.

Needed for CTF data by dtrace when MKDEBUG=no MKDEBUGKERNEL=no.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/conf/XEN3PAE_DOMU

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/conf

2023-07-22 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 22 15:19:03 UTC 2023

Modified Files:
src/sys/arch/i386/conf: XEN3PAE_DOM0

Log Message:
i386/XEN3PAE_DOM0: Pass -g to build debug data like GENERIC.

Needed for CTF data by dtrace when MKDEBUG=no MKDEBUGKERNEL=no.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/i386/conf/XEN3PAE_DOM0

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/conf

2023-07-22 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 22 15:19:03 UTC 2023

Modified Files:
src/sys/arch/i386/conf: XEN3PAE_DOM0

Log Message:
i386/XEN3PAE_DOM0: Pass -g to build debug data like GENERIC.

Needed for CTF data by dtrace when MKDEBUG=no MKDEBUGKERNEL=no.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/i386/conf/XEN3PAE_DOM0

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/conf/XEN3PAE_DOM0
diff -u src/sys/arch/i386/conf/XEN3PAE_DOM0:1.38 src/sys/arch/i386/conf/XEN3PAE_DOM0:1.39
--- src/sys/arch/i386/conf/XEN3PAE_DOM0:1.38	Fri Jul 21 02:08:45 2023
+++ src/sys/arch/i386/conf/XEN3PAE_DOM0	Sat Jul 22 15:19:03 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: XEN3PAE_DOM0,v 1.38 2023/07/21 02:08:45 riastradh Exp $
+#	$NetBSD: XEN3PAE_DOM0,v 1.39 2023/07/22 15:19:03 riastradh Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
@@ -74,7 +74,7 @@ options 	DDB_ONPANIC=1	# see also sysctl
 options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
 #options 	KGDB		# remote debugger
 #options 	KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x2f8,KGDB_DEVRATE=57600
-#makeoptions	DEBUG="-g"	# compile full symbol table
+makeoptions	DEBUG="-g"	# compile full symbol table
 options DDB_COMMANDONENTER="show registers"
 options 	KDTRACE_HOOKS	# kernel DTrace hooks
 



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

2023-07-22 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 22 15:19:18 UTC 2023

Modified Files:
src/sys/arch/i386/conf: XEN3PAE_DOMU

Log Message:
i386/XEN3PAE_DOMU: Pass -g to build debug data like GENERIC.

Needed for CTF data by dtrace when MKDEBUG=no MKDEBUGKERNEL=no.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/conf/XEN3PAE_DOMU

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/conf/XEN3PAE_DOMU
diff -u src/sys/arch/i386/conf/XEN3PAE_DOMU:1.20 src/sys/arch/i386/conf/XEN3PAE_DOMU:1.21
--- src/sys/arch/i386/conf/XEN3PAE_DOMU:1.20	Fri Jul 21 02:10:37 2023
+++ src/sys/arch/i386/conf/XEN3PAE_DOMU	Sat Jul 22 15:19:17 2023
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3PAE_DOMU,v 1.20 2023/07/21 02:10:37 riastradh Exp $
+# $NetBSD: XEN3PAE_DOMU,v 1.21 2023/07/22 15:19:17 riastradh Exp $
 
 include 	"arch/i386/conf/std.xen"
 
@@ -58,7 +58,7 @@ options 	DDB_ONPANIC=1	# see also sysctl
 options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
 #options 	KGDB		# remote debugger
 #options 	KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x2f8,KGDB_DEVRATE=57600
-#makeoptions	DEBUG="-g"	# compile full symbol table
+makeoptions	DEBUG="-g"	# compile full symbol table
 options DDB_COMMANDONENTER="trace;show registers"
 options 	KDTRACE_HOOKS	# kernel DTrace hooks
 



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

2023-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 21 02:10:37 UTC 2023

Modified Files:
src/sys/arch/i386/conf: XEN3PAE_DOMU

Log Message:
i386/XEN3PAE_DOMU: Enable KDTRACE_HOOKS.

XXX pullup-10


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

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/conf/XEN3PAE_DOMU
diff -u src/sys/arch/i386/conf/XEN3PAE_DOMU:1.19 src/sys/arch/i386/conf/XEN3PAE_DOMU:1.20
--- src/sys/arch/i386/conf/XEN3PAE_DOMU:1.19	Thu Feb  9 14:09:48 2023
+++ src/sys/arch/i386/conf/XEN3PAE_DOMU	Fri Jul 21 02:10:37 2023
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3PAE_DOMU,v 1.19 2023/02/09 14:09:48 abs Exp $
+# $NetBSD: XEN3PAE_DOMU,v 1.20 2023/07/21 02:10:37 riastradh Exp $
 
 include 	"arch/i386/conf/std.xen"
 
@@ -60,6 +60,7 @@ options 	DDB_HISTORY_SIZE=512	# enable h
 #options 	KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x2f8,KGDB_DEVRATE=57600
 #makeoptions	DEBUG="-g"	# compile full symbol table
 options DDB_COMMANDONENTER="trace;show registers"
+options 	KDTRACE_HOOKS	# kernel DTrace hooks
 
 # Compatibility options
 include 	"conf/compat_netbsd09.config"



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

2023-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 21 02:10:37 UTC 2023

Modified Files:
src/sys/arch/i386/conf: XEN3PAE_DOMU

Log Message:
i386/XEN3PAE_DOMU: Enable KDTRACE_HOOKS.

XXX pullup-10


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

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/conf

2023-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 21 02:08:45 UTC 2023

Modified Files:
src/sys/arch/i386/conf: XEN3PAE_DOM0

Log Message:
i386/XEN3PAE_DOM0: Enable KDTRACE_HOOKS.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/conf/XEN3PAE_DOM0

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/conf/XEN3PAE_DOM0
diff -u src/sys/arch/i386/conf/XEN3PAE_DOM0:1.37 src/sys/arch/i386/conf/XEN3PAE_DOM0:1.38
--- src/sys/arch/i386/conf/XEN3PAE_DOM0:1.37	Thu Feb  9 14:09:48 2023
+++ src/sys/arch/i386/conf/XEN3PAE_DOM0	Fri Jul 21 02:08:45 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: XEN3PAE_DOM0,v 1.37 2023/02/09 14:09:48 abs Exp $
+#	$NetBSD: XEN3PAE_DOM0,v 1.38 2023/07/21 02:08:45 riastradh Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
@@ -76,6 +76,7 @@ options 	DDB_HISTORY_SIZE=512	# enable h
 #options 	KGDB_DEVNAME="\"com\"",KGDB_DEVADDR=0x2f8,KGDB_DEVRATE=57600
 #makeoptions	DEBUG="-g"	# compile full symbol table
 options DDB_COMMANDONENTER="show registers"
+options 	KDTRACE_HOOKS	# kernel DTrace hooks
 
 # Compatibility options
 include 	"conf/compat_netbsd09.config"



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

2023-07-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Fri Jul 21 02:08:45 UTC 2023

Modified Files:
src/sys/arch/i386/conf: XEN3PAE_DOM0

Log Message:
i386/XEN3PAE_DOM0: Enable KDTRACE_HOOKS.

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/i386/conf/XEN3PAE_DOM0

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/conf

2023-07-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jul 17 21:12:29 UTC 2023

Modified Files:
src/sys/arch/i386/conf: LEGACY

Log Message:
i386/LEGACY: Enable ATA_DOWNGRADE_MODE.

PR kern/57362


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/conf/LEGACY

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/conf/LEGACY
diff -u src/sys/arch/i386/conf/LEGACY:1.1 src/sys/arch/i386/conf/LEGACY:1.2
--- src/sys/arch/i386/conf/LEGACY:1.1	Sat Mar  7 07:28:37 2015
+++ src/sys/arch/i386/conf/LEGACY	Mon Jul 17 21:12:29 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: LEGACY,v 1.1 2015/03/07 07:28:37 mrg Exp $
+#	$NetBSD: LEGACY,v 1.2 2023/07/17 21:12:29 riastradh Exp $
 
 # LEGACY kernel -- includes vga@isa and pcdisplay@isa for pre-PCI
 # systems, due to significant pain making them fail to attach when
@@ -10,5 +10,8 @@ vga0		at isa?
 pcdisplay0	at isa?			# CGA, MDA, EGA, HGA
 wsdisplay*	at pcdisplay? console ?
 
+# Enable DMA -> PIO downgrade after a certain number of DMA errors.
+options 	ATA_DOWNGRADE_MODE
+
 # XXX we could turn off all sorts of other modern features in this
 # configuration, but that is left for future work.



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

2023-07-17 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon Jul 17 21:12:29 UTC 2023

Modified Files:
src/sys/arch/i386/conf: LEGACY

Log Message:
i386/LEGACY: Enable ATA_DOWNGRADE_MODE.

PR kern/57362


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/conf/LEGACY

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/conf

2023-07-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jul 16 10:20:08 UTC 2023

Modified Files:
src/sys/arch/i386/conf: ALL GENERIC

Log Message:
i386: Re-enable HEARTBEAT.


To generate a diff of this commit:
cvs rdiff -u -r1.509 -r1.510 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1249 -r1.1250 src/sys/arch/i386/conf/GENERIC

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/conf

2023-07-16 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sun Jul 16 10:20:08 UTC 2023

Modified Files:
src/sys/arch/i386/conf: ALL GENERIC

Log Message:
i386: Re-enable HEARTBEAT.


To generate a diff of this commit:
cvs rdiff -u -r1.509 -r1.510 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1249 -r1.1250 src/sys/arch/i386/conf/GENERIC

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/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.509 src/sys/arch/i386/conf/ALL:1.510
--- src/sys/arch/i386/conf/ALL:1.509	Sun Jul 16 05:24:08 2023
+++ src/sys/arch/i386/conf/ALL	Sun Jul 16 10:20:07 2023
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.509 2023/07/16 05:24:08 mrg Exp $
+# $NetBSD: ALL,v 1.510 2023/07/16 10:20:07 riastradh Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.509 $"
+#ident		"ALL-$Revision: 1.510 $"
 
 maxusers	64		# estimated number of users
 
@@ -131,6 +131,10 @@ options 	BIOHIST		# kernhist for buff I/
 makeoptions	KCOV=1
 options		KCOV
 
+# Heartbeat checks
+options 	HEARTBEAT
+options 	HEARTBEAT_MAX_PERIOD_DEFAULT=15
+
 # Compatibility options
 include 	"conf/compat_netbsd09.config"
 options 	COMPAT_NOMID	# NetBSD 0.8, 386BSD, and BSDI

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1249 src/sys/arch/i386/conf/GENERIC:1.1250
--- src/sys/arch/i386/conf/GENERIC:1.1249	Sun Jul 16 05:24:08 2023
+++ src/sys/arch/i386/conf/GENERIC	Sun Jul 16 10:20:07 2023
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1249 2023/07/16 05:24:08 mrg Exp $
+# $NetBSD: GENERIC,v 1.1250 2023/07/16 10:20:07 riastradh Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.1249 $"
+#ident		"GENERIC-$Revision: 1.1250 $"
 
 maxusers	64		# estimated number of users
 
@@ -140,6 +140,10 @@ options 	KDTRACE_HOOKS	# kernel DTrace h
 #makeoptions	KCOV=1
 #options 	KCOV
 
+# Heartbeat checks
+options 	HEARTBEAT
+options 	HEARTBEAT_MAX_PERIOD_DEFAULT=15
+
 # Compatibility options
 include 	"conf/compat_netbsd09.config"
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID



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

2023-07-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jul 16 05:24:08 UTC 2023

Modified Files:
src/sys/arch/i386/conf: ALL GENERIC

Log Message:
revert previous change to enable HEARTBEAT.

the new code has a "needs 64-bit atomic ops" trigger:

ci->ci_heartbeat_uptime_cache = atomic_load_relaxed(_uptime);

but time_uptime is a 64-bit value, and this trips CTASSERT().


To generate a diff of this commit:
cvs rdiff -u -r1.508 -r1.509 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1248 -r1.1249 src/sys/arch/i386/conf/GENERIC

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/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.508 src/sys/arch/i386/conf/ALL:1.509
--- src/sys/arch/i386/conf/ALL:1.508	Sat Jul 15 22:13:27 2023
+++ src/sys/arch/i386/conf/ALL	Sun Jul 16 05:24:08 2023
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.508 2023/07/15 22:13:27 riastradh Exp $
+# $NetBSD: ALL,v 1.509 2023/07/16 05:24:08 mrg Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.508 $"
+#ident		"ALL-$Revision: 1.509 $"
 
 maxusers	64		# estimated number of users
 
@@ -131,10 +131,6 @@ options 	BIOHIST		# kernhist for buff I/
 makeoptions	KCOV=1
 options		KCOV
 
-# Heartbeat checks
-options 	HEARTBEAT
-options 	HEARTBEAT_MAX_PERIOD_DEFAULT=15
-
 # Compatibility options
 include 	"conf/compat_netbsd09.config"
 options 	COMPAT_NOMID	# NetBSD 0.8, 386BSD, and BSDI

Index: src/sys/arch/i386/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1248 src/sys/arch/i386/conf/GENERIC:1.1249
--- src/sys/arch/i386/conf/GENERIC:1.1248	Sat Jul 15 22:14:39 2023
+++ src/sys/arch/i386/conf/GENERIC	Sun Jul 16 05:24:08 2023
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1248 2023/07/15 22:14:39 riastradh Exp $
+# $NetBSD: GENERIC,v 1.1249 2023/07/16 05:24:08 mrg Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.1248 $"
+#ident		"GENERIC-$Revision: 1.1249 $"
 
 maxusers	64		# estimated number of users
 
@@ -140,10 +140,6 @@ options 	KDTRACE_HOOKS	# kernel DTrace h
 #makeoptions	KCOV=1
 #options 	KCOV
 
-# Heartbeat checks
-options 	HEARTBEAT
-options 	HEARTBEAT_MAX_PERIOD_DEFAULT=15
-
 # Compatibility options
 include 	"conf/compat_netbsd09.config"
 #options 	COMPAT_386BSD_MBRPART # recognize old partition ID



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

2023-07-15 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jul 16 05:24:08 UTC 2023

Modified Files:
src/sys/arch/i386/conf: ALL GENERIC

Log Message:
revert previous change to enable HEARTBEAT.

the new code has a "needs 64-bit atomic ops" trigger:

ci->ci_heartbeat_uptime_cache = atomic_load_relaxed(_uptime);

but time_uptime is a 64-bit value, and this trips CTASSERT().


To generate a diff of this commit:
cvs rdiff -u -r1.508 -r1.509 src/sys/arch/i386/conf/ALL
cvs rdiff -u -r1.1248 -r1.1249 src/sys/arch/i386/conf/GENERIC

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/conf

2023-07-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 15 22:13:27 UTC 2023

Modified Files:
src/sys/arch/i386/conf: ALL

Log Message:
i386/ALL: Enable HEARTBEAT.


To generate a diff of this commit:
cvs rdiff -u -r1.507 -r1.508 src/sys/arch/i386/conf/ALL

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/conf

2023-07-15 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 15 22:13:27 UTC 2023

Modified Files:
src/sys/arch/i386/conf: ALL

Log Message:
i386/ALL: Enable HEARTBEAT.


To generate a diff of this commit:
cvs rdiff -u -r1.507 -r1.508 src/sys/arch/i386/conf/ALL

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/conf/ALL
diff -u src/sys/arch/i386/conf/ALL:1.507 src/sys/arch/i386/conf/ALL:1.508
--- src/sys/arch/i386/conf/ALL:1.507	Mon May 22 16:28:25 2023
+++ src/sys/arch/i386/conf/ALL	Sat Jul 15 22:13:27 2023
@@ -1,4 +1,4 @@
-# $NetBSD: ALL,v 1.507 2023/05/22 16:28:25 riastradh Exp $
+# $NetBSD: ALL,v 1.508 2023/07/15 22:13:27 riastradh Exp $
 # From NetBSD: GENERIC,v 1.787 2006/10/01 18:37:54 bouyer Exp
 #
 # ALL machine description file
@@ -17,7 +17,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"ALL-$Revision: 1.507 $"
+#ident		"ALL-$Revision: 1.508 $"
 
 maxusers	64		# estimated number of users
 
@@ -131,6 +131,10 @@ options 	BIOHIST		# kernhist for buff I/
 makeoptions	KCOV=1
 options		KCOV
 
+# Heartbeat checks
+options 	HEARTBEAT
+options 	HEARTBEAT_MAX_PERIOD_DEFAULT=15
+
 # Compatibility options
 include 	"conf/compat_netbsd09.config"
 options 	COMPAT_NOMID	# NetBSD 0.8, 386BSD, and BSDI



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/conf

2023-05-22 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Mon May 22 16:28:34 UTC 2023

Modified Files:
src/sys/arch/i386/conf: GENERIC

Log Message:
i386/GENERIC: Enable EFI runtime support.

PR kern/57076

XXX pullup-10


To generate a diff of this commit:
cvs rdiff -u -r1.1246 -r1.1247 src/sys/arch/i386/conf/GENERIC

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/conf/GENERIC
diff -u src/sys/arch/i386/conf/GENERIC:1.1246 src/sys/arch/i386/conf/GENERIC:1.1247
--- src/sys/arch/i386/conf/GENERIC:1.1246	Thu Feb  9 14:09:48 2023
+++ src/sys/arch/i386/conf/GENERIC	Mon May 22 16:28:34 2023
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.1246 2023/02/09 14:09:48 abs Exp $
+# $NetBSD: GENERIC,v 1.1247 2023/05/22 16:28:34 riastradh Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/i386/conf/std.i386"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident		"GENERIC-$Revision: 1.1246 $"
+#ident		"GENERIC-$Revision: 1.1247 $"
 
 maxusers	64		# estimated number of users
 
@@ -1504,9 +1504,9 @@ pseudo-device	cmos
 # userland interface to drivers, including autoconf and properties retrieval
 pseudo-device	drvctl
 
-# EFI runtime support -- not yet tested
-#options 	EFI_RUNTIME
-#pseudo-device 	efi			# /dev/efi
+# EFI runtime support
+options 	EFI_RUNTIME
+pseudo-device 	efi			# /dev/efi
 
 include "dev/veriexec.config"
 



  1   2   3   4   >