CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: rin Date: Wed Sep 18 22:29:39 UTC 2024 Modified Files: src/sys/arch/i386/i386: db_interface.c Log Message: i386: DDB: Call x86_pause() (`pause` insn) when CPUs are paused as already done for amd64: https://mail-index.netbsd.org/source-changes/2023/07/31/msg146423.html `pause` insn has been introduced to Pentium 4. However, its opcode is consisted of `nop` (0x90) followed by `rep` prefix (0xf3), and therefore interpreted as `nop` for older processors. Intel assured this behavior [1]. Also note that we already use `pause` unconditionally for i386. Briefly tested on QEMU. [1] Intel, ``AP-949 Using Spin-Loops on Intel Pentium 4 Processor and Intel Xeon Processor'', Version 2.1, Sec 2.1.1. (2001) To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sys/arch/i386/i386/db_interface.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
Module Name:src Committed By: rin Date: Wed Sep 18 22:29:39 UTC 2024 Modified Files: src/sys/arch/i386/i386: db_interface.c Log Message: i386: DDB: Call x86_pause() (`pause` insn) when CPUs are paused as already done for amd64: https://mail-index.netbsd.org/source-changes/2023/07/31/msg146423.html `pause` insn has been introduced to Pentium 4. However, its opcode is consisted of `nop` (0x90) followed by `rep` prefix (0xf3), and therefore interpreted as `nop` for older processors. Intel assured this behavior [1]. Also note that we already use `pause` unconditionally for i386. Briefly tested on QEMU. [1] Intel, ``AP-949 Using Spin-Loops on Intel Pentium 4 Processor and Intel Xeon Processor'', Version 2.1, Sec 2.1.1. (2001) To generate a diff of this commit: cvs rdiff -u -r1.88 -r1.89 src/sys/arch/i386/i386/db_interface.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/db_interface.c diff -u src/sys/arch/i386/i386/db_interface.c:1.88 src/sys/arch/i386/i386/db_interface.c:1.89 --- src/sys/arch/i386/i386/db_interface.c:1.88 Wed Oct 26 23:38:07 2022 +++ src/sys/arch/i386/i386/db_interface.c Wed Sep 18 22:29:39 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: db_interface.c,v 1.88 2022/10/26 23:38:07 riastradh Exp $ */ +/* $NetBSD: db_interface.c,v 1.89 2024/09/18 22:29:39 rin Exp $ */ /* * Mach Operating System @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.88 2022/10/26 23:38:07 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.89 2024/09/18 22:29:39 rin Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -369,7 +369,7 @@ ddb_suspend(struct trapframe *frame) atomic_or_32(&ci->ci_flags, CPUF_PAUSE); while (ci->ci_flags & CPUF_PAUSE) - ; + x86_pause(); ci->ci_ddb_regs = 0; tlbflushg(); }
Re: CVS commit: src/sys/arch/i386/stand/lib
Hi, On 2024/09/19 3:33, Andrius V wrote: On Wed, Sep 18, 2024 at 3:44 AM Rin Okuyama wrote: Module Name:src Committed By: rin Date: Wed Sep 18 00:44:03 UTC 2024 Modified Files: src/sys/arch/i386/stand/lib: libi386.h Log Message: i386/stand: Remove XMS leftover from libi386.h, NFC PR port-i386/58624 To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 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. Thanks, not sure how it slipped (I have definitely seen the code, either forgot to copy to cvs directory or just forgot about it). It can be... Your work was otherwise perfect. Thank you very much for cleaning up things including tiny comments! rin
Re: CVS commit: src/sys/arch/i386/stand/lib
On Wed, Sep 18, 2024 at 3:44 AM Rin Okuyama wrote: > > Module Name:src > Committed By: rin > Date: Wed Sep 18 00:44:03 UTC 2024 > > Modified Files: > src/sys/arch/i386/stand/lib: libi386.h > > Log Message: > i386/stand: Remove XMS leftover from libi386.h, NFC > > PR port-i386/58624 > > > To generate a diff of this commit: > cvs rdiff -u -r1.53 -r1.54 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. > Thanks, not sure how it slipped (I have definitely seen the code, either forgot to copy to cvs directory or just forgot about it).
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: rin Date: Wed Sep 18 00:44:03 UTC 2024 Modified Files: src/sys/arch/i386/stand/lib: libi386.h Log Message: i386/stand: Remove XMS leftover from libi386.h, NFC PR port-i386/58624 To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 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.53 src/sys/arch/i386/stand/lib/libi386.h:1.54 --- src/sys/arch/i386/stand/lib/libi386.h:1.53 Sat Jun 29 13:46:40 2024 +++ src/sys/arch/i386/stand/lib/libi386.h Wed Sep 18 00:44:03 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: libi386.h,v 1.53 2024/06/29 13:46:40 rin Exp $ */ +/* $NetBSD: libi386.h,v 1.54 2024/09/18 00:44:03 rin Exp $ */ /* * Copyright (c) 1996 @@ -98,12 +98,6 @@ struct multiboot_package *probe_multiboo /* 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 *);
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: rin Date: Wed Sep 18 00:44:03 UTC 2024 Modified Files: src/sys/arch/i386/stand/lib: libi386.h Log Message: i386/stand: Remove XMS leftover from libi386.h, NFC PR port-i386/58624 To generate a diff of this commit: cvs rdiff -u -r1.53 -r1.54 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
Module Name:src Committed By: andvar Date: Wed Sep 11 20:15:37 UTC 2024 Modified Files: src/sys/arch/i386/stand/dosboot: Makefile main.c start_dos.S version src/sys/arch/i386/stand/lib: exec.c Log Message: dosboot(8): remove XMS-specific code. The boot process has been broken for over a decade, and its relevance has diminished due to the availability of other boot options. PR port-i386/58624 To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/i386/stand/dosboot/Makefile cvs rdiff -u -r1.33 -r1.34 src/sys/arch/i386/stand/dosboot/main.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/dosboot/start_dos.S cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/dosboot/version cvs rdiff -u -r1.80 -r1.81 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/dosboot/Makefile diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.38 src/sys/arch/i386/stand/dosboot/Makefile:1.39 --- src/sys/arch/i386/stand/dosboot/Makefile:1.38 Sat Jun 29 13:46:40 2024 +++ src/sys/arch/i386/stand/dosboot/Makefile Wed Sep 11 20:15:36 2024 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.38 2024/06/29 13:46:40 rin Exp $ +# $NetBSD: Makefile,v 1.39 2024/09/11 20:15:36 andvar Exp $ S= ${.CURDIR}/../../../.. @@ -14,7 +14,6 @@ SRCS+= exec_multiboot1.c exec_multiboot2 #CPPFLAGS+= -DSLOW # for libz; no longer available CPPFLAGS+= -DCOMPAT_386BSD_MBRPART -CPPFLAGS+= -DXMS CPPFLAGS+= -DLIBSA_ENABLE_LS_OP CPPFLAGS+= -DNO_MULTIBOOT2 # keep the binary small #uncomment if there are problems with memory detection Index: src/sys/arch/i386/stand/dosboot/main.c diff -u src/sys/arch/i386/stand/dosboot/main.c:1.33 src/sys/arch/i386/stand/dosboot/main.c:1.34 --- src/sys/arch/i386/stand/dosboot/main.c:1.33 Mon May 13 17:50:30 2019 +++ src/sys/arch/i386/stand/dosboot/main.c Wed Sep 11 20:15:36 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.33 2019/05/13 17:50:30 maxv Exp $ */ +/* $NetBSD: main.c,v 1.34 2024/09/11 20:15:36 andvar Exp $ */ /* * Copyright (c) 1996, 1997 @@ -191,31 +191,14 @@ static void print_banner(void) { int extmem = getextmem(); - char *s = ""; clear_pc_screen(); -#ifdef XMS - u_long xmsmem; - if (getextmem1() == 0 && (xmsmem = checkxms()) != 0) { - /* - * With "CONSERVATIVE_MEMDETECT", extmem is 0 because - * getextmem() is getextmem1(). Without, the "smart" - * methods could fail to report all memory as well. - * xmsmem is a few kB less than the actual size, but - * better than nothing. - */ - if ((int)xmsmem > extmem) - extmem = xmsmem; - s = "(xms) "; - } -#endif - printf("\n" ">> %s, Revision %s (from NetBSD %s)\n" - ">> Memory: %d/%d %sk\n", + ">> Memory: %d/%d k\n", bootprog_name, bootprog_rev, bootprog_kernrev, - getbasemem(), extmem, s); + getbasemem(), extmem); } void Index: src/sys/arch/i386/stand/dosboot/start_dos.S diff -u src/sys/arch/i386/stand/dosboot/start_dos.S:1.1 src/sys/arch/i386/stand/dosboot/start_dos.S:1.2 --- src/sys/arch/i386/stand/dosboot/start_dos.S:1.1 Sat Jun 29 13:45:14 2024 +++ src/sys/arch/i386/stand/dosboot/start_dos.S Wed Sep 11 20:15:36 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: start_dos.S,v 1.1 2024/06/29 13:45:14 rin Exp $ */ +/* $NetBSD: start_dos.S,v 1.2 2024/09/11 20:15:36 andvar Exp $ */ /* * startup for DOS .COM programs @@ -6,7 +6,6 @@ * netbsd:sys/arch/i386/boot/start.S * Tor Egge's patches for NetBSD boot (pr port-i386/1002) * freebsd:sys/i386/boot/netboot/start2.S - * XMS support by Martin Husemann */ /* @@ -484,137 +483,3 @@ _C_LABEL(trace_str): .code32 popl %esi ret - -#ifdef XMS - -/* pointer to XMS driver, 0 if no XMS used */ - - .data -_C_LABEL(xmsdrv): - .long 0 - - .text -ENTRY(checkxms) - .code32 - pushl %ebp - movl %esp, %ebp - pushl %ebx - pushl %edx - pushl %es - pushl %esi - pushl %edi - - call _C_LABEL(prot_to_real) # enter real mode - .code16 - - movw $0x4300, %ax - int $0x2f /* check if XMS installed */ - cmpb $0x80, %al - jnz noxms - - movw $0x4310, %ax - int $0x2f /* get driver address */ - - movw %bx, _C_LABEL(xmsdrv) /* save es:bx to _xmsdrv */ - movw %es, _C_LABEL(xmsdrv) + 2 - - movb $0x08, %ah /* XMS: query free extended memory */ -#if 0 - movb $0x00, %bl -#endif - lcall *_C_LABEL(xmsdrv) - jmp xdone - -noxms: /* no XMS manager found */ - mov $0, %dx - -xdone: - calll _C_LABEL(real_to_prot) # back to protected mode - .code32 - - xorl %eax, %eax - movw %dx, %ax - - popl %edi - popl %esi - popl %es - popl %edx - popl %ebx - popl %ebp - ret - -/* - Allocate a block of XMS memory with the requested size - void *xmsalloc(long int kBytes); - - Depends on _xmsdrv being set by getextmem() before first call - to this function. - - Return value: a physical address. -*/ -ENTRY(xmsalloc) - .code32 - pushl %ebp - movl %esp, %ebp - pushl %ebx - pushl %edx - pushl %esi - pushl %e
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: andvar Date: Wed Sep 11 20:15:37 UTC 2024 Modified Files: src/sys/arch/i386/stand/dosboot: Makefile main.c start_dos.S version src/sys/arch/i386/stand/lib: exec.c Log Message: dosboot(8): remove XMS-specific code. The boot process has been broken for over a decade, and its relevance has diminished due to the availability of other boot options. PR port-i386/58624 To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 src/sys/arch/i386/stand/dosboot/Makefile cvs rdiff -u -r1.33 -r1.34 src/sys/arch/i386/stand/dosboot/main.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/dosboot/start_dos.S cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/dosboot/version cvs rdiff -u -r1.80 -r1.81 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/i386
Module Name:src Committed By: christos Date: Wed Aug 28 23:20:50 UTC 2024 Modified Files: src/sys/arch/i386/i386: vector.S Log Message: PR/58653: me: Revert btsl of negative value to orl To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sys/arch/i386/i386/vector.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/i386/vector.S diff -u src/sys/arch/i386/i386/vector.S:1.89 src/sys/arch/i386/i386/vector.S:1.90 --- src/sys/arch/i386/i386/vector.S:1.89 Tue Sep 6 20:40:18 2022 +++ src/sys/arch/i386/i386/vector.S Wed Aug 28 19:20:50 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: vector.S,v 1.89 2022/09/07 00:40:18 knakahara Exp $ */ +/* $NetBSD: vector.S,v 1.90 2024/08/28 23:20:50 christos Exp $ */ /* * Copyright 2002 (c) Wasabi Systems, Inc. @@ -65,7 +65,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.89 2022/09/07 00:40:18 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vector.S,v 1.90 2024/08/28 23:20:50 christos Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -354,7 +354,7 @@ IDTVEC(resume_hyperv_hypercall) cli jmp _C_LABEL(Xdoreti) 2: - btsl $(LIR_HV - 32),CPUVAR(IPENDING)+4 + orl $(1 << LIR_HV),CPUVAR(IPENDING) INTRFASTEXIT IDTVEC_END(resume_hyperv_hypercall) #endif /* NHYPERV > 0 */
CVS commit: src/sys/arch/i386/i386
Module Name:src Committed By: christos Date: Wed Aug 28 23:20:50 UTC 2024 Modified Files: src/sys/arch/i386/i386: vector.S Log Message: PR/58653: me: Revert btsl of negative value to orl To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 src/sys/arch/i386/i386/vector.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: riastradh Date: Sat Aug 24 20:23:12 UTC 2024 Modified Files: src/sys/arch/i386/stand/lib: biosmemx.S bootinfo_memmap.c getextmemx.c Log Message: i386/stand/lib: Nix trailing whitespace and tidy comments a bit. No functional change intended. PR port-amd64/49470: NetBSD 7 BETA reboots after bootloader (HP 2133) To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/stand/lib/biosmemx.S cvs rdiff -u -r1.7 -r1.8 src/sys/arch/i386/stand/lib/bootinfo_memmap.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/lib/getextmemx.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/biosmemx.S diff -u src/sys/arch/i386/stand/lib/biosmemx.S:1.12 src/sys/arch/i386/stand/lib/biosmemx.S:1.13 --- src/sys/arch/i386/stand/lib/biosmemx.S:1.12 Sat Aug 17 08:38:31 2024 +++ src/sys/arch/i386/stand/lib/biosmemx.S Sat Aug 24 20:23:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: biosmemx.S,v 1.12 2024/08/17 08:38:31 andvar Exp $ */ +/* $NetBSD: biosmemx.S,v 1.13 2024/08/24 20:23:11 riastradh Exp $ */ /* * Copyright (c) 1997, 1999 @@ -91,18 +91,23 @@ ENTRY(getextmem2) * buffer[2]: length (bytes) * buffer[4]: type * buffer[5]: ACPI 3.0 Extended Attributes bitfield (unused) + * * Some buggy BIOSes may write to 24 bytes even if only 20 were requested. * Therefore, the buffer is defined for 6 elements to avoid stack buffer * overruns. See PR install/49470. * - * More details can be found in the - * Advanced Configuration and Power Interface (ACPI) Specification, Release 6.5, - * 2022-08-29, UEFI Forum, Inc., - * Sec. 15.1 `INT 15H E820H - Query System Address Map', pp. 756-757 - * https://uefi.org/sites/default/files/resources/ACPI_Spec_6_5_Aug29.pdf#page=824 - * https://uefi.org/specs/ACPI/6.5/15_System_Address_Map_Interfaces.html#int-15h-e820h-query-system-address-map - * as well as OSDev.org wiki page - * https://wiki.osdev.org/Detecting_Memory_(x86)#BIOS_Function:_INT_0x15,_EAX_=_0xE820. + * More details can be found in the: + * + * Advanced Configuration and Power Interface (ACPI) + * Specification, Release 6.5, 2022-08-29, UEFI Forum, Inc., + * Sec. 15.1 `INT 15H E820H - Query System Address Map', + * pp. 756-757 + * https://uefi.org/sites/default/files/resources/ACPI_Spec_6_5_Aug29.pdf#page=824 + * https://uefi.org/specs/ACPI/6.5/15_System_Address_Map_Interfaces.html#int-15h-e820h-query-system-address-map + * + * as well as this OSDev.org wiki page: + * + * https://wiki.osdev.org/Detecting_Memory_(x86)#BIOS_Function:_INT_0x15,_EAX_=_0xE820 */ ENTRY(getmementry) pushl %ebp Index: src/sys/arch/i386/stand/lib/bootinfo_memmap.c diff -u src/sys/arch/i386/stand/lib/bootinfo_memmap.c:1.7 src/sys/arch/i386/stand/lib/bootinfo_memmap.c:1.8 --- src/sys/arch/i386/stand/lib/bootinfo_memmap.c:1.7 Sat Aug 17 08:38:31 2024 +++ src/sys/arch/i386/stand/lib/bootinfo_memmap.c Sat Aug 24 20:23:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: bootinfo_memmap.c,v 1.7 2024/08/17 08:38:31 andvar Exp $ */ +/* $NetBSD: bootinfo_memmap.c,v 1.8 2024/08/24 20:23:11 riastradh Exp $ */ /* * Copyright (c) 1999 @@ -37,9 +37,9 @@ extern int getmementry(int *, int *); void bi_getmemmap(void) { - /* - * Allocate 6 words, not 5, to work around buggy firmware -- see comment - * on getmementry in biosmemx.S. + /* + * Allocate 6 words, not 5, to work around buggy firmware -- + * see comment on getmementry in biosmemx.S. */ int buf[6], i, nranges, n; Index: src/sys/arch/i386/stand/lib/getextmemx.c diff -u src/sys/arch/i386/stand/lib/getextmemx.c:1.11 src/sys/arch/i386/stand/lib/getextmemx.c:1.12 --- src/sys/arch/i386/stand/lib/getextmemx.c:1.11 Sat Aug 17 08:38:31 2024 +++ src/sys/arch/i386/stand/lib/getextmemx.c Sat Aug 24 20:23:11 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: getextmemx.c,v 1.11 2024/08/17 08:38:31 andvar Exp $ */ +/* $NetBSD: getextmemx.c,v 1.12 2024/08/24 20:23:11 riastradh Exp $ */ /* * Copyright (c) 1997, 1999 @@ -39,8 +39,8 @@ int getextmemx(void) { /* - * Allocate 6 words, not 5, to work around buggy firmware -- see comment - * on getmementry in biosmemx.S. + * Allocate 6 words, not 5, to work around buggy firmware -- + * see comment on getmementry in biosmemx.S. */ int buf[6], i; int extmem = getextmem1();
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: riastradh Date: Sat Aug 24 20:23:12 UTC 2024 Modified Files: src/sys/arch/i386/stand/lib: biosmemx.S bootinfo_memmap.c getextmemx.c Log Message: i386/stand/lib: Nix trailing whitespace and tidy comments a bit. No functional change intended. PR port-amd64/49470: NetBSD 7 BETA reboots after bootloader (HP 2133) To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/stand/lib/biosmemx.S cvs rdiff -u -r1.7 -r1.8 src/sys/arch/i386/stand/lib/bootinfo_memmap.c cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/lib/getextmemx.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
Module Name:src Committed By: andvar Date: Sat Aug 17 08:38:31 UTC 2024 Modified Files: src/sys/arch/i386/stand/lib: biosmemx.S bootinfo_memmap.c getextmemx.c Log Message: Allocate buf[6] instead of buf[5] to work around buggy firmware, which may write mementry to 24 bytes instead 20 requested with ACPI 3.0 enabled, causing corrupted stack and wrong marks[] values in common_load_kernel(). This in turn was leading to erroneous caluclations and memory addresses. This eventually may result in null pointer dereference in the kernel and sudden reboot for VIA based systems. Commit should fix boot issues for VIA C7-M based HP 2133 Mini-Note, mentioned in the original bug report. For AMD based HP Compaq 6005 Pro discussed in a separate thread, the issue may be different. Tested on my VIA C7-D based Biostar Viotech 3100+ motherboard. needs-pullups to 9, 10. PR install/49470 To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/lib/biosmemx.S cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/lib/bootinfo_memmap.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/stand/lib/getextmemx.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/biosmemx.S diff -u src/sys/arch/i386/stand/lib/biosmemx.S:1.11 src/sys/arch/i386/stand/lib/biosmemx.S:1.12 --- src/sys/arch/i386/stand/lib/biosmemx.S:1.11 Mon Aug 2 12:56:23 2021 +++ src/sys/arch/i386/stand/lib/biosmemx.S Sat Aug 17 08:38:31 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: biosmemx.S,v 1.11 2021/08/02 12:56:23 andvar Exp $ */ +/* $NetBSD: biosmemx.S,v 1.12 2024/08/17 08:38:31 andvar Exp $ */ /* * Copyright (c) 1997, 1999 @@ -84,12 +84,25 @@ ENTRY(getextmem2) ret /* - * int getmementry(int *iterator, int buffer[5]) + * int getmementry(int *iterator, int buffer[6]) * * return: 0=ok, else error * buffer[0]: start of memory chunk * buffer[2]: length (bytes) * buffer[4]: type + * buffer[5]: ACPI 3.0 Extended Attributes bitfield (unused) + * Some buggy BIOSes may write to 24 bytes even if only 20 were requested. + * Therefore, the buffer is defined for 6 elements to avoid stack buffer + * overruns. See PR install/49470. + * + * More details can be found in the + * Advanced Configuration and Power Interface (ACPI) Specification, Release 6.5, + * 2022-08-29, UEFI Forum, Inc., + * Sec. 15.1 `INT 15H E820H - Query System Address Map', pp. 756-757 + * https://uefi.org/sites/default/files/resources/ACPI_Spec_6_5_Aug29.pdf#page=824 + * https://uefi.org/specs/ACPI/6.5/15_System_Address_Map_Interfaces.html#int-15h-e820h-query-system-address-map + * as well as OSDev.org wiki page + * https://wiki.osdev.org/Detecting_Memory_(x86)#BIOS_Function:_INT_0x15,_EAX_=_0xE820. */ ENTRY(getmementry) pushl %ebp Index: src/sys/arch/i386/stand/lib/bootinfo_memmap.c diff -u src/sys/arch/i386/stand/lib/bootinfo_memmap.c:1.6 src/sys/arch/i386/stand/lib/bootinfo_memmap.c:1.7 --- src/sys/arch/i386/stand/lib/bootinfo_memmap.c:1.6 Fri Sep 13 02:19:46 2019 +++ src/sys/arch/i386/stand/lib/bootinfo_memmap.c Sat Aug 17 08:38:31 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: bootinfo_memmap.c,v 1.6 2019/09/13 02:19:46 manu Exp $ */ +/* $NetBSD: bootinfo_memmap.c,v 1.7 2024/08/17 08:38:31 andvar Exp $ */ /* * Copyright (c) 1999 @@ -37,7 +37,11 @@ extern int getmementry(int *, int *); void bi_getmemmap(void) { - int buf[5], i, nranges, n; + /* + * Allocate 6 words, not 5, to work around buggy firmware -- see comment + * on getmementry in biosmemx.S. + */ + int buf[6], i, nranges, n; nranges = 0; i = 0; Index: src/sys/arch/i386/stand/lib/getextmemx.c diff -u src/sys/arch/i386/stand/lib/getextmemx.c:1.10 src/sys/arch/i386/stand/lib/getextmemx.c:1.11 --- src/sys/arch/i386/stand/lib/getextmemx.c:1.10 Thu Jun 16 13:27:59 2011 +++ src/sys/arch/i386/stand/lib/getextmemx.c Sat Aug 17 08:38:31 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: getextmemx.c,v 1.10 2011/06/16 13:27:59 joerg Exp $ */ +/* $NetBSD: getextmemx.c,v 1.11 2024/08/17 08:38:31 andvar Exp $ */ /* * Copyright (c) 1997, 1999 @@ -38,7 +38,11 @@ int getextmemx(void) { - int buf[5], i; + /* + * Allocate 6 words, not 5, to work around buggy firmware -- see comment + * on getmementry in biosmemx.S. + */ + int buf[6], i; int extmem = getextmem1(); #ifdef SUPPORT_PS2 struct {
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: andvar Date: Sat Aug 17 08:38:31 UTC 2024 Modified Files: src/sys/arch/i386/stand/lib: biosmemx.S bootinfo_memmap.c getextmemx.c Log Message: Allocate buf[6] instead of buf[5] to work around buggy firmware, which may write mementry to 24 bytes instead 20 requested with ACPI 3.0 enabled, causing corrupted stack and wrong marks[] values in common_load_kernel(). This in turn was leading to erroneous caluclations and memory addresses. This eventually may result in null pointer dereference in the kernel and sudden reboot for VIA based systems. Commit should fix boot issues for VIA C7-M based HP 2133 Mini-Note, mentioned in the original bug report. For AMD based HP Compaq 6005 Pro discussed in a separate thread, the issue may be different. Tested on my VIA C7-D based Biostar Viotech 3100+ motherboard. needs-pullups to 9, 10. PR install/49470 To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/lib/biosmemx.S cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/lib/bootinfo_memmap.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/stand/lib/getextmemx.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
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
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
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
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
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 dif
CVS commit: src/sys/arch/i386/stand
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
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
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 Drochner
CVS commit: src/sys/arch/i386/stand/mbr
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
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
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
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
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
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
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
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
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 con
CVS commit: src/sys/arch/i386/stand/lib
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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, &efi_disklist, list) { + if (edi->type == BIOSDISK_TYPE_HD) { + memset(&bibg->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(&bi_disk, BTINFO_BOOTDISK, sizeof(bi_disk)); BI_ADD(&bi_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(&bi_disk, BTINFO_BOOTDISK, sizeof(bi_disk)); + BI_ADD(&bi_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
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
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
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
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
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 = &sdata.d; repl = &rdata.d; - 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(
CVS commit: src/sys/arch/i386/stand/bootxx
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
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
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
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
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
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
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
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
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
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
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(&raidframe, rf_offset, rf_size) != 0) - return RF_PROTECTED_SECTORS; + if (read_gpt(&raidframe, 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]
CVS commit: src/sys/arch/i386/stand/lib
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
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
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
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
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
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
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
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
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
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(&ehdr.e_ident, ELFMAG, SELFMAG) != 0) + if (memcmp(&ehdr.e32.e_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 *)&ehdr; + ehdr32 = &ehdr.e32; shnum = ehdr32->e_shnum; shentsize = ehdr32->e_shentsize; shstrndx = ehdr32->e_shstrndx; shoff = ehdr32->e_shoff; break; case ELFCLASS64: - ehdr64 = (Elf64_Ehdr *)&ehdr; + ehdr64 = &ehdr.e64; shnum = ehdr64->e_shnum; shentsize = ehdr64->e_shentsize; shstrndx = ehdr64->e_shstrndx;
CVS commit: src/sys/arch/i386/stand/lib
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
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
"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
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
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", __fu
CVS commit: src/sys/arch/i386/conf
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
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
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
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
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
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
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
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
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
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
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
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