CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: nonaka Date: Thu Mar 8 10:34:33 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile.efiboot TODO.efiboot boot.c devopen.c efiboot.c efiboot.h efidisk.c efidisk.h efidisk_ll.c src/sys/arch/i386/stand/lib: biosdisk.c biosdisk.h biosdisk_ll.h Added Files: src/sys/arch/i386/stand/efiboot: efidev.c Log Message: efiboot: system can boot from CD/DVD-ROM media. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/efiboot/Makefile.efiboot cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/efiboot/TODO.efiboot cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/efiboot/boot.c \ src/sys/arch/i386/stand/efiboot/efiboot.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/devopen.c \ src/sys/arch/i386/stand/efiboot/efidisk.c \ src/sys/arch/i386/stand/efiboot/efidisk.h \ src/sys/arch/i386/stand/efiboot/efidisk_ll.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/efiboot/efiboot.c cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/stand/efiboot/efidev.c cvs rdiff -u -r1.46 -r1.47 src/sys/arch/i386/stand/lib/biosdisk.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/stand/lib/biosdisk.h cvs rdiff -u -r1.15 -r1.16 src/sys/arch/i386/stand/lib/biosdisk_ll.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.9 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.10 --- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.9 Sat Apr 29 00:05:35 2017 +++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot Thu Mar 8 10:34:33 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.efiboot,v 1.9 2017/04/29 00:05:35 nonaka Exp $ +# $NetBSD: Makefile.efiboot,v 1.10 2018/03/08 10:34:33 nonaka Exp $ S= ${.CURDIR}/../../../../.. @@ -12,8 +12,8 @@ SOURCES?= start.S conf.c devopen.c efibo LIBI386SRCS= boot.c biosdisk.c bootinfo.c bootinfo_biosgeom.c LIBI386SRCS+= bootmenu.c diskbuf.c exec.c menuutils.c LIBI386SRCS+= panic.c parseutils.c pread.c -LIBI386SRCS+= eficons.c efidelay.c efidisk.c efidisk_ll.c efigetsecs.c -LIBI386SRCS+= efimemory.c +LIBI386SRCS+= eficons.c efidelay.c efidev.c efidisk.c efidisk_ll.c +LIBI386SRCS+= efigetsecs.c efimemory.c SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} PIE_CFLAGS= @@ -54,9 +54,11 @@ CPPFLAGS+= -Wno-pointer-sign CPPFLAGS+= -DEFI_ALLOCATE_MAX_ADDRESS=0x1ULL CPPFLAGS+= -DHEAP_VARIABLE CPPFLAGS+= -DSUPPORT_CD9660 +CPPFLAGS+= -D"devb2cdb(bno)=(bno)" CPPFLAGS+= -DSUPPORT_DOSFS CPPFLAGS+= -DSUPPORT_EXT2FS CPPFLAGS+= -DPASS_BIOSGEOM +CPPFLAGS+= -DBIOSDISK_DEFAULT_SECSIZE=2048 # for bootinfo_biosgeom.c CPPFLAGS+= -DLIBSA_ENABLE_LS_OP EFIDIR= ${S}/external/bsd/gnu-efi/dist @@ -66,6 +68,7 @@ CPPFLAGS+= -I${EFIDIR}/inc/protocol SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT +SAMISCCPPFLAGS+= -D"cdb2devb(bno)=(bno)" SAMISCMAKEFLAGS+= SA_USE_CREAD=yes # Read compressed kernels SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no # Netboot via TFTP, NFS Index: src/sys/arch/i386/stand/efiboot/TODO.efiboot diff -u src/sys/arch/i386/stand/efiboot/TODO.efiboot:1.3 src/sys/arch/i386/stand/efiboot/TODO.efiboot:1.4 --- src/sys/arch/i386/stand/efiboot/TODO.efiboot:1.3 Sun Mar 12 06:37:41 2017 +++ src/sys/arch/i386/stand/efiboot/TODO.efiboot Thu Mar 8 10:34:33 2018 @@ -1,6 +1,5 @@ - efiboot * handle UEFI variables - * boot from CD/DVD (bootable from CD/DVD, but root fs not found.) * load boot.cfg from EFI system partition (FAT32) - kernel Index: src/sys/arch/i386/stand/efiboot/boot.c diff -u src/sys/arch/i386/stand/efiboot/boot.c:1.5 src/sys/arch/i386/stand/efiboot/boot.c:1.6 --- src/sys/arch/i386/stand/efiboot/boot.c:1.5 Mon May 1 13:03:01 2017 +++ src/sys/arch/i386/stand/efiboot/boot.c Thu Mar 8 10:34:33 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.5 2017/05/01 13:03:01 nonaka Exp $ */ +/* $NetBSD: boot.c,v 1.6 2018/03/08 10:34:33 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -419,7 +419,7 @@ command_dev(char *arg) const char *file; /* dummy */ if (*arg == '\0') { - biosdisk_probe(); + efi_disk_show(); printf("default %s%d%c\n", default_devname, default_unit, 'a' + default_partition); return; @@ -554,6 +554,7 @@ command_multiboot(char *arg) void command_version(char *arg) { + CHAR16 *path; if (strcmp(arg, "full") == 0) { printf("ImageBase: 0x%" PRIxPTR "\n", @@ -563,6 +564,10 @@ command_version(char *arg) ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0x); Print(L"EFI Firmware: %s (rev %d.%02d)\n", ST->FirmwareVendor, ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0x); + path = DevicePathToStr(efi_bootdp); + Print(L"Boot DevicePath: %d:%d:%s\n", DevicePathType(efi_bootdp), + DevicePathSubType(efi_bootdp), path); + FreePool(path); }
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: manu Date: Tue Dec 10 02:02:48 UTC 2019 Modified Files: src/sys/arch/i386/stand/boot: devopen.c src/sys/arch/i386/stand/efiboot: devopen.c src/sys/arch/i386/stand/lib: biosdisk.c Log Message: In-RAID partitions with no name can be candidate for booting The code to select boot partition in RAID assumed thet had a name, which is true when there is a GPT inside the RAID, but not when there is a disklabel inside the RAID. This caused a regression from behavior of NetBSD 8.1. We fix this by allowing nameless partition to be boot candidates. This fixes misc/54748 While there, let raid device be used in the boot specification, like raid0a:/netbsd. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/boot/devopen.c cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/stand/efiboot/devopen.c cvs rdiff -u -r1.52 -r1.53 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/boot/devopen.c diff -u src/sys/arch/i386/stand/boot/devopen.c:1.9 src/sys/arch/i386/stand/boot/devopen.c:1.10 --- src/sys/arch/i386/stand/boot/devopen.c:1.9 Sun Aug 18 02:18:24 2019 +++ src/sys/arch/i386/stand/boot/devopen.c Tue Dec 10 02:02:47 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.9 2019/08/18 02:18:24 manu Exp $ */ +/* $NetBSD: devopen.c,v 1.10 2019/12/10 02:02:47 manu Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -156,7 +156,7 @@ devopen(struct open_file *f, const char if (strstr(devname, "raid") == devname) { f->f_dev = &devsw[0]; /* must be biosdisk */ - return biosdisk_open_name(f, devname); + return biosdisk_open_name(f, fname); } #endif Index: src/sys/arch/i386/stand/efiboot/devopen.c diff -u src/sys/arch/i386/stand/efiboot/devopen.c:1.8 src/sys/arch/i386/stand/efiboot/devopen.c:1.9 --- src/sys/arch/i386/stand/efiboot/devopen.c:1.8 Thu Sep 26 12:21:03 2019 +++ src/sys/arch/i386/stand/efiboot/devopen.c Tue Dec 10 02:02:47 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.8 2019/09/26 12:21:03 nonaka Exp $ */ +/* $NetBSD: devopen.c,v 1.9 2019/12/10 02:02:47 manu Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -151,6 +151,7 @@ int devopen(struct open_file *f, const char *fname, char **file) { char *fsname, *devname; + const char *xname = NULL; int unit, partition; int biosdev; int i, error; @@ -172,8 +173,12 @@ devopen(struct open_file *f, const char nfsys = nfsys_disk; /* Search by GPT label or raidframe name */ - if ((strstr(devname, "NAME=") == devname) || - (strstr(devname, "raid") == devname)) { + if (strstr(devname, "NAME=") == devname) + xname = devname; + if (strstr(devname, "raid") == devname) + xname = fname; + + if (xname != NULL) { f->f_dev = &devsw[0]; /* must be biosdisk */ if (!kernel_loaded) { @@ -181,7 +186,7 @@ devopen(struct open_file *f, const char BI_ADD(&bibp, BTINFO_BOOTPATH, sizeof(bibp)); } - error = biosdisk_open_name(f, devname); + error = biosdisk_open_name(f, xname); return error; } Index: src/sys/arch/i386/stand/lib/biosdisk.c diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.52 src/sys/arch/i386/stand/lib/biosdisk.c:1.53 --- src/sys/arch/i386/stand/lib/biosdisk.c:1.52 Fri Sep 13 02:19:46 2019 +++ src/sys/arch/i386/stand/lib/biosdisk.c Tue Dec 10 02:02:47 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: biosdisk.c,v 1.52 2019/09/13 02:19:46 manu Exp $ */ +/* $NetBSD: biosdisk.c,v 1.53 2019/12/10 02:02:47 manu Exp $ */ /* * Copyright (c) 1996, 1998 @@ -1401,9 +1401,9 @@ next_disk: continue; if (d->part[part].fstype == FS_UNUSED) continue; - if (d->part[part].part_name == NULL) -continue; - if (strcmp(d->part[part].part_name, name) == 0) { + + if (d->part[part].part_name != NULL && + strcmp(d->part[part].part_name, name) == 0) { *biosdev = raidframe[i].biosdev; *offset = raidframe[i].offset + RF_PROTECTED_SECTORS
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: manu Date: Tue Dec 17 01:37:53 UTC 2019 Modified Files: src/sys/arch/i386/stand/efiboot: efidisk.c src/sys/arch/i386/stand/lib: biosdisk.c Log Message: Do not use NAME=label syntax when label are empty When booting sysinst from UEFI, it defaults to a GPT installation where partition have no labels. Bootstrap used the NAME=label partition anyway, with the result that both EFI and FFS root partition had the same name "NAME=" and could not be distinguished. The first matching partition for the name was used, and bootstrap looked for the kernel in the EFI partition. We fix that by not using NAME=label names for partition when label is empty. In that case we revert to old syntax such as hd0b To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/stand/efiboot/efidisk.c cvs rdiff -u -r1.53 -r1.54 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/efiboot/efidisk.c diff -u src/sys/arch/i386/stand/efiboot/efidisk.c:1.8 src/sys/arch/i386/stand/efiboot/efidisk.c:1.9 --- src/sys/arch/i386/stand/efiboot/efidisk.c:1.8 Sun Aug 18 02:18:24 2019 +++ src/sys/arch/i386/stand/efiboot/efidisk.c Tue Dec 17 01:37:52 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: efidisk.c,v 1.8 2019/08/18 02:18:24 manu Exp $ */ +/* $NetBSD: efidisk.c,v 1.9 2019/12/17 01:37:52 manu Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -253,7 +253,7 @@ efi_disk_show(void) printf(" "); first = false; } - if (part[i].part_name != NULL) + if (part[i].part_name && part[i].part_name[0]) printf(" NAME=%s(", part[i].part_name); else printf(" hd%d%c(", edi->dev & 0x7f, i + 'a'); @@ -308,7 +308,7 @@ efi_disk_show(void) printf(" "); first = 0; } - if (part[j].part_name != NULL) + if (part[j].part_name && part[j].part_name[0]) printf(" NAME=%s(", part[j].part_name); else printf(" raid%d%c(", Index: src/sys/arch/i386/stand/lib/biosdisk.c diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.53 src/sys/arch/i386/stand/lib/biosdisk.c:1.54 --- src/sys/arch/i386/stand/lib/biosdisk.c:1.53 Tue Dec 10 02:02:47 2019 +++ src/sys/arch/i386/stand/lib/biosdisk.c Tue Dec 17 01:37:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: biosdisk.c,v 1.53 2019/12/10 02:02:47 manu Exp $ */ +/* $NetBSD: biosdisk.c,v 1.54 2019/12/17 01:37:53 manu Exp $ */ /* * Copyright (c) 1996, 1998 @@ -908,7 +908,8 @@ biosdisk_probe(void) first = 0; } #ifndef NO_GPT - if (d->part[part].part_name != NULL) + if (d->part[part].part_name && + d->part[part].part_name[0]) printf(" NAME=%s(", d->part[part].part_name); else #endif @@ -987,7 +988,8 @@ next_disk: first = 0; } #ifndef NO_GPT - if (d->part[part].part_name != NULL) + if (d->part[part].part_name && + d->part[part].part_name[0]) printf(" NAME=%s(", d->part[part].part_name); else #endif @@ -1095,7 +1097,9 @@ biosdisk_findpartition(int biosdev, dadd *partition = boot_part; #ifndef NO_GPT - if (part_name && d->part[boot_part].part_name) { + if (part_name && + d->part[boot_part].part_name && + d->part[boot_part].part_name[0]) { strlcpy(namebuf, d->part[boot_part].part_name, BIOSDISK_PART_NAME_LEN); *part_name = namebuf;
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: christos Date: Sat Jun 2 14:30:07 UTC 2018 Modified Files: src/sys/arch/i386/stand: Makefile.booters Makefile.inc src/sys/arch/i386/stand/boot: Makefile.boot src/sys/arch/i386/stand/bootxx: Makefile.bootxx src/sys/arch/i386/stand/cdboot: Makefile src/sys/arch/i386/stand/dosboot: Makefile src/sys/arch/i386/stand/efiboot: Makefile.efiboot src/sys/arch/i386/stand/fatboot: Makefile.fat src/sys/arch/i386/stand/pxeboot: Makefile Log Message: - Disable MKSANITIZER - Redo using NOPIE - Add NORELRO To generate a diff of this commit: cvs rdiff -u -r1.91 -r1.92 src/sys/arch/i386/stand/Makefile.booters cvs rdiff -u -r1.14 -r1.15 src/sys/arch/i386/stand/Makefile.inc cvs rdiff -u -r1.70 -r1.71 src/sys/arch/i386/stand/boot/Makefile.boot cvs rdiff -u -r1.49 -r1.50 src/sys/arch/i386/stand/bootxx/Makefile.bootxx cvs rdiff -u -r1.14 -r1.15 src/sys/arch/i386/stand/cdboot/Makefile cvs rdiff -u -r1.30 -r1.31 src/sys/arch/i386/stand/dosboot/Makefile cvs rdiff -u -r1.12 -r1.13 src/sys/arch/i386/stand/efiboot/Makefile.efiboot cvs rdiff -u -r1.7 -r1.8 src/sys/arch/i386/stand/fatboot/Makefile.fat cvs rdiff -u -r1.24 -r1.25 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.91 src/sys/arch/i386/stand/Makefile.booters:1.92 --- src/sys/arch/i386/stand/Makefile.booters:1.91 Sat Apr 8 15:53:21 2017 +++ src/sys/arch/i386/stand/Makefile.booters Sat Jun 2 10:30:06 2018 @@ -1,5 +1,6 @@ -# $NetBSD: Makefile.booters,v 1.91 2017/04/08 19:53:21 christos Exp $ +# $NetBSD: Makefile.booters,v 1.92 2018/06/02 14:30:06 christos Exp $ +NOSANITIZER= .include STRIPFLAG= Index: src/sys/arch/i386/stand/Makefile.inc diff -u src/sys/arch/i386/stand/Makefile.inc:1.14 src/sys/arch/i386/stand/Makefile.inc:1.15 --- src/sys/arch/i386/stand/Makefile.inc:1.14 Wed Feb 21 20:37:04 2018 +++ src/sys/arch/i386/stand/Makefile.inc Sat Jun 2 10:30:06 2018 @@ -1,4 +1,8 @@ -# $NetBSD: Makefile.inc,v 1.14 2018/02/22 01:37:04 christos Exp $ +# $NetBSD: Makefile.inc,v 1.15 2018/06/02 14:30:06 christos Exp $ + +NOSANITIZER= +NOPIE= +NOMAN= .include Index: src/sys/arch/i386/stand/boot/Makefile.boot diff -u src/sys/arch/i386/stand/boot/Makefile.boot:1.70 src/sys/arch/i386/stand/boot/Makefile.boot:1.71 --- src/sys/arch/i386/stand/boot/Makefile.boot:1.70 Sat Apr 8 15:53:21 2017 +++ src/sys/arch/i386/stand/boot/Makefile.boot Sat Jun 2 10:30:06 2018 @@ -1,8 +1,10 @@ -# $NetBSD: Makefile.boot,v 1.70 2017/04/08 19:53:21 christos Exp $ +# $NetBSD: Makefile.boot,v 1.71 2018/06/02 14:30:06 christos Exp $ S= ${.CURDIR}/../../../../.. NOMAN= +NOSANITIZER= +NOPIE= PROG?= boot NEWVERSWHAT?= "BIOS Boot" @@ -11,11 +13,7 @@ AFLAGS.biosboot.S= ${${ACTIVE_CC} == "cl SOURCES?= biosboot.S boot2.c conf.c devopen.c exec.c SRCS= ${SOURCES} -PIE_CFLAGS= -PIE_AFLAGS= -PIE_LDFLAGS= - -.include +.include STRIPFLAG= # nothing Index: src/sys/arch/i386/stand/bootxx/Makefile.bootxx diff -u src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.49 src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.50 --- src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.49 Thu Aug 20 07:38:27 2015 +++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx Sat Jun 2 10:30:07 2018 @@ -1,14 +1,13 @@ -# $NetBSD: Makefile.bootxx,v 1.49 2015/08/20 11:38:27 uebayasi Exp $ +# $NetBSD: Makefile.bootxx,v 1.50 2018/06/02 14:30:07 christos Exp $ S= ${.CURDIR}/../../../../.. AFLAGS.bootxx.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} AFLAGS.pbr.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} -PIE_CFLAGS= -PIE_LDFLAGS= -PIE_AFLAGS= +NOPIE= NOMAN= +NOSANITIZER= PROG?= bootxx_${FS} BINDIR= /usr/mdec BINMODE= 0444 @@ -23,7 +22,7 @@ BOOTXX_MAXSIZE?= $$(( ${BOOTXX_SECTORS} SRCS= pbr.S label.S bootxx.S boot1.c -.include +.include STRIPFLAG= # nothing Index: src/sys/arch/i386/stand/cdboot/Makefile diff -u src/sys/arch/i386/stand/cdboot/Makefile:1.14 src/sys/arch/i386/stand/cdboot/Makefile:1.15 --- src/sys/arch/i386/stand/cdboot/Makefile:1.14 Sun Jan 12 10:26:29 2014 +++ src/sys/arch/i386/stand/cdboot/Makefile Sat Jun 2 10:30:07 2018 @@ -1,15 +1,10 @@ -# $NetBSD: Makefile,v 1.14 2014/01/12 15:26:29 tsutsui Exp $ +# $NetBSD: Makefile,v 1.15 2018/06/02 14:30:07 christos Exp $ S= ${.CURDIR}/../../../.. AFLAGS.cdboot.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} -PIE_CFLAGS= -PIE_LDFLAGS= -PIE_AFLAGS= - -NOMAN= # defined -.include +.include STRIPFLAG= # nothing Index: src/sys/arch/i386/stand/dosboot/Makefile diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.30 src/sys/arch/i386/stand/dosboot/Makefile:1.31 --- src/sys/arch/i386/stand/dosboot/Makefile:1.30 Sat Jan 23 17:29:29 2016 +++ src/sys/arch/i386/stand/dosboot/Makefile Sat Jun 2 10:30:07 2
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: dholland Date: Sun Jan 27 04:56:46 UTC 2019 Modified Files: src/sys/arch/i386/stand: Makefile.inc src/sys/arch/i386/stand/genprom: Makefile src/sys/arch/i386/stand/misc: Makefile Log Message: fix duplicated chunk from merge To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/i386/stand/Makefile.inc cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/genprom/Makefile cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/stand/misc/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.inc diff -u src/sys/arch/i386/stand/Makefile.inc:1.17 src/sys/arch/i386/stand/Makefile.inc:1.18 --- src/sys/arch/i386/stand/Makefile.inc:1.17 Sun Jan 27 02:08:38 2019 +++ src/sys/arch/i386/stand/Makefile.inc Sun Jan 27 04:56:46 2019 @@ -1,9 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.17 2019/01/27 02:08:38 pgoyette Exp $ - -NOLIBCSANITIZER= -NOSANITIZER= -NOPIE= -NOMAN= +# $NetBSD: Makefile.inc,v 1.18 2019/01/27 04:56:46 dholland Exp $ NOLIBCSANITIZER= NOSANITIZER= Index: src/sys/arch/i386/stand/genprom/Makefile diff -u src/sys/arch/i386/stand/genprom/Makefile:1.9 src/sys/arch/i386/stand/genprom/Makefile:1.10 --- src/sys/arch/i386/stand/genprom/Makefile:1.9 Sun Jan 27 02:08:38 2019 +++ src/sys/arch/i386/stand/genprom/Makefile Sun Jan 27 04:56:46 2019 @@ -1,6 +1,4 @@ -# $NetBSD: Makefile,v 1.9 2019/01/27 02:08:38 pgoyette Exp $ - -.include +# $NetBSD: Makefile,v 1.10 2019/01/27 04:56:46 dholland Exp $ .include Index: src/sys/arch/i386/stand/misc/Makefile diff -u src/sys/arch/i386/stand/misc/Makefile:1.10 src/sys/arch/i386/stand/misc/Makefile:1.11 --- src/sys/arch/i386/stand/misc/Makefile:1.10 Sun Jan 27 02:08:38 2019 +++ src/sys/arch/i386/stand/misc/Makefile Sun Jan 27 04:56:46 2019 @@ -1,6 +1,4 @@ -# $NetBSD: Makefile,v 1.10 2019/01/27 02:08:38 pgoyette Exp $ - -.include +# $NetBSD: Makefile,v 1.11 2019/01/27 04:56:46 dholland Exp $ .include
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: nonaka Date: Sun Mar 12 05:33:48 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: boot.c src/sys/arch/i386/stand/lib: exec.c libi386.h Log Message: efiboot: Kernel modules are loaded in pre-allocated memory. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/efiboot/boot.c cvs rdiff -u -r1.66 -r1.67 src/sys/arch/i386/stand/lib/exec.c cvs rdiff -u -r1.41 -r1.42 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/efiboot/boot.c diff -u src/sys/arch/i386/stand/efiboot/boot.c:1.3 src/sys/arch/i386/stand/efiboot/boot.c:1.4 --- src/sys/arch/i386/stand/efiboot/boot.c:1.3 Fri Mar 3 09:29:57 2017 +++ src/sys/arch/i386/stand/efiboot/boot.c Sun Mar 12 05:33:48 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.3 2017/03/03 09:29:57 nonaka Exp $ */ +/* $NetBSD: boot.c,v 1.4 2017/03/12 05:33:48 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -31,10 +31,9 @@ #include #include -#include - -#include -#include +#include "bootcfg.h" +#include "bootmod.h" +#include "bootmenu.h" #include "devopen.h" int errno; @@ -207,16 +206,40 @@ clearit(void) static void bootit(const char *filename, int howto) { + EFI_STATUS status; + EFI_PHYSICAL_ADDRESS bouncebuf; + UINTN npages; + u_long allocsz; if (howto & AB_VERBOSE) printf("booting %s (howto 0x%x)\n", sprint_bootsel(filename), howto); - if (exec_netbsd(filename, 0, howto, 0, efi_cleanup) < 0) + if (count_netbsd(filename, &allocsz) < 0) { + printf("boot: %s: %s\n", sprint_bootsel(filename), + strerror(errno)); + return; + } + + bouncebuf = EFI_ALLOCATE_MAX_ADDRESS; + npages = EFI_SIZE_TO_PAGES(allocsz); + status = uefi_call_wrapper(BS->AllocatePages, 4, AllocateMaxAddress, + EfiLoaderData, npages, &bouncebuf); + if (EFI_ERROR(status)) { + printf("boot: %s: %s\n", sprint_bootsel(filename), + strerror(ENOMEM)); + return; + } + + efi_loadaddr = bouncebuf; + if (exec_netbsd(filename, bouncebuf, howto, 0, efi_cleanup) < 0) printf("boot: %s: %s\n", sprint_bootsel(filename), strerror(errno)); else printf("boot returned\n"); + + (void) uefi_call_wrapper(BS->FreePages, 2, bouncebuf, npages); + efi_loadaddr = 0; } void Index: src/sys/arch/i386/stand/lib/exec.c diff -u src/sys/arch/i386/stand/lib/exec.c:1.66 src/sys/arch/i386/stand/lib/exec.c:1.67 --- src/sys/arch/i386/stand/lib/exec.c:1.66 Thu Feb 23 12:14:53 2017 +++ src/sys/arch/i386/stand/lib/exec.c Sun Mar 12 05:33:48 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.66 2017/02/23 12:14:53 nonaka Exp $ */ +/* $NetBSD: exec.c,v 1.67 2017/03/12 05:33:48 nonaka Exp $ */ /* * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -151,6 +151,11 @@ static void module_add_common(const char static void userconf_init(void); +static void extract_device(const char *, char *, size_t); +static void module_base_path(char *, size_t); +static int module_open(boot_module_t *, int, const char *, const char *, + bool); + void framebuffer_configure(struct btinfo_framebuffer *fb) { @@ -196,6 +201,10 @@ module_add_common(const char *name, uint while (*name == ' ' || *name == '\t') ++name; + for (bm = boot_modules; bm != NULL; bm = bm->bm_next) + if (bm->bm_type == type && strcmp(bm->bm_path, name) == 0) + return; + bm = alloc(sizeof(boot_module_t)); len = strlen(name) + 1; str = alloc(len); @@ -299,30 +308,6 @@ common_load_kernel(const char *file, u_l return ENOMEM; } #endif -#ifdef EFIBOOT - { - EFI_STATUS status; - EFI_PHYSICAL_ADDRESS addr; - UINTN kernsize; - - marks[MARK_START] = loadaddr; - if ((fd = loadfile(file, marks, COUNT_KERNEL)) == -1) - return EIO; - close(fd); - - /* Allocate temporary arena. */ - addr = EFI_ALLOCATE_MAX_ADDRESS; - kernsize = marks[MARK_END] - loadaddr; - kernsize = EFI_SIZE_TO_PAGES(kernsize); - status = uefi_call_wrapper(BS->AllocatePages, 4, - AllocateMaxAddress, EfiLoaderData, kernsize, &addr); - if (EFI_ERROR(status)) - return ENOMEM; - efi_loadaddr = loadaddr = addr; - - memset(marks, 0, sizeof(marks[0]) * MARK_MAX); - } -#endif marks[MARK_START] = loadaddr; if ((fd = loadfile(file, marks, LOAD_KERNEL & ~(floppy ? LOAD_BACKWARDS : 0))) == -1) @@ -360,15 +345,6 @@ common_load_kernel(const char *file, u_l ppbcopy(loadaddr, origaddr, marks[MARK_END]); } #endif -#ifdef EFIBOOT - marks[MARK_START] -= loadaddr; - marks[MARK_ENTRY] -= loadaddr; - marks[MARK_DATA] -= loadaddr; - /* MARK_NSYM */ - marks[MARK_SYM] -= loadaddr; - marks[MARK_END] -= loadaddr; - /* Copy the kernel to original load address later. */ -#endif marks[MARK_END] = (((u_long) marks[MARK_END] + sizeof(int) - 1)) & (-sizeof(int)); image_end = marks[MARK_END]; @@ -410,6 +386,15 @@ exec_netbsd(const char *file, physaddr_t errno = err
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: christos Date: Thu Feb 22 01:37:04 UTC 2018 Modified Files: src/sys/arch/i386/stand: Makefile.inc Log Message: gcc-6 needs -nosse To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 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.13 src/sys/arch/i386/stand/Makefile.inc:1.14 --- src/sys/arch/i386/stand/Makefile.inc:1.13 Thu Jan 12 17:16:29 2017 +++ src/sys/arch/i386/stand/Makefile.inc Wed Feb 21 20:37:04 2018 @@ -1,11 +1,11 @@ -# $NetBSD: Makefile.inc,v 1.13 2017/01/12 22:16:29 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.14 2018/02/22 01:37:04 christos Exp $ .include BINDIR= /usr/mdec OPT_SIZE.gcc= -Os -ffreestanding -fomit-frame-pointer -fno-unwind-tables \ - -fno-asynchronous-unwind-tables -fno-exceptions + -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 \
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: christos Date: Sun Jul 8 16:50:28 UTC 2018 Modified Files: src/sys/arch/i386/stand: Makefile src/sys/arch/i386/stand/efiboot: Makefile Log Message: Enable efiboot on i386, for 32 bit bootblocks To generate a diff of this commit: cvs rdiff -u -r1.28 -r1.29 src/sys/arch/i386/stand/Makefile cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/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 diff -u src/sys/arch/i386/stand/Makefile:1.28 src/sys/arch/i386/stand/Makefile:1.29 --- src/sys/arch/i386/stand/Makefile:1.28 Tue Jan 24 06:09:14 2017 +++ src/sys/arch/i386/stand/Makefile Sun Jul 8 12:50:27 2018 @@ -1,11 +1,9 @@ -# $NetBSD: Makefile,v 1.28 2017/01/24 11:09:14 nonaka Exp $ +# $NetBSD: Makefile,v 1.29 2018/07/08 16:50:27 christos Exp $ SUBDIR= mbr boot SUBDIR+= bootxx cdboot fatboot SUBDIR+= dosboot misc SUBDIR+= pxeboot -.if ${MACHINE} == "amd64" SUBDIR+= efiboot -.endif .include Index: src/sys/arch/i386/stand/efiboot/Makefile diff -u src/sys/arch/i386/stand/efiboot/Makefile:1.1 src/sys/arch/i386/stand/efiboot/Makefile:1.2 --- src/sys/arch/i386/stand/efiboot/Makefile:1.1 Tue Jan 24 06:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/Makefile Sun Jul 8 12:50:28 2018 @@ -1,6 +1,8 @@ -# $NetBSD: Makefile,v 1.1 2017/01/24 11:09:14 nonaka Exp $ +# $NetBSD: Makefile,v 1.2 2018/07/08 16:50:28 christos Exp $ +SUBDIR= bootia32 +.if ${MACHINE} == "amd64" SUBDIR= bootx64 -SUBDIR+= bootia32 +.endif .include
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: joerg Date: Thu Jan 12 22:16:29 UTC 2017 Modified Files: src/sys/arch/i386/stand: Makefile.inc Log Message: Remove some manual size tuning that no longer seems to be needed. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 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.12 src/sys/arch/i386/stand/Makefile.inc:1.13 --- src/sys/arch/i386/stand/Makefile.inc:1.12 Thu May 1 18:37:26 2014 +++ src/sys/arch/i386/stand/Makefile.inc Thu Jan 12 22:16:29 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.12 2014/05/01 18:37:26 dsl Exp $ +# $NetBSD: Makefile.inc,v 1.13 2017/01/12 22:16:29 joerg Exp $ .include @@ -9,5 +9,4 @@ OPT_SIZE.gcc= -Os -ffreestanding -fomit- OPT_SIZE.clang= -Oz -ffreestanding -fomit-frame-pointer -DNDEBUG \ -fno-stack-protector -mno-sse \ -mstack-alignment=4 \ - -mllvm -inline-threshold=3 -mllvm -enable-load-pre=false \ -fno-unwind-tables
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: nonaka Date: Sat Feb 11 10:23:39 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: efiboot.c efiboot.h src/sys/arch/i386/stand/efiboot/bootx64: efibootx64.c startprog64.S src/sys/arch/i386/stand/lib: exec.c Log Message: PR/51953: fix unable to boot on some AMD machine. Delayed the timing to copy the kernel to actual address. copy routine from common/lib/libc/arch/x86_64/string/bcopy.S To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/efiboot/efiboot.c \ src/sys/arch/i386/stand/efiboot/efiboot.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c cvs rdiff -u -r1.2 -r1.3 \ src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S cvs rdiff -u -r1.64 -r1.65 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/efiboot.c diff -u src/sys/arch/i386/stand/efiboot/efiboot.c:1.3 src/sys/arch/i386/stand/efiboot/efiboot.c:1.4 --- src/sys/arch/i386/stand/efiboot/efiboot.c:1.3 Sat Feb 11 10:15:55 2017 +++ src/sys/arch/i386/stand/efiboot/efiboot.c Sat Feb 11 10:23:39 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.c,v 1.3 2017/02/11 10:15:55 nonaka Exp $ */ +/* $NetBSD: efiboot.c,v 1.4 2017/02/11 10:23:39 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -35,6 +35,8 @@ EFI_HANDLE IH; EFI_DEVICE_PATH *efi_bootdp; EFI_LOADED_IMAGE *efi_li; uintptr_t efi_main_sp; +physaddr_t efi_loadaddr, efi_kernel_start; +u_long efi_kernel_size; bool efi_cleanuped; static EFI_PHYSICAL_ADDRESS heap_start = EFI_ALLOCATE_MAX_ADDRESS; Index: src/sys/arch/i386/stand/efiboot/efiboot.h diff -u src/sys/arch/i386/stand/efiboot/efiboot.h:1.3 src/sys/arch/i386/stand/efiboot/efiboot.h:1.4 --- src/sys/arch/i386/stand/efiboot/efiboot.h:1.3 Sat Feb 11 10:15:55 2017 +++ src/sys/arch/i386/stand/efiboot/efiboot.h Sat Feb 11 10:23:39 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.h,v 1.3 2017/02/11 10:15:55 nonaka Exp $ */ +/* $NetBSD: efiboot.h,v 1.4 2017/02/11 10:23:39 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -48,6 +48,8 @@ extern EFI_HANDLE IH; extern EFI_DEVICE_PATH *efi_bootdp; extern EFI_LOADED_IMAGE *efi_li; extern uintptr_t efi_main_sp; +extern physaddr_t efi_loadaddr, efi_kernel_start; +extern u_long efi_kernel_size; extern bool efi_cleanuped; void efi_cleanup(void); Index: src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c diff -u src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c:1.1 src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c:1.2 --- src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c:1.1 Tue Jan 24 11:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.c Sat Feb 11 10:23:39 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efibootx64.c,v 1.1 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: efibootx64.c,v 1.2 2017/02/11 10:23:39 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -32,8 +32,10 @@ struct x86_boot_params boot_params; -void startprog64_start(void *, physaddr_t, physaddr_t); -extern void (*startprog64)(void *, physaddr_t, physaddr_t); +void startprog64_start(physaddr_t, physaddr_t, physaddr_t, u_long, +void *, physaddr_t); +extern void (*startprog64)(physaddr_t, physaddr_t, physaddr_t, u_long, +void *, physaddr_t); extern u_int startprog64_size; void @@ -64,7 +66,8 @@ startprog(physaddr_t entry, uint32_t arg memcpy(newsp, argv, sizeof(*argv) * argc); } - (*startprog64)(startprog64, entry, (physaddr_t)newsp); + (*startprog64)(efi_kernel_start, efi_kernel_start + efi_loadaddr, + (physaddr_t)newsp, efi_kernel_size, startprog64, entry); } /* ARGSUSED */ Index: src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S diff -u src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S:1.2 src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S:1.3 --- src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S:1.2 Sat Feb 4 16:14:27 2017 +++ src/sys/arch/i386/stand/efiboot/bootx64/startprog64.S Sat Feb 11 10:23:39 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: startprog64.S,v 1.2 2017/02/04 16:14:27 christos Exp $ */ +/* $NetBSD: startprog64.S,v 1.3 2017/02/11 10:23:39 nonaka Exp $ */ /* NetBSD: startprog.S,v 1.3 2003/02/01 14:48:18 dsl Exp */ /* starts program in protected mode / flat space @@ -78,26 +78,135 @@ _C_LABEL(startprog64_size): .p2align 4,,15 /* - * startprog64(loadddr,entry,stack) + * startprog64(loadddr,entry,stack,kern_load,kern_start,kern_size) */ ENTRY(startprog64_start) start: /* * This function is to call the loaded kernel's start() with * 32bit segment mode from x64 mode. - * %rdi: loaded start address - * %rsi: kernel entry address + * %rdi: kernel start address + * %rsi: loaded kernel address * %rdx: stack address + * %rcx: loaded kernel size + * %r8 : loaded start address + * %r9 : kernel entry address */ - cld #
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: christos Date: Sat Jan 23 22:29:29 UTC 2016 Modified Files: src/sys/arch/i386/stand/boot: Makefile.boot src/sys/arch/i386/stand/dosboot: Makefile src/sys/arch/i386/stand/pxeboot: Makefile Log Message: We'll define the kernel types for standalone code. To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/arch/i386/stand/boot/Makefile.boot cvs rdiff -u -r1.29 -r1.30 src/sys/arch/i386/stand/dosboot/Makefile cvs rdiff -u -r1.23 -r1.24 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/boot/Makefile.boot diff -u src/sys/arch/i386/stand/boot/Makefile.boot:1.68 src/sys/arch/i386/stand/boot/Makefile.boot:1.69 --- src/sys/arch/i386/stand/boot/Makefile.boot:1.68 Sat Jan 23 16:22:47 2016 +++ src/sys/arch/i386/stand/boot/Makefile.boot Sat Jan 23 17:29:29 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.boot,v 1.68 2016/01/23 21:22:47 christos Exp $ +# $NetBSD: Makefile.boot,v 1.69 2016/01/23 22:29:29 christos Exp $ S= ${.CURDIR}/../../../../.. @@ -36,7 +36,7 @@ BINMODE=444 LDFLAGS+= -nostdlib -Wl,-N -Wl,-e,boot_start CPPFLAGS+= -I ${.CURDIR}/.. -I ${.CURDIR}/../../lib -I ${S}/lib/libsa -CPPFLAGS+= -I ${.OBJDIR} -D_KERNTYPES +CPPFLAGS+= -I ${.OBJDIR} # Make sure we override any optimization options specified by the user COPTS= -Os Index: src/sys/arch/i386/stand/dosboot/Makefile diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.29 src/sys/arch/i386/stand/dosboot/Makefile:1.30 --- src/sys/arch/i386/stand/dosboot/Makefile:1.29 Sat Jan 23 16:22:47 2016 +++ src/sys/arch/i386/stand/dosboot/Makefile Sat Jan 23 17:29:29 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.29 2016/01/23 21:22:47 christos Exp $ +# $NetBSD: Makefile,v 1.30 2016/01/23 22:29:29 christos Exp $ S= ${.CURDIR}/../../../.. @@ -13,7 +13,7 @@ SRCS= main.c devopen.c exec.c CPPFLAGS+= -DSLOW # for libz CPPFLAGS+= -DCOMPAT_386BSD_MBRPART -CPPFLAGS+= -DXMS -D_KERNTYPES +CPPFLAGS+= -DXMS CPPFLAGS+= -DLIBSA_ENABLE_LS_OP #uncomment if there are problems with memory detection #CPPFLAGS+= -DCONSERVATIVE_MEMDETECT Index: src/sys/arch/i386/stand/pxeboot/Makefile diff -u src/sys/arch/i386/stand/pxeboot/Makefile:1.23 src/sys/arch/i386/stand/pxeboot/Makefile:1.24 --- src/sys/arch/i386/stand/pxeboot/Makefile:1.23 Sat Jan 23 16:22:47 2016 +++ src/sys/arch/i386/stand/pxeboot/Makefile Sat Jan 23 17:29:29 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.23 2016/01/23 21:22:47 christos Exp $ +# $NetBSD: Makefile,v 1.24 2016/01/23 22:29:29 christos Exp $ S= ${.CURDIR}/../../../.. @@ -40,7 +40,7 @@ CPPFLAGS+= -DSUPPORT_SERIAL=boot_params. CPPFLAGS+= -DCONSPEED=boot_params.bp_conspeed CPPFLAGS+= -DCONSADDR=boot_params.bp_consaddr CPPFLAGS+= -DCONSOLE_KEYMAP=boot_params.bp_keymap -CPPFLAGS+= -DDIRECT_SERIAL -D_KERNTYPES +CPPFLAGS+= -DDIRECT_SERIAL # Various serial line configurations #CPPFLAGS+= -DSUPPORT_SERIAL=CONSDEV_PC -DDIRECT_SERIAL # or
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: joerg Date: Mon Jul 1 12:48:03 UTC 2013 Modified Files: src/sys/arch/i386/stand: Makefile.inc Log Message: Explicitly disable unwind table generation. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 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.10 src/sys/arch/i386/stand/Makefile.inc:1.11 --- src/sys/arch/i386/stand/Makefile.inc:1.10 Wed Apr 4 10:54:44 2012 +++ src/sys/arch/i386/stand/Makefile.inc Mon Jul 1 12:48:03 2013 @@ -1,11 +1,12 @@ -# $NetBSD: Makefile.inc,v 1.10 2012/04/04 10:54:44 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.11 2013/07/01 12:48:03 joerg Exp $ .include BINDIR= /usr/mdec -OPT_SIZE.gcc= -Os -ffreestanding -fomit-frame-pointer +OPT_SIZE.gcc= -Os -ffreestanding -fomit-frame-pointer -fno-unwind-tables OPT_SIZE.clang= -Oz -ffreestanding -fomit-frame-pointer -DNDEBUG \ -fno-stack-protector -mno-sse \ -mstack-alignment=4 \ - -mllvm -inline-threshold=3 -mllvm -enable-load-pre=false + -mllvm -inline-threshold=3 -mllvm -enable-load-pre=false \ + -fno-unwind-tables
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: he Date: Sun Jul 28 08:50:09 UTC 2013 Modified Files: src/sys/arch/i386/stand/boot: boot2.c src/sys/arch/i386/stand/lib: bootmenu.c bootmenu.h Log Message: Two changes for the i386 boot loader related to the boot menu which can be defined in boot.cfg: * Add a "menu" command which re-displays the menu and initiates the timed countdown * Use any default command defined in boot.cfg as default args if the user runs "boot" with no arguments This is useful in circumstances where you e.g. need to interrupt the normal boot process to switch to serial console, and where simply "boot netbsd" is no longer sufficient (e.g. as with install media which needs the miniroot kernel module loaded). To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/sys/arch/i386/stand/boot/boot2.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/stand/lib/bootmenu.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/lib/bootmenu.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/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.58 src/sys/arch/i386/stand/boot/boot2.c:1.59 --- src/sys/arch/i386/stand/boot/boot2.c:1.58 Sat Aug 4 03:51:27 2012 +++ src/sys/arch/i386/stand/boot/boot2.c Sun Jul 28 08:50:09 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.58 2012/08/04 03:51:27 riastradh Exp $ */ +/* $NetBSD: boot2.c,v 1.59 2013/07/28 08:50:09 he Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -120,6 +120,9 @@ void command_quit(char *); void command_boot(char *); void command_dev(char *); void command_consdev(char *); +#ifndef SMALL +void command_menu(char *); +#endif void command_modules(char *); void command_multiboot(char *); @@ -131,6 +134,9 @@ const struct bootblk_command commands[] { "boot", command_boot }, { "dev", command_dev }, { "consdev", command_consdev }, +#ifndef SMALL + { "menu", command_menu }, +#endif { "modules", command_modules }, { "load", module_add }, { "multiboot", command_multiboot }, @@ -394,6 +400,9 @@ command_help(char *arg) "dev xd[N[x]]:\n" "consdev {pc|com[0123]|com[0123]kbd|auto}\n" "vesa {modenum|on|off|enabled|disabled|list}\n" +#ifndef SMALL + "menu (reenters boot menu, if defined in boot.cfg)\n" +#endif "modules {on|off|enabled|disabled}\n" "load {path_to_module}\n" "multiboot [xdNx:][filename] []\n" @@ -439,6 +448,10 @@ command_boot(char *arg) bootit(filename, howto, tell); } else { int i; + +#ifndef SMALL + bootdefault(); +#endif for (i = 0; i < NUMNAMES; i++) { bootit(names[i][0], howto, tell); bootit(names[i][1], howto, tell); @@ -504,6 +517,21 @@ command_consdev(char *arg) printf("invalid console device.\n"); } +#ifndef SMALL +/* ARGSUSED */ +void +command_menu(char *arg) +{ + + if (bootconf.nummenu > 0) { + /* Does not return */ + doboottypemenu(); + } else { + printf("No menu defined in boot.cfg\n"); + } +} +#endif /* !SMALL */ + void command_modules(char *arg) { Index: src/sys/arch/i386/stand/lib/bootmenu.c diff -u src/sys/arch/i386/stand/lib/bootmenu.c:1.10 src/sys/arch/i386/stand/lib/bootmenu.c:1.11 --- src/sys/arch/i386/stand/lib/bootmenu.c:1.10 Thu Aug 18 13:20:04 2011 +++ src/sys/arch/i386/stand/lib/bootmenu.c Sun Jul 28 08:50:09 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: bootmenu.c,v 1.10 2011/08/18 13:20:04 christos Exp $ */ +/* $NetBSD: bootmenu.c,v 1.11 2013/07/28 08:50:09 he Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -41,6 +41,8 @@ #define isnum(c) ((c) >= '0' && (c) <= '9') +static void docommandchoice(int); + extern struct x86_boot_params boot_params; extern const char bootprog_name[], bootprog_rev[], bootprog_kernrev[]; @@ -297,11 +299,57 @@ getchoicefrominput(char *input, int def) return choice; } +static void +docommandchoice(int choice) +{ + char input[80], *ic, *oc; + + ic = bootconf.command[choice]; + /* Split command string at ; into separate commands */ + do { + oc = input; + /* Look for ; separator */ + for (; *ic && *ic != COMMAND_SEPARATOR; ic++) + *oc++ = *ic; + if (*input == '\0') + continue; + /* Strip out any trailing spaces */ + oc--; + for (; *oc == ' ' && oc > input; oc--); + *++oc = '\0'; + if (*ic == COMMAND_SEPARATOR) + ic++; + /* Stop silly command strings like ;;; */ + if (*input != '\0') + docommand(input); + /* Skip leading spaces */ + for (; *ic == ' '; ic++); + } while (*ic); +} + +void +bootdefault(void) +{ + int choice; + static int entered; + + if (bootconf.nummenu > 0) { + if (entered) { + printf("default boot twice, skipping...\n"); + return; + } + entered = 1; + choice = bootconf.def; + printf("command(s): %s\n", bootconf.command[choice]); + docommandchoice(choice); + } +} + void doboottypemenu(void) { int choice; - char input[80], *ic, *oc; + char input[8
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: matt Date: Wed Aug 21 08:15:19 UTC 2013 Modified Files: src/sys/arch/i386/stand: Makefile.booters src/sys/arch/i386/stand/boot: Makefile.boot src/sys/arch/i386/stand/bootxx: Makefile.bootxx Log Message: Use To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/arch/i386/stand/Makefile.booters cvs rdiff -u -r1.58 -r1.59 src/sys/arch/i386/stand/boot/Makefile.boot cvs rdiff -u -r1.43 -r1.44 src/sys/arch/i386/stand/bootxx/Makefile.bootxx 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.86 src/sys/arch/i386/stand/Makefile.booters:1.87 --- src/sys/arch/i386/stand/Makefile.booters:1.86 Fri Aug 10 12:18:14 2012 +++ src/sys/arch/i386/stand/Makefile.booters Wed Aug 21 08:15:19 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.booters,v 1.86 2012/08/10 12:18:14 joerg Exp $ +# $NetBSD: Makefile.booters,v 1.87 2013/08/21 08:15:19 matt Exp $ .include @@ -49,18 +49,6 @@ KERNMISCMAKEFLAGS="LIBKERN_ARCH=i386" CLEANFILES+= ${STARTFILE} vers.c ${BASE}.list SRCS+= vers.c -CLEANFILES+= machine x86 - -.if !make(obj) && !make(clean) && !make(cleandir) -.BEGIN: - -rm -f machine && ln -s $S/arch/i386/include machine - -rm -f x86 && ln -s $S/arch/x86/include x86 -.ifdef LIBOBJ - -rm -f lib && ln -s ${LIBOBJ}/lib lib - mkdir -p ${LIBOBJ}/lib -.endif -.endif - ### find out what to use for libkern KERN_AS= library .include "${S}/lib/libkern/Makefile.inc" @@ -125,3 +113,4 @@ ${BASE}.bin: ${STARTFILE} ${OBJS} ${LIBS ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin .include +.include Index: src/sys/arch/i386/stand/boot/Makefile.boot diff -u src/sys/arch/i386/stand/boot/Makefile.boot:1.58 src/sys/arch/i386/stand/boot/Makefile.boot:1.59 --- src/sys/arch/i386/stand/boot/Makefile.boot:1.58 Fri Aug 10 12:18:15 2012 +++ src/sys/arch/i386/stand/boot/Makefile.boot Wed Aug 21 08:15:19 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.boot,v 1.58 2012/08/10 12:18:15 joerg Exp $ +# $NetBSD: Makefile.boot,v 1.59 2013/08/21 08:15:19 matt Exp $ S= ${.CURDIR}/../../../../.. @@ -91,18 +91,6 @@ CPPFLAGS+= -Wno-pointer-sign I386_STAND_DIR?= $S/arch/i386/stand -CLEANFILES+= machine x86 - -.if !make(obj) && !make(clean) && !make(cleandir) -.BEGIN: - -rm -f machine && ln -s $S/arch/i386/include machine - -rm -f x86 && ln -s $S/arch/x86/include x86 -.ifdef LIBOBJ - -rm -f lib && ln -s ${LIBOBJ}/lib lib - mkdir -p ${LIBOBJ}/lib -.endif -.endif - ### find out what to use for libi386 I386DIR= ${I386_STAND_DIR}/lib .include "${I386DIR}/Makefile.inc" @@ -165,3 +153,4 @@ ${PROG}: ${OBJS} ${LIBLIST} ${.CURDIR}/. ${OBJCOPY} -O binary ${PROG}.syms ${PROG} .include +.include Index: src/sys/arch/i386/stand/bootxx/Makefile.bootxx diff -u src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.43 src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.44 --- src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.43 Fri Aug 10 12:18:15 2012 +++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx Wed Aug 21 08:15:19 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootxx,v 1.43 2012/08/10 12:18:15 joerg Exp $ +# $NetBSD: Makefile.bootxx,v 1.44 2013/08/21 08:15:19 matt Exp $ S= ${.CURDIR}/../../../../.. @@ -93,18 +93,6 @@ CPPFLAGS+= -DLIBSA_SINGLE_FILESYSTEM=xxf I386_STAND_DIR?= $S/arch/i386/stand -CLEANFILES+= machine x86 - -.if !make(obj) && !make(clean) && !make(cleandir) -.BEGIN: - -rm -f machine && ln -s $S/arch/i386/include machine - -rm -f x86 && ln -s $S/arch/x86/include x86 -.ifdef LIBOBJ - -rm -f lib && ln -s ${LIBOBJ}/lib lib - mkdir -p ${LIBOBJ}/lib -.endif -.endif - ### find out what to use for libi386 I386DIR= ${I386_STAND_DIR}/lib .include "${I386DIR}/Makefile.inc" @@ -150,3 +138,4 @@ ${PROG}: ${OBJS} ${LIBLIST} fi .include +.include
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: matt Date: Wed Aug 21 15:24:27 UTC 2013 Modified Files: src/sys/arch/i386/stand: Makefile.booters Log Message: Set KLINK_MACHINE To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 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.87 src/sys/arch/i386/stand/Makefile.booters:1.88 --- src/sys/arch/i386/stand/Makefile.booters:1.87 Wed Aug 21 08:15:19 2013 +++ src/sys/arch/i386/stand/Makefile.booters Wed Aug 21 15:24:27 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.booters,v 1.87 2013/08/21 08:15:19 matt Exp $ +# $NetBSD: Makefile.booters,v 1.88 2013/08/21 15:24:27 matt Exp $ .include @@ -113,4 +113,5 @@ ${BASE}.bin: ${STARTFILE} ${OBJS} ${LIBS ${OBJCOPY} -O binary ${BASE}.sym ${BASE}.bin .include +KLINK_MACHINE= i386 .include
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: joerg Date: Wed Apr 4 10:54:45 UTC 2012 Modified Files: src/sys/arch/i386/stand: Makefile.inc Log Message: -enable-iv-rewrite is neither supported nor needed with LLVM now. The one case where it was a big win was partially an inliner bug and the changes to the inline cost estimate are much smaller over all. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 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.9 src/sys/arch/i386/stand/Makefile.inc:1.10 --- src/sys/arch/i386/stand/Makefile.inc:1.9 Sun Dec 11 14:59:24 2011 +++ src/sys/arch/i386/stand/Makefile.inc Wed Apr 4 10:54:44 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.9 2011/12/11 14:59:24 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.10 2012/04/04 10:54:44 joerg Exp $ .include @@ -7,6 +7,5 @@ BINDIR= /usr/mdec OPT_SIZE.gcc= -Os -ffreestanding -fomit-frame-pointer OPT_SIZE.clang= -Oz -ffreestanding -fomit-frame-pointer -DNDEBUG \ -fno-stack-protector -mno-sse \ - -mllvm -enable-iv-rewrite=true \ -mstack-alignment=4 \ -mllvm -inline-threshold=3 -mllvm -enable-load-pre=false
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: joerg Date: Fri Aug 10 12:18:15 UTC 2012 Modified Files: src/sys/arch/i386/stand: Makefile.booters src/sys/arch/i386/stand/boot: Makefile.boot src/sys/arch/i386/stand/bootxx: Makefile.bootxx src/sys/arch/i386/stand/lib: Makefile src/sys/arch/i386/stand/netboot/ne2000_isa: Makefile Log Message: Don't depend on HAVE_GCC being always present. To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.86 src/sys/arch/i386/stand/Makefile.booters cvs rdiff -u -r1.57 -r1.58 src/sys/arch/i386/stand/boot/Makefile.boot cvs rdiff -u -r1.42 -r1.43 src/sys/arch/i386/stand/bootxx/Makefile.bootxx cvs rdiff -u -r1.35 -r1.36 src/sys/arch/i386/stand/lib/Makefile cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/netboot/ne2000_isa/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.85 src/sys/arch/i386/stand/Makefile.booters:1.86 --- src/sys/arch/i386/stand/Makefile.booters:1.85 Mon Jun 20 06:52:37 2011 +++ src/sys/arch/i386/stand/Makefile.booters Fri Aug 10 12:18:14 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.booters,v 1.85 2011/06/20 06:52:37 mrg Exp $ +# $NetBSD: Makefile.booters,v 1.86 2012/08/10 12:18:14 joerg Exp $ .include @@ -12,13 +12,11 @@ LIBC= # nothing # Make sure we override any optimization options specified by the # user. -.if defined(HAVE_GCC) .if ${MACHINE_ARCH} == "x86_64" CPUFLAGS= -m32 .else CPUFLAGS= -march=i386 -mtune=i386 .endif -.endif COPTS= ${OPT_SIZE.${ACTIVE_CC}} I386_STAND_DIR?= $S/arch/i386/stand Index: src/sys/arch/i386/stand/boot/Makefile.boot diff -u src/sys/arch/i386/stand/boot/Makefile.boot:1.57 src/sys/arch/i386/stand/boot/Makefile.boot:1.58 --- src/sys/arch/i386/stand/boot/Makefile.boot:1.57 Mon Jan 16 18:46:20 2012 +++ src/sys/arch/i386/stand/boot/Makefile.boot Fri Aug 10 12:18:15 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.boot,v 1.57 2012/01/16 18:46:20 christos Exp $ +# $NetBSD: Makefile.boot,v 1.58 2012/08/10 12:18:15 joerg Exp $ S= ${.CURDIR}/../../../../.. @@ -39,7 +39,6 @@ CPPFLAGS+= -I ${.OBJDIR} # Make sure we override any optimization options specified by the user COPTS= -Os -.if defined(HAVE_GCC) .if ${MACHINE_ARCH} == "x86_64" LDFLAGS+= -Wl,-m,elf_i386 AFLAGS+= -m32 @@ -49,7 +48,6 @@ KERNMISCMAKEFLAGS="LIBKERN_ARCH=i386" .else CPUFLAGS= -march=i386 -mtune=i386 .endif -.endif CFLAGS+= -mno-sse -mno-sse2 -mno-sse3 @@ -87,9 +85,7 @@ SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG SAMISCMAKEFLAGS+= SA_USE_CREAD=yes # Read compressed kernels SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no # Netboot via TFTP, NFS -.if defined(HAVE_GCC) || defined(HAVE_PCC) CPPFLAGS+= -Wno-pointer-sign -.endif # CPPFLAGS+= -DBOOTXX_RAID1_SUPPORT Index: src/sys/arch/i386/stand/bootxx/Makefile.bootxx diff -u src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.42 src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.43 --- src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.42 Mon Jun 20 06:52:38 2011 +++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx Fri Aug 10 12:18:15 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootxx,v 1.42 2011/06/20 06:52:38 mrg Exp $ +# $NetBSD: Makefile.bootxx,v 1.43 2012/08/10 12:18:15 joerg Exp $ S= ${.CURDIR}/../../../../.. @@ -59,7 +59,6 @@ DBG= CPPFLAGS+= -DNO_LBA_CHECK -.if defined(HAVE_GCC) .if ${MACHINE_ARCH} == "x86_64" LDFLAGS+= -Wl,-m,elf_i386 AFLAGS+= -m32 @@ -70,7 +69,6 @@ KERNMISCMAKEFLAGS="LIBKERN_ARCH=i386" CPPFLAGS+= -DEPIA_HACK CPUFLAGS= -march=i386 -mtune=i386 .endif -.endif CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes CPPFLAGS+= -nostdinc -D_STANDALONE Index: src/sys/arch/i386/stand/lib/Makefile diff -u src/sys/arch/i386/stand/lib/Makefile:1.35 src/sys/arch/i386/stand/lib/Makefile:1.36 --- src/sys/arch/i386/stand/lib/Makefile:1.35 Wed Jun 22 02:49:44 2011 +++ src/sys/arch/i386/stand/lib/Makefile Fri Aug 10 12:18:15 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.35 2011/06/22 02:49:44 mrg Exp $ +# $NetBSD: Makefile,v 1.36 2012/08/10 12:18:15 joerg Exp $ S?= ${.CURDIR}/../../../.. @@ -75,6 +75,6 @@ lib${LIB}.o:: ${OBJS} @${LD} -r -o lib${LIB}.o `lorder ${OBJS} | tsort` # XXX -.if ${HAVE_GCC} == 45 +.if ${HAVE_GCC:U} == 45 COPTS.biosdisk.c+= -fno-strict-aliasing .endif Index: src/sys/arch/i386/stand/netboot/ne2000_isa/Makefile diff -u src/sys/arch/i386/stand/netboot/ne2000_isa/Makefile:1.3 src/sys/arch/i386/stand/netboot/ne2000_isa/Makefile:1.4 --- src/sys/arch/i386/stand/netboot/ne2000_isa/Makefile:1.3 Mon Jun 20 08:46:28 2011 +++ src/sys/arch/i386/stand/netboot/ne2000_isa/Makefile Fri Aug 10 12:18:15 2012 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2011/06/20 08:46:28 mrg Exp $ +# $NetBSD: Makefile,v 1.4 2012/08/10 12:18:15 joerg Exp $ USE_NETIF= ne2000_isa @@ -6,7 +6,5 @@ CPPFLAGS+= -DBASEREG=0x300 .include ".
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: tsutsui Date: Mon Mar 30 09:22:53 UTC 2009 Modified Files: src/sys/arch/i386/stand: Makefile.booters src/sys/arch/i386/stand/boot: Makefile.boot src/sys/arch/i386/stand/bootxx: Makefile.bootxx src/sys/arch/i386/stand/dosboot: Makefile src/sys/arch/i386/stand/fatboot: Makefile.fat src/sys/arch/i386/stand/lib: Makefile src/sys/arch/i386/stand/mbr: Makefile.mbr src/sys/arch/i386/stand/netboot: Makefile.netboot src/sys/arch/i386/stand/pxeboot: Makefile Log Message: Remove extra trailing slash in ${S} path. To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/sys/arch/i386/stand/Makefile.booters cvs rdiff -u -r1.39 -r1.40 src/sys/arch/i386/stand/boot/Makefile.boot cvs rdiff -u -r1.34 -r1.35 src/sys/arch/i386/stand/bootxx/Makefile.bootxx cvs rdiff -u -r1.24 -r1.25 src/sys/arch/i386/stand/dosboot/Makefile cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/fatboot/Makefile.fat cvs rdiff -u -r1.27 -r1.28 src/sys/arch/i386/stand/lib/Makefile cvs rdiff -u -r1.15 -r1.16 src/sys/arch/i386/stand/mbr/Makefile.mbr cvs rdiff -u -r1.7 -r1.8 src/sys/arch/i386/stand/netboot/Makefile.netboot cvs rdiff -u -r1.16 -r1.17 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.77 src/sys/arch/i386/stand/Makefile.booters:1.78 --- src/sys/arch/i386/stand/Makefile.booters:1.77 Thu Jan 8 19:02:12 2009 +++ src/sys/arch/i386/stand/Makefile.booters Mon Mar 30 09:22:52 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.booters,v 1.77 2009/01/08 19:02:12 jakllsch Exp $ +# $NetBSD: Makefile.booters,v 1.78 2009/03/30 09:22:52 tsutsui Exp $ .include @@ -104,8 +104,8 @@ LIBLIST=${LIBI386} ${LIBSA} ${LIBZ} ${LIBSA} ${LIBKERN} ${LIBI386} ${LIBSA} -vers.c: ${VERSIONFILE} ${SOURCES} ${S}conf/newvers_stand.sh - ${HOST_SH} ${S}conf/newvers_stand.sh -DM ${VERSIONFILE} x86 ${NEWVERSWHAT} +vers.c: ${VERSIONFILE} ${SOURCES} ${S}/conf/newvers_stand.sh + ${HOST_SH} ${S}/conf/newvers_stand.sh -DM ${VERSIONFILE} x86 ${NEWVERSWHAT} CLEANFILES+= ${BASE}.sym ${BASE}.sym: ${STARTFILE} ${OBJS} ${LIBSA} ${LIBZ} ${LIBKERN} ${LIBI386} Index: src/sys/arch/i386/stand/boot/Makefile.boot diff -u src/sys/arch/i386/stand/boot/Makefile.boot:1.39 src/sys/arch/i386/stand/boot/Makefile.boot:1.40 --- src/sys/arch/i386/stand/boot/Makefile.boot:1.39 Thu Mar 12 17:16:59 2009 +++ src/sys/arch/i386/stand/boot/Makefile.boot Mon Mar 30 09:22:52 2009 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile.boot,v 1.39 2009/03/12 17:16:59 abs Exp $ +# $NetBSD: Makefile.boot,v 1.40 2009/03/30 09:22:52 tsutsui Exp $ -S= ${.CURDIR}/../../../../../ +S= ${.CURDIR}/../../../../.. NOMAN= PROG?= boot @@ -138,7 +138,7 @@ CLEANFILES+= ${PROG}.tmp ${PROG}.map vers.c vers.c: ${VERSIONFILE} ${SOURCES} ${LIBLIST} ${.CURDIR}/../Makefile.boot - ${HOST_SH} ${S}conf/newvers_stand.sh -DM ${VERSIONFILE} x86 ${NEWVERSWHAT} + ${HOST_SH} ${S}/conf/newvers_stand.sh -DM ${VERSIONFILE} x86 ${NEWVERSWHAT} # Anything that calls 'real_to_prot' must have a %pc < 0x1. # We link the program, find the callers (all in libi386), then Index: src/sys/arch/i386/stand/bootxx/Makefile.bootxx diff -u src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.34 src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.35 --- src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.34 Thu Mar 12 17:16:59 2009 +++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx Mon Mar 30 09:22:52 2009 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile.bootxx,v 1.34 2009/03/12 17:16:59 abs Exp $ +# $NetBSD: Makefile.bootxx,v 1.35 2009/03/30 09:22:52 tsutsui Exp $ -S= ${.CURDIR}/../../../../../ +S= ${.CURDIR}/../../../../.. PIE_CFLAGS= PIE_LDFLAGS= Index: src/sys/arch/i386/stand/dosboot/Makefile diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.24 src/sys/arch/i386/stand/dosboot/Makefile:1.25 --- src/sys/arch/i386/stand/dosboot/Makefile:1.24 Mon Oct 20 03:02:07 2008 +++ src/sys/arch/i386/stand/dosboot/Makefile Mon Mar 30 09:22:52 2009 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.24 2008/10/20 03:02:07 christos Exp $ +# $NetBSD: Makefile,v 1.25 2009/03/30 09:22:52 tsutsui Exp $ -S= ${.CURDIR}/../../../../ +S= ${.CURDIR}/../../../.. BASE= dosboot PROG= ${BASE}.com Index: src/sys/arch/i386/stand/fatboot/Makefile.fat diff -u src/sys/arch/i386/stand/fatboot/Makefile.fat:1.4 src/sys/arch/i386/stand/fatboot/Makefile.fat:1.5 --- src/sys/arch/i386/stand/fatboot/Makefile.fat:1.4 Thu Mar 12 17:16:59 2009 +++ src/sys/arch/i386/stand/fatboot/Makefile.fat Mon Mar 30 09:22:52 2009 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile.fat,v 1.4 2009/03/12 17:16:59 abs Exp $ +# $NetBSD: Makefile.fat,v 1.5 2009/03/30 09:22:52 tsutsui Exp $ -S= ${.CURDIR}/../../../../../ +S= ${.CURDIR}/../../../../.. PROG?= fatboot NOMAN= # defined Index: src/sys/arch/
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: jmcneill Date: Sun Sep 13 22:45:27 UTC 2009 Modified Files: src/sys/arch/i386/stand/boot: boot2.c src/sys/arch/i386/stand/lib: biosdisk.c libi386.h Log Message: Make the 'dev' command print out a list of known boot devices based on information from the BIOS in addition to the currently selected default partition. Handy when you don't know where to boot from. Here's a demo: type "?" or "help" for help. > dev disk hd0 size 3815 MB hd0a(4.2BSD) hd0b(swap) disk cd0 cd0a(unknown) default hd0a > To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/i386/stand/boot/boot2.c cvs rdiff -u -r1.28 -r1.29 src/sys/arch/i386/stand/lib/biosdisk.c cvs rdiff -u -r1.31 -r1.32 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/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.44 src/sys/arch/i386/stand/boot/boot2.c:1.45 --- src/sys/arch/i386/stand/boot/boot2.c:1.44 Sat Mar 21 15:01:56 2009 +++ src/sys/arch/i386/stand/boot/boot2.c Sun Sep 13 22:45:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.44 2009/03/21 15:01:56 ad Exp $ */ +/* $NetBSD: boot2.c,v 1.45 2009/09/13 22:45:27 jmcneill Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -420,7 +420,8 @@ const char *file; /* dummy */ if (*arg == '\0') { - printf("%s%d%c:\n", default_devname, default_unit, + biosdisk_probe(); + printf("default %s%d%c\n", default_devname, default_unit, 'a' + default_partition); return; } Index: src/sys/arch/i386/stand/lib/biosdisk.c diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.28 src/sys/arch/i386/stand/lib/biosdisk.c:1.29 --- src/sys/arch/i386/stand/lib/biosdisk.c:1.28 Sat Jan 5 15:28:43 2008 +++ src/sys/arch/i386/stand/lib/biosdisk.c Sun Sep 13 22:45:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: biosdisk.c,v 1.28 2008/01/05 15:28:43 dsl Exp $ */ +/* $NetBSD: biosdisk.c,v 1.29 2009/09/13 22:45:27 jmcneill Exp $ */ /* * Copyright (c) 1996, 1998 @@ -63,16 +63,21 @@ * the rights to redistribute these changes. */ +#ifndef NO_DISKLABEL +#define FSTYPENAMES +#endif + #include -#include #include #include +#include #include #include #include #include +#include #include "libi386.h" #include "biosdisk_ll.h" @@ -292,6 +297,79 @@ } #endif /* NO_DISKLABEL */ +void +biosdisk_probe(void) +{ +#ifndef NO_DISKLABEL + struct disklabel *lp; + int first, part; +#endif + struct biosdisk d; + struct biosdisk_extinfo ed; + uint64_t size; + int i; + + for (i = 0; i < MAX_BIOSDISKS + 2; i++) { + first = 1; + memset(&d, 0, sizeof(d)); + memset(&ed, 0, sizeof(ed)); + if (i >= MAX_BIOSDISKS) + d.ll.dev = 0x00 + i - MAX_BIOSDISKS; /* fd */ + else + d.ll.dev = 0x80 + i; /* hd/cd */ + if (set_geometry(&d.ll, &ed)) + continue; + switch (d.ll.type) { + case BIOSDISK_TYPE_CD: + printf("disk cd0\n"); + printf(" cd0a(unknown)\n"); + break; + case BIOSDISK_TYPE_FD: + printf("disk fd%d\n", d.ll.dev & 0x7f); + printf(" fd%da(unknown)\n", d.ll.dev & 0x7f); + break; + case BIOSDISK_TYPE_HD: + printf("disk hd%d", d.ll.dev & 0x7f); + if (d.ll.flags & BIOSDISK_INT13EXT) { +printf(" size "); +size = ed.totsec * ed.sbytes; +if (size >= (10ULL * 1024 * 1024 * 1024)) + printf("%llu GB", + size / (1024 * 1024 * 1024)); +else + printf("%llu MB", + size / (1024 * 1024)); + } + printf("\n"); + break; + } +#ifndef NO_DISKLABEL + if (read_label(&d) == -1) + break; + lp = (struct disklabel *)(d.buf + LABELOFFSET); + for (part = 0; part < lp->d_npartitions; part++) { + if (lp->d_partitions[part].p_size == 0) +continue; + if (lp->d_partitions[part].p_fstype == FS_UNUSED) +continue; + if (first) { +printf(" "); +first = 0; + } + printf(" hd%d%c(", d.ll.dev & 0x7f, part + 'a'); + if (lp->d_partitions[part].p_fstype < FSMAXTYPES) +printf("%s", + fstypenames[lp->d_partitions[part].p_fstype]); + else +printf("%d", lp->d_partitions[part].p_fstype); + printf(")"); + } + if (first == 0) + printf("\n"); +#endif + } +} + /* Determine likely partition for possible sector number of dos * partition. */ Index: src/sys/arch/i386/stand/lib/libi386.h diff -u src/sys/arch/i386/stand/lib/libi386.h:1.31 src/sys/arch/i386/stand/lib/libi386.h:1.32 --- src/sys/arch/i386/stand/lib/libi386.h:1.31 Sat Mar 21 15:01:56 2009 +++ src/sys/arch/i386/stand/lib/libi386.h Sun Sep 13 22:45:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: libi386.h,v 1.31 2009/03/21 15:01:56 ad Exp $ */ +/* $NetBSD: libi386.h,v 1.32 2009/09/13 22:45:27 jmcneill Exp $ */ /* * Copyright (c) 1996 @@ -122,6 +122,7 @@ struct biosdisk_extinfo; void biosdisk_getextinfo(int, struct biosdisk_extinfo *); int get_harddrives(void); +void biosdisk_probe(void); int pcibios_cfgread(unsigned i
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: jmcneill Date: Mon Sep 14 11:56:28 UTC 2009 Modified Files: src/sys/arch/i386/stand/lib: exec.c vbe.c vbe.h src/sys/arch/i386/stand/pxeboot: main.c Log Message: Don't commit the selected VBE mode until the loader is past the point of no return; need to stick in text mode as long as possible since libsa does not include a rasops library. While here, add the 'vesa' command to pxeboot to mirror biosboot behaviour. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/arch/i386/stand/lib/exec.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/lib/vbe.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/lib/vbe.h cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/stand/pxeboot/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/lib/exec.c diff -u src/sys/arch/i386/stand/lib/exec.c:1.41 src/sys/arch/i386/stand/lib/exec.c:1.42 --- src/sys/arch/i386/stand/lib/exec.c:1.41 Sun Sep 13 18:13:37 2009 +++ src/sys/arch/i386/stand/lib/exec.c Mon Sep 14 11:56:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.41 2009/09/13 18:13:37 jmcneill Exp $ */ +/* $NetBSD: exec.c,v 1.42 2009/09/14 11:56:27 jmcneill Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -114,6 +114,7 @@ #include "libi386.h" #include "bootinfo.h" #include "bootmod.h" +#include "vbe.h" #ifdef SUPPORT_PS2 #include "biosmca.h" #endif @@ -289,8 +290,6 @@ BI_ALLOC(32); /* ??? */ BI_ADD(&btinfo_console, BTINFO_CONSOLE, sizeof(struct btinfo_console)); - BI_ADD(&btinfo_framebuffer, BTINFO_FRAMEBUFFER, - sizeof(struct btinfo_framebuffer)); howto = boothowto; @@ -323,6 +322,11 @@ btinfo_symtab.esym = marks[MARK_END]; BI_ADD(&btinfo_symtab, BTINFO_SYMTAB, sizeof(struct btinfo_symtab)); + /* set new video mode if necessary */ + vbe_commit(); + BI_ADD(&btinfo_framebuffer, BTINFO_FRAMEBUFFER, + sizeof(struct btinfo_framebuffer)); + if (callback != NULL) (*callback)(); startprog(marks[MARK_ENTRY], BOOT_NARGS, boot_argv, Index: src/sys/arch/i386/stand/lib/vbe.c diff -u src/sys/arch/i386/stand/lib/vbe.c:1.3 src/sys/arch/i386/stand/lib/vbe.c:1.4 --- src/sys/arch/i386/stand/lib/vbe.c:1.3 Mon Aug 24 02:15:46 2009 +++ src/sys/arch/i386/stand/lib/vbe.c Mon Sep 14 11:56:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: vbe.c,v 1.3 2009/08/24 02:15:46 jmcneill Exp $ */ +/* $NetBSD: vbe.c,v 1.4 2009/09/14 11:56:27 jmcneill Exp $ */ /*- * Copyright (c) 2009 Jared D. McNeill @@ -42,6 +42,7 @@ static struct _vbestate { int available; + int modenum; } vbestate; static void @@ -91,6 +92,7 @@ vbe_dump(&vbe); vbestate.available = 1; + vbestate.modenum = 0; } int @@ -173,6 +175,22 @@ return 0; } +int +vbe_commit(void) +{ + int ret = 1; + + if (vbestate.modenum > 0) { + ret = vbe_set_mode(vbestate.modenum); + if (ret) { + printf("WARNING: failed to set VESA VBE mode 0x%x\n", + vbestate.modenum); + delay(500); + } + } + return ret; +} + static void * vbe_farptr(uint32_t farptr) { @@ -330,8 +348,7 @@ } if (strcmp(arg, "disabled") == 0 || strcmp(arg, "off") == 0) { - framebuffer_configure(NULL); - biosvideomode(); + vbestate.modenum = 0; return; } @@ -341,13 +358,15 @@ modenum = strtoul(arg, NULL, 0); else if (strchr(arg, 'x') != NULL) { modenum = vbe_find_mode(arg); - if (modenum == 0) + if (modenum == 0) { + printf("mode %s not supported by firmware\n", arg); return; + } } else modenum = 0; if (modenum >= 0x100) { - vbe_set_mode(modenum); + vbestate.modenum = modenum; return; } Index: src/sys/arch/i386/stand/lib/vbe.h diff -u src/sys/arch/i386/stand/lib/vbe.h:1.1 src/sys/arch/i386/stand/lib/vbe.h:1.2 --- src/sys/arch/i386/stand/lib/vbe.h:1.1 Mon Feb 16 22:39:31 2009 +++ src/sys/arch/i386/stand/lib/vbe.h Mon Sep 14 11:56:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: vbe.h,v 1.1 2009/02/16 22:39:31 jmcneill Exp $ */ +/* $NetBSD: vbe.h,v 1.2 2009/09/14 11:56:27 jmcneill Exp $ */ /*- * Copyright (c) 2009 Jared D. McNeill @@ -94,6 +94,7 @@ /* high-level VBE helpers, from vbe.c */ void vbe_init(void); +int vbe_commit(void); int vbe_available(void); int vbe_set_mode(int); int vbe_set_palette(const uint8_t *, int); Index: src/sys/arch/i386/stand/pxeboot/main.c diff -u src/sys/arch/i386/stand/pxeboot/main.c:1.20 src/sys/arch/i386/stand/pxeboot/main.c:1.21 --- src/sys/arch/i386/stand/pxeboot/main.c:1.20 Sat Mar 21 15:01:56 2009 +++ src/sys/arch/i386/stand/pxeboot/main.c Mon Sep 14 11:56:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.20 2009/03/21 15:01:56 ad Exp $ */ +/* $NetBSD: main.c,v 1.21 2009/09/14 11:56:27 jmcneill Exp $ */ /* * Copyright (c) 1996 @@ -48,6 +48,7 @@ #include #include #include "pxeboot.h" +#include "vbe.h" extern struct x86_boot_params boot_params; @@ -72,6 +73,7 @@ { "consdev", command_consdev }, { "modules",co
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: joerg Date: Fri May 20 22:29:56 UTC 2011 Modified Files: src/sys/arch/i386/stand/boot: Makefile.boot src/sys/arch/i386/stand/bootxx: Makefile.bootxx src/sys/arch/i386/stand/cdboot: Makefile src/sys/arch/i386/stand/dosboot: Makefile src/sys/arch/i386/stand/fatboot: Makefile.fat src/sys/arch/i386/stand/lib: Makefile src/sys/arch/i386/stand/netboot: Makefile.netboot src/sys/arch/i386/stand/pxeboot: Makefile Log Message: Disable integrated assembler for files that use .code16 or .code32 for now. Disable Clang completely for bootxx and netboot for now until the size issue has been sorted out. To generate a diff of this commit: cvs rdiff -u -r1.50 -r1.51 src/sys/arch/i386/stand/boot/Makefile.boot cvs rdiff -u -r1.39 -r1.40 src/sys/arch/i386/stand/bootxx/Makefile.bootxx cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/cdboot/Makefile cvs rdiff -u -r1.25 -r1.26 src/sys/arch/i386/stand/dosboot/Makefile cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/fatboot/Makefile.fat cvs rdiff -u -r1.31 -r1.32 src/sys/arch/i386/stand/lib/Makefile cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/stand/netboot/Makefile.netboot cvs rdiff -u -r1.20 -r1.21 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/boot/Makefile.boot diff -u src/sys/arch/i386/stand/boot/Makefile.boot:1.50 src/sys/arch/i386/stand/boot/Makefile.boot:1.51 --- src/sys/arch/i386/stand/boot/Makefile.boot:1.50 Sat Feb 26 18:22:58 2011 +++ src/sys/arch/i386/stand/boot/Makefile.boot Fri May 20 22:29:55 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.boot,v 1.50 2011/02/26 18:22:58 jakllsch Exp $ +# $NetBSD: Makefile.boot,v 1.51 2011/05/20 22:29:55 joerg Exp $ S= ${.CURDIR}/../../../../.. @@ -7,6 +7,8 @@ NEWVERSWHAT?= "BIOS Boot" VERSIONFILE?= ${.CURDIR}/../version +AFLAGS.biosboot.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} + SOURCES?= biosboot.S boot2.c conf.c devopen.c exec.c SRCS= ${SOURCES} .if !make(depend) Index: src/sys/arch/i386/stand/bootxx/Makefile.bootxx diff -u src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.39 src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.40 --- src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.39 Thu May 27 06:58:14 2010 +++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx Fri May 20 22:29:55 2011 @@ -1,7 +1,13 @@ -# $NetBSD: Makefile.bootxx,v 1.39 2010/05/27 06:58:14 dholland Exp $ +# $NetBSD: Makefile.bootxx,v 1.40 2011/05/20 22:29:55 joerg Exp $ S= ${.CURDIR}/../../../../.. +UNSUPPORTED_COMPILER.clang= # defined + +AFLAGS.bootxx.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} +AFLAGS.label.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} +AFLAGS.pbr.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} + PIE_CFLAGS= PIE_LDFLAGS= PIE_AFLAGS= Index: src/sys/arch/i386/stand/cdboot/Makefile diff -u src/sys/arch/i386/stand/cdboot/Makefile:1.11 src/sys/arch/i386/stand/cdboot/Makefile:1.12 --- src/sys/arch/i386/stand/cdboot/Makefile:1.11 Sun Jan 2 02:31:32 2011 +++ src/sys/arch/i386/stand/cdboot/Makefile Fri May 20 22:29:55 2011 @@ -1,7 +1,9 @@ -# $NetBSD: Makefile,v 1.11 2011/01/02 02:31:32 jakllsch Exp $ +# $NetBSD: Makefile,v 1.12 2011/05/20 22:29:55 joerg Exp $ S= ${.CURDIR}/../../../.. +AFLAGS.cdboot.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} + NOMAN= # defined .include Index: src/sys/arch/i386/stand/dosboot/Makefile diff -u src/sys/arch/i386/stand/dosboot/Makefile:1.25 src/sys/arch/i386/stand/dosboot/Makefile:1.26 --- src/sys/arch/i386/stand/dosboot/Makefile:1.25 Mon Mar 30 09:22:52 2009 +++ src/sys/arch/i386/stand/dosboot/Makefile Fri May 20 22:29:55 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.25 2009/03/30 09:22:52 tsutsui Exp $ +# $NetBSD: Makefile,v 1.26 2011/05/20 22:29:55 joerg Exp $ S= ${.CURDIR}/../../../.. @@ -9,6 +9,9 @@ STARTFILE= ${DOSSTART} RELOC= 0x100 +AFLAGS.dosboot.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} +AFLAGS.start_dos.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} + SRCS= main.c devopen.c exec.c CPPFLAGS+= -DSLOW # for libz Index: src/sys/arch/i386/stand/fatboot/Makefile.fat diff -u src/sys/arch/i386/stand/fatboot/Makefile.fat:1.5 src/sys/arch/i386/stand/fatboot/Makefile.fat:1.6 --- src/sys/arch/i386/stand/fatboot/Makefile.fat:1.5 Mon Mar 30 09:22:52 2009 +++ src/sys/arch/i386/stand/fatboot/Makefile.fat Fri May 20 22:29:56 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.fat,v 1.5 2009/03/30 09:22:52 tsutsui Exp $ +# $NetBSD: Makefile.fat,v 1.6 2011/05/20 22:29:56 joerg Exp $ S= ${.CURDIR}/../../../../.. @@ -10,6 +10,8 @@ LIBCRTEND= # nothing LIBC= # nothing +AFLAGS.fatboot.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} + PIE_CFLAGS= PIE_LDFLAGS= PIE_AFLAGS= Index: src/sys/arch/i386/stand/lib/Makefile diff -u src/sys/arch/i386/stand/lib/Makefile:1.31 src/sys/arch/i386/stand/l
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: joerg Date: Thu Jun 16 16:39:53 UTC 2011 Modified Files: src/sys/arch/i386/stand: Makefile.booters Makefile.inc src/sys/arch/i386/stand/bootxx: Makefile.bootxx Log Message: Refactor compiler-specific optimizer flags. Mark bootxx as supported with clang. To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/arch/i386/stand/Makefile.booters cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/Makefile.inc cvs rdiff -u -r1.40 -r1.41 src/sys/arch/i386/stand/bootxx/Makefile.bootxx 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.83 src/sys/arch/i386/stand/Makefile.booters:1.84 --- src/sys/arch/i386/stand/Makefile.booters:1.83 Sat Apr 9 00:26:52 2011 +++ src/sys/arch/i386/stand/Makefile.booters Thu Jun 16 16:39:53 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.booters,v 1.83 2011/04/09 00:26:52 joerg Exp $ +# $NetBSD: Makefile.booters,v 1.84 2011/06/16 16:39:53 joerg Exp $ .include @@ -23,7 +23,7 @@ .endif .endif .endif -COPTS= -Os -ffreestanding +COPTS= ${OPT_SIZE.${ACTIVE_CC}} I386_STAND_DIR?= $S/arch/i386/stand Index: src/sys/arch/i386/stand/Makefile.inc diff -u src/sys/arch/i386/stand/Makefile.inc:1.6 src/sys/arch/i386/stand/Makefile.inc:1.7 --- src/sys/arch/i386/stand/Makefile.inc:1.6 Fri Aug 29 00:02:23 2008 +++ src/sys/arch/i386/stand/Makefile.inc Thu Jun 16 16:39:53 2011 @@ -1,5 +1,11 @@ -# $NetBSD: Makefile.inc,v 1.6 2008/08/29 00:02:23 gmcgarry Exp $ +# $NetBSD: Makefile.inc,v 1.7 2011/06/16 16:39:53 joerg Exp $ .include BINDIR= /usr/mdec + +OPT_SIZE.gcc= -Os -ffreestanding -fomit-frame-pointer +OPT_SIZE.clang= -Oz -ffreestanding -fomit-frame-pointer \ + -fno-stack-protector -mno-sse \ + -mllvm -stack-alignment=4 -mllvm -realign-stack=false \ + -mllvm -inline-threshold=3 -mllvm -enable-load-pre=false Index: src/sys/arch/i386/stand/bootxx/Makefile.bootxx diff -u src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.40 src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.41 --- src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.40 Fri May 20 22:29:55 2011 +++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx Thu Jun 16 16:39:53 2011 @@ -1,9 +1,7 @@ -# $NetBSD: Makefile.bootxx,v 1.40 2011/05/20 22:29:55 joerg Exp $ +# $NetBSD: Makefile.bootxx,v 1.41 2011/06/16 16:39:53 joerg Exp $ S= ${.CURDIR}/../../../../.. -UNSUPPORTED_COMPILER.clang= # defined - AFLAGS.bootxx.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} AFLAGS.label.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} AFLAGS.pbr.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} @@ -55,7 +53,8 @@ # CPPFLAGS+= -DBOOT_MSG_COM0 # Make sure we override any optimization options specified by the user -COPTS= -Os -momit-leaf-frame-pointer +.include "${.PARSEDIR}/../Makefile.inc" +COPTS= ${OPT_SIZE.${ACTIVE_CC}} DBG= CPPFLAGS+= -DNO_LBA_CHECK @@ -77,7 +76,6 @@ .endif .endif -COPTS+=-ffreestanding CFLAGS+= -Wall -Wmissing-prototypes -Wstrict-prototypes CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -I$S
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: joerg Date: Sat Apr 9 00:26:52 UTC 2011 Modified Files: src/sys/arch/i386/stand: Makefile.booters Log Message: Do not ignore errors from genprom. To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 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.82 src/sys/arch/i386/stand/Makefile.booters:1.83 --- src/sys/arch/i386/stand/Makefile.booters:1.82 Sat Jan 22 19:19:18 2011 +++ src/sys/arch/i386/stand/Makefile.booters Sat Apr 9 00:26:52 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.booters,v 1.82 2011/01/22 19:19:18 joerg Exp $ +# $NetBSD: Makefile.booters,v 1.83 2011/04/09 00:26:52 joerg Exp $ .include @@ -113,7 +113,7 @@ ${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 + ( rm -f ${BASE}.rom && false ) rm -f ${BASE}.rom.tmp CLEANFILES+= ${BASE}.com
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: joerg Date: Sun Dec 11 14:59:24 UTC 2011 Modified Files: src/sys/arch/i386/stand: Makefile.inc Log Message: Use new -mstack-alignment option to replace the removed internal option. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 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.8 src/sys/arch/i386/stand/Makefile.inc:1.9 --- src/sys/arch/i386/stand/Makefile.inc:1.8 Tue Oct 11 13:54:00 2011 +++ src/sys/arch/i386/stand/Makefile.inc Sun Dec 11 14:59:24 2011 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.8 2011/10/11 13:54:00 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.9 2011/12/11 14:59:24 joerg Exp $ .include @@ -8,5 +8,5 @@ OPT_SIZE.gcc= -Os -ffreestanding -fomit- OPT_SIZE.clang= -Oz -ffreestanding -fomit-frame-pointer -DNDEBUG \ -fno-stack-protector -mno-sse \ -mllvm -enable-iv-rewrite=true \ - -mllvm -stack-alignment=4 -mllvm -realign-stack=false \ + -mstack-alignment=4 \ -mllvm -inline-threshold=3 -mllvm -enable-load-pre=false
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: jmcneill Date: Sun Feb 6 23:16:05 UTC 2011 Modified Files: src/sys/arch/i386/stand/boot: boot2.c version src/sys/arch/i386/stand/lib: bootmod.h exec.c libi386.h Log Message: add support for passing image files to the kernel with the 'splash' keyword: vesa on;splash /netbsd.jpg;boot -z To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/arch/i386/stand/boot/boot2.c cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/stand/boot/version cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/lib/bootmod.h cvs rdiff -u -r1.45 -r1.46 src/sys/arch/i386/stand/lib/exec.c cvs rdiff -u -r1.33 -r1.34 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/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.51 src/sys/arch/i386/stand/boot/boot2.c:1.52 --- src/sys/arch/i386/stand/boot/boot2.c:1.51 Wed Jan 5 23:13:01 2011 +++ src/sys/arch/i386/stand/boot/boot2.c Sun Feb 6 23:16:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.51 2011/01/05 23:13:01 jakllsch Exp $ */ +/* $NetBSD: boot2.c,v 1.52 2011/02/06 23:16:05 jmcneill Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -135,6 +135,7 @@ { "load", module_add }, { "multiboot", command_multiboot }, { "vesa", command_vesa }, + { "splash", splash_add }, { NULL, NULL }, }; Index: src/sys/arch/i386/stand/boot/version diff -u src/sys/arch/i386/stand/boot/version:1.13 src/sys/arch/i386/stand/boot/version:1.14 --- src/sys/arch/i386/stand/boot/version:1.13 Wed Jan 5 23:13:01 2011 +++ src/sys/arch/i386/stand/boot/version Sun Feb 6 23:16:05 2011 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.13 2011/01/05 23:13:01 jakllsch Exp $ +$NetBSD: version,v 1.14 2011/02/06 23:16:05 jmcneill Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -45,3 +45,4 @@ 5.5: Adjust stack and heap areas to not overlap. 5.6: GUID Partition Table support. 5.7: Recognize 64-bit LBA from bootxx. +5.8: Support for splash images. Index: src/sys/arch/i386/stand/lib/bootmod.h diff -u src/sys/arch/i386/stand/lib/bootmod.h:1.3 src/sys/arch/i386/stand/lib/bootmod.h:1.4 --- src/sys/arch/i386/stand/lib/bootmod.h:1.3 Mon May 5 00:12:49 2008 +++ src/sys/arch/i386/stand/lib/bootmod.h Sun Feb 6 23:16:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: bootmod.h,v 1.3 2008/05/05 00:12:49 jmcneill Exp $ */ +/* $NetBSD: bootmod.h,v 1.4 2011/02/06 23:16:05 jmcneill Exp $ */ /*- * Copyright (c) 2008 Jared D. McNeill @@ -32,6 +32,9 @@ typedef struct boot_module { char *bm_path; ssize_t bm_len; + uint8_t bm_type; +#define BM_TYPE_KMOD 0x00 +#define BM_TYPE_IMAGE 0x01 struct boot_module *bm_next; } boot_module_t; Index: src/sys/arch/i386/stand/lib/exec.c diff -u src/sys/arch/i386/stand/lib/exec.c:1.45 src/sys/arch/i386/stand/lib/exec.c:1.46 --- src/sys/arch/i386/stand/lib/exec.c:1.45 Sat Oct 30 08:12:43 2010 +++ src/sys/arch/i386/stand/lib/exec.c Sun Feb 6 23:16:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.45 2010/10/30 08:12:43 jnemeth Exp $ */ +/* $NetBSD: exec.c,v 1.46 2011/02/06 23:16:05 jmcneill Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -135,6 +135,7 @@ static int howto; static void module_init(const char *); +static void module_add_common(char *, uint8_t); void framebuffer_configure(struct btinfo_framebuffer *fb) @@ -150,6 +151,18 @@ void module_add(char *name) { + return module_add_common(name, BM_TYPE_KMOD); +} + +void +splash_add(char *name) +{ + return module_add_common(name, BM_TYPE_IMAGE); +} + +static void +module_add_common(char *name, uint8_t type) +{ boot_module_t *bm, *bmp; size_t len; char *str; @@ -167,6 +180,7 @@ memcpy(str, name, len); bm->bm_path = str; bm->bm_next = NULL; + bm->bm_type = type; if (boot_modules == NULL) boot_modules = bm; else { @@ -509,7 +523,8 @@ strncpy(bi->path, bm->bm_path, sizeof(bi->path) - 1); bi->base = image_end; bi->len = len; - bi->type = BI_MODULE_ELF; + bi->type = bm->bm_type == BM_TYPE_KMOD ? + BI_MODULE_ELF : BI_MODULE_IMAGE; if ((howto & AB_SILENT) == 0) printf(" \n"); } Index: src/sys/arch/i386/stand/lib/libi386.h diff -u src/sys/arch/i386/stand/lib/libi386.h:1.33 src/sys/arch/i386/stand/lib/libi386.h:1.34 --- src/sys/arch/i386/stand/lib/libi386.h:1.33 Fri Jun 25 15:35:08 2010 +++ src/sys/arch/i386/stand/lib/libi386.h Sun Feb 6 23:16:05 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: libi386.h,v 1.33 2010/06/25 15:35:08 tsutsui Exp $ */ +/* $NetBSD: libi386.h,v 1.34 2011/02/06 23:16:05 jmcneill Exp $ */ /* * Copyright (c) 1996 @@ -137,6 +137,7 @@ extern int doserrno; /* in dos_file.S */ void module_add(char *); +void splash_add(char *); struct btinfo_framebuffer; void framebuffer_configure(struct btinfo_fr
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: jmcneill Date: Wed Feb 9 04:37:54 UTC 2011 Modified Files: src/sys/arch/i386/stand/boot: version src/sys/arch/i386/stand/lib: biosvbe.S vbe.c vbe.h Log Message: Add VESA VBE/DDC EDID support for determining the monitor's preferred video mode. "vesa on" will now select the preferred mode @ 8bpp if it can be determined and is supported by the display adapter, otherwise it will use 640x480 @ 8bpp. To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/i386/stand/boot/version cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/lib/biosvbe.S cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/lib/vbe.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/lib/vbe.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/boot/version diff -u src/sys/arch/i386/stand/boot/version:1.14 src/sys/arch/i386/stand/boot/version:1.15 --- src/sys/arch/i386/stand/boot/version:1.14 Sun Feb 6 23:16:05 2011 +++ src/sys/arch/i386/stand/boot/version Wed Feb 9 04:37:54 2011 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.14 2011/02/06 23:16:05 jmcneill Exp $ +$NetBSD: version,v 1.15 2011/02/09 04:37:54 jmcneill Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -46,3 +46,4 @@ 5.6: GUID Partition Table support. 5.7: Recognize 64-bit LBA from bootxx. 5.8: Support for splash images. +5.9: VESA VBE/DDC EDID support. Index: src/sys/arch/i386/stand/lib/biosvbe.S diff -u src/sys/arch/i386/stand/lib/biosvbe.S:1.1 src/sys/arch/i386/stand/lib/biosvbe.S:1.2 --- src/sys/arch/i386/stand/lib/biosvbe.S:1.1 Mon Feb 16 22:39:30 2009 +++ src/sys/arch/i386/stand/lib/biosvbe.S Wed Feb 9 04:37:54 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: biosvbe.S,v 1.1 2009/02/16 22:39:30 jmcneill Exp $ */ +/* $NetBSD: biosvbe.S,v 1.2 2011/02/09 04:37:54 jmcneill Exp $ */ /*- * Copyright (c) 2009 Jared D. McNeill @@ -254,3 +254,101 @@ popl %ebx popl %ebp ret + +/* + * Function 15h BL=00h - Report VBE/DDC Capabilities + * + * int biosvbe_ddc_caps(void) + * return: VBE/DDC capabilities + */ +ENTRY(biosvbe_ddc_caps) + pushl %ebp + movl %esp,%ebp + pushl %ebx + pushl %ecx + pushl %edx + push %esi + push %edi + + call _C_LABEL(prot_to_real) + .code16 + + movw $0x4f15, %ax /* display identification extensions */ + mov $0x00, %bx /* report DDC capabilities */ + + movl $0x, %esi /* ES:DI == 0:0 */ + movl $0x, %edi + mov $0x00, %cx /* controller unit number (00h = primary) */ + int $0x10 + + calll _C_LABEL(real_to_prot) + .code32 + + movl %eax,%ecx + movl $0x,%eax + andl $0x,%ecx + cmpl $0x004f,%ecx + jne 1f + andl $0x,%ebx + movl %ebx,%eax +1: + + pop %edi + pop %esi + popl %edx + popl %ecx + popl %ebx + popl %ebp + ret + +/* + * Function 15h BL=01h - Read EDID + * + * int biosvbe_ddc_read_edid(int blockno, void *buf) + * return: VBE call status + */ +ENTRY(biosvbe_ddc_read_edid) + pushl %ebp + movl %esp,%ebp + pushl %ebx + pushl %ecx + pushl %edx + push %esi + push %edi + + movl 8(%ebp), %edx /* EDID block number */ + movl 12(%ebp), %edi /* EDID block address */ + + call _C_LABEL(prot_to_real) + .code16 + + push %es + + push %di + shrl $4, %edi + mov %ds, %ax + add %di, %ax + mov %ax, %es + pop %di + and $0xf, %di /* EDID block address now in es:di */ + + movw $0x4f15, %ax /* display identification extensions */ + mov $0x01, %bx /* read EDID */ + mov $0x00, %cx /* controller unit number (00h = primary) */ + int $0x10 + + pop %es + + calll _C_LABEL(real_to_prot) + .code32 + + andl $0x,%eax + + pop %edi + pop %esi + popl %edx + popl %ecx + popl %ebx + popl %ebp + ret + Index: src/sys/arch/i386/stand/lib/vbe.c diff -u src/sys/arch/i386/stand/lib/vbe.c:1.6 src/sys/arch/i386/stand/lib/vbe.c:1.7 --- src/sys/arch/i386/stand/lib/vbe.c:1.6 Fri Jun 25 15:35:08 2010 +++ src/sys/arch/i386/stand/lib/vbe.c Wed Feb 9 04:37:54 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: vbe.c,v 1.6 2010/06/25 15:35:08 tsutsui Exp $ */ +/* $NetBSD: vbe.c,v 1.7 2011/02/09 04:37:54 jmcneill Exp $ */ /*- * Copyright (c) 2009 Jared D. McNeill @@ -37,6 +37,8 @@ #include "vbe.h" extern const uint8_t rasops_cmap[]; +static uint8_t *vbe_edid = NULL; +static int vbe_edid_valid = 0; static struct _vbestate { int available; @@ -185,7 +187,7 @@ } static int -vbe_parse_mode_str(char *str, int *x, int *y, int *bpp) +vbe_parse_mode_str(char *str, int *x, int *y, int *depth) { char *p; @@ -202,11 +204,11 @@ return 0; p = strchr(p, 'x'); if (!p) - *bpp = 8; + *depth = 8; else { ++p; - *bpp = strtoul(p, NULL, 0); - if (*bpp == 0) + *depth = strtoul(p, NULL, 0); + if (*depth == 0) return 0; } @@ -214,18 +216,14 @@ } static int -vbe_find_mode(char *str) +vbe_find_mode_xyd(int x, int y, int depth) { struct vbeinfoblock vbe; struct modeinfoblock mi; uint32_t farptr; u
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: dsl Date: Thu Nov 19 22:10:03 UTC 2009 Modified Files: src/sys/arch/i386/stand/lib: message.S src/sys/arch/i386/stand/mbr: mbr.S Log Message: Move code for outputting directly to the serial port into message.S Allows it to be enabled for other parts of the boot sequence. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/lib/message.S cvs rdiff -u -r1.21 -r1.22 src/sys/arch/i386/stand/mbr/mbr.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/lib/message.S diff -u src/sys/arch/i386/stand/lib/message.S:1.3 src/sys/arch/i386/stand/lib/message.S:1.4 --- src/sys/arch/i386/stand/lib/message.S:1.3 Mon Apr 28 20:23:25 2008 +++ src/sys/arch/i386/stand/lib/message.S Thu Nov 19 22:10:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: message.S,v 1.3 2008/04/28 20:23:25 martin Exp $ */ +/* $NetBSD: message.S,v 1.4 2009/11/19 22:10:03 dsl Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -33,6 +33,10 @@ .global message, message_1 +#if defined(BOOT_MSG_COM0) && !defined(COM_PORT_VAL) +#define COM_PORT_VAL $0x3f8 /* Value for COM1 */ +#endif + /* * message: write the error message in %ds:%esi to the console */ @@ -49,9 +53,18 @@ message_1: /* for dump_eax */ lodsb 1: +#ifdef COM_PORT_VAL + mov COM_PORT_VAL, %dx + outb%al, %dx + add $5, %dl +2: inb %dx + test$0x40, %al + jz 2b +#else movb $0x0e, %ah movw $0x0001, %bx int $0x10 +#endif lodsb testb %al, %al jnz 1b Index: src/sys/arch/i386/stand/mbr/mbr.S diff -u src/sys/arch/i386/stand/mbr/mbr.S:1.21 src/sys/arch/i386/stand/mbr/mbr.S:1.22 --- src/sys/arch/i386/stand/mbr/mbr.S:1.21 Wed Nov 18 20:51:22 2009 +++ src/sys/arch/i386/stand/mbr/mbr.S Thu Nov 19 22:10:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: mbr.S,v 1.21 2009/11/18 20:51:22 dsl Exp $ */ +/* $NetBSD: mbr.S,v 1.22 2009/11/19 22:10:03 dsl Exp $ */ /* * Copyright (c) 1999-2004 The NetBSD Foundation, Inc. @@ -602,26 +602,7 @@ message_crlf: call message movw $crlf, %si -#ifdef COM_PORT_VAL -message: - pusha -message_1: - lodsb - test %al, %al - jz 3f - mov COM_PORT_VAL, %dx - outb %al, %dx - add $5, %dl -2: inb %dx - test $0x40, %al - jz 2b - jmp message_1 -3: popa - ret -#else #include -#endif - #if 0 #include #endif
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: dsl Date: Fri Nov 20 17:28:19 UTC 2009 Modified Files: src/sys/arch/i386/stand/boot: Makefile.boot src/sys/arch/i386/stand/bootxx: Makefile.bootxx src/sys/arch/i386/stand/mbr: Makefile.mbr Log Message: Change relay address for mbr and bootxx code to be 0x8800. I'm not sure why I used 0x600, but I have a feeling that might sometimes corrupt bios data. 0x8800 is far enough above 0x7e00 for a sector read to the latter address. To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/arch/i386/stand/boot/Makefile.boot cvs rdiff -u -r1.36 -r1.37 src/sys/arch/i386/stand/bootxx/Makefile.bootxx cvs rdiff -u -r1.16 -r1.17 src/sys/arch/i386/stand/mbr/Makefile.mbr Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/boot/Makefile.boot diff -u src/sys/arch/i386/stand/boot/Makefile.boot:1.41 src/sys/arch/i386/stand/boot/Makefile.boot:1.42 --- src/sys/arch/i386/stand/boot/Makefile.boot:1.41 Wed Nov 18 20:33:39 2009 +++ src/sys/arch/i386/stand/boot/Makefile.boot Fri Nov 20 17:28:19 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.boot,v 1.41 2009/11/18 20:33:39 dsl Exp $ +# $NetBSD: Makefile.boot,v 1.42 2009/11/20 17:28:19 dsl Exp $ S= ${.CURDIR}/../../../../.. @@ -36,7 +36,7 @@ CPPFLAGS+= -I ${.CURDIR}/.. -I ${.CURDIR}/../../lib -I ${S}/lib/libsa CPPFLAGS+= -I ${.OBJDIR} #CPPFLAGS+= -DDEBUG_MEMSIZE - +#CPPFLAGS+= -DBOOT_MSG_COM0 # Make sure we override any optimization options specified by the user COPTS= -Os Index: src/sys/arch/i386/stand/bootxx/Makefile.bootxx diff -u src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.36 src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.37 --- src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.36 Fri Apr 3 10:38:12 2009 +++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx Fri Nov 20 17:28:19 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootxx,v 1.36 2009/04/03 10:38:12 tsutsui Exp $ +# $NetBSD: Makefile.bootxx,v 1.37 2009/11/20 17:28:19 dsl Exp $ S= ${.CURDIR}/../../../../.. @@ -10,7 +10,7 @@ BINDIR= /usr/mdec BINMODE= 0444 -PRIMARY_LOAD_ADDRESS=0x600 +PRIMARY_LOAD_ADDRESS=0x8800 SECONDARY_LOAD_ADDRESS=0x1 # We ought (need?) to fit into track 0 of a 1.2M floppy. @@ -46,6 +46,7 @@ CPPFLAGS+= -DXXfs_read=${FS}_read CPPFLAGS+= -DXXfs_stat=${FS}_stat CPPFLAGS+= -DFS=${FS} +# CPPFLAGS+= -DBOOT_MSG_COM0 # Make sure we override any optimization options specified by the user COPTS= -Os -momit-leaf-frame-pointer Index: src/sys/arch/i386/stand/mbr/Makefile.mbr diff -u src/sys/arch/i386/stand/mbr/Makefile.mbr:1.16 src/sys/arch/i386/stand/mbr/Makefile.mbr:1.17 --- src/sys/arch/i386/stand/mbr/Makefile.mbr:1.16 Mon Mar 30 09:22:52 2009 +++ src/sys/arch/i386/stand/mbr/Makefile.mbr Fri Nov 20 17:28:19 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.mbr,v 1.16 2009/03/30 09:22:52 tsutsui Exp $ +# $NetBSD: Makefile.mbr,v 1.17 2009/11/20 17:28:19 dsl Exp $ S= ${.CURDIR}/../../../../.. @@ -39,9 +39,11 @@ CLEANFILES+= ${PROG}.tmp +LOADADDR= 0x8800 + ${PROG}: ${OBJS} ${_MKTARGET_LINK} - ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,0x600 ${OBJS} + ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${LOADADDR} ${OBJS} @ set -- $$( ${NM} -t d ${PROG}.tmp | grep '\' \ | ${TOOL_SED} 's/^0*//' ); \ echo " There are $$1 free bytes in ${PROG}"
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: jym Date: Sat Nov 6 23:07:47 UTC 2010 Modified Files: src/sys/arch/i386/stand/boot: boot2.c src/sys/arch/i386/stand/pxeboot: main.c Log Message: Bring the help command output from boot and pxeboot on par with their code. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/arch/i386/stand/boot/boot2.c cvs rdiff -u -r1.25 -r1.26 src/sys/arch/i386/stand/pxeboot/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.48 src/sys/arch/i386/stand/boot/boot2.c:1.49 --- src/sys/arch/i386/stand/boot/boot2.c:1.48 Mon Feb 8 21:25:32 2010 +++ src/sys/arch/i386/stand/boot/boot2.c Sat Nov 6 23:07:46 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.48 2010/02/08 21:25:32 hubertf Exp $ */ +/* $NetBSD: boot2.c,v 1.49 2010/11/06 23:07:46 jym Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -386,8 +386,8 @@ "ls [path]\n" "dev xd[N[x]]:\n" "consdev {pc|com[0123]|com[0123]kbd|auto}\n" - "vesa {enabled|disabled|list|modenum}\n" - "modules {enabled|disabled}\n" + "vesa {modenum|on|off|enabled|disabled|list}\n" + "modules {on|off|enabled|disabled}\n" "load {path_to_module}\n" "multiboot [xdNx:][filename] []\n" "help|?\n" Index: src/sys/arch/i386/stand/pxeboot/main.c diff -u src/sys/arch/i386/stand/pxeboot/main.c:1.25 src/sys/arch/i386/stand/pxeboot/main.c:1.26 --- src/sys/arch/i386/stand/pxeboot/main.c:1.25 Tue Apr 6 21:18:59 2010 +++ src/sys/arch/i386/stand/pxeboot/main.c Sat Nov 6 23:07:46 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.25 2010/04/06 21:18:59 tnn Exp $ */ +/* $NetBSD: main.c,v 1.26 2010/11/06 23:07:46 jym Exp $ */ /* * Copyright (c) 1996 @@ -194,9 +194,9 @@ "boot [filename] [-adsqv]\n" " (ex. \"netbsd.old -s\"\n" "consdev {pc|com[0123]|com[0123]kbd|auto}\n" - "vesa {enabled|disabled|list|modenum}\n" + "vesa {modenum|on|off|enabled|disabled|list}\n" "multiboot [filename] []\n" - "modules {enabled|disabled}\n" + "modules {on|off|enabled|disabled}\n" "load {path_to_module}\n" "help|?\n" "quit\n");
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: jakllsch Date: Mon Dec 20 01:12:45 UTC 2010 Modified Files: src/sys/arch/i386/stand/boot: boot2.c src/sys/arch/i386/stand/dosboot: main.c src/sys/arch/i386/stand/lib: Makefile src/sys/arch/i386/stand/lib/crt/dos: start_dos.S src/sys/arch/i386/stand/netboot: main.c start_rom.S src/sys/arch/i386/stand/pxeboot: main.c start_pxe.S Removed Files: src/sys/arch/i386/stand/lib: panic.c Log Message: MI libsa provides panic() and exit() functions, no need to provide our own. As MI libsa exit() calls panic() with a "exit" message, don't use it if we print our own farewell or have already panic()ed. To generate a diff of this commit: cvs rdiff -u -r1.49 -r1.50 src/sys/arch/i386/stand/boot/boot2.c cvs rdiff -u -r1.29 -r1.30 src/sys/arch/i386/stand/dosboot/main.c cvs rdiff -u -r1.29 -r1.30 src/sys/arch/i386/stand/lib/Makefile cvs rdiff -u -r1.7 -r0 src/sys/arch/i386/stand/lib/panic.c cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/lib/crt/dos/start_dos.S cvs rdiff -u -r1.17 -r1.18 src/sys/arch/i386/stand/netboot/main.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/netboot/start_rom.S cvs rdiff -u -r1.26 -r1.27 src/sys/arch/i386/stand/pxeboot/main.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/pxeboot/start_pxe.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/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.49 src/sys/arch/i386/stand/boot/boot2.c:1.50 --- src/sys/arch/i386/stand/boot/boot2.c:1.49 Sat Nov 6 23:07:46 2010 +++ src/sys/arch/i386/stand/boot/boot2.c Mon Dec 20 01:12:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.49 2010/11/06 23:07:46 jym Exp $ */ +/* $NetBSD: boot2.c,v 1.50 2010/12/20 01:12:44 jakllsch Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -414,7 +414,6 @@ reboot(); /* Note: we shouldn't get to this point! */ panic("Could not reboot!"); - exit(0); } void Index: src/sys/arch/i386/stand/dosboot/main.c diff -u src/sys/arch/i386/stand/dosboot/main.c:1.29 src/sys/arch/i386/stand/dosboot/main.c:1.30 --- src/sys/arch/i386/stand/dosboot/main.c:1.29 Sat Mar 21 15:01:56 2009 +++ src/sys/arch/i386/stand/dosboot/main.c Mon Dec 20 01:12:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.29 2009/03/21 15:01:56 ad Exp $ */ +/* $NetBSD: main.c,v 1.30 2010/12/20 01:12:44 jakllsch Exp $ */ /* * Copyright (c) 1996, 1997 @@ -337,7 +337,7 @@ command_quit(char *arg) { printf("Exiting... goodbye...\n"); - exit(0); + _rtt(); } void Index: src/sys/arch/i386/stand/lib/Makefile diff -u src/sys/arch/i386/stand/lib/Makefile:1.29 src/sys/arch/i386/stand/lib/Makefile:1.30 --- src/sys/arch/i386/stand/lib/Makefile:1.29 Thu Nov 19 22:13:17 2009 +++ src/sys/arch/i386/stand/lib/Makefile Mon Dec 20 01:12:44 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.29 2009/11/19 22:13:17 dsl Exp $ +# $NetBSD: Makefile,v 1.30 2010/12/20 01:12:44 jakllsch Exp $ S?= ${.CURDIR}/../../../.. @@ -21,7 +21,7 @@ SRCS+= biosmem.S getextmemx.c biosmemx.S printmemlist.c SRCS+= pread.c menuutils.c parseutils.c SRCS+= bootinfo.c bootinfo_biosgeom.c bootinfo_memmap.c -SRCS+= startprog.S multiboot.S panic.c +SRCS+= startprog.S multiboot.S SRCS+= biosgetsystime.S cpufunc.S bootmenu.c SRCS+= realprot.S message.S message32.S dump_eax.S pvcopy.S putstr.S SRCS+= rasops.c vbe.c biosvbe.S Index: src/sys/arch/i386/stand/lib/crt/dos/start_dos.S diff -u src/sys/arch/i386/stand/lib/crt/dos/start_dos.S:1.9 src/sys/arch/i386/stand/lib/crt/dos/start_dos.S:1.10 --- src/sys/arch/i386/stand/lib/crt/dos/start_dos.S:1.9 Sun Mar 4 05:59:59 2007 +++ src/sys/arch/i386/stand/lib/crt/dos/start_dos.S Mon Dec 20 01:12:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: start_dos.S,v 1.9 2007/03/04 05:59:59 christos Exp $ */ +/* $NetBSD: start_dos.S,v 1.10 2010/12/20 01:12:44 jakllsch Exp $ */ /* * startup for DOS .COM programs @@ -188,7 +188,7 @@ stosb call _C_LABEL(doscommain) -ENTRY(exit) +ENTRY(_rtt) call _C_LABEL(prot_to_real) .code16 ENTRY(exit16) Index: src/sys/arch/i386/stand/netboot/main.c diff -u src/sys/arch/i386/stand/netboot/main.c:1.17 src/sys/arch/i386/stand/netboot/main.c:1.18 --- src/sys/arch/i386/stand/netboot/main.c:1.17 Sat Mar 21 15:01:56 2009 +++ src/sys/arch/i386/stand/netboot/main.c Mon Dec 20 01:12:44 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.17 2009/03/21 15:01:56 ad Exp $ */ +/* $NetBSD: main.c,v 1.18 2010/12/20 01:12:44 jakllsch Exp $ */ /* * Copyright (c) 1996 @@ -123,7 +123,7 @@ command_quit(char *arg) { printf("Exiting... goodbye...\n"); - exit(0); + _rtt(); } void Index: src/sys/arch/i386/stand/netboot/start_rom.S diff -u src/sys/arch/i386/stand/netboot/start_rom.S:1.2 src/sys/arch/i386/stand/netboot/start_rom.S:1.3 --- src/sys/arch/i386/stand/netboot/start_rom.S:1.2 Sun Dec 11 12:17:49 2005 +++ src/sys/arch/i386/stand/netboot/start_rom.S Mo
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: jakllsch Date: Wed Dec 22 20:46:43 UTC 2010 Modified Files: src/sys/arch/i386/stand: Makefile.booters src/sys/arch/i386/stand/pxeboot: pxe.h Log Message: It just so happens we don't need -Wno-attributes if we place __packed in the right place. To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/sys/arch/i386/stand/Makefile.booters cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/pxeboot/pxe.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.80 src/sys/arch/i386/stand/Makefile.booters:1.81 --- src/sys/arch/i386/stand/Makefile.booters:1.80 Tue Jul 6 06:00:00 2010 +++ src/sys/arch/i386/stand/Makefile.booters Wed Dec 22 20:46:42 2010 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.booters,v 1.80 2010/07/06 06:00:00 mrg Exp $ +# $NetBSD: Makefile.booters,v 1.81 2010/12/22 20:46:42 jakllsch Exp $ .include @@ -15,14 +15,11 @@ .if defined(HAVE_GCC) .if ${MACHINE_ARCH} == "x86_64" CPUFLAGS= -m32 -.if ${HAVE_GCC} != 3 -CPUFLAGS+= -Wno-attributes -.endif .else .if ${HAVE_GCC} == 3 CPUFLAGS= -mcpu=i386 .else -CPUFLAGS= -march=i386 -mtune=i386 -Wno-attributes +CPUFLAGS= -march=i386 -mtune=i386 .endif .endif .endif Index: src/sys/arch/i386/stand/pxeboot/pxe.h diff -u src/sys/arch/i386/stand/pxeboot/pxe.h:1.5 src/sys/arch/i386/stand/pxeboot/pxe.h:1.6 --- src/sys/arch/i386/stand/pxeboot/pxe.h:1.5 Tue Dec 25 18:33:34 2007 +++ src/sys/arch/i386/stand/pxeboot/pxe.h Wed Dec 22 20:46:42 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: pxe.h,v 1.5 2007/12/25 18:33:34 perry Exp $ */ +/* $NetBSD: pxe.h,v 1.6 2010/12/22 20:46:42 jakllsch Exp $ */ /* * Copyright (c) 2000 Alfred Perlstein @@ -49,13 +49,13 @@ typedef struct { uint16_t offset; uint16_t segment; -} SEGOFF16_t __packed; +} __packed SEGOFF16_t; typedef struct { uint16_t Seg_Addr; uint32_t Phy_Addr; uint16_t Seg_Size; -} SEGDESC_t __packed; +} __packed SEGDESC_t; typedef uint16_t SEGSEL_t; typedef uint16_t PXENV_STATUS_t;
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: jakllsch Date: Wed Dec 29 17:44:03 UTC 2010 Modified Files: src/sys/arch/i386/stand: Makefile src/sys/arch/i386/stand/bootxx: Makefile src/sys/arch/i386/stand/cdboot: Makefile Removed Files: src/sys/arch/i386/stand/bootxx/bootxx_cd9660: Makefile Log Message: bootxx_cd9660 (cdboot), like bootxx_fat16 (fatboot), is not a traditional libsa-based program. As such, build bootxx_cd9660 where its source lives. This has been done by moving bootxx/bootxx_cd9660/Makefile to cdboot/Makefile and adjusting the relative paths appropriately, so as to minimize binary change. To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/sys/arch/i386/stand/Makefile cvs rdiff -u -r1.13 -r1.14 src/sys/arch/i386/stand/bootxx/Makefile cvs rdiff -u -r1.12 -r0 src/sys/arch/i386/stand/bootxx/bootxx_cd9660/Makefile cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/cdboot/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 diff -u src/sys/arch/i386/stand/Makefile:1.25 src/sys/arch/i386/stand/Makefile:1.26 --- src/sys/arch/i386/stand/Makefile:1.25 Sat Jan 6 20:48:59 2007 +++ src/sys/arch/i386/stand/Makefile Wed Dec 29 17:44:03 2010 @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.25 2007/01/06 20:48:59 dsl Exp $ +# $NetBSD: Makefile,v 1.26 2010/12/29 17:44:03 jakllsch Exp $ SUBDIR= genprom .WAIT SUBDIR+= mbr boot -SUBDIR+= bootxx fatboot +SUBDIR+= bootxx cdboot fatboot SUBDIR+= dosboot misc SUBDIR+= netboot SUBDIR+= pxeboot Index: src/sys/arch/i386/stand/bootxx/Makefile diff -u src/sys/arch/i386/stand/bootxx/Makefile:1.13 src/sys/arch/i386/stand/bootxx/Makefile:1.14 --- src/sys/arch/i386/stand/bootxx/Makefile:1.13 Sat Sep 11 13:06:37 2010 +++ src/sys/arch/i386/stand/bootxx/Makefile Wed Dec 29 17:44:03 2010 @@ -1,6 +1,6 @@ -# $NetBSD: Makefile,v 1.13 2010/09/11 13:06:37 tsutsui Exp $ +# $NetBSD: Makefile,v 1.14 2010/12/29 17:44:03 jakllsch Exp $ -SUBDIR= bootxx_cd9660 bootxx_ffsv1 .WAIT bootxx_ffsv2 bootxx_lfsv1 bootxx_lfsv2 +SUBDIR= bootxx_ffsv1 .WAIT bootxx_ffsv2 bootxx_lfsv1 bootxx_lfsv2 SUBDIR+=bootxx_msdos bootxx_ustarfs # Ext2fs doesn't have enough free space (it has only 1KB) Index: src/sys/arch/i386/stand/cdboot/Makefile diff -u src/sys/arch/i386/stand/cdboot/Makefile:1.9 src/sys/arch/i386/stand/cdboot/Makefile:1.10 --- src/sys/arch/i386/stand/cdboot/Makefile:1.9 Sat Feb 14 13:52:51 2009 +++ src/sys/arch/i386/stand/cdboot/Makefile Wed Dec 29 17:44:03 2010 @@ -1,8 +1,10 @@ -# $NetBSD: Makefile,v 1.9 2009/02/14 13:52:51 abs Exp $ +# $NetBSD: Makefile,v 1.10 2010/12/29 17:44:03 jakllsch Exp $ -S= ${.CURDIR}/../../../.. +S= ${.CURDIR}/../../../.. NOMAN= # defined +.include + STRIPFLAG= # nothing LIBCRT0= # nothing @@ -10,59 +12,41 @@ LIBCRTEND= # nothing LIBC= # nothing -PRIMARY_LOAD_ADDRESS=0x600 -SECONDARY_LOAD_ADDRESS=0x1 - -PIE_CFLAGS= -PIE_LDFLAGS= -PIE_AFLAGS= - -.include - -PROG= cdboot -SRCS?= cdboot.S +PRIMARY_LOAD_ADDRESS= 0x600 +SECONDARY_LOAD_ADDRESS= 0x1 -BINDIR= /usr/mdec -BINMODE=444 +PROG= bootxx_cd9660 +SRCS?= cdboot.S -.PATH: ${.CURDIR}/.. +BINDIR= /usr/mdec +BINMODE= 444 -LDFLAGS+= -nostdlib -Wl,-e,start -CPPFLAGS+= -I. -I${.CURDIR}/../lib -I${S} -CPPFLAGS+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS} -CPPFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS} -#CPPFLAGS+= -DDISABLE_KEYPRESS +.PATH: ${.CURDIR}/.. + +LDFLAGS+= -nostdlib -Wl,-e,start +CPPFLAGS+= -I. -I${.CURDIR}/../lib -I${S} +CPPFLAGS+= -DPRIMARY_LOAD_ADDRESS=${PRIMARY_LOAD_ADDRESS} +CPPFLAGS+= -DSECONDARY_LOAD_ADDRESS=${SECONDARY_LOAD_ADDRESS} +CPPFLAGS+= -DDISABLE_KEYPRESS .if ${MACHINE_ARCH} == "x86_64" -LDFLAGS+= -Wl,-m,elf_i386 -AFLAGS+= -m32 -.endif - -.if !make(obj) && !make(clean) && !make(cleandir) -.BEGIN: machine x86 -.NOPATH: machine x86 +LDFLAGS+= -Wl,-m,elf_i386 +AFLAGS+= -m32 .endif -realdepend realall: machine x86 -CLEANFILES+= machine x86 - -machine:: - -rm -f $@ - ln -s $S/arch/i386/include $@ - -x86:: - -rm -f $@ - ln -s $S/arch/x86/include $@ +BUILDSYMLINKS+= $S/arch/i386/include machine \ + $S/arch/x86/include x86 -${OBJS}: machine x86 +DPSRCS+= machine x86 -CLEANFILES+= ${PROG}.tmp +CLEANFILES+= ${PROG}.tmp ${PROG}: ${OBJS} ${_MKTARGET_LINK} - ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${PRIMARY_LOAD_ADDRESS} ${OBJS} + ${CC} -o ${PROG}.tmp ${LDFLAGS} -Wl,-Ttext,${PRIMARY_LOAD_ADDRESS} \ + ${OBJS} @ set -- $$( ${NM} -t d ${PROG}.tmp | grep '\' \ - | ${TOOL_SED} 's/^0*//' ); \ + | ${TOOL_SED} 's/^0*//' ); \ echo " There are $$1 free bytes in ${PROG}" ${OBJCOPY} -O binary ${PROG}.tmp ${PROG} rm -f ${PROG}.tmp
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: christos Date: Wed Mar 26 17:58:57 UTC 2014 Modified Files: src/sys/arch/i386/stand/boot: boot2.c src/sys/arch/i386/stand/dosboot: main.c src/sys/arch/i386/stand/lib/test: sanamespace.h Log Message: kill sprintf. To generate a diff of this commit: cvs rdiff -u -r1.61 -r1.62 src/sys/arch/i386/stand/boot/boot2.c cvs rdiff -u -r1.31 -r1.32 src/sys/arch/i386/stand/dosboot/main.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/lib/test/sanamespace.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/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.61 src/sys/arch/i386/stand/boot/boot2.c:1.62 --- src/sys/arch/i386/stand/boot/boot2.c:1.61 Wed Mar 19 21:15:29 2014 +++ src/sys/arch/i386/stand/boot/boot2.c Wed Mar 26 13:58:57 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.61 2014/03/20 01:15:29 christos Exp $ */ +/* $NetBSD: boot2.c,v 1.62 2014/03/26 17:58:57 christos Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -228,7 +228,8 @@ sprint_bootsel(const char *filename) if (parsebootfile(filename, &fsname, &devname, &unit, &partition, &file) == 0) { - sprintf(buf, "%s%d%c:%s", devname, unit, 'a' + partition, file); + snprintf(buf, sizeof(buf), "%s%d%c:%s", devname, unit, + 'a' + partition, file); return buf; } return "(invalid)"; Index: src/sys/arch/i386/stand/dosboot/main.c diff -u src/sys/arch/i386/stand/dosboot/main.c:1.31 src/sys/arch/i386/stand/dosboot/main.c:1.32 --- src/sys/arch/i386/stand/dosboot/main.c:1.31 Sun Dec 25 01:09:09 2011 +++ src/sys/arch/i386/stand/dosboot/main.c Wed Mar 26 13:58:57 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.31 2011/12/25 06:09:09 tsutsui Exp $ */ +/* $NetBSD: main.c,v 1.32 2014/03/26 17:58:57 christos Exp $ */ /* * Copyright (c) 1996, 1997 @@ -163,9 +163,9 @@ sprint_bootsel(const char *filename) if (parsebootfile(filename, &fsname, &devname, &unit, &partition, &file) == 0) { if (!strcmp(fsname, "dos")) - sprintf(buf, "dos:%s", file); + snprintf(buf, sizeof(buf), "dos:%s", file); else if (!strcmp(fsname, "ufs")) - sprintf(buf, "%s%d%c:%s", devname, unit, + snprintf(buf, sizeof(buf), "%s%d%c:%s", devname, unit, 'a' + partition, file); else goto bad; return (buf); Index: src/sys/arch/i386/stand/lib/test/sanamespace.h diff -u src/sys/arch/i386/stand/lib/test/sanamespace.h:1.1 src/sys/arch/i386/stand/lib/test/sanamespace.h:1.2 --- src/sys/arch/i386/stand/lib/test/sanamespace.h:1.1 Fri May 15 13:07:16 1998 +++ src/sys/arch/i386/stand/lib/test/sanamespace.h Wed Mar 26 13:58:57 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sanamespace.h,v 1.1 1998/05/15 17:07:16 drochner Exp $ */ +/* $NetBSD: sanamespace.h,v 1.2 2014/03/26 17:58:57 christos Exp $ */ /* take back the namespace mangling done by "Makefile.satest" */ @@ -12,7 +12,6 @@ #undef ioctl #undef lseek #undef printf -#undef sprintf #undef vprintf #undef putchar #undef gets
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: dsl Date: Thu May 1 18:37:26 UTC 2014 Modified Files: src/sys/arch/i386/stand: Makefile.inc Log Message: Add -fno-asynchronous-unwind-tables -fno-exceptions to gcc builds. One of these (probably the first) is needed to stop the eh-frame section being created. The eh_frame section is loadable and bloats the boot images. This might be enough to make pxeboot work. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 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.11 src/sys/arch/i386/stand/Makefile.inc:1.12 --- src/sys/arch/i386/stand/Makefile.inc:1.11 Mon Jul 1 12:48:03 2013 +++ src/sys/arch/i386/stand/Makefile.inc Thu May 1 18:37:26 2014 @@ -1,10 +1,11 @@ -# $NetBSD: Makefile.inc,v 1.11 2013/07/01 12:48:03 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.12 2014/05/01 18:37:26 dsl Exp $ .include BINDIR= /usr/mdec -OPT_SIZE.gcc= -Os -ffreestanding -fomit-frame-pointer -fno-unwind-tables +OPT_SIZE.gcc= -Os -ffreestanding -fomit-frame-pointer -fno-unwind-tables \ + -fno-asynchronous-unwind-tables -fno-exceptions OPT_SIZE.clang= -Oz -ffreestanding -fomit-frame-pointer -DNDEBUG \ -fno-stack-protector -mno-sse \ -mstack-alignment=4 \
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: martin Date: Sun Mar 8 19:47:17 UTC 2015 Modified Files: src/sys/arch/i386/stand: Makefile.booters Log Message: Compile the booblocks for i386 CPUs, even when the main target architecture is amd64. Fixes PR port-i386/49725. To generate a diff of this commit: cvs rdiff -u -r1.89 -r1.90 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.89 src/sys/arch/i386/stand/Makefile.booters:1.90 --- src/sys/arch/i386/stand/Makefile.booters:1.89 Sun Jan 12 15:26:29 2014 +++ src/sys/arch/i386/stand/Makefile.booters Sun Mar 8 19:47:17 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.booters,v 1.89 2014/01/12 15:26:29 tsutsui Exp $ +# $NetBSD: Makefile.booters,v 1.90 2015/03/08 19:47:17 martin Exp $ .include @@ -14,7 +14,7 @@ LIBC= # nothing # Make sure we override any optimization options specified by the # user. .if ${MACHINE_ARCH} == "x86_64" -CPUFLAGS= -m32 +CPUFLAGS= -m32 -march=i386 -mtune=i386 .else CPUFLAGS= -march=i386 -mtune=i386 .endif
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: christos Date: Sat Apr 4 15:30:46 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile.efiboot Log Message: Add --noinhibit-exec and --no-dynamic-linker To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/i386/stand/efiboot/Makefile.efiboot Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/Makefile.efiboot diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.16 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.17 --- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.16 Thu Sep 12 22:19:45 2019 +++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot Sat Apr 4 11:30:46 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.efiboot,v 1.16 2019/09/13 02:19:45 manu Exp $ +# $NetBSD: Makefile.efiboot,v 1.17 2020/04/04 15:30:46 christos Exp $ S= ${.CURDIR}/../../../../.. @@ -41,6 +41,7 @@ BINMODE=444 .PATH: ${.CURDIR}/../../libsa LDSCRIPT?= ${.CURDIR}/ldscript +LDFLAGS+= --no-dynamic-linker --noinhibit-exec LDFLAGS+= -nostdlib -T${LDSCRIPT} -Bsymbolic -shared -nocombreloc CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR}/.. -I$S/lib/libsa CPPFLAGS+= -I${.OBJDIR}
CVS commit: src/sys/arch/i386/stand/misc
Module Name:src Committed By: martin Date: Fri Jun 2 18:19:33 UTC 2017 Modified Files: src/sys/arch/i386/stand/misc: rawr32.exe.uue Log Message: Update to rawrite32 1.0.5 (new signatures to avoid scary windows warnings) To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/misc/rawr32.exe.uue Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. diffs are larger than 1MB and have been omitted
CVS commit: src/sys/arch/i386/stand/misc
Module Name:src Committed By: martin Date: Mon May 23 18:36:06 UTC 2016 Modified Files: src/sys/arch/i386/stand/misc: rawr32.exe.uue Log Message: New Rawrite32 release To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/misc/rawr32.exe.uue Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. diffs are larger than 1MB and have been omitted
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: maxv Date: Sun Jun 5 14:06:31 UTC 2016 Modified Files: src/sys/arch/i386/stand/lib: biosdisk.c exec.c Log Message: The bootinfo is refreshed each time the bootloader tries to execute a kernel, so there's no point in using this global variable. Because of this variable, only one "boot" command can be issued in the prompt, and you have to reboot the machine if you mistyped the kernel name. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/i386/stand/lib/biosdisk.c cvs rdiff -u -r1.59 -r1.60 src/sys/arch/i386/stand/lib/exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/lib/biosdisk.c diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.44 src/sys/arch/i386/stand/lib/biosdisk.c:1.45 --- src/sys/arch/i386/stand/lib/biosdisk.c:1.44 Sun Jan 18 20:18:07 2015 +++ src/sys/arch/i386/stand/lib/biosdisk.c Sun Jun 5 14:06:31 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: biosdisk.c,v 1.44 2015/01/18 20:18:07 jakllsch Exp $ */ +/* $NetBSD: biosdisk.c,v 1.45 2016/06/05 14:06:31 maxv Exp $ */ /* * Copyright (c) 1996, 1998 @@ -701,24 +701,13 @@ biosdisk_findpartition(int biosdev, dadd static void add_biosdisk_bootinfo(void) { - static bool done; - if (bootinfo == NULL) { - done = false; return; } - - if (done) - return; - BI_ADD(&bi_disk, BTINFO_BOOTDISK, sizeof(bi_disk)); BI_ADD(&bi_wedge, BTINFO_BOOTWEDGE, sizeof(bi_wedge)); - - done = true; - return; } - #endif int Index: src/sys/arch/i386/stand/lib/exec.c diff -u src/sys/arch/i386/stand/lib/exec.c:1.59 src/sys/arch/i386/stand/lib/exec.c:1.60 --- src/sys/arch/i386/stand/lib/exec.c:1.59 Sun Apr 6 19:18:00 2014 +++ src/sys/arch/i386/stand/lib/exec.c Sun Jun 5 14:06:31 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.59 2014/04/06 19:18:00 jakllsch Exp $ */ +/* $NetBSD: exec.c,v 1.60 2016/06/05 14:06:31 maxv Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -411,7 +411,7 @@ exec_netbsd(const char *file, physaddr_t out: BI_FREE(); - bootinfo = 0; + bootinfo = NULL; return -1; }
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: maxv Date: Sun Jun 5 14:13:57 UTC 2016 Modified Files: src/sys/arch/i386/stand/lib: bootinfo.c bootinfo.h exec.c Log Message: Don't use a magic value. Define a limit, and enforce it. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/lib/bootinfo.c cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/stand/lib/bootinfo.h cvs rdiff -u -r1.60 -r1.61 src/sys/arch/i386/stand/lib/exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/lib/bootinfo.c diff -u src/sys/arch/i386/stand/lib/bootinfo.c:1.5 src/sys/arch/i386/stand/lib/bootinfo.c:1.6 --- src/sys/arch/i386/stand/lib/bootinfo.c:1.5 Sun Dec 14 18:46:33 2008 +++ src/sys/arch/i386/stand/lib/bootinfo.c Sun Jun 5 14:13:57 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: bootinfo.c,v 1.5 2008/12/14 18:46:33 christos Exp $ */ +/* $NetBSD: bootinfo.c,v 1.6 2016/06/05 14:13:57 maxv Exp $ */ /* * Copyright (c) 1997 @@ -40,6 +40,11 @@ bi_add(struct btinfo_common *what, int t what->len = size; what->type = type; - if (bootinfo) - bootinfo->entry[bootinfo->nentries++] = vtophys(what); + if (bootinfo == NULL) { + return; + } + if (bootinfo->nentries >= BTINFO_MAX) { + panic("bootinfo too big"); + } + bootinfo->entry[bootinfo->nentries++] = vtophys(what); } Index: src/sys/arch/i386/stand/lib/bootinfo.h diff -u src/sys/arch/i386/stand/lib/bootinfo.h:1.10 src/sys/arch/i386/stand/lib/bootinfo.h:1.11 --- src/sys/arch/i386/stand/lib/bootinfo.h:1.10 Mon Nov 18 03:52:45 2013 +++ src/sys/arch/i386/stand/lib/bootinfo.h Sun Jun 5 14:13:57 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: bootinfo.h,v 1.10 2013/11/18 03:52:45 jakllsch Exp $ */ +/* $NetBSD: bootinfo.h,v 1.11 2016/06/05 14:13:57 maxv Exp $ */ /* * Copyright (c) 1997 @@ -35,6 +35,8 @@ struct bootinfo { extern struct bootinfo *bootinfo; +#define BTINFO_MAX 32 + #define BI_ALLOC(max) (bootinfo = alloc(sizeof(struct bootinfo) \ + ((max) - 1) * sizeof(uint32_t))) \ ->nentries = 0 Index: src/sys/arch/i386/stand/lib/exec.c diff -u src/sys/arch/i386/stand/lib/exec.c:1.60 src/sys/arch/i386/stand/lib/exec.c:1.61 --- src/sys/arch/i386/stand/lib/exec.c:1.60 Sun Jun 5 14:06:31 2016 +++ src/sys/arch/i386/stand/lib/exec.c Sun Jun 5 14:13:57 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.60 2016/06/05 14:06:31 maxv Exp $ */ +/* $NetBSD: exec.c,v 1.61 2016/06/05 14:13:57 maxv Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -356,7 +356,7 @@ exec_netbsd(const char *file, physaddr_t file ? file : "NULL", loadaddr); #endif - BI_ALLOC(32); /* ??? */ + BI_ALLOC(BTINFO_MAX); BI_ADD(&btinfo_console, BTINFO_CONSOLE, sizeof(struct btinfo_console));
Re: CVS commit: src/sys/arch/i386/stand
Thanks, Christos. This should also fix PR/53045 (qemu booting). On 21 February 2018 at 17:37, Christos Zoulas wrote: > Module Name:src > Committed By: christos > Date: Thu Feb 22 01:37:04 UTC 2018 > > Modified Files: > src/sys/arch/i386/stand: Makefile.inc > > Log Message: > gcc-6 needs -nosse > > > To generate a diff of this commit: > cvs rdiff -u -r1.13 -r1.14 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/efiboot
Module Name:src Committed By: nonaka Date: Tue Mar 20 10:16:18 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: devopen.c Log Message: efiboot: fix it can't boot from HDD. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/devopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/devopen.c diff -u src/sys/arch/i386/stand/efiboot/devopen.c:1.2 src/sys/arch/i386/stand/efiboot/devopen.c:1.3 --- src/sys/arch/i386/stand/efiboot/devopen.c:1.2 Thu Mar 8 10:34:33 2018 +++ src/sys/arch/i386/stand/efiboot/devopen.c Tue Mar 20 10:16:17 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.2 2018/03/08 10:34:33 nonaka Exp $ */ +/* $NetBSD: devopen.c,v 1.3 2018/03/20 10:16:17 nonaka Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ dev2bios(char *devname, int unit, int *b if (strcmp(devname, "hd") == 0) *biosdev = 0x80 + unit; - if (strcmp(devname, "cd") == 0) + else if (strcmp(devname, "cd") == 0) *biosdev = 0x80 + get_harddrives() + unit; else return ENXIO;
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Tue Mar 20 10:18:10 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: boot.c Log Message: efiboot: more pager. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/efiboot/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/boot.c diff -u src/sys/arch/i386/stand/efiboot/boot.c:1.6 src/sys/arch/i386/stand/efiboot/boot.c:1.7 --- src/sys/arch/i386/stand/efiboot/boot.c:1.6 Thu Mar 8 10:34:33 2018 +++ src/sys/arch/i386/stand/efiboot/boot.c Tue Mar 20 10:18:10 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.6 2018/03/08 10:34:33 nonaka Exp $ */ +/* $NetBSD: boot.c,v 1.7 2018/03/20 10:18:10 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -627,6 +627,12 @@ command_devpath(char *arg) break; Print(L"DevicePathType %d\n", DevicePathType(dp0)); + if (++row >= rows) { + row = 0; + Print(L"Press Any Key to continue :"); + (void) awaitkey(-1, 0); + Print(L"\n"); + } for (dp = dp0; !IsDevicePathEnd(dp); dp = NextDevicePathNode(dp)) {
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Tue Mar 20 10:19:33 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: efidisk.c Log Message: efiboot: boot device is always efi_distlist first element. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/efidisk.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.2 src/sys/arch/i386/stand/efiboot/efidisk.c:1.3 --- src/sys/arch/i386/stand/efiboot/efidisk.c:1.2 Thu Mar 8 10:34:33 2018 +++ src/sys/arch/i386/stand/efiboot/efidisk.c Tue Mar 20 10:19:33 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: efidisk.c,v 1.2 2018/03/08 10:34:33 nonaka Exp $ */ +/* $NetBSD: efidisk.c,v 1.3 2018/03/20 10:19:33 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -106,14 +106,11 @@ next: FreePool(handles); if (efi_bootdp_type == BIOSDISK_TYPE_CD) { - TAILQ_FOREACH(edi, &efi_disklist, list) { - if (edi->bootdev) { -edi = TAILQ_FIRST(&efi_disklist); -edi->type = BIOSDISK_TYPE_CD; -TAILQ_REMOVE(&efi_disklist, edi, list); -TAILQ_INSERT_TAIL(&efi_disklist, edi, list); -break; - } + edi = TAILQ_FIRST(&efi_disklist); + if (edi != NULL && edi->bootdev) { + edi->type = BIOSDISK_TYPE_CD; + TAILQ_REMOVE(&efi_disklist, edi, list); + TAILQ_INSERT_TAIL(&efi_disklist, edi, list); } }
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: nonaka Date: Tue Mar 20 10:21:01 UTC 2018 Modified Files: src/sys/arch/i386/stand/lib: biosdisk.c Log Message: efiboot: fix to find boot partition process. NetBSD related partitions with no bootme flag set are also candidates for boot partition. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 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.47 src/sys/arch/i386/stand/lib/biosdisk.c:1.48 --- src/sys/arch/i386/stand/lib/biosdisk.c:1.47 Thu Mar 8 10:34:33 2018 +++ src/sys/arch/i386/stand/lib/biosdisk.c Tue Mar 20 10:21:01 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: biosdisk.c,v 1.47 2018/03/08 10:34:33 nonaka Exp $ */ +/* $NetBSD: biosdisk.c,v 1.48 2018/03/20 10:21:01 nonaka Exp $ */ /* * Copyright (c) 1996, 1998 @@ -802,20 +802,21 @@ biosdisk_findpartition(int biosdev, dadd if (d->part[partition].fstype == FS_UNUSED) continue; #ifdef EFIBOOT - if (d->part[partition].attr & GPT_ENT_ATTR_BOOTME) { -switch (d->part[partition].fstype) { -case FS_BSDFFS: -case FS_BSDLFS: -case FS_RAID: -case FS_CCD: -case FS_CGD: -case FS_ISO9660: - break; + switch (d->part[partition].fstype) { + case FS_BSDFFS: + case FS_BSDLFS: + case FS_RAID: + case FS_CCD: + case FS_CGD: + case FS_ISO9660: +if (d->part[partition].attr & GPT_ENT_ATTR_BOOTME) + goto found; +candidate = partition; +break; -default: + default: +if (d->part[partition].attr & GPT_ENT_ATTR_BOOTME) candidate = partition; - continue; -} break; } #else @@ -824,6 +825,7 @@ biosdisk_findpartition(int biosdev, dadd #endif } #ifdef EFIBOOT +found: if (partition == 0 && candidate != 0) partition = candidate; #endif
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Tue Mar 27 14:15:05 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile.efiboot boot.c efiboot.c efiboot.h eficons.c efidelay.c efidisk.c efimemory.c src/sys/arch/i386/stand/efiboot/bootia32: efibootia32.c src/sys/arch/i386/stand/efiboot/bootx64: efibootx64.c Added Files: src/sys/arch/i386/stand/efiboot: efichar.c Log Message: efiboot: Added serial console support. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/stand/efiboot/Makefile.efiboot cvs rdiff -u -r1.7 -r1.8 src/sys/arch/i386/stand/efiboot/boot.c cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/efiboot/efiboot.c cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/efiboot/efiboot.h cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/stand/efiboot/efichar.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/efiboot/eficons.c \ src/sys/arch/i386/stand/efiboot/efimemory.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/efidelay.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/efiboot/efidisk.c cvs rdiff -u -r1.3 -r1.4 \ src/sys/arch/i386/stand/efiboot/bootia32/efibootia32.c cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/efiboot/bootx64/efibootx64.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/Makefile.efiboot diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.10 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.11 --- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.10 Thu Mar 8 10:34:33 2018 +++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot Tue Mar 27 14:15:05 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.efiboot,v 1.10 2018/03/08 10:34:33 nonaka Exp $ +# $NetBSD: Makefile.efiboot,v 1.11 2018/03/27 14:15:05 nonaka Exp $ S= ${.CURDIR}/../../../../.. @@ -12,7 +12,7 @@ SOURCES?= start.S conf.c devopen.c efibo LIBI386SRCS= boot.c biosdisk.c bootinfo.c bootinfo_biosgeom.c LIBI386SRCS+= bootmenu.c diskbuf.c exec.c menuutils.c LIBI386SRCS+= panic.c parseutils.c pread.c -LIBI386SRCS+= eficons.c efidelay.c efidev.c efidisk.c efidisk_ll.c +LIBI386SRCS+= efichar.c eficons.c efidelay.c efidev.c efidisk.c efidisk_ll.c LIBI386SRCS+= efigetsecs.c efimemory.c SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} Index: src/sys/arch/i386/stand/efiboot/boot.c diff -u src/sys/arch/i386/stand/efiboot/boot.c:1.7 src/sys/arch/i386/stand/efiboot/boot.c:1.8 --- src/sys/arch/i386/stand/efiboot/boot.c:1.7 Tue Mar 20 10:18:10 2018 +++ src/sys/arch/i386/stand/efiboot/boot.c Tue Mar 27 14:15:05 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.7 2018/03/20 10:18:10 nonaka Exp $ */ +/* $NetBSD: boot.c,v 1.8 2018/03/27 14:15:05 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -463,11 +463,16 @@ command_consdev(char *arg) char *sep, *sep2 = NULL; int ioport, speed = 0; + if (*arg == '\0') { + efi_cons_show(); + return; + } + sep = strchr(arg, ','); if (sep != NULL) { *sep++ = '\0'; sep2 = strchr(sep, ','); - if (sep != NULL) + if (sep2 != NULL) *sep2++ = '\0'; } @@ -555,6 +560,8 @@ void command_version(char *arg) { CHAR16 *path; + char *upath, *ufirmware; + int rv; if (strcmp(arg, "full") == 0) { printf("ImageBase: 0x%" PRIxPTR "\n", @@ -562,12 +569,24 @@ command_version(char *arg) printf("Stack: 0x%" PRIxPTR "\n", efi_main_sp); printf("EFI version: %d.%02d\n", ST->Hdr.Revision >> 16, ST->Hdr.Revision & 0x); - Print(L"EFI Firmware: %s (rev %d.%02d)\n", ST->FirmwareVendor, - ST->FirmwareRevision >> 16, ST->FirmwareRevision & 0x); + ufirmware = NULL; + rv = ucs2_to_utf8(ST->FirmwareVendor, &ufirmware); + if (rv == 0) { + printf("EFI Firmware: %s (rev %d.%02d)\n", ufirmware, + ST->FirmwareRevision >> 16, + ST->FirmwareRevision & 0x); + FreePool(ufirmware); + } path = DevicePathToStr(efi_bootdp); - Print(L"Boot DevicePath: %d:%d:%s\n", DevicePathType(efi_bootdp), - DevicePathSubType(efi_bootdp), path); + upath = NULL; + rv = ucs2_to_utf8(path, &upath); FreePool(path); + if (rv == 0) { + printf("Boot DevicePath: %d:%d:%s\n", + DevicePathType(efi_bootdp), + DevicePathSubType(efi_bootdp), upath); + FreePool(upath); + } } printf("\n" @@ -603,7 +622,9 @@ command_devpath(char *arg) EFI_HANDLE *handles; EFI_DEVICE_PATH *dp0, *dp; CHAR16 *path; + char *upath; UINTN cols, rows, row = 0; + int rv; status = uefi_call_wrapper(ST->ConOut->QueryMode, 4, ST->ConOut, ST->ConOut->Mode->Mode, &cols, &rows); @@ -626,41 +647,54 @@ command_devpath(char *arg) if (EFI_ERROR(status)) break; - Print(L"DevicePathType %d\n", DevicePathType(dp0)); + printf("DevicePathType %d\n", DevicePathType(dp0)); if (++row >= rows) { row = 0; - Print(L"Press Any Key to continue :"); + printf("Press Any Key to continue :"); (void) awaitkey(-1, 0); -
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Wed Apr 11 10:32:10 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile.efiboot boot.c conf.c devopen.c devopen.h efiboot.c efiboot.h efidisk.c Added Files: src/sys/arch/i386/stand/efiboot: dev_net.c efinet.c efinet.h efipxe.c Log Message: efiboot: Added network boot support. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/efiboot/Makefile.efiboot cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/efiboot/boot.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/conf.c cvs rdiff -u -r0 -r1.1 src/sys/arch/i386/stand/efiboot/dev_net.c \ src/sys/arch/i386/stand/efiboot/efinet.c \ src/sys/arch/i386/stand/efiboot/efinet.h \ src/sys/arch/i386/stand/efiboot/efipxe.c cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/efiboot/devopen.c cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/devopen.h cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/efiboot/efiboot.c cvs rdiff -u -r1.7 -r1.8 src/sys/arch/i386/stand/efiboot/efiboot.h cvs rdiff -u -r1.5 -r1.6 src/sys/arch/i386/stand/efiboot/efidisk.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/Makefile.efiboot diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.11 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.12 --- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.11 Tue Mar 27 14:15:05 2018 +++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot Wed Apr 11 10:32:09 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.efiboot,v 1.11 2018/03/27 14:15:05 nonaka Exp $ +# $NetBSD: Makefile.efiboot,v 1.12 2018/04/11 10:32:09 nonaka Exp $ S= ${.CURDIR}/../../../../.. @@ -8,12 +8,12 @@ NEWVERSWHAT?= "EFI Boot" AFLAGS.start.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} -SOURCES?= start.S conf.c devopen.c efiboot.c self_reloc.c -LIBI386SRCS= boot.c biosdisk.c bootinfo.c bootinfo_biosgeom.c -LIBI386SRCS+= bootmenu.c diskbuf.c exec.c menuutils.c -LIBI386SRCS+= panic.c parseutils.c pread.c -LIBI386SRCS+= efichar.c eficons.c efidelay.c efidev.c efidisk.c efidisk_ll.c -LIBI386SRCS+= efigetsecs.c efimemory.c +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+= 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+= diskbuf.c exec.c menuutils.c parseutils.c pread.c SRCS= ${SOURCES} ${EXTRA_SOURCES} ${LIBI386SRCS} PIE_CFLAGS= @@ -57,10 +57,22 @@ CPPFLAGS+= -DSUPPORT_CD9660 CPPFLAGS+= -D"devb2cdb(bno)=(bno)" CPPFLAGS+= -DSUPPORT_DOSFS CPPFLAGS+= -DSUPPORT_EXT2FS +CPPFLAGS+= -DSUPPORT_BOOTP +CPPFLAGS+= -DSUPPORT_DHCP +CPPFLAGS+= -DSUPPORT_NFS +#CPPFLAGS+= -DSUPPORT_TFTP CPPFLAGS+= -DPASS_BIOSGEOM CPPFLAGS+= -DBIOSDISK_DEFAULT_SECSIZE=2048 # for bootinfo_biosgeom.c CPPFLAGS+= -DLIBSA_ENABLE_LS_OP +#CPPFLAGS+= -DARP_DEBUG +#CPPFLAGS+= -DBOOTP_DEBUG +#CPPFLAGS+= -DNET_DEBUG +#CPPFLAGS+= -DNETIF_DEBUG +#CPPFLAGS+= -DNFS_DEBUG +#CPPFLAGS+= -DRARP_DEBUG +#CPPFLAGS+= -DRPC_DEBUG + EFIDIR= ${S}/external/bsd/gnu-efi/dist GNUEFIARCH?= ${MACHINE_CPU} CPPFLAGS+= -I${EFIDIR}/inc -I${EFIDIR}/inc/${GNUEFIARCH} @@ -69,12 +81,12 @@ CPPFLAGS+= -I${EFIDIR}/inc/protocol SAMISCCPPFLAGS+= -DLIBSA_PRINTF_LONGLONG_SUPPORT SAMISCCPPFLAGS+= -DLIBSA_PRINTF_WIDTH_SUPPORT SAMISCCPPFLAGS+= -D"cdb2devb(bno)=(bno)" -SAMISCMAKEFLAGS+= SA_USE_CREAD=yes # Read compressed kernels -SAMISCMAKEFLAGS+= SA_INCLUDE_NET=no # Netboot via TFTP, NFS ### find out what to use for libsa SA_AS= library SAMISCMAKEFLAGS+="SA_USE_LOADFILE=yes" +SAMISCMAKEFLAGS+="SA_USE_CREAD=yes" +SAMISCMAKEFLAGS+="SA_INCLUDE_NET=yes" SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes" .include "${S}/lib/libsa/Makefile.inc" LIBSA= ${SALIB} Index: src/sys/arch/i386/stand/efiboot/boot.c diff -u src/sys/arch/i386/stand/efiboot/boot.c:1.9 src/sys/arch/i386/stand/efiboot/boot.c:1.10 --- src/sys/arch/i386/stand/efiboot/boot.c:1.9 Mon Apr 2 09:44:18 2018 +++ src/sys/arch/i386/stand/efiboot/boot.c Wed Apr 11 10:32:09 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.9 2018/04/02 09:44:18 nonaka Exp $ */ +/* $NetBSD: boot.c,v 1.10 2018/04/11 10:32:09 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -182,6 +182,21 @@ parsebootfile(const char *fname, char ** } static char * +snprint_bootdev(char *buf, size_t bufsize, const char *devname, int unit, +int partition) +{ + static const char *no_partition_devs[] = { "esp", "net", "nfs", "tftp" }; + int i; + + for (i = 0; i < __arraycount(no_partition_devs); i++) + if (strcmp(devname, no_partition_devs[i]) == 0) + break; + snprintf(buf, bufsize, "%s%d%c", devname, unit, + i < __arraycount(no_partition_devs) ? '\0' : 'a' + partition); + return buf; +} + +static char * sprint_bootsel(cons
CVS commit: src/sys/arch/i386/stand/boot
Module Name:src Committed By: maxv Date: Sat Oct 7 10:32:56 UTC 2017 Modified Files: src/sys/arch/i386/stand/boot: version Log Message: Bump bootloader version, support for booting KASLR amd64 kernels. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/i386/stand/boot/version Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/boot/version diff -u src/sys/arch/i386/stand/boot/version:1.16 src/sys/arch/i386/stand/boot/version:1.17 --- src/sys/arch/i386/stand/boot/version:1.16 Fri Aug 30 16:43:33 2013 +++ src/sys/arch/i386/stand/boot/version Sat Oct 7 10:32:56 2017 @@ -1,4 +1,4 @@ -$NetBSD: version,v 1.16 2013/08/30 16:43:33 jmcneill Exp $ +$NetBSD: version,v 1.17 2017/10/07 10:32:56 maxv Exp $ NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this file is important - make sure the entries are appended on end, last item @@ -48,3 +48,4 @@ is taken as the current. 5.8: Support for splash images. 5.9: VESA VBE/DDC EDID support. 5.10: Support for using raw file-system images as memory disks. +5.11: Support for booting KASLR amd64 kernels.
CVS commit: src/sys/arch/i386/stand/boot
Module Name:src Committed By: maxv Date: Wed Oct 11 09:53:14 UTC 2017 Modified Files: src/sys/arch/i386/stand/boot: boot2.c Log Message: Reset has_prekern if pkboot fails. Otherwise here: pkboot wrong_kernel_path boot netbsd the prekern still gets invoked in the second command. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/arch/i386/stand/boot/boot2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.67 src/sys/arch/i386/stand/boot/boot2.c:1.68 --- src/sys/arch/i386/stand/boot/boot2.c:1.67 Sat Oct 7 10:26:38 2017 +++ src/sys/arch/i386/stand/boot/boot2.c Wed Oct 11 09:53:14 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.67 2017/10/07 10:26:38 maxv Exp $ */ +/* $NetBSD: boot2.c,v 1.68 2017/10/11 09:53:14 maxv Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -477,6 +477,7 @@ command_pkboot(char *arg) extern int has_prekern; has_prekern = 1; command_boot(arg); + has_prekern = 0; } void
CVS commit: src/sys/arch/i386/stand/boot
Module Name:src Committed By: maxv Date: Wed Nov 8 18:31:00 UTC 2017 Modified Files: src/sys/arch/i386/stand/boot: boot2.c Log Message: Add pkboot in "help". To generate a diff of this commit: cvs rdiff -u -r1.68 -r1.69 src/sys/arch/i386/stand/boot/boot2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.68 src/sys/arch/i386/stand/boot/boot2.c:1.69 --- src/sys/arch/i386/stand/boot/boot2.c:1.68 Wed Oct 11 09:53:14 2017 +++ src/sys/arch/i386/stand/boot/boot2.c Wed Nov 8 18:31:00 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.68 2017/10/11 09:53:14 maxv Exp $ */ +/* $NetBSD: boot2.c,v 1.69 2017/11/08 18:31:00 maxv Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -403,6 +403,7 @@ command_help(char *arg) printf("commands are:\n" "boot [xdNx:][filename] [-12acdqsvxz]\n" " (ex. \"hd0a:netbsd.old -s\"\n" + "pkboot [xdNx:][filename] [-12acdqsvxz]\n" #if LIBSA_ENABLE_LS_OP "ls [path]\n" #endif
CVS commit: src/sys/arch/i386/stand/boot
Module Name:src Committed By: maxv Date: Tue Nov 14 09:55:41 UTC 2017 Modified Files: src/sys/arch/i386/stand/boot: boot2.c Log Message: Add missing ). To generate a diff of this commit: cvs rdiff -u -r1.69 -r1.70 src/sys/arch/i386/stand/boot/boot2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.69 src/sys/arch/i386/stand/boot/boot2.c:1.70 --- src/sys/arch/i386/stand/boot/boot2.c:1.69 Wed Nov 8 18:31:00 2017 +++ src/sys/arch/i386/stand/boot/boot2.c Tue Nov 14 09:55:41 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.69 2017/11/08 18:31:00 maxv Exp $ */ +/* $NetBSD: boot2.c,v 1.70 2017/11/14 09:55:41 maxv Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -402,7 +402,7 @@ command_help(char *arg) printf("commands are:\n" "boot [xdNx:][filename] [-12acdqsvxz]\n" - " (ex. \"hd0a:netbsd.old -s\"\n" + " (ex. \"hd0a:netbsd.old -s\")\n" "pkboot [xdNx:][filename] [-12acdqsvxz]\n" #if LIBSA_ENABLE_LS_OP "ls [path]\n"
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: christos Date: Sat Dec 7 02:29:03 UTC 2019 Modified Files: src/sys/arch/i386/stand/lib: exec.c Log Message: loadfile sets errno, return the correct error, not EIO. To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/sys/arch/i386/stand/lib/exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/lib/exec.c diff -u src/sys/arch/i386/stand/lib/exec.c:1.74 src/sys/arch/i386/stand/lib/exec.c:1.75 --- src/sys/arch/i386/stand/lib/exec.c:1.74 Thu Sep 12 22:19:46 2019 +++ src/sys/arch/i386/stand/lib/exec.c Fri Dec 6 21:29:03 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.74 2019/09/13 02:19:46 manu Exp $ */ +/* $NetBSD: exec.c,v 1.75 2019/12/07 02:29:03 christos Exp $ */ /* * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -321,7 +321,7 @@ common_load_prekern(const char *file, u_ /* Load the prekern (static) */ flags = LOAD_KERNEL & ~(LOAD_HDR|LOAD_SYM); if ((fd = loadfile(prekernpath, marks, flags)) == -1) - return EIO; + return errno; close(fd); prekern_start = marks[MARK_START]; @@ -334,7 +334,7 @@ common_load_prekern(const char *file, u_ /* Load the kernel (dynamic) */ flags = (LOAD_KERNEL | LOAD_DYN) & ~(floppy ? LOAD_BACKWARDS : 0); if ((fd = loadfile(file, marks, flags)) == -1) - return EIO; + return errno; close(fd); kernpa_end = marks[MARK_END] - loadaddr; @@ -399,7 +399,7 @@ common_load_kernel(const char *file, u_l */ marks[MARK_START] = loadaddr; if ((fd = loadfile(file, marks, COUNT_KERNEL)) == -1) - return EIO; + return errno; close(fd); kernsize = marks[MARK_END]; @@ -413,7 +413,7 @@ common_load_kernel(const char *file, u_l marks[MARK_START] = loadaddr; if ((fd = loadfile(file, marks, LOAD_KERNEL & ~(floppy ? LOAD_BACKWARDS : 0))) == -1) - return EIO; + return errno; close(fd);
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: christos Date: Sun Dec 15 03:38:17 UTC 2019 Modified Files: src/sys/arch/i386/stand/lib: vbe.c Log Message: PR/54767: elo: fix incorrect test (mlelstv) Add symbolic constants and reference to the standard. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/lib/vbe.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/vbe.c diff -u src/sys/arch/i386/stand/lib/vbe.c:1.9 src/sys/arch/i386/stand/lib/vbe.c:1.10 --- src/sys/arch/i386/stand/lib/vbe.c:1.9 Tue Jan 24 06:09:14 2017 +++ src/sys/arch/i386/stand/lib/vbe.c Sat Dec 14 22:38:17 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: vbe.c,v 1.9 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: vbe.c,v 1.10 2019/12/15 03:38:17 christos Exp $ */ /*- * Copyright (c) 2009 Jared D. McNeill @@ -45,19 +45,57 @@ static struct _vbestate { int modenum; } vbestate; +/* + * https://pdos.csail.mit.edu/6.828/2018/readings/hardware/vbe3.pdf + * p32 + */ +#define VBE_MODEATTR_MODE_HARDWARE_SUPPORTED 0x0001u +#define VBE_MODEATTR_RESERVED_10x0002u +#define VBE_MODEATTR_TTY_OUTPUT_FUNCTIONS_SUPPORTED 0x0004u +#define VBE_MODEATTR_COLOR_MODE0x0008u +#define VBE_MODEATTR_GRAPHICS_MODE 0x0010u +#define VBE_MODEATTR_VGA_COMPATIBLE_MODE 0x0020u +#define VBE_MODEATTR_VGA_COMPATIBLE_WINDOWD_MEMORY_MODE 0x0040u +#define VBE_MODEATTR_LINEAR_FRAME_BUFFER_MODE 0x0080u +#define VBE_MODEATTR_DOUBLE_SCAN_MODE 0x0100u +#define VBE_MODEATTR_INTERLACED_MODE 0x0200u +#define VBE_MODEATTR_HARDWARE_TRIPPLE_BUFFERING_SUPPORT 0x0400u +#define VBE_MODEATTR_HARDWARE_STEREOSCOPIC_SUPPORT 0x0800u +#define VBE_MODEATTR_DUAL_DISPLAY_START_ADDRESS_SUPPORT 0x1000u +#define VBE_MODEATTR_RESERVED_20x2000u +#define VBE_MODEATTR_RESERVED_30x4000u +#define VBE_MODEATTR_RESERVED_40x8000u + +/* + * p36 + */ +#define VBE_MEMMODEL_TEXT 0x00u +#define VBE_MEMMODEL_CGA 0x01u +#define VBE_MEMMODEL_HERCULES 0x02u +#define VBE_MEMMODEL_PLANAR 0x03u +#define VBE_MEMMODEL_PACKED_PIXEL 0x04u +#define VBE_MEMMODEL_NON_CHAIN_4_256 0x05u +#define VBE_MEMMODEL_DIRECT_COLOR 0x06u +#define VBE_MEMMODEL_YUV 0x07u +/* VESA Reserved 0x08u-0x0fu */ +/* OEM Reserved0x10u-0xffU */ + + static int vbe_mode_is_supported(struct modeinfoblock *mi) { - if ((mi->ModeAttributes & 0x01) == 0) + if ((mi->ModeAttributes & VBE_MODEATTR_MODE_HARDWARE_SUPPORTED) == 0) return 0; /* mode not supported by hardware */ - if ((mi->ModeAttributes & 0x08) == 0) - return 0; /* linear fb not available */ - if ((mi->ModeAttributes & 0x10) == 0) + if ((mi->ModeAttributes & VBE_MODEATTR_COLOR_MODE) == 0) + return 0; /* only color modes are supported */ + if ((mi->ModeAttributes & VBE_MODEATTR_GRAPHICS_MODE) == 0) return 0; /* text mode */ + if ((mi->ModeAttributes & VBE_MODEATTR_LINEAR_FRAME_BUFFER_MODE) == 0) + return 0; /* linear fb not available */ if (mi->NumberOfPlanes != 1) return 0; /* planar mode not supported */ - if (mi->MemoryModel != 0x04 /* Packed pixel */ && - mi->MemoryModel != 0x06 /* Direct Color */) + if (mi->MemoryModel != VBE_MEMMODEL_PACKED_PIXEL /* Packed pixel */ && + mi->MemoryModel != VBE_MEMMODEL_DIRECT_COLOR /* Direct Color */) return 0; /* unsupported pixel format */ return 1; }
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Sat Jan 18 19:20:23 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: devopen.c Log Message: fix indent. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/efiboot/devopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/devopen.c diff -u src/sys/arch/i386/stand/efiboot/devopen.c:1.9 src/sys/arch/i386/stand/efiboot/devopen.c:1.10 --- src/sys/arch/i386/stand/efiboot/devopen.c:1.9 Tue Dec 10 02:02:47 2019 +++ src/sys/arch/i386/stand/efiboot/devopen.c Sat Jan 18 19:20:23 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.9 2019/12/10 02:02:47 manu Exp $ */ +/* $NetBSD: devopen.c,v 1.10 2020/01/18 19:20:23 nonaka Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -103,7 +103,7 @@ bios2dev(int biosdev, daddr_t sector, ch if (*part_name != NULL) { snprintf(savedevname, sizeof(savedevname), "NAME=%s", *part_name); - *devname = savedevname; + *devname = savedevname; } }
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Sat Jan 18 19:25:58 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: devopen.c Log Message: x86 efiboot: Fixed the problem that /EFI/NetBSD/boot.cfg could not be loaded. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/i386/stand/efiboot/devopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/devopen.c diff -u src/sys/arch/i386/stand/efiboot/devopen.c:1.10 src/sys/arch/i386/stand/efiboot/devopen.c:1.11 --- src/sys/arch/i386/stand/efiboot/devopen.c:1.10 Sat Jan 18 19:20:23 2020 +++ src/sys/arch/i386/stand/efiboot/devopen.c Sat Jan 18 19:25:58 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: devopen.c,v 1.10 2020/01/18 19:20:23 nonaka Exp $ */ +/* $NetBSD: devopen.c,v 1.11 2020/01/18 19:25:58 nonaka Exp $ */ /*- * Copyright (c) 2005 The NetBSD Foundation, Inc. @@ -100,7 +100,7 @@ bios2dev(int biosdev, daddr_t sector, ch *devname = "hd"; (void)biosdisk_findpartition(biosdev, sector, partition, part_name); - if (*part_name != NULL) { + if (part_name != NULL && *part_name != NULL) { snprintf(savedevname, sizeof(savedevname), "NAME=%s", *part_name); *devname = savedevname;
CVS commit: src/sys/arch/i386/stand/bootxx
Module Name:src Committed By: uebayasi Date: Thu Aug 20 11:38:27 UTC 2015 Modified Files: src/sys/arch/i386/stand/bootxx: Makefile.bootxx Log Message: ${PROG} depends on ${LDSCRIPT}. To generate a diff of this commit: cvs rdiff -u -r1.48 -r1.49 src/sys/arch/i386/stand/bootxx/Makefile.bootxx 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/Makefile.bootxx diff -u src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.48 src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.49 --- src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.48 Wed Jan 15 22:25:22 2014 +++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx Thu Aug 20 11:38:27 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootxx,v 1.48 2014/01/15 22:25:22 joerg Exp $ +# $NetBSD: Makefile.bootxx,v 1.49 2015/08/20 11:38:27 uebayasi Exp $ S= ${.CURDIR}/../../../../.. @@ -120,7 +120,7 @@ LIBLIST= ${LIBI386} ${LIBSA} ${LIBKERN} CLEANFILES+= ${PROG}.sym ${PROG}.map -${PROG}: ${OBJS} ${LIBLIST} +${PROG}: ${OBJS} ${LIBLIST} ${LDSCRIPT} ${_MKTARGET_LINK} ${CC} -o ${PROG}.sym ${LDFLAGS} -Wl,-Ttext,${PRIMARY_LOAD_ADDRESS} \ -T ${LDSCRIPT} -Wl,-Map,${PROG}.map -Wl,-cref ${OBJS} ${LIBLIST}
CVS commit: src/sys/arch/i386/stand/boot
Module Name:src Committed By: uebayasi Date: Thu Aug 20 11:39:28 UTC 2015 Modified Files: src/sys/arch/i386/stand/boot: Makefile.boot Log Message: ${PROG} depends on ${LDSCRIPT}. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.67 src/sys/arch/i386/stand/boot/Makefile.boot Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/boot/Makefile.boot diff -u src/sys/arch/i386/stand/boot/Makefile.boot:1.66 src/sys/arch/i386/stand/boot/Makefile.boot:1.67 --- src/sys/arch/i386/stand/boot/Makefile.boot:1.66 Mon Apr 14 15:05:19 2014 +++ src/sys/arch/i386/stand/boot/Makefile.boot Thu Aug 20 11:39:28 2015 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.boot,v 1.66 2014/04/14 15:05:19 uebayasi Exp $ +# $NetBSD: Makefile.boot,v 1.67 2015/08/20 11:39:28 uebayasi Exp $ S= ${.CURDIR}/../../../../.. @@ -132,7 +132,7 @@ vers.c: ${VERSIONFILE} ${SOURCES} ${LIBL # Anything that calls 'real_to_prot' must have a %pc < 0x1. # We link the program, find the callers (all in libi386), then # explicitly pull in the required objects before any other library code. -${PROG}: ${OBJS} ${LIBLIST} ${.CURDIR}/../Makefile.boot +${PROG}: ${OBJS} ${LIBLIST} ${LDSCRIPT} ${.CURDIR}/../Makefile.boot ${_MKTARGET_LINK} bb="$$( ${CC} -o ${PROG}.sym ${LDFLAGS} -Wl,-Ttext,0 -Wl,-cref \ ${OBJS} ${LIBLIST} | ( \
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Wed Apr 17 06:50:34 UTC 2019 Modified Files: src/sys/arch/i386/stand/efiboot: efidisk.c Log Message: efiboot: Don't panic when BLOCK_IO_PROTOCOL is not found. It has been reported that there is a machine where BLOCK_IO_PROTOCOL can not be found when network boot without disk. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/efiboot/efidisk.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.6 src/sys/arch/i386/stand/efiboot/efidisk.c:1.7 --- src/sys/arch/i386/stand/efiboot/efidisk.c:1.6 Wed Apr 11 10:32:09 2018 +++ src/sys/arch/i386/stand/efiboot/efidisk.c Wed Apr 17 06:50:34 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: efidisk.c,v 1.6 2018/04/11 10:32:09 nonaka Exp $ */ +/* $NetBSD: efidisk.c,v 1.7 2019/04/17 06:50:34 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -57,8 +57,7 @@ efi_disk_probe(void) status = LibLocateHandle(ByProtocol, &BlockIoProtocol, NULL, &nhandles, &handles); if (EFI_ERROR(status)) - panic("LocateHandle(BlockIoProtocol): %" PRIxMAX, - (uintmax_t)status); + return; if (efi_bootdp != NULL) depth = efi_device_path_depth(efi_bootdp, MEDIA_DEVICE_PATH); @@ -76,8 +75,7 @@ efi_disk_probe(void) status = uefi_call_wrapper(BS->HandleProtocol, 3, handles[i], &BlockIoProtocol, (void **)&bio); if (EFI_ERROR(status)) - panic("HandleProtocol(BlockIoProtocol): %" PRIxMAX, - (uintmax_t)status); + continue; media = bio->Media; if (media->LogicalPartition || !media->MediaPresent)
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: jmcneill Date: Sat Feb 8 14:35:47 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: eficons.c Log Message: Fix a few bugs related to the framebuffer: - If a GOP mode wasn't explicitly requested, the bootloader was passing fb info to the kernel even if the console was in text mode! This results in garbled console output on at least ThinkPad T420 and likely many others. If a mode isn't specified, default to 800x600. - The "gop" command was incorrectly parsing video modes in the form WxHxD as WxWxD. - Allow a short form WxH for the "gop" command to select any mode with the target dimensions. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 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.7 src/sys/arch/i386/stand/efiboot/eficons.c:1.8 --- src/sys/arch/i386/stand/efiboot/eficons.c:1.7 Fri Sep 13 02:19:45 2019 +++ src/sys/arch/i386/stand/efiboot/eficons.c Sat Feb 8 14:35:47 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: eficons.c,v 1.7 2019/09/13 02:19:45 manu Exp $ */ +/* $NetBSD: eficons.c,v 1.8 2020/02/08 14:35:47 jmcneill Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -34,6 +34,10 @@ #include "bootinfo.h" #include "vbe.h" +#ifndef DEFAULT_GOP_MODE +#define DEFAULT_GOP_MODE "800x600" +#endif + extern struct x86_boot_params boot_params; struct btinfo_console btinfo_console; @@ -71,6 +75,8 @@ static int efi_com_putc(int); static int efi_com_status(int); static int efi_com_waitforinputevent(uint64_t); +static int efi_find_gop_mode(char *); + static int iodev; static int (*internal_getchar)(void) = efi_cons_getc; static int (*internal_putchar)(int) = efi_cons_putc; @@ -415,46 +421,36 @@ bi_framebuffer(void) EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info; struct btinfo_framebuffer fb; INT32 bestmode = -1; + UINTN sz; - if (efi_gop == NULL) { - framebuffer_configure(NULL); - return; - } + if (efi_gop == NULL) + goto nofb; if (efi_gop_mode >= 0) { bestmode = efi_gop_mode; } else { -#if 0 - UINT64 res, bestres = 0; - UINTN sz; - UINT32 i; - - /* XXX EDID? EFI_EDID_DISCOVERED_PROTOCOL */ - for (i = 0; i < efi_gop->Mode->MaxMode; i++) { - status = uefi_call_wrapper(efi_gop->QueryMode, 4, - efi_gop, i, &sz, &info); - if (EFI_ERROR(status)) -continue; + /* If a mode has not been selected, choose a default */ + bestmode = efi_find_gop_mode(DEFAULT_GOP_MODE); + } + if (bestmode == -1) + goto nofb; - res = (UINT64)info->HorizontalResolution * - (UINT64)info->VerticalResolution * - (UINT64)getdepth(info); - if (res > bestres) { -bestmode = i; -bestres = res; - } - } -#endif + status = uefi_call_wrapper(efi_gop->SetMode, 2, efi_gop, + bestmode); + if (EFI_ERROR(status) || efi_gop->Mode->Mode != bestmode) { + printf("GOP setmode failed: %" PRIxMAX "\n", + (uintmax_t)status); + goto nofb; } - if (bestmode >= 0) { - status = uefi_call_wrapper(efi_gop->SetMode, 2, efi_gop, - bestmode); - if (EFI_ERROR(status) || efi_gop->Mode->Mode != bestmode) - printf("GOP setmode failed: %" PRIxMAX "\n", - (uintmax_t)status); + + status = uefi_call_wrapper(efi_gop->QueryMode, 4, + efi_gop, bestmode, &sz, &info); + if (EFI_ERROR(status)) { + printf("GOP querymode failed: %" PRIxMAX "\n", + (uintmax_t)status); + goto nofb; } - info = efi_gop->Mode->Info; memset(&fb, 0, sizeof(fb)); fb.physaddr = efi_gop->Mode->FrameBufferBase; fb.flags = 0; @@ -499,6 +495,10 @@ bi_framebuffer(void) } framebuffer_configure(&fb); + return; + +nofb: + framebuffer_configure(NULL); } int @@ -658,10 +658,16 @@ efi_find_gop_mode(char *arg) snprintf(mode, sizeof(mode), "%lux%lux%u", (long)info->HorizontalResolution, - (long)info->HorizontalResolution, + (long)info->VerticalResolution, depth); if (strcmp(arg, mode) == 0) return i; + + snprintf(mode, sizeof(mode), "%lux%lu", + (long)info->HorizontalResolution, + (long)info->VerticalResolution); + if (strcmp(arg, mode) == 0) + return i; } return -1; }
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: jmcneill Date: Sun Feb 9 12:13:39 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: efiboot.c Log Message: Do not clear the screen before exiting boot services as this may cause an undesired display mode switch. PR# 54615 To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/efiboot/efiboot.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/efiboot.c diff -u src/sys/arch/i386/stand/efiboot/efiboot.c:1.11 src/sys/arch/i386/stand/efiboot/efiboot.c:1.12 --- src/sys/arch/i386/stand/efiboot/efiboot.c:1.11 Fri Sep 13 02:19:45 2019 +++ src/sys/arch/i386/stand/efiboot/efiboot.c Sun Feb 9 12:13:39 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.c,v 1.11 2019/09/13 02:19:45 manu Exp $ */ +/* $NetBSD: efiboot.c,v 1.12 2020/02/09 12:13:39 jmcneill Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -112,8 +112,6 @@ efi_cleanup(void) UINT32 DescriptorVersion; size_t allocsz; - clearit(); - memset(&btinfo_efi, 0, sizeof(btinfo_efi)); btinfo_efi.systblpa = (intptr_t)ST; #ifdef __i386__ /* bootia32.efi */
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: jmcneill Date: Tue Feb 11 11:01:10 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: eficons.c Log Message: Use 1024x768 as the default GOP mode. It is the only option available for Hyper-V Gen.2 VMs and it seems to be the de facto standard and part of WHQL requirements. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 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.8 src/sys/arch/i386/stand/efiboot/eficons.c:1.9 --- src/sys/arch/i386/stand/efiboot/eficons.c:1.8 Sat Feb 8 14:35:47 2020 +++ src/sys/arch/i386/stand/efiboot/eficons.c Tue Feb 11 11:01:10 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: eficons.c,v 1.8 2020/02/08 14:35:47 jmcneill Exp $ */ +/* $NetBSD: eficons.c,v 1.9 2020/02/11 11:01:10 jmcneill Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -35,7 +35,7 @@ #include "vbe.h" #ifndef DEFAULT_GOP_MODE -#define DEFAULT_GOP_MODE "800x600" +#define DEFAULT_GOP_MODE "1024x768" #endif extern struct x86_boot_params boot_params;
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: jmcneill Date: Sat Feb 22 09:34:26 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: eficons.c Log Message: If the default GOP mode is unavailable, fallback to the first mode defined. PR# port-amd64/55000 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 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.9 src/sys/arch/i386/stand/efiboot/eficons.c:1.10 --- src/sys/arch/i386/stand/efiboot/eficons.c:1.9 Tue Feb 11 11:01:10 2020 +++ src/sys/arch/i386/stand/efiboot/eficons.c Sat Feb 22 09:34:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: eficons.c,v 1.9 2020/02/11 11:01:10 jmcneill Exp $ */ +/* $NetBSD: eficons.c,v 1.10 2020/02/22 09:34:26 jmcneill Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -37,6 +37,7 @@ #ifndef DEFAULT_GOP_MODE #define DEFAULT_GOP_MODE "1024x768" #endif +#define FALLBACK_GOP_MODE 0 extern struct x86_boot_params boot_params; @@ -431,6 +432,8 @@ bi_framebuffer(void) } else { /* If a mode has not been selected, choose a default */ bestmode = efi_find_gop_mode(DEFAULT_GOP_MODE); + if (bestmode == -1) + bestmode = FALLBACK_GOP_MODE; } if (bestmode == -1) goto nofb;
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: jmcneill Date: Sat Feb 22 10:30:37 UTC 2020 Modified Files: src/sys/arch/i386/stand/efiboot: eficons.c Log Message: Remove check for bestmode==-1 (shouldn't happen) To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 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.10 src/sys/arch/i386/stand/efiboot/eficons.c:1.11 --- src/sys/arch/i386/stand/efiboot/eficons.c:1.10 Sat Feb 22 09:34:26 2020 +++ src/sys/arch/i386/stand/efiboot/eficons.c Sat Feb 22 10:30:37 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: eficons.c,v 1.10 2020/02/22 09:34:26 jmcneill Exp $ */ +/* $NetBSD: eficons.c,v 1.11 2020/02/22 10:30:37 jmcneill Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -421,7 +421,7 @@ bi_framebuffer(void) EFI_STATUS status; EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info; struct btinfo_framebuffer fb; - INT32 bestmode = -1; + INT32 bestmode; UINTN sz; if (efi_gop == NULL) @@ -435,8 +435,6 @@ bi_framebuffer(void) if (bestmode == -1) bestmode = FALLBACK_GOP_MODE; } - if (bestmode == -1) - goto nofb; status = uefi_call_wrapper(efi_gop->SetMode, 2, efi_gop, bestmode);
CVS commit: src/sys/arch/i386/stand/boot
Module Name:src Committed By: kim Date: Wed Jul 15 12:36:30 UTC 2020 Modified Files: src/sys/arch/i386/stand/boot: boot2.c Log Message: Let consdev command also set speed Adapted from PR install/55490 by Sunil Nimmagadda To generate a diff of this commit: cvs rdiff -u -r1.73 -r1.74 src/sys/arch/i386/stand/boot/boot2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.73 src/sys/arch/i386/stand/boot/boot2.c:1.74 --- src/sys/arch/i386/stand/boot/boot2.c:1.73 Sat Apr 4 19:50:54 2020 +++ src/sys/arch/i386/stand/boot/boot2.c Wed Jul 15 12:36:30 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.73 2020/04/04 19:50:54 christos Exp $ */ +/* $NetBSD: boot2.c,v 1.74 2020/07/15 12:36:30 kim Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -449,7 +449,7 @@ command_help(char *arg) "ls [dev:][path]\n" #endif "dev [dev:]\n" - "consdev {pc|com[0123]|com[0123]kbd|auto}\n" + "consdev {pc|{com[0123]|com[0123]kbd|auto}[,{speed}]}\n" "vesa {modenum|on|off|enabled|disabled|list}\n" #ifndef SMALL "menu (reenters boot menu, if defined in boot.cfg)\n" @@ -581,14 +581,32 @@ void command_consdev(char *arg) { const struct cons_devs *cdp; + char *sep; + int speed; + + sep = strchr(arg, ','); + if (sep != NULL) + *sep++ = '\0'; for (cdp = cons_devs; cdp->name; cdp++) { - if (strcmp(arg, cdp->name) == 0) { - initio(cdp->tag); - print_banner(); - return; + if (strcmp(arg, cdp->name) != 0) + continue; + + if (sep != NULL) { + if (cdp->tag == CONSDEV_PC) +goto error; + + speed = atoi(sep); + if (speed < 0) +goto error; + boot_params.bp_conspeed = speed; } + + initio(cdp->tag); + print_banner(); + return; } +error: printf("invalid console device.\n"); }
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: jakllsch Date: Wed May 16 19:53:54 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: eficons.c Log Message: During awaitkey(), move the cursor back to the beginning of the countdown with '\b' only after waiting. Some UEFI implementations have a destructive/erasing backspace, and will not show the countdown if we move the cursor back before the wait. My ThinkPad T430 w/ Lenovo's UEFI exhibited this whiteout-backspace, while my Gigabyte Brix GB-BXBT-2807 did not. Should fix PR #53292. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 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.5 src/sys/arch/i386/stand/efiboot/eficons.c:1.6 --- src/sys/arch/i386/stand/efiboot/eficons.c:1.5 Tue Mar 27 14:15:05 2018 +++ src/sys/arch/i386/stand/efiboot/eficons.c Wed May 16 19:53:54 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: eficons.c,v 1.5 2018/03/27 14:15:05 nonaka Exp $ */ +/* $NetBSD: eficons.c,v 1.6 2018/05/16 19:53:54 jakllsch Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -328,10 +328,10 @@ awaitkey(int timeout, int tell) char c = 0; for (;;) { - if (tell && timeout) { - char numbuf[32]; - int len; + char numbuf[32]; + int len; + if (tell && timeout) { len = snprintf(numbuf, sizeof(numbuf), "%d seconds. ", timeout); if (len > 0 && len < sizeof(numbuf)) { @@ -340,7 +340,6 @@ awaitkey(int timeout, int tell) printf("%s", numbuf); while (*p) *p++ = '\b'; -printf("%s", numbuf); } } if (iskey(1)) { @@ -355,6 +354,8 @@ awaitkey(int timeout, int tell) internal_waitforinputevent(1000); else break; + if (tell) + printf("%s", numbuf); } out:
CVS commit: src/sys/arch/i386/stand/mbr
Module Name:src Committed By: jakllsch Date: Sat May 19 18:18:16 UTC 2018 Modified Files: src/sys/arch/i386/stand/mbr: gpt.S Log Message: Compact crc32 code by 12 bytes of text. >From dave0 in #NetBSD on Freenode circa December 2017. Tested in a 32-bit userland harness to produce identical results as old code for one set of inputs. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/mbr/gpt.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/mbr/gpt.S diff -u src/sys/arch/i386/stand/mbr/gpt.S:1.1 src/sys/arch/i386/stand/mbr/gpt.S:1.2 --- src/sys/arch/i386/stand/mbr/gpt.S:1.1 Thu Jan 6 01:08:49 2011 +++ src/sys/arch/i386/stand/mbr/gpt.S Sat May 19 18:18:16 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: gpt.S,v 1.1 2011/01/06 01:08:49 jakllsch Exp $ */ +/* $NetBSD: gpt.S,v 1.2 2018/05/19 18:18:16 jakllsch Exp $ */ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -428,21 +428,14 @@ message_1: * %ebx crc (returned) */ crc32: - push %dx /* preserve drive number */ - push %ax /* preserve original CRC */ - - xorl %ebx, %ebx - decl %ebx /* init value */ + orl $-1, %ebx /* init value */ 1: - lodsb/* load next message byte to %al */ + xorb (%si), %bl /* xoring next message byte with previous result */ + inc %si movb $8, %cl /* set bit counter */ 2: - movb %al, %dl - xorb %bl, %dl /* xoring with previous result */ shrl $1, %ebx - shrb $1, %al - testb $1, %dl - jz 3f + jnc 3f crc32_poly = . + 3 /* gross, but saves a few bytes */ xorl $0xedb88320, %ebx /* EFI CRC32 Polynomial */ 3: @@ -451,8 +444,6 @@ crc32_poly = . + 3 /* gross, but saves jne 1b notl %ebx /* result correction */ - pop %ax - pop %dx ret #endif
CVS commit: src/sys/arch/i386/stand/mbr
Module Name:src Committed By: jakllsch Date: Sat May 19 18:19:37 UTC 2018 Modified Files: src/sys/arch/i386/stand/mbr: gpt.S Log Message: Fix some whitespace style issues. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/mbr/gpt.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/mbr/gpt.S diff -u src/sys/arch/i386/stand/mbr/gpt.S:1.2 src/sys/arch/i386/stand/mbr/gpt.S:1.3 --- src/sys/arch/i386/stand/mbr/gpt.S:1.2 Sat May 19 18:18:16 2018 +++ src/sys/arch/i386/stand/mbr/gpt.S Sat May 19 18:19:37 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: gpt.S,v 1.2 2018/05/19 18:18:16 jakllsch Exp $ */ +/* $NetBSD: gpt.S,v 1.3 2018/05/19 18:19:37 jakllsch Exp $ */ /* * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -44,7 +44,7 @@ * * NO_LBA_CHECK - no check if bios supports LBA reads * NO_CRC_CHECK - disable crc checks for GPT - * NO_BANNER- do not output title line 'banner' + * NO_BANNER - do not output title line 'banner' */ #ifdef COM_PORT @@ -143,7 +143,7 @@ ENTRY(start) mov %ax, %es mov %ax, %ds movw $mbr, %di - mov $BOOTADDR + (mbr - start), %si + mov $BOOTADDR + (mbr - start), %si push %ax /* zero for %cs of lret */ push %di movw $(bss_start - mbr), %cx
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Fri Jun 8 11:52:30 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: efiboot.c Log Message: Remove unused include. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/i386/stand/efiboot/efiboot.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/efiboot.c diff -u src/sys/arch/i386/stand/efiboot/efiboot.c:1.7 src/sys/arch/i386/stand/efiboot/efiboot.c:1.8 --- src/sys/arch/i386/stand/efiboot/efiboot.c:1.7 Wed Apr 11 10:32:09 2018 +++ src/sys/arch/i386/stand/efiboot/efiboot.c Fri Jun 8 11:52:30 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.c,v 1.7 2018/04/11 10:32:09 nonaka Exp $ */ +/* $NetBSD: efiboot.c,v 1.8 2018/06/08 11:52:30 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -28,7 +28,6 @@ #include "efiboot.h" -#include "biosdisk_ll.h" #include "bootinfo.h" #include "devopen.h"
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: christos Date: Mon Jun 11 21:35:13 UTC 2018 Modified Files: src/sys/arch/i386/stand/lib: Makefile.inc Log Message: switch CFLAGS from using MAKEOBJDIRPREFIX to MAKEOBJDIR. This whole thing is disgusting, but fixing it properly. requires restructuring To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 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.17 src/sys/arch/i386/stand/lib/Makefile.inc:1.18 --- src/sys/arch/i386/stand/lib/Makefile.inc:1.17 Sat May 26 21:14:50 2018 +++ src/sys/arch/i386/stand/lib/Makefile.inc Mon Jun 11 17:35:13 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.17 2018/05/27 01:14:50 christos Exp $ +# $NetBSD: Makefile.inc,v 1.18 2018/06/11 21:35:13 christos Exp $ # # Configuration variables (default values are below): # @@ -24,7 +24,7 @@ CWARNFLAGS.clang+= -Wno-tautological-com I386MAKE= \ cd ${I386DIR} && MAKEOBJDIRPREFIX= && unset MAKEOBJDIRPREFIX && \ MAKEOBJDIR=${I386DST} ${MAKE} \ - CC=${CC:q} CFLAGS=${CFLAGS:q} \ + CC=${CC:q} CFLAGS=${CFLAGS:S/MAKEOBJDIRPREFIX/MAKEOBJDIR/:q} \ AS=${AS:q} AFLAGS=${AFLAGS:q} \ LD=${LD:q} STRIP=${STRIP:q} \ MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:q} \
CVS commit: src/sys/arch/i386/stand/mbr
Module Name:src Committed By: kamil Date: Tue Jun 12 21:35:17 UTC 2018 Modified Files: src/sys/arch/i386/stand/mbr: Makefile.mbr Log Message: Set NOSANITIZER in i386 mbr files This is required to build these files and keep then functional with enabled MKSANITIZER. Sponsored by To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/i386/stand/mbr/Makefile.mbr 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.19 src/sys/arch/i386/stand/mbr/Makefile.mbr:1.20 --- src/sys/arch/i386/stand/mbr/Makefile.mbr:1.19 Sun Jan 12 15:26:29 2014 +++ src/sys/arch/i386/stand/mbr/Makefile.mbr Tue Jun 12 21:35:17 2018 @@ -1,7 +1,8 @@ -# $NetBSD: Makefile.mbr,v 1.19 2014/01/12 15:26:29 tsutsui Exp $ +# $NetBSD: Makefile.mbr,v 1.20 2018/06/12 21:35:17 kamil Exp $ S= ${.CURDIR}/../../../../.. +NOSANITIZER= # defined NOMAN= # defined LIBCRT0= # nothing
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: christos Date: Wed Jun 13 16:03:10 UTC 2018 Modified Files: src/sys/arch/i386/stand/lib: Makefile.inc Log Message: revert previous MAKEOBJDIRPREFIX massaging To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 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.18 src/sys/arch/i386/stand/lib/Makefile.inc:1.19 --- src/sys/arch/i386/stand/lib/Makefile.inc:1.18 Mon Jun 11 17:35:13 2018 +++ src/sys/arch/i386/stand/lib/Makefile.inc Wed Jun 13 12:03:10 2018 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.18 2018/06/11 21:35:13 christos Exp $ +# $NetBSD: Makefile.inc,v 1.19 2018/06/13 16:03:10 christos Exp $ # # Configuration variables (default values are below): # @@ -24,7 +24,7 @@ CWARNFLAGS.clang+= -Wno-tautological-com I386MAKE= \ cd ${I386DIR} && MAKEOBJDIRPREFIX= && unset MAKEOBJDIRPREFIX && \ MAKEOBJDIR=${I386DST} ${MAKE} \ - CC=${CC:q} CFLAGS=${CFLAGS:S/MAKEOBJDIRPREFIX/MAKEOBJDIR/:q} \ + CC=${CC:q} CFLAGS=${CFLAGS:q} \ AS=${AS:q} AFLAGS=${AFLAGS:q} \ LD=${LD:q} STRIP=${STRIP:q} \ MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH:q} \
CVS commit: src/sys/arch/i386/stand/misc
Module Name:src Committed By: martin Date: Tue Jun 26 10:15:37 UTC 2018 Modified Files: src/sys/arch/i386/stand/misc: Makefile Removed Files: src/sys/arch/i386/stand/misc: rawr32.exe.uue Log Message: Remove Rawrite32 installer - no point having an outdated version on some install media, the windows machine it needs to run on will have internet and can easily download it. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/stand/misc/Makefile cvs rdiff -u -r1.7 -r0 src/sys/arch/i386/stand/misc/rawr32.exe.uue 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/misc/Makefile diff -u src/sys/arch/i386/stand/misc/Makefile:1.8 src/sys/arch/i386/stand/misc/Makefile:1.9 --- src/sys/arch/i386/stand/misc/Makefile:1.8 Tue May 1 19:59:45 2018 +++ src/sys/arch/i386/stand/misc/Makefile Tue Jun 26 10:15:36 2018 @@ -1,10 +1,9 @@ -# $NetBSD: Makefile,v 1.8 2018/05/01 19:59:45 christos Exp $ +# $NetBSD: Makefile,v 1.9 2018/06/26 10:15:36 martin Exp $ .include MISC_FILES= rawrite.c UUDECODE_FILES= pfdisk.doc pfdisk.exe pfdisktc.zip \ - rawr32.exe \ rawrite.doc rawrite.exe .include
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: christos Date: Thu Nov 8 21:47:04 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile Log Message: Don't build this as a PIE binary, PIE binaries need PHDR and this barfs under the new binutils: error: PHDR segment not covered by LOAD segment [including bsd.init.mk includes ../Makefile.inc which disables PIE like all the other bootloaders do] To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/efiboot/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/efiboot/Makefile diff -u src/sys/arch/i386/stand/efiboot/Makefile:1.3 src/sys/arch/i386/stand/efiboot/Makefile:1.4 --- src/sys/arch/i386/stand/efiboot/Makefile:1.3 Sun Jul 8 13:01:02 2018 +++ src/sys/arch/i386/stand/efiboot/Makefile Thu Nov 8 16:47:04 2018 @@ -1,4 +1,6 @@ -# $NetBSD: Makefile,v 1.3 2018/07/08 17:01:02 christos Exp $ +# $NetBSD: Makefile,v 1.4 2018/11/08 21:47:04 christos Exp $ + +.include SUBDIR= bootia32 .if ${MACHINE} == "amd64"
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: christos Date: Thu Nov 8 23:20:52 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile Log Message: revert previous; does not fix the issue To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/efiboot/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/efiboot/Makefile diff -u src/sys/arch/i386/stand/efiboot/Makefile:1.4 src/sys/arch/i386/stand/efiboot/Makefile:1.5 --- src/sys/arch/i386/stand/efiboot/Makefile:1.4 Thu Nov 8 16:47:04 2018 +++ src/sys/arch/i386/stand/efiboot/Makefile Thu Nov 8 18:20:52 2018 @@ -1,6 +1,4 @@ -# $NetBSD: Makefile,v 1.4 2018/11/08 21:47:04 christos Exp $ - -.include +# $NetBSD: Makefile,v 1.5 2018/11/08 23:20:52 christos Exp $ SUBDIR= bootia32 .if ${MACHINE} == "amd64"
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Sun Mar 12 06:37:41 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: TODO.efiboot Log Message: Remove `fix module_init()' entry. I've been committed. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/TODO.efiboot Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/TODO.efiboot diff -u src/sys/arch/i386/stand/efiboot/TODO.efiboot:1.2 src/sys/arch/i386/stand/efiboot/TODO.efiboot:1.3 --- src/sys/arch/i386/stand/efiboot/TODO.efiboot:1.2 Tue Feb 21 10:53:37 2017 +++ src/sys/arch/i386/stand/efiboot/TODO.efiboot Sun Mar 12 06:37:41 2017 @@ -2,7 +2,6 @@ * handle UEFI variables * boot from CD/DVD (bootable from CD/DVD, but root fs not found.) * load boot.cfg from EFI system partition (FAT32) - * fix module_init(). need to allocate memory for modules. - kernel * handle UEFI variables (/dev/efivar)
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Fri Mar 24 01:00:47 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: eficons.c Log Message: Don't maximize the screen size when gop is not specified. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 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.1 src/sys/arch/i386/stand/efiboot/eficons.c:1.2 --- src/sys/arch/i386/stand/efiboot/eficons.c:1.1 Tue Jan 24 11:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/eficons.c Fri Mar 24 01:00:47 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: eficons.c,v 1.1 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: eficons.c,v 1.2 2017/03/24 01:00:47 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -209,9 +209,6 @@ bi_framebuffer(void) EFI_STATUS status; EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *info; struct btinfo_framebuffer fb; - UINT64 res, bestres = 0; - UINTN sz; - UINT32 i; INT32 bestmode = -1; if (efi_gop == NULL) { @@ -222,7 +219,12 @@ bi_framebuffer(void) if (efi_gop_mode >= 0) { bestmode = efi_gop_mode; } else { - /* XXX EDID? EFI_EDID_DISCOVERD_PROTOCOL */ +#if 0 + UINT64 res, bestres = 0; + UINTN sz; + UINT32 i; + + /* XXX EDID? EFI_EDID_DISCOVERED_PROTOCOL */ for (i = 0; i < efi_gop->Mode->MaxMode; i++) { status = uefi_call_wrapper(efi_gop->QueryMode, 4, efi_gop, i, &sz, &info); @@ -237,6 +239,7 @@ bi_framebuffer(void) bestres = res; } } +#endif } if (bestmode >= 0) { status = uefi_call_wrapper(efi_gop->SetMode, 2, efi_gop,
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Fri Mar 24 01:25:36 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: eficons.c Log Message: Don't maximize the text columns and rows. only use 100x31 or 80x25. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 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.2 src/sys/arch/i386/stand/efiboot/eficons.c:1.3 --- src/sys/arch/i386/stand/efiboot/eficons.c:1.2 Fri Mar 24 01:00:47 2017 +++ src/sys/arch/i386/stand/efiboot/eficons.c Fri Mar 24 01:25:36 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: eficons.c,v 1.2 2017/03/24 01:00:47 nonaka Exp $ */ +/* $NetBSD: eficons.c,v 1.3 2017/03/24 01:25:36 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -499,24 +499,27 @@ static void eficons_init_video(void) { EFI_STATUS status; - UINTN cols, rows, dim = 0; - INT32 i, best = -1; + UINTN cols, rows; + INT32 i, best, mode80x25, mode100x31; /* * Setup text mode */ uefi_call_wrapper(ST->ConOut->Reset, 2, ST->ConOut, TRUE); + mode80x25 = mode100x31 = -1; for (i = 0; i < ST->ConOut->Mode->MaxMode; i++) { status = uefi_call_wrapper(ST->ConOut->QueryMode, 4, ST->ConOut, i, &cols, &rows); if (EFI_ERROR(status)) continue; - if (dim < cols * rows) { - dim = cols * rows; - best = i; - } + + if (mode80x25 < 0 && cols == 80 && rows == 25) + mode80x25 = i; + else if (mode100x31 < 0 && cols == 100 && rows == 31) + mode100x31 = i; } + best = mode100x31 >= 0 ? mode100x31 : mode80x25 >= 0 ? mode80x25 : -1; if (best >= 0) uefi_call_wrapper(ST->ConOut->SetMode, 2, ST->ConOut, best); uefi_call_wrapper(ST->ConOut->EnableCursor, 2, ST->ConOut, TRUE);
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: nonaka Date: Fri Mar 24 08:50:17 UTC 2017 Modified Files: src/sys/arch/i386/stand/lib: exec.c Log Message: efiboot: fix calculation of the kernel size when loading modules. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/arch/i386/stand/lib/exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/lib/exec.c diff -u src/sys/arch/i386/stand/lib/exec.c:1.67 src/sys/arch/i386/stand/lib/exec.c:1.68 --- src/sys/arch/i386/stand/lib/exec.c:1.67 Sun Mar 12 05:33:48 2017 +++ src/sys/arch/i386/stand/lib/exec.c Fri Mar 24 08:50:17 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.c,v 1.67 2017/03/12 05:33:48 nonaka Exp $ */ +/* $NetBSD: exec.c,v 1.68 2017/03/24 08:50:17 nonaka Exp $ */ /* * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -469,14 +469,16 @@ count_netbsd(const char *file, u_long *r { u_long marks[MARK_MAX]; char kdev[64]; - char base_path[64]; + char base_path[64] = "/"; struct stat st; boot_module_t *bm; u_long sz; int err, fd; + howto = AB_SILENT; + memset(marks, 0, sizeof(marks)); - if ((fd = loadfile(file, marks, COUNT_KERNEL)) == -1) + if ((fd = loadfile(file, marks, COUNT_KERNEL | LOAD_NOTE)) == -1) return -1; close(fd); marks[MARK_END] = (((u_long) marks[MARK_END] + sizeof(int) - 1)) & @@ -490,13 +492,13 @@ count_netbsd(const char *file, u_long *r /* If the root fs type is unusual, load its module. */ if (fsmod != NULL) - module_add(__UNCONST(fsmod)); + module_add_common(fsmod, BM_TYPE_KMOD); for (bm = boot_modules; bm; bm = bm->bm_next) { fd = module_open(bm, 0, kdev, base_path, false); if (fd == -1) continue; - sz = (image_end + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1); + sz = (sz + PAGE_SIZE - 1) & ~(PAGE_SIZE - 1); err = fstat(fd, &st); if (err == -1 || st.st_size == -1) { close(fd);
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nonaka Date: Mon May 1 13:03:02 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: boot.c efiboot.h eficons.c Log Message: efiboot: implement consdev command. no support to change console device for efiboot yet. only pass console parameters to kernel. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/efiboot/boot.c \ src/sys/arch/i386/stand/efiboot/efiboot.h cvs rdiff -u -r1.3 -r1.4 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/boot.c diff -u src/sys/arch/i386/stand/efiboot/boot.c:1.4 src/sys/arch/i386/stand/efiboot/boot.c:1.5 --- src/sys/arch/i386/stand/efiboot/boot.c:1.4 Sun Mar 12 05:33:48 2017 +++ src/sys/arch/i386/stand/efiboot/boot.c Mon May 1 13:03:01 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.4 2017/03/12 05:33:48 nonaka Exp $ */ +/* $NetBSD: boot.c,v 1.5 2017/05/01 13:03:01 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -30,6 +30,7 @@ #include #include +#include #include "bootcfg.h" #include "bootmod.h" @@ -340,7 +341,7 @@ command_help(char *arg) "boot [xdNx:][filename] [-12acdqsvxz]\n" " (ex. \"hd0a:netbsd.old -s\"\n" "dev [xd[N[x]]:]\n" - "consdev {pc|com[0123]|com[0123]kbd|auto}\n" + "consdev {pc|com[0123][,{speed}]|com,{ioport}[,{speed}]}\n" "devpath\n" "efivar\n" "gop [{modenum|list}]\n" @@ -436,12 +437,77 @@ command_dev(char *arg) default_devname = savedevname; } -/* ARGSUSED */ +static const struct cons_devs { + const char *name; + u_int tag; + int ioport; +} cons_devs[] = { + { "pc", CONSDEV_PC, 0 }, + { "com0", CONSDEV_COM0, 0 }, + { "com1", CONSDEV_COM1, 0 }, + { "com2", CONSDEV_COM2, 0 }, + { "com3", CONSDEV_COM3, 0 }, + { "com0kbd", CONSDEV_COM0KBD, 0 }, + { "com1kbd", CONSDEV_COM1KBD, 0 }, + { "com2kbd", CONSDEV_COM2KBD, 0 }, + { "com3kbd", CONSDEV_COM3KBD, 0 }, + { "com", CONSDEV_COM0, -1 }, + { "auto", CONSDEV_AUTO, 0 }, + { NULL, 0 } +}; + void command_consdev(char *arg) { - - /* XXX not implemented yet */ + const struct cons_devs *cdp; + char *sep, *sep2 = NULL; + int ioport, speed = 0; + + sep = strchr(arg, ','); + if (sep != NULL) { + *sep++ = '\0'; + sep2 = strchr(sep, ','); + if (sep != NULL) + *sep2++ = '\0'; + } + + for (cdp = cons_devs; cdp->name; cdp++) { + if (strcmp(arg, cdp->name) == 0) { + ioport = cdp->ioport; + if (cdp->tag == CONSDEV_PC || cdp->tag == CONSDEV_AUTO) { +if (sep != NULL || sep2 != NULL) + goto error; + } else { +/* com? */ +if (ioport == -1) { + if (sep != NULL) { + u_long t = strtoul(sep, NULL, 0); + if (t > INT_MAX) + goto error; + ioport = (int)t; + } + if (sep2 != NULL) { + speed = atoi(sep2); + if (speed < 0) + goto error; + } +} else { + if (sep != NULL) { + speed = atoi(sep); + if (speed < 0) + goto error; + } + if (sep2 != NULL) + goto error; +} + } + consinit(cdp->tag, ioport, speed); + print_banner(); + return; + } + } +error: + printf("invalid console device.\n"); } #ifndef SMALL Index: src/sys/arch/i386/stand/efiboot/efiboot.h diff -u src/sys/arch/i386/stand/efiboot/efiboot.h:1.4 src/sys/arch/i386/stand/efiboot/efiboot.h:1.5 --- src/sys/arch/i386/stand/efiboot/efiboot.h:1.4 Sat Feb 11 10:23:39 2017 +++ src/sys/arch/i386/stand/efiboot/efiboot.h Mon May 1 13:03:01 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efiboot.h,v 1.4 2017/02/11 10:23:39 nonaka Exp $ */ +/* $NetBSD: efiboot.h,v 1.5 2017/05/01 13:03:01 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -55,6 +55,7 @@ void efi_cleanup(void); /* eficons.c */ int cninit(void); +void consinit(int, int, int); void command_text(char *); void command_gop(char *); Index: src/sys/arch/i386/stand/efiboot/eficons.c diff -u src/sys/arch/i386/stand/efiboot/eficons.c:1.3 src/sys/arch/i386/stand/efiboot/eficons.c:1.4 --- src/sys/arch/i386/stand/efiboot/eficons.c:1.3 Fri Mar 24 01:25:36 2017 +++ src/sys/arch/i386/stand/efiboot/eficons.c Mon May 1 13:03:01 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: eficons.c,v 1.3 2017/03/24 01:25:36 nonaka Exp $ */ +/* $NetBSD: eficons.c,v 1.4 2017/05/01 13:03:01 nonaka Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -34,6 +34,8 @@ #include "bootinfo.h" #include "vbe.h" +extern struct x86_boot_params boot_params; + struct btinfo_console btinfo_console; static EFI_GRAPHICS_OUTPUT_PROTOCOL *efi_gop; @@ -46,6 +48,68 @@ static int keybuf_write = 0; static void eficons_init_video(void); static void efi_switch_video_to_text_mode(void); +static int +getcomaddr(int idx) +{ + static const short comioport[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; + + if (idx < __arraycount(comioport)) + return comioport[idx]; + return 0; +} + +/* + * XXX onl
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: christos Date: Mon Dec 24 18:21:50 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot/bootia32: ldscript src/sys/arch/i386/stand/efiboot/bootx64: ldscript Log Message: Avoid error with new binutils: error: PHDR segment not covered by LOAD segment To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/bootia32/ldscript cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/bootx64/ldscript Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/bootia32/ldscript diff -u src/sys/arch/i386/stand/efiboot/bootia32/ldscript:1.1 src/sys/arch/i386/stand/efiboot/bootia32/ldscript:1.2 --- src/sys/arch/i386/stand/efiboot/bootia32/ldscript:1.1 Tue Jan 24 06:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/bootia32/ldscript Mon Dec 24 13:21:50 2018 @@ -1,7 +1,14 @@ -/* $NetBSD: ldscript,v 1.1 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: ldscript,v 1.2 2018/12/24 18:21:50 christos Exp $ */ OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386") OUTPUT_ARCH(i386) ENTRY(_start) + +PHDRS +{ + text PT_LOAD; + headers PT_PHDR FILEHDR PHDRS; +} + SECTIONS { . = 0; @@ -13,7 +20,7 @@ SECTIONS *(.text) *(.text.*) *(.gnu.linkonce.t.*) - } + } :text . = ALIGN(4096); .sdata : { Index: src/sys/arch/i386/stand/efiboot/bootx64/ldscript diff -u src/sys/arch/i386/stand/efiboot/bootx64/ldscript:1.1 src/sys/arch/i386/stand/efiboot/bootx64/ldscript:1.2 --- src/sys/arch/i386/stand/efiboot/bootx64/ldscript:1.1 Tue Jan 24 06:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/bootx64/ldscript Mon Dec 24 13:21:50 2018 @@ -1,8 +1,15 @@ -/* $NetBSD: ldscript,v 1.1 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: ldscript,v 1.2 2018/12/24 18:21:50 christos Exp $ */ /* Same as elf_x86_64_fbsd_efi.lds, except for OUTPUT_FORMAT below - KEEP IN SYNC */ OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") OUTPUT_ARCH(i386:x86-64) ENTRY(_start) + +PHDRS +{ + text PT_LOAD; + headers PT_PHDR FILEHDR PHDRS; +} + SECTIONS { . = 0; @@ -19,7 +26,7 @@ SECTIONS *(.text) *(.text.*) *(.gnu.linkonce.t.*) - } + } :text . = ALIGN(4096); .reloc : {
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: mlelstv Date: Fri Dec 11 08:04:20 UTC 2015 Modified Files: src/sys/arch/i386/stand/lib: dosfile.c Log Message: PR 50516 bad switch statement. Adding some comments. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/sys/arch/i386/stand/lib/dosfile.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/dosfile.c diff -u src/sys/arch/i386/stand/lib/dosfile.c:1.16 src/sys/arch/i386/stand/lib/dosfile.c:1.17 --- src/sys/arch/i386/stand/lib/dosfile.c:1.16 Sun Oct 20 21:06:37 2013 +++ src/sys/arch/i386/stand/lib/dosfile.c Fri Dec 11 08:04:20 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: dosfile.c,v 1.16 2013/10/20 21:06:37 christos Exp $ */ +/* $NetBSD: dosfile.c,v 1.17 2015/12/11 08:04:20 mlelstv Exp $ */ /* * Copyright (c) 1996 @@ -56,18 +56,22 @@ dos2errno(void) int err; switch (doserrno) { - case 1: - case 4: - case 12: + case 1: /* invalid function number */ + case 4: /* too many open files */ + case 12: /* invalid access mode */ default: err = EIO; - case 2: - case 3: + break; + case 2: /* file not found */ + case 3: /* path not found */ err = ENOENT; - case 5: + break; + case 5: /* access denied */ err = EPERM; - case 6: + break; + case 6: /* invalid handle */ err = EINVAL; + break; } return err; }
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: christos Date: Sun Dec 13 19:51:53 UTC 2015 Modified Files: src/sys/arch/i386/stand/lib: dosfile.c Log Message: better than returning random errors. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/i386/stand/lib/dosfile.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/dosfile.c diff -u src/sys/arch/i386/stand/lib/dosfile.c:1.17 src/sys/arch/i386/stand/lib/dosfile.c:1.18 --- src/sys/arch/i386/stand/lib/dosfile.c:1.17 Fri Dec 11 03:04:20 2015 +++ src/sys/arch/i386/stand/lib/dosfile.c Sun Dec 13 14:51:53 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: dosfile.c,v 1.17 2015/12/11 08:04:20 mlelstv Exp $ */ +/* $NetBSD: dosfile.c,v 1.18 2015/12/13 19:51:53 christos Exp $ */ /* * Copyright (c) 1996 @@ -70,6 +70,7 @@ dos2errno(void) err = EPERM; break; case 6: /* invalid handle */ + default: err = EINVAL; break; }
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: christos Date: Sun Dec 13 21:03:31 UTC 2015 Modified Files: src/sys/arch/i386/stand/lib: dosfile.c Log Message: one default is better than two To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/stand/lib/dosfile.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/dosfile.c diff -u src/sys/arch/i386/stand/lib/dosfile.c:1.18 src/sys/arch/i386/stand/lib/dosfile.c:1.19 --- src/sys/arch/i386/stand/lib/dosfile.c:1.18 Sun Dec 13 14:51:53 2015 +++ src/sys/arch/i386/stand/lib/dosfile.c Sun Dec 13 16:03:31 2015 @@ -1,4 +1,4 @@ -/* $NetBSD: dosfile.c,v 1.18 2015/12/13 19:51:53 christos Exp $ */ +/* $NetBSD: dosfile.c,v 1.19 2015/12/13 21:03:31 christos Exp $ */ /* * Copyright (c) 1996 @@ -70,7 +70,6 @@ dos2errno(void) err = EPERM; break; case 6: /* invalid handle */ - default: err = EINVAL; break; }
CVS commit: src/sys/arch/i386/stand/bootxx
Module Name:src Committed By: christos Date: Sun Jan 3 20:59:47 UTC 2016 Modified Files: src/sys/arch/i386/stand/bootxx: pbr.S Log Message: change 60 to 70 which is the current release. Noticed by Rares Aioanei. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 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.20 src/sys/arch/i386/stand/bootxx/pbr.S:1.21 --- src/sys/arch/i386/stand/bootxx/pbr.S:1.20 Tue Aug 16 20:07:38 2011 +++ src/sys/arch/i386/stand/bootxx/pbr.S Sun Jan 3 15:59:47 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: pbr.S,v 1.20 2011/08/17 00:07:38 jakllsch Exp $ */ +/* $NetBSD: pbr.S,v 1.21 2016/01/03 20:59:47 christos Exp $ */ /*- * Copyright (c) 2003,2004 The NetBSD Foundation, Inc. @@ -115,7 +115,7 @@ ENTRY(start) */ jmp start0 nop - .ascii "NetBSD60" /* oemname (8 bytes) */ + .ascii "NetBSD70" /* oemname (8 bytes) */ . = start + MBR_BPB_OFFSET /* move to start of BPB */ /* (ensures oemname doesn't overflow) */
CVS commit: src/sys/arch/i386/stand/bootxx
Module Name:src Committed By: christos Date: Mon Jan 4 18:17:31 UTC 2016 Modified Files: src/sys/arch/i386/stand/bootxx: pbr.S Log Message: revert, this has to do with the bootloader protocol version and should stay the same until there is a reason for it to change. To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 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.21 src/sys/arch/i386/stand/bootxx/pbr.S:1.22 --- src/sys/arch/i386/stand/bootxx/pbr.S:1.21 Sun Jan 3 15:59:47 2016 +++ src/sys/arch/i386/stand/bootxx/pbr.S Mon Jan 4 13:17:31 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: pbr.S,v 1.21 2016/01/03 20:59:47 christos Exp $ */ +/* $NetBSD: pbr.S,v 1.22 2016/01/04 18:17:31 christos Exp $ */ /*- * Copyright (c) 2003,2004 The NetBSD Foundation, Inc. @@ -115,7 +115,7 @@ ENTRY(start) */ jmp start0 nop - .ascii "NetBSD70" /* oemname (8 bytes) */ + .ascii "NetBSD60" /* oemname (8 bytes) */ . = start + MBR_BPB_OFFSET /* move to start of BPB */ /* (ensures oemname doesn't overflow) */
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: pgoyette Date: Sat Jan 27 22:25:23 UTC 2018 Modified Files: src/sys/arch/i386/stand/lib: bootinfo.h Log Message: Recent changes have increased the number of "things" the bootloader needs to deal with. Increase the table size so we don't overflow. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/sys/arch/i386/stand/lib/bootinfo.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/bootinfo.h diff -u src/sys/arch/i386/stand/lib/bootinfo.h:1.11 src/sys/arch/i386/stand/lib/bootinfo.h:1.12 --- src/sys/arch/i386/stand/lib/bootinfo.h:1.11 Sun Jun 5 14:13:57 2016 +++ src/sys/arch/i386/stand/lib/bootinfo.h Sat Jan 27 22:25:23 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: bootinfo.h,v 1.11 2016/06/05 14:13:57 maxv Exp $ */ +/* $NetBSD: bootinfo.h,v 1.12 2018/01/27 22:25:23 pgoyette Exp $ */ /* * Copyright (c) 1997 @@ -35,7 +35,7 @@ struct bootinfo { extern struct bootinfo *bootinfo; -#define BTINFO_MAX 32 +#define BTINFO_MAX 64 #define BI_ALLOC(max) (bootinfo = alloc(sizeof(struct bootinfo) \ + ((max) - 1) * sizeof(uint32_t))) \
CVS commit: src/sys/arch/i386/stand/mbr
Module Name:src Committed By: joerg Date: Sat Feb 17 13:54:52 UTC 2018 Modified Files: src/sys/arch/i386/stand/mbr: gptmbr.S src/sys/arch/i386/stand/mbr/gptmbr: Makefile Log Message: Drop explicit loop prefix. GAS doesn't care and LLVM doesn't support it. Drop the need for assembling with GAS. While LLVM is using a suboptimal encoding of for hard-coded memory writes, it shouldn't affect functionality. It just wastes three bytes with extra prefixes. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/mbr/gptmbr.S cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/mbr/gptmbr/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/gptmbr.S diff -u src/sys/arch/i386/stand/mbr/gptmbr.S:1.1 src/sys/arch/i386/stand/mbr/gptmbr.S:1.2 --- src/sys/arch/i386/stand/mbr/gptmbr.S:1.1 Wed Aug 17 00:25:05 2011 +++ src/sys/arch/i386/stand/mbr/gptmbr.S Sat Feb 17 13:54:52 2018 @@ -160,7 +160,7 @@ next: get_ptab: call read_sector call inc64 - loopw get_ptab + loop get_ptab /* Find the boot partition */ xorw %si,%si /* Nothing found yet */ @@ -182,7 +182,7 @@ find_part: movw %di,%si not_this: addw %ax,%di - loopw find_part + loop find_part andw %si,%si jnz found_part Index: src/sys/arch/i386/stand/mbr/gptmbr/Makefile diff -u src/sys/arch/i386/stand/mbr/gptmbr/Makefile:1.3 src/sys/arch/i386/stand/mbr/gptmbr/Makefile:1.4 --- src/sys/arch/i386/stand/mbr/gptmbr/Makefile:1.3 Wed Sep 21 18:15:59 2011 +++ src/sys/arch/i386/stand/mbr/gptmbr/Makefile Sat Feb 17 13:54:52 2018 @@ -1,10 +1,8 @@ -# $NetBSD: Makefile,v 1.3 2011/09/21 18:15:59 jakllsch Exp $ +# $NetBSD: Makefile,v 1.4 2018/02/17 13:54:52 joerg Exp $ PROG= gptmbr.bin SRCS= gptmbr.S -AFLAGS.gptmbr.S= ${${ACTIVE_CC} == "clang":?-no-integrated-as:} - .include <../Makefile.mbr> LOADADDR= 0x600
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: christos Date: Sun Jul 8 17:01:02 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile Log Message: use += :-) To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/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/efiboot/Makefile diff -u src/sys/arch/i386/stand/efiboot/Makefile:1.2 src/sys/arch/i386/stand/efiboot/Makefile:1.3 --- src/sys/arch/i386/stand/efiboot/Makefile:1.2 Sun Jul 8 12:50:28 2018 +++ src/sys/arch/i386/stand/efiboot/Makefile Sun Jul 8 13:01:02 2018 @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.2 2018/07/08 16:50:28 christos Exp $ +# $NetBSD: Makefile,v 1.3 2018/07/08 17:01:02 christos Exp $ SUBDIR= bootia32 .if ${MACHINE} == "amd64" -SUBDIR= bootx64 +SUBDIR+= bootx64 .endif .include
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: kre Date: Fri Aug 17 04:59:34 UTC 2018 Modified Files: src/sys/arch/i386/stand/efiboot: panic.c Log Message: Deal with gnu-efi upgrade - "efilib.h" now provides a prototype for VPrint() so it is no longer needed here, particularly not a slightly different prototype. Fixes the amd64 i386 & ia64 builds. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/efiboot/panic.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/panic.c diff -u src/sys/arch/i386/stand/efiboot/panic.c:1.4 src/sys/arch/i386/stand/efiboot/panic.c:1.5 --- src/sys/arch/i386/stand/efiboot/panic.c:1.4 Sat Feb 11 10:15:55 2017 +++ src/sys/arch/i386/stand/efiboot/panic.c Fri Aug 17 04:59:34 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: panic.c,v 1.4 2017/02/11 10:15:55 nonaka Exp $ */ +/* $NetBSD: panic.c,v 1.5 2018/08/17 04:59:34 kre Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -30,9 +30,6 @@ #include -/* from sys/external/bsd/gnu-efi/dist/lib/print.c */ -UINTN VPrint (IN CHAR16 *, va_list); - __dead VOID Panic( IN CHAR16 *fmt,
CVS commit: src/sys/arch/i386/stand/lib
Module Name:src Committed By: maxv Date: Sun Dec 4 08:21:08 UTC 2016 Modified Files: src/sys/arch/i386/stand/lib: biosmem.S biosmemps2.S biosmemx.S exec.c multiboot.S startprog.S Log Message: KNF and explain a few things To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/arch/i386/stand/lib/biosmem.S \ src/sys/arch/i386/stand/lib/biosmemx.S cvs rdiff -u -r1.6 -r1.7 src/sys/arch/i386/stand/lib/biosmemps2.S cvs rdiff -u -r1.61 -r1.62 src/sys/arch/i386/stand/lib/exec.c cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/lib/multiboot.S cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/lib/startprog.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/lib/biosmem.S diff -u src/sys/arch/i386/stand/lib/biosmem.S:1.9 src/sys/arch/i386/stand/lib/biosmem.S:1.10 --- src/sys/arch/i386/stand/lib/biosmem.S:1.9 Thu Jun 16 13:27:59 2011 +++ src/sys/arch/i386/stand/lib/biosmem.S Sun Dec 4 08:21:08 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: biosmem.S,v 1.9 2011/06/16 13:27:59 joerg Exp $ */ +/* $NetBSD: biosmem.S,v 1.10 2016/12/04 08:21:08 maxv Exp $ */ /* * Copyright (c) 1996 @@ -36,8 +36,9 @@ .text -/* get mem below 1M, in kByte */ - +/* + * Get mem below 1M, in kByte. + */ ENTRY(getbasemem) pusha @@ -45,18 +46,19 @@ ENTRY(getbasemem) .code16 int $0x12 - # zero-extend 16-bit result to 32 bits. - movzwl %ax, %eax + /* Zero-extend 16-bit result to 32 bits */ + movzwl %ax,%eax calll _C_LABEL(real_to_prot) .code32 - movl %eax, 28(%esp) + movl %eax,28(%esp) popa ret -/* get mem above 1M, in kByte */ - +/* + * Get mem above 1M, in kByte. + */ ENTRY(getextmem1) pusha @@ -66,13 +68,13 @@ ENTRY(getextmem1) movb $0x88,%ah int $0x15 - # zero-extend 16-bit result to 32 bits. - movzwl %ax, %eax + /* Zero-extend 16-bit result to 32 bits */ + movzwl %ax,%eax calll _C_LABEL(real_to_prot) .code32 - movl %eax, 28(%esp) + movl %eax,28(%esp) popa ret Index: src/sys/arch/i386/stand/lib/biosmemx.S diff -u src/sys/arch/i386/stand/lib/biosmemx.S:1.9 src/sys/arch/i386/stand/lib/biosmemx.S:1.10 --- src/sys/arch/i386/stand/lib/biosmemx.S:1.9 Tue Oct 14 14:18:11 2008 +++ src/sys/arch/i386/stand/lib/biosmemx.S Sun Dec 4 08:21:08 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: biosmemx.S,v 1.9 2008/10/14 14:18:11 ad Exp $ */ +/* $NetBSD: biosmemx.S,v 1.10 2016/12/04 08:21:08 maxv Exp $ */ /* * Copyright (c) 1997, 1999 @@ -30,11 +30,13 @@ .text -/* int getextmem2(int buffer[2]) - return: 0=OK, -1=error - buffer[0]: extmem kBytes below 16M (max 15M/1024) - buffer[1]: extmem above 16M, in 64k units -*/ +/* + * int getextmem2(int buffer[2]) + * + * return: 0=OK, -1=error + * buffer[0]: extmem kBytes below 16M (max 15M/1024) + * buffer[1]: extmem above 16M, in 64k units + */ ENTRY(getextmem2) pushl %ebp movl %esp,%ebp @@ -47,16 +49,16 @@ ENTRY(getextmem2) call _C_LABEL(prot_to_real) .code16 - xorl %ebx, %ebx - movl $0xe801, %eax + xorl %ebx,%ebx + movl $0xe801,%eax int $0x15 pushf - movw %si, %ax - orw %si, %bx + movw %si,%ax + orw %si,%bx jz 1f /* if zero use configured values */ - movw %cx, %ax /* k below 16M (max 0x3c00 = 15MB) */ - movw %dx, %bx /* 64k above 16M */ + movw %cx,%ax /* k below 16M (max 0x3c00 = 15MB) */ + movw %dx,%bx /* 64k above 16M */ 1: popf setc %bl @@ -64,13 +66,13 @@ ENTRY(getextmem2) calll _C_LABEL(real_to_prot) .code32 - movl 8(%ebp), %edi - xorl %eax, %eax - movw %cx, %ax + movl 8(%ebp),%edi + xorl %eax,%eax + movw %cx,%ax stosl - movw %dx, %ax + movw %dx,%ax stosl - movb %bl, %al + movb %bl,%al cbw pop %edi @@ -81,12 +83,14 @@ ENTRY(getextmem2) popl %ebp ret -/* int getmementry(int *iterator, buffer[5]) - return: 0=ok, else error - buffer[0]: start of memory chunk - buffer[2]: length (bytes) - buffer[4]: type -*/ +/* + * int getmementry(int *iterator, int buffer[5]) + * + * return: 0=ok, else error + * buffer[0]: start of memory chunk + * buffer[2]: length (bytes) + * buffer[4]: type + */ ENTRY(getmementry) pushl %ebp movl %esp,%ebp @@ -96,24 +100,24 @@ ENTRY(getmementry) push %esi push %edi - movl 8(%ebp), %eax - movl 0(%eax), %ebx /* index */ - movl $20, %ecx /* Buffer size */ - movl $0x534d4150, %edx /* "SMAP" */ - movl 12(%ebp), %edi /* buffer address */ + movl 8(%ebp),%eax + movl 0(%eax),%ebx /* index */ + movl $20,%ecx /* Buffer size */ + movl $0x534d4150,%edx /* "SMAP" */ + movl 12(%ebp),%edi /* buffer address */ call _C_LABEL(prot_to_real) .code16 push %di - shrl $4, %edi - mov %ds, %ax - add %di, %ax - mov %ax, %es + shrl $4,%edi + mov %ds,%ax + add %di,%ax + mov %ax,%es pop %di - and $0xf, %di /* buffer addres now in ES:DI */ + and $0xf,%di /* buffer addres now in ES:DI */ - movl $0xe820, %eax /* Some BIOS check EAX value */ + movl $0xe820,%eax /* Some BIOS check EAX value */ int $0x15 setc %cl @@ -
CVS commit: src/sys/arch/i386/stand/boot
Module Name:src Committed By: nia Date: Mon Jun 21 19:43:17 UTC 2021 Modified Files: src/sys/arch/i386/stand/boot: boot2.c Log Message: biosboot: Add ASCII art. To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 src/sys/arch/i386/stand/boot/boot2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.75 src/sys/arch/i386/stand/boot/boot2.c:1.76 --- src/sys/arch/i386/stand/boot/boot2.c:1.75 Sun May 30 05:59:22 2021 +++ src/sys/arch/i386/stand/boot/boot2.c Mon Jun 21 19:43:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.75 2021/05/30 05:59:22 mlelstv Exp $ */ +/* $NetBSD: boot2.c,v 1.76 2021/06/21 19:43:17 nia Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -311,12 +311,16 @@ print_banner(void) printf("%s\n", bootcfg_info.banner[n]); } else { #endif /* !SMALL */ - printf("\n" - ">> %s, Revision %s (from NetBSD %s)\n" - ">> Memory: %d/%d k\n", - bootprog_name, bootprog_rev, bootprog_kernrev, - getbasemem(), getextmem()); - + printf("\n"); + printf(" \\-__,--,___.\n"); + printf(" \\__,---` %s (from NetBSD %s)\n", + bootprog_name, bootprog_kernrev); + printf("\\ `---,_. Revision %s\n", bootprog_rev); + printf(" \\-,_,.---` Memory: %d/%d k\n", + getbasemem(), getextmem()); + printf(" \\\n"); + printf(" \\\n"); + printf("\\\n"); #ifndef SMALL } #endif /* !SMALL */
CVS commit: src/sys/arch/i386/stand/boot
Module Name:src Committed By: nia Date: Mon Jun 21 19:52:17 UTC 2021 Modified Files: src/sys/arch/i386/stand/boot: boot2.c Log Message: use a single printf call for readability To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/sys/arch/i386/stand/boot/boot2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/boot/boot2.c diff -u src/sys/arch/i386/stand/boot/boot2.c:1.76 src/sys/arch/i386/stand/boot/boot2.c:1.77 --- src/sys/arch/i386/stand/boot/boot2.c:1.76 Mon Jun 21 19:43:17 2021 +++ src/sys/arch/i386/stand/boot/boot2.c Mon Jun 21 19:52:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: boot2.c,v 1.76 2021/06/21 19:43:17 nia Exp $ */ +/* $NetBSD: boot2.c,v 1.77 2021/06/21 19:52:17 nia Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -311,16 +311,17 @@ print_banner(void) printf("%s\n", bootcfg_info.banner[n]); } else { #endif /* !SMALL */ - printf("\n"); - printf(" \\-__,--,___.\n"); - printf(" \\__,---` %s (from NetBSD %s)\n", - bootprog_name, bootprog_kernrev); - printf("\\ `---,_. Revision %s\n", bootprog_rev); - printf(" \\-,_,.---` Memory: %d/%d k\n", - getbasemem(), getextmem()); - printf(" \\\n"); - printf(" \\\n"); - printf("\\\n"); + printf("\n" + " \\-__,--,___.\n" + " \\__,---` %s (from NetBSD %s)\n" + "\\ `---,_. Revision %s\n" + " \\-,_,.---` Memory: %d/%d k\n" + " \\\n" + " \\\n" + "\\\n", + bootprog_name, bootprog_kernrev, + bootprog_rev, + getbasemem(), getextmem()); #ifndef SMALL } #endif /* !SMALL */
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: nia Date: Tue Jun 22 19:53:58 UTC 2021 Modified Files: src/sys/arch/i386/stand/efiboot: boot.c Log Message: efiboot (x86): add ASCII art To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/arch/i386/stand/efiboot/boot.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/boot.c diff -u src/sys/arch/i386/stand/efiboot/boot.c:1.18 src/sys/arch/i386/stand/efiboot/boot.c:1.19 --- src/sys/arch/i386/stand/efiboot/boot.c:1.18 Sun May 30 05:59:22 2021 +++ src/sys/arch/i386/stand/efiboot/boot.c Tue Jun 22 19:53:58 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.18 2021/05/30 05:59:22 mlelstv Exp $ */ +/* $NetBSD: boot.c,v 1.19 2021/06/22 19:53:58 nia Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -287,8 +287,19 @@ print_banner(void) for (n = 0; n < BOOTCFG_MAXBANNER && bootcfg_info.banner[n]; n++) printf("%s\n", bootcfg_info.banner[n]); - } else - command_version("short"); + } else { + printf("\n" + " \\-__,--,___.\n" + " \\__,---` %s (from NetBSD %s)\n" + "\\ `---,_. Revision %s\n" + " \\-,_,.---` Memory: %d/%d k\n" + " \\\n" + " \\\n" + "\\\n", + bootprog_name, bootprog_kernrev, + bootprog_rev, + getbasemem(), getextmem()); + } } void
CVS commit: src/sys/arch/i386/stand/bootxx
Module Name:src Committed By: gutteridge Date: Thu Jun 24 01:23:17 UTC 2021 Modified Files: src/sys/arch/i386/stand/bootxx: boot1.c Log Message: boot1.c: remove a comment that's no longer relevant/correct In r. 1.13, a check of the return value in fd was removed, and a comment about this ("...so keep going") added. Then in r. 1.19, the fd return value check was reinstated (as the true underlying errno could be masked by the fstat() call), so there is no "keep going" happening anymore. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/arch/i386/stand/bootxx/boot1.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/bootxx/boot1.c diff -u src/sys/arch/i386/stand/bootxx/boot1.c:1.20 src/sys/arch/i386/stand/bootxx/boot1.c:1.21 --- src/sys/arch/i386/stand/bootxx/boot1.c:1.20 Thu Jan 6 01:08:48 2011 +++ src/sys/arch/i386/stand/bootxx/boot1.c Thu Jun 24 01:23:16 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: boot1.c,v 1.20 2011/01/06 01:08:48 jakllsch Exp $ */ +/* $NetBSD: boot1.c,v 1.21 2021/06/24 01:23:16 gutteridge Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: boot1.c,v 1.20 2011/01/06 01:08:48 jakllsch Exp $"); +__RCSID("$NetBSD: boot1.c,v 1.21 2021/06/24 01:23:16 gutteridge Exp $"); #include #include @@ -106,7 +106,6 @@ boot1(uint32_t biosdev, uint64_t *sector fd = ob(); done: - /* if we fail here, so will fstat, so keep going */ if (fd == -1 || fstat(fd, &sb) == -1) return "Can't open /boot\r\n";
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: roy Date: Fri Feb 3 16:42:26 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: boot.c efimemory.c Log Message: rows is a uint ... it will always be greater than or equal to 0. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/boot.c \ src/sys/arch/i386/stand/efiboot/efimemory.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/boot.c diff -u src/sys/arch/i386/stand/efiboot/boot.c:1.1 src/sys/arch/i386/stand/efiboot/boot.c:1.2 --- src/sys/arch/i386/stand/efiboot/boot.c:1.1 Tue Jan 24 11:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/boot.c Fri Feb 3 16:42:26 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: boot.c,v 1.1 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: boot.c,v 1.2 2017/02/03 16:42:26 roy Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -540,7 +540,7 @@ command_devpath(char *arg) Print(L"%d:%d:%s\n", DevicePathType(dp), DevicePathSubType(dp), path); FreePool(path); - if (rows >= 0 && ++row >= rows) { + if (++row >= rows) { row = 0; Print(L"Press Any Key to continue :"); (void) awaitkey(-1, 0); @@ -607,7 +607,7 @@ command_efivar(char *arg) val ? val : L"(null)"); FreePool(val); - if (rows >= 0 && ++row >= rows) { + if (++row >= rows) { row = 0; Print(L"Press Any Key to continue :"); (void) awaitkey(-1, 0); Index: src/sys/arch/i386/stand/efiboot/efimemory.c diff -u src/sys/arch/i386/stand/efiboot/efimemory.c:1.1 src/sys/arch/i386/stand/efiboot/efimemory.c:1.2 --- src/sys/arch/i386/stand/efiboot/efimemory.c:1.1 Tue Jan 24 11:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/efimemory.c Fri Feb 3 16:42:26 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: efimemory.c,v 1.1 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: efimemory.c,v 1.2 2017/02/03 16:42:26 roy Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -288,7 +288,7 @@ efi_memory_show_map(bool sorted) md->Type >= __arraycount(efimemtypes) ? efimemstr : efimemtypes[md->Type]); - if (rows >= 0 && ++row >= rows) { + if (++row >= rows) { row = 0; Print(L"Press Any Key to continue :"); (void) awaitkey(-1, 0);
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: roy Date: Fri Feb 3 17:24:43 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile.efiboot Log Message: Fix build with clang. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/Makefile.efiboot Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/Makefile.efiboot diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.1 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.2 --- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.1 Tue Jan 24 11:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot Fri Feb 3 17:24:43 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.efiboot,v 1.1 2017/01/24 11:09:14 nonaka Exp $ +# $NetBSD: Makefile.efiboot,v 1.2 2017/02/03 17:24:43 roy Exp $ S= ${.CURDIR}/../../../../.. @@ -46,8 +46,10 @@ CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR CPPFLAGS+= -I${.OBJDIR} CPPFLAGS+= -I${.CURDIR}/../../lib +CWARNFLAGS.clang+= -Wno-invalid-noreturn #panic.c COPTS+= -ffreestanding -fPIC -fshort-wchar -fno-strict-aliasing -fno-builtin -COPTS+= -fno-stack-protector -falign-functions=16 +COPTS+= -fno-stack-protector +COPTS+= ${${ACTIVE_CC} == "gcc":? -falign-functions=16 :} CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -DEFIBOOT
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: roy Date: Sat Feb 4 13:36:07 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile.efiboot panic.c Log Message: Mark reboot() and _rtt() as __dead. Use __builtin_unreachable() to ensure Panic really is marked dead. Thanks to joerg@ To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/Makefile.efiboot cvs rdiff -u -r1.1 -r1.2 src/sys/arch/i386/stand/efiboot/panic.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/Makefile.efiboot diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.2 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.3 --- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.2 Fri Feb 3 17:24:43 2017 +++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot Sat Feb 4 13:36:07 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.efiboot,v 1.2 2017/02/03 17:24:43 roy Exp $ +# $NetBSD: Makefile.efiboot,v 1.3 2017/02/04 13:36:07 roy Exp $ S= ${.CURDIR}/../../../../.. @@ -46,7 +46,6 @@ CPPFLAGS+= -I$S -I${.CURDIR} -I${.CURDIR CPPFLAGS+= -I${.OBJDIR} CPPFLAGS+= -I${.CURDIR}/../../lib -CWARNFLAGS.clang+= -Wno-invalid-noreturn #panic.c COPTS+= -ffreestanding -fPIC -fshort-wchar -fno-strict-aliasing -fno-builtin COPTS+= -fno-stack-protector COPTS+= ${${ACTIVE_CC} == "gcc":? -falign-functions=16 :} Index: src/sys/arch/i386/stand/efiboot/panic.c diff -u src/sys/arch/i386/stand/efiboot/panic.c:1.1 src/sys/arch/i386/stand/efiboot/panic.c:1.2 --- src/sys/arch/i386/stand/efiboot/panic.c:1.1 Tue Jan 24 11:09:14 2017 +++ src/sys/arch/i386/stand/efiboot/panic.c Sat Feb 4 13:36:07 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: panic.c,v 1.1 2017/01/24 11:09:14 nonaka Exp $ */ +/* $NetBSD: panic.c,v 1.2 2017/02/04 13:36:07 roy Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -47,9 +47,10 @@ Panic( va_end(args); reboot(); /*NOTREACHED*/ + __builtin_unreachable(); } -void +__dead void reboot(void) { @@ -61,7 +62,7 @@ reboot(void) continue; } -void +__dead void _rtt(void) {
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: christos Date: Sat Feb 4 16:14:04 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile.efiboot Log Message: Don't error out for set but unused variables for now. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/efiboot/Makefile.efiboot Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/Makefile.efiboot diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.3 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.4 --- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.3 Sat Feb 4 08:36:07 2017 +++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot Sat Feb 4 11:14:04 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.efiboot,v 1.3 2017/02/04 13:36:07 roy Exp $ +# $NetBSD: Makefile.efiboot,v 1.4 2017/02/04 16:14:04 christos Exp $ S= ${.CURDIR}/../../../../.. @@ -48,6 +48,7 @@ CPPFLAGS+= -I${.CURDIR}/../../lib COPTS+= -ffreestanding -fPIC -fshort-wchar -fno-strict-aliasing -fno-builtin COPTS+= -fno-stack-protector +COPTS+= -Wno-error=unused-but-set-variable COPTS+= ${${ACTIVE_CC} == "gcc":? -falign-functions=16 :} CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -DEFIBOOT
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: joerg Date: Sun Feb 5 10:13:18 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: Makefile.efiboot Log Message: Unbreak clang again. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/sys/arch/i386/stand/efiboot/Makefile.efiboot Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/Makefile.efiboot diff -u src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.4 src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.5 --- src/sys/arch/i386/stand/efiboot/Makefile.efiboot:1.4 Sat Feb 4 16:14:04 2017 +++ src/sys/arch/i386/stand/efiboot/Makefile.efiboot Sun Feb 5 10:13:18 2017 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.efiboot,v 1.4 2017/02/04 16:14:04 christos Exp $ +# $NetBSD: Makefile.efiboot,v 1.5 2017/02/05 10:13:18 joerg Exp $ S= ${.CURDIR}/../../../../.. @@ -48,7 +48,7 @@ CPPFLAGS+= -I${.CURDIR}/../../lib COPTS+= -ffreestanding -fPIC -fshort-wchar -fno-strict-aliasing -fno-builtin COPTS+= -fno-stack-protector -COPTS+= -Wno-error=unused-but-set-variable +COPTS+= ${${ACTIVE_CC} == "gcc":? -Wno-error=unused-but-set-variable :} COPTS+= ${${ACTIVE_CC} == "gcc":? -falign-functions=16 :} CPPFLAGS+= -nostdinc -D_STANDALONE CPPFLAGS+= -DEFIBOOT
CVS commit: src/sys/arch/i386/stand/efiboot
Module Name:src Committed By: joerg Date: Sun Feb 5 10:13:43 UTC 2017 Modified Files: src/sys/arch/i386/stand/efiboot: panic.c Log Message: Be a bit nicer to outdated compilers and use __unreachable(). To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/arch/i386/stand/efiboot/panic.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/panic.c diff -u src/sys/arch/i386/stand/efiboot/panic.c:1.2 src/sys/arch/i386/stand/efiboot/panic.c:1.3 --- src/sys/arch/i386/stand/efiboot/panic.c:1.2 Sat Feb 4 13:36:07 2017 +++ src/sys/arch/i386/stand/efiboot/panic.c Sun Feb 5 10:13:43 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: panic.c,v 1.2 2017/02/04 13:36:07 roy Exp $ */ +/* $NetBSD: panic.c,v 1.3 2017/02/05 10:13:43 joerg Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -47,7 +47,7 @@ Panic( va_end(args); reboot(); /*NOTREACHED*/ - __builtin_unreachable(); + __unreachable(); } __dead void