Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Replace boot_ustar with xxboot_ustarfs.



details:   https://anonhg.NetBSD.org/src/rev/ba780a929990
branches:  trunk
changeset: 937345:ba780a929990
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sun Aug 16 07:03:45 2020 +0000

description:
Replace boot_ustar with xxboot_ustarfs.
The old boot_ustar had many hard coding and was small(<1KB).
The new xxboot_ustarfs is a part of integrated larger(<8KB) xxboot.
We had to maintain three similar but not the same bootloaders, but
now we have two!

diffstat:

 distrib/sets/lists/base/md.x68k                    |    5 +-
 distrib/x68k/floppies/bootfloppy.generic/Makefile  |    4 +-
 distrib/x68k/floppies/bootfloppy.sysinst/Makefile  |    4 +-
 sys/arch/x68k/stand/Makefile                       |    3 +-
 sys/arch/x68k/stand/README                         |    9 +-
 sys/arch/x68k/stand/boot_ustar/Makefile            |   52 -----
 sys/arch/x68k/stand/boot_ustar/boot_ustar.S        |  187 ---------------------
 sys/arch/x68k/stand/boot_ustar/boot_ustar.ldscript |   51 -----
 sys/arch/x68k/stand/boot_ustar/version             |    8 -
 sys/arch/x68k/stand/xxboot/Makefile                |    3 +-
 10 files changed, 14 insertions(+), 312 deletions(-)

diffs (truncated from 433 to 300 lines):

diff -r 8565ef223097 -r ba780a929990 distrib/sets/lists/base/md.x68k
--- a/distrib/sets/lists/base/md.x68k   Sun Aug 16 06:43:43 2020 +0000
+++ b/distrib/sets/lists/base/md.x68k   Sun Aug 16 07:03:45 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: md.x68k,v 1.46 2013/08/11 22:29:02 joerg Exp $
+# $NetBSD: md.x68k,v 1.47 2020/08/16 07:03:45 isaki Exp $
 ./dev/pow0                                     base-obsolete           obsolete
 ./dev/pow1                                     base-obsolete           obsolete
 ./usr/bin/bellctrl                             base-util-bin
@@ -9,7 +9,7 @@
 ./usr/bin/tvctrl                               base-util-bin
 ./usr/mdec/boot                                        base-sysutil-bin
 ./usr/mdec/fdboot_ufs                          base-sysutil-bin
-./usr/mdec/fdboot_ustar                                base-sysutil-bin
+./usr/mdec/fdboot_ustar                                base-obsolete           obsolete
 ./usr/mdec/installboot                         base-sysutil-bin
 ./usr/mdec/installboot.new                     base-obsolete           obsolete
 ./usr/mdec/loadbsd.x                           base-sysutil-bin
@@ -24,6 +24,7 @@
 ./usr/mdec/xxboot_lfsv1                                base-sysutil-bin
 ./usr/mdec/xxboot_lfsv2                                base-sysutil-bin
 ./usr/mdec/xxboot_ufs                          base-sysutil-bin
+./usr/mdec/xxboot_ustarfs                      base-sysutil-bin
 ./usr/sbin/memswitch                           base-sysutil-bin
 ./usr/sbin/poffd                               base-obsolete           obsolete
 ./usr/share/keymaps/x68k/ascii_kmap            base-sys-share
diff -r 8565ef223097 -r ba780a929990 distrib/x68k/floppies/bootfloppy.generic/Makefile
--- a/distrib/x68k/floppies/bootfloppy.generic/Makefile Sun Aug 16 06:43:43 2020 +0000
+++ b/distrib/x68k/floppies/bootfloppy.generic/Makefile Sun Aug 16 07:03:45 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.9 2014/08/05 15:40:58 apb Exp $
+#      $NetBSD: Makefile,v 1.10 2020/08/16 07:03:45 isaki Exp $
 
 .include <bsd.own.mk>
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -17,7 +17,7 @@
 FLOPPY_NETBSD= netbsd.gz
 # XXXDISTRIB: use MI installboot
 FLOPPYINSTBOOT=\
-       "dd if=${MDEC}/fdboot_ustar of=@IMAGE@ bs=8k count=1 conv=sync,notrunc"
+       "dd if=${MDEC}/xxboot_ustarfs of=@IMAGE@ bs=8k count=1 conv=sync,notrunc"
 
 CLEANFILES+=   ${BOOTNAME} netbsd.gz
 
diff -r 8565ef223097 -r ba780a929990 distrib/x68k/floppies/bootfloppy.sysinst/Makefile
--- a/distrib/x68k/floppies/bootfloppy.sysinst/Makefile Sun Aug 16 06:43:43 2020 +0000
+++ b/distrib/x68k/floppies/bootfloppy.sysinst/Makefile Sun Aug 16 07:03:45 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.13 2012/11/04 13:12:10 isaki Exp $
+#      $NetBSD: Makefile,v 1.14 2020/08/16 07:03:45 isaki Exp $
 
 .include <bsd.own.mk>
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
@@ -19,7 +19,7 @@
 FLOPPY_NETBSD= ${KERNOBJ}/netbsd-INSTALL.gz
 # XXXDISTRIB: use MI installboot
 FLOPPYINSTBOOT=\
-       "dd if=${MDEC}/fdboot_ustar of=@IMAGE@ bs=8k count=1 conv=sync,notrunc"
+       "dd if=${MDEC}/xxboot_ustarfs of=@IMAGE@ bs=8k count=1 conv=sync,notrunc"
 
 CLEANFILES+=   ${BOOTNAME}
 
diff -r 8565ef223097 -r ba780a929990 sys/arch/x68k/stand/Makefile
--- a/sys/arch/x68k/stand/Makefile      Sun Aug 16 06:43:43 2020 +0000
+++ b/sys/arch/x68k/stand/Makefile      Sun Aug 16 07:03:45 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.14 2020/08/14 03:29:23 isaki Exp $
+#      $NetBSD: Makefile,v 1.15 2020/08/16 07:03:45 isaki Exp $
 
 # host tools
 SUBDIR= newdisk installboot
@@ -9,7 +9,6 @@
 # standalone bootloaders
 SUBDIR+= mboot
 SUBDIR+= boot_ufs
-SUBDIR+= boot_ustar
 SUBDIR+= xxboot
 SUBDIR+= boot netboot
 
diff -r 8565ef223097 -r ba780a929990 sys/arch/x68k/stand/README
--- a/sys/arch/x68k/stand/README        Sun Aug 16 06:43:43 2020 +0000
+++ b/sys/arch/x68k/stand/README        Sun Aug 16 07:03:45 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: README,v 1.1 2020/01/18 04:42:29 isaki Exp $
+$NetBSD: README,v 1.2 2020/08/16 07:03:45 isaki Exp $
 
 Primary bootloaders:
        boot_ufs/
@@ -9,15 +9,14 @@
                and can recognize Human68k partition table.
                (See #ifdef SCSI_ADHOC_BOOTPART part for details)
 
-       boot_ustar/
-               is placed in floppy's sector#0 and loads secondary bootloader
-               from subsequent USTARFS.
-
        xxboot/
                contains following variants.
                * cdboot_cd9660
                        is placed in CD and loads secondary bootloader
                        from cd9660 filesystem.
+               * fdboot_ustarfs
+                       is placed in floppy's sector#0 and loads secondary
+                       bootloader from subsequent USTARFS.
                * xxboot_ffsv1
                * xxboot_ffsv2
                * xxboot_lfsv1
diff -r 8565ef223097 -r ba780a929990 sys/arch/x68k/stand/boot_ustar/Makefile
--- a/sys/arch/x68k/stand/boot_ustar/Makefile   Sun Aug 16 06:43:43 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-#      $NetBSD: Makefile,v 1.30 2020/01/18 07:25:11 isaki Exp $
-
-NOMAN=         # defined
-
-.include <bsd.own.mk>
-
-BOOT=  boot_ustar
-VERSIONFILE=   ${.CURDIR}/version
-VERSION!=      ${TOOL_AWK} -F: '$$1 ~ /^[0-9.]*$$/ { it = $$1; } \
-                       END { print it }' ${VERSIONFILE}
-NEWVERSWHAT=   "${BOOT}"
-
-# text and bss addresses
-TEXT=          0x2000          # Primary (me)
-BOOT_TEXT=     0x6000          # Secondary (/boot)
-
-BOOT_MAXSIZE=  65536           # size enough to read /boot whole
-
-PROG=          fd$(BOOT)
-BINDIR=                /usr/mdec
-STRIPFLAG=
-BINMODE=       444
-
-S=             ${.CURDIR}/../../../..
-M=             $S/arch/x68k
-COMMONDIR=     $M/stand/common
-LIBIOCS=       $M/stand/libiocs
-SRCS=  boot_ustar.S
-
-
-.include "${S}/conf/newvers_stand.mk"
-
-CPPFLAGS+= -DTEXTADDR="$(TEXT)" -DBOOT_TEXTADDR="$(BOOT_TEXT)"
-CPPFLAGS+= -DBOOT_MAXSIZE="$(BOOT_MAXSIZE)"
-CPPFLAGS+= -DBOOT=\"$(BOOT)\" -DBOOT_VERS=\"$(VERSION)\"
-CPPFLAGS+= -I${COMMONDIR} -I${LIBIOCS} -I${S} -I. -D_STANDALONE
-CFLAGS+=   -m68000
-AFLAGS=           ${CFLAGS:M-[ID]*}
-AFLAGS+=   -Wa,-march=m68000 -Wa,-mcpu=m68000
-LINKFLAGS=   -n -Bstatic -T ${.CURDIR}/${BOOT}.ldscript
-LINKFLAGS+=  --defsym=TEXTADDR=$(TEXT)
-LINKFLAGS+=  --defsym=BOOT_TEXTADDR=$(BOOT_TEXT)
-
-.include "${.CURDIR}/../Makefile.booters"
-.include "${S}/../common/lib/libc/Makefile.inc"
-
-
-${PROG}: $(OBJS)
-       ${_MKTARGET_LINK}
-       $(LD) $(LINKFLAGS) -o ${PROG} $(OBJS) $(LDADD)
-
-.include <bsd.prog.mk>
diff -r 8565ef223097 -r ba780a929990 sys/arch/x68k/stand/boot_ustar/boot_ustar.S
--- a/sys/arch/x68k/stand/boot_ustar/boot_ustar.S       Sun Aug 16 06:43:43 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,187 +0,0 @@
-| file: boot_ustar.S
-| author: chapuni(webmaster%chapuni.com@localhost)
-|         ITOH Yasufumi
-|        minoura%NetBSD.org@localhost
-|
-| $NetBSD: boot_ustar.S,v 1.12 2020/01/18 06:00:04 isaki Exp $
-
-| supports floppy only
-
-#include <sys/reboot.h>
-#include <machine/asm.h>
-#include <machine/bootinfo.h>
-#include "iocscall.h"
-
-#define BOOT_ERROR(s)  jbsr boot_error; .asciz s; .even
-#define SRAM_MEMSIZE   (0x00ed0008)
-
-       .text
-ASENTRY_NOPROFILE(start)
-ASENTRY_NOPROFILE(top)
-               bras    _ASM_LABEL(entry0)
-               .ascii  "SHARP/"
-               .ascii  "X680x0"
-               .word   0x8199,0x94e6,0x82ea,0x82bd
-               .word   0x8e9e,0x82c9,0x82cd,0x8cbb
-               .word   0x8ec0,0x93a6,0x94f0,0x8149
-               .word   0
-ASENTRY_NOPROFILE(entry0)
-               IOCS(__BOOTINF)
-               lsll    #8,%d0          | clear MSByte
-               lsrl    #8,%d0          |
-
-               |
-               | 0x80...0x8F           SASI
-               | 0x90...0x93           Floppy
-               | 0xED0000...0xED3FFE   SRAM
-               | others                ROM (SCSI?)
-               |
-               movel   %d0,%d6
-               clrb    %d0
-               tstl    %d0
-               jne     boot_dev_unsupported
-
-               bra     _ASM_LABEL(entry)
-
-|      Disklabel= 404bytes
-|      Since LABELOFFSET in <machine/disklabel.h> is 0x40,
-|      entry must be after 0x000001d4 (0x000021d4)
-               .org    0x40
-disklabel:
-               .space  404
-
-ASENTRY_NOPROFILE(entry)
-               | Initialize the screen first.  Some IPL (060turbo ROM or
-               | genuine boot selector) doesn't initialize the screen.
-               moveq   #0x10,%d1
-               IOCS(__CRTMOD)
-
-               | We use 68020 instructions, and check MPU beforehand.
-               | Here "moveql #-1,%d0" = 0x70ff, and subsequent moveb loads
-               |   0xff if MPU <= 010 (chkmpu+2 + %d0.w)
-               |   0x70 if MPU >= 020 (chkmpu+2 + %d0.w*2).
-               | This is a move, not a tst instruction because tst with
-               | pc-relative is not available on 000/010.
-chkmpu:
-               moveql  #-1,%d0
-               .word   0x103b, 0x02fe  | moveb %pc@(chkmpu+2,%d0:W:2),%d0
-               jpl     mpuok           | MC68020 or later
-               BOOT_ERROR("MPU 68000?");
-mpuok:
-               |
-               | SASI or Floppy
-               |
-               movel   %d6,%d0
-               andib   #0xFC,%d0
-               cmpib   #0x90,%d0
-               jne     boot_dev_unsupported    | boot from SASI?
-               |
-               | Floppy
-               |   read /boot.
-               |
-               |   This boot_ustar has the 1KB size restriction and
-               |   it is impossible to detect /boot's actual size in this
-               |   restriction.  So define BOOT_MAXSIZE (in Makefile) as
-               |   the size enough to read /boot whole.
-               |
-               andib   #0x03,%d0       | drive # (head=0)
-               jbsr    check_fd_format
-               moveb   %d6,%d2
-               lslw    #8,%d2
-               moveq   #0x70,%d1
-               orw     %d2,%d1         | PDA*256 + MODE
-               movel   %d0,%d2         | read position (first sector)
-               movel   #(BOOT_MAXSIZE+8192+0x200),%d3  | read bytes
-               moval   #(BOOT_TEXTADDR-8192-0x200-32),%a1
-               moval   %a1,%a4         | save buffer addr
-               IOCS(__B_READ)
-               jra     boot_read_done
-
-#include "chkfmt.s"
-
-boot_dev_unsupported:
-               BOOT_ERROR("unsupported boot device")
-
-booterr_msg:   .ascii  "\r\n\n"
-               .ascii  BOOT
-               .asciz  ": "
-reboot_msg:    .asciz  "\r\n[Hit key to reboot]"
-               .even
-
-ASENTRY_NOPROFILE(boot_error)
-               lea     %pc@(booterr_msg),%a1
-               IOCS(__B_PRINT)
-               moveal  %sp@+,%a1
-               IOCS(__B_PRINT)
-               lea     %pc@(reboot_msg),%a1
-               IOCS(__B_PRINT)
-
-               | wait for a key press (or release of a modifier)
-               IOCS(__B_KEYINP)
-
-               | issue software reset
-               trap    #10
-               | NOTREACHED
-
-boot_read_done:
-               lea     %a4@(8192),%a1          | USTAR header
-               cmpl    #0x55535441,%a1@        | filename `USTA
-               bne     error_invalidname
-               cmpl    #0x522e766f,%a1@(4)     |           R.vo...'
-               bne     error_invalidname
-               cmpl    #0x00757374,%a1@(256)   | magic `\0ust'
-               bne     error_invalidfs



Home | Main Index | Thread Index | Old Index