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, ) == -1) return "Can't open /boot\r\n";
CVS commit: src/sys/arch/i386/stand/bootxx/bootxx_msdos
Module Name:src Committed By: martin Date: Wed Jan 22 06:13:18 UTC 2020 Modified Files: src/sys/arch/i386/stand/bootxx/bootxx_msdos: Makefile Log Message: Clamp FAT partition size to 32 bit byte offsets to make the code small enough to fit. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile diff -u src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile:1.3 src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile:1.4 --- src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile:1.3 Sun Dec 11 12:17:48 2005 +++ src/sys/arch/i386/stand/bootxx/bootxx_msdos/Makefile Wed Jan 22 06:13:18 2020 @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.3 2005/12/11 12:17:48 christos Exp $ +# $NetBSD: Makefile,v 1.4 2020/01/22 06:13:18 martin Exp $ PROG= bootxx_msdos FS= dosfs -CPPFLAGS=-DBOOT_FROM_FAT -DTERSE_ERROR +CPPFLAGS=-DBOOT_FROM_FAT -DTERSE_ERROR -DSA_DOSFS_NO_BIG_PART_SUPPORT .include <../Makefile.bootxx>
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/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: 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/bootxx
Module Name:src Committed By: christos Date: Fri Nov 1 00:18:24 UTC 2013 Modified Files: src/sys/arch/i386/stand/bootxx: Makefile.bootxx Log Message: provide an ldscript to strip the unwind sections XXX: untested To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 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.45 src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.46 --- src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.45 Wed Aug 21 20:13:00 2013 +++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx Thu Oct 31 20:18:24 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootxx,v 1.45 2013/08/22 00:13:00 matt Exp $ +# $NetBSD: Makefile.bootxx,v 1.46 2013/11/01 00:18:24 christos Exp $ S= ${.CURDIR}/../../../../.. @@ -109,6 +109,7 @@ KERN_AS=library .include ${S}/lib/libkern/Makefile.inc LIBKERN=${KERNLIB} +LDSCRIPT ?= $S/arch/i386/conf/stand.ldscript cleandir distclean: .WAIT cleanlibdir @@ -122,7 +123,7 @@ CLEANFILES+= ${PROG}.sym ${PROG}.map ${PROG}: ${OBJS} ${LIBLIST} ${_MKTARGET_LINK} ${CC} -o ${PROG}.sym ${LDFLAGS} -Wl,-Ttext,${PRIMARY_LOAD_ADDRESS} \ - -Wl,-Map,${PROG}.map -Wl,-cref ${OBJS} ${LIBLIST} + -T ${LDSCRIPT} -Wl,-Map,${PROG}.map -Wl,-cref ${OBJS} ${LIBLIST} ${OBJCOPY} -O binary ${PROG}.sym ${PROG} @ sz=$$(${TOOL_STAT} -f '%z' ${PROG}); \ if [ $$sz -gt ${BOOTXX_MAXSIZE} ]; then \
CVS commit: src/sys/arch/i386/stand/bootxx
Module Name:src Committed By: matt Date: Thu Aug 22 00:13:00 UTC 2013 Modified Files: src/sys/arch/i386/stand/bootxx: Makefile.bootxx Log Message: Add a missing KLINK_MACHINE= i386 To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 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.44 src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.45 --- src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.44 Wed Aug 21 08:15:19 2013 +++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx Thu Aug 22 00:13:00 2013 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootxx,v 1.44 2013/08/21 08:15:19 matt Exp $ +# $NetBSD: Makefile.bootxx,v 1.45 2013/08/22 00:13:00 matt Exp $ S= ${.CURDIR}/../../../../.. @@ -138,4 +138,5 @@ ${PROG}: ${OBJS} ${LIBLIST} fi .include bsd.prog.mk +KLINK_MACHINE= i386 .include bsd.klinks.mk
CVS commit: src/sys/arch/i386/stand/bootxx
Module Name:src Committed By: jakllsch Date: Wed Aug 17 00:07:39 UTC 2011 Modified Files: src/sys/arch/i386/stand/bootxx: pbr.S Log Message: Remove home grown GPT MBR handoff support in favor of T13 EDD-4 annex A, which does the same thing in a more interoperable way. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 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.19 src/sys/arch/i386/stand/bootxx/pbr.S:1.20 --- src/sys/arch/i386/stand/bootxx/pbr.S:1.19 Thu Jan 6 01:08:48 2011 +++ src/sys/arch/i386/stand/bootxx/pbr.S Wed Aug 17 00:07:38 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pbr.S,v 1.19 2011/01/06 01:08:48 jakllsch Exp $ */ +/* $NetBSD: pbr.S,v 1.20 2011/08/17 00:07:38 jakllsch Exp $ */ /*- * Copyright (c) 2003,2004 The NetBSD Foundation, Inc. @@ -97,8 +97,9 @@ * sector we were loaded from (if we were loaded by NetBSD mbr code). * In any case we have to re-read sector zero of the disk and hunt * through the BIOS partition table for the NetBSD partition. - * However, if there's a magic number in %eax, then %ecx:%ebx - * contains the sector we were loaded from. + * + * Or, we may have been loaded by a GPT hybrid MBR, handoff state is + * specified in T13 EDD-4 annex A. */ .text @@ -121,19 +122,16 @@ . = start + MBR_AFTERBPB /* skip BPB */ start0: + xor %cx, %cx /* don't trust values of ds, es or ss */ + mov %cx, %ss + mov %cx, %sp + mov %cx, %es #ifndef BOOT_FROM_FAT - movl %eax, %edi /* move %eax magic out of the way */ -#endif - xor %ax, %ax /* don't trust values of ds, es or ss */ - mov %ax, %ds - mov %ax, %es - mov %ax, %ss - mov $0xfffc, %sp - -#ifndef BOOT_FROM_FAT - cmpl $X86_MBR_GPT_MAGIC, %edi /* did mbr_gpt leave us a LBA? */ + cmpl $0x54504721, %eax /* did a GPT hybrid MBR start us? */ je boot_gpt #endif + mov %cx, %ds + xor %ax, %ax /* A 'reset disk system' request is traditional here... */ push %dx /* some BIOS zap %dl here :-( */ @@ -141,7 +139,7 @@ pop %dx /* Read from start of disk */ - movw $0x0001, %cx /* track zero sector 1 */ + incw %cx /* track zero sector 1 */ movb %ch, %dh /* dh = head = 0 */ call chs_read @@ -368,10 +366,12 @@ #ifndef BOOT_FROM_FAT boot_gpt: - /* 64-bit LBA in %ecx:%ebx */ - movl %ebx, lba_sector - movl %ecx, lba_sector + 4 - movl %ebx, %ebp + movl (20+32+0)(%si), %ebp + movl (20+32+4)(%si), %edi + movw %cx, %ds + movl %ebp, lba_sector + 0 + movl %edi, lba_sector + 4 + movl %ebp, %esi jmp boot_lba #endif
CVS commit: src/sys/arch/i386/stand/bootxx
Module Name:src Committed By: jakllsch Date: Sun Jan 2 02:01:58 UTC 2011 Modified Files: src/sys/arch/i386/stand/bootxx: pbr.S Log Message: Correct comments referencing PRIMARY_LOAD_ADDRESS to match current reality. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 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.17 src/sys/arch/i386/stand/bootxx/pbr.S:1.18 --- src/sys/arch/i386/stand/bootxx/pbr.S:1.17 Mon Nov 30 21:37:16 2009 +++ src/sys/arch/i386/stand/bootxx/pbr.S Sun Jan 2 02:01:58 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: pbr.S,v 1.17 2009/11/30 21:37:16 dsl Exp $ */ +/* $NetBSD: pbr.S,v 1.18 2011/01/02 02:01:58 jakllsch Exp $ */ /*- * Copyright (c) 2003,2004 The NetBSD Foundation, Inc. @@ -40,11 +40,11 @@ * The job of this code is to read in the phase 1 bootstrap. * * Makefile supplies: - * PRIMARY_LOAD_ADDRESS: Address we load code to (0x600). + * PRIMARY_LOAD_ADDRESS: Address we load code to (0x1000). * BOOTXX_SECTORS: Number of sectors we load (15). * X86_BOOT_MAGIC_1: A random magic number. * - * Although this code is executing at 0x7c00, it is linked to address 0x600. + * Although this code is executing at 0x7c00, it is linked to address 0x1000. * All data references MUST be fixed up using R(). */ @@ -91,7 +91,7 @@ * (for a floppy) or the mbr boot code. Since the boot program will * be loaded to address 1000:0, we don't need to relocate ourselves * and can load the subsequent blocks (that load boot) to an address - * of our choosing. 0:600 is a not unreasonable choice. + * of our choosing. 0:1000 is a not unreasonable choice. * * On entry the BIOS drive number is in %dl and %esi may contain the * sector we were loaded from (if we were loaded by NetBSD mbr code).
CVS commit: src/sys/arch/i386/stand/bootxx
Module Name:src Committed By: christos Date: Fri Jan 1 03:18:27 UTC 2010 Modified Files: src/sys/arch/i386/stand/bootxx: boot1.c Log Message: If the open fails, don't call fstat, because this changes the errno to EINVAL from eg. ENOENT. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 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.18 src/sys/arch/i386/stand/bootxx/boot1.c:1.19 --- src/sys/arch/i386/stand/bootxx/boot1.c:1.18 Wed Nov 18 16:02:16 2009 +++ src/sys/arch/i386/stand/bootxx/boot1.c Thu Dec 31 22:18:27 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: boot1.c,v 1.18 2009/11/18 21:02:16 dsl Exp $ */ +/* $NetBSD: boot1.c,v 1.19 2010/01/01 03:18:27 christos Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__RCSID($NetBSD: boot1.c,v 1.18 2009/11/18 21:02:16 dsl Exp $); +__RCSID($NetBSD: boot1.c,v 1.19 2010/01/01 03:18:27 christos Exp $); #include lib/libsa/stand.h #include lib/libkern/libkern.h @@ -107,9 +107,8 @@ done: /* if we fail here, so will fstat, so keep going */ - if (fstat(fd, sb) == -1) { + if (fd == -1 || fstat(fd, sb) == -1) return Can't open /boot\r\n; - } biosdev = (uint32_t)sb.st_size; #if 0
CVS commit: src/sys/arch/i386/stand/bootxx
Module Name:src Committed By: dsl Date: Mon Nov 30 21:37:16 UTC 2009 Modified Files: src/sys/arch/i386/stand/bootxx: pbr.S Log Message: Update 'oemname' to NetBSD60. To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 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.16 src/sys/arch/i386/stand/bootxx/pbr.S:1.17 --- src/sys/arch/i386/stand/bootxx/pbr.S:1.16 Mon Apr 28 20:23:25 2008 +++ src/sys/arch/i386/stand/bootxx/pbr.S Mon Nov 30 21:37:16 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: pbr.S,v 1.16 2008/04/28 20:23:25 martin Exp $ */ +/* $NetBSD: pbr.S,v 1.17 2009/11/30 21:37:16 dsl Exp $ */ /*- * Copyright (c) 2003,2004 The NetBSD Foundation, Inc. @@ -112,7 +112,7 @@ */ jmp start0 nop - .ascii NetBSD40 /* 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/bootxx
Module Name:src Committed By: dsl Date: Mon Nov 30 21:40:35 UTC 2009 Modified Files: src/sys/arch/i386/stand/bootxx: Makefile.bootxx Log Message: Move relocation address to lower memory (0x1000) further away from the BIOS 40:0 segment than previously but giving more room for heap that 0x8800. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 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.37 src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.38 --- src/sys/arch/i386/stand/bootxx/Makefile.bootxx:1.37 Fri Nov 20 17:28:19 2009 +++ src/sys/arch/i386/stand/bootxx/Makefile.bootxx Mon Nov 30 21:40:35 2009 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.bootxx,v 1.37 2009/11/20 17:28:19 dsl Exp $ +# $NetBSD: Makefile.bootxx,v 1.38 2009/11/30 21:40:35 dsl Exp $ S= ${.CURDIR}/../../../../.. @@ -10,7 +10,7 @@ BINDIR= /usr/mdec BINMODE= 0444 -PRIMARY_LOAD_ADDRESS=0x8800 +PRIMARY_LOAD_ADDRESS=0x1000 SECONDARY_LOAD_ADDRESS=0x1 # We ought (need?) to fit into track 0 of a 1.2M floppy.