Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x68k/stand/boot_ustar Define BOOT_MAXSIZE instead o...



details:   https://anonhg.NetBSD.org/src/rev/99a5598183c5
branches:  trunk
changeset: 346094:99a5598183c5
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sat Jun 25 04:08:57 2016 +0000

description:
Define BOOT_MAXSIZE instead of magic number.
Present size 56832 is 65536 - 8192 - 0x200 and is the same size
as before.

diffstat:

 sys/arch/x68k/stand/boot_ustar/Makefile     |   5 ++++-
 sys/arch/x68k/stand/boot_ustar/boot_ustar.S |  11 ++++++++---
 2 files changed, 12 insertions(+), 4 deletions(-)

diffs (61 lines):

diff -r 5f0a98bb8ceb -r 99a5598183c5 sys/arch/x68k/stand/boot_ustar/Makefile
--- a/sys/arch/x68k/stand/boot_ustar/Makefile   Fri Jun 24 23:04:09 2016 +0000
+++ b/sys/arch/x68k/stand/boot_ustar/Makefile   Sat Jun 25 04:08:57 2016 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.21 2014/04/16 14:33:43 tsutsui Exp $
+#      $NetBSD: Makefile,v 1.22 2016/06/25 04:08:57 isaki Exp $
 
 NOMAN=         # defined
 
@@ -14,6 +14,8 @@
 TEXT=          002000          # Primary (me)
 BOOT_TEXT=     006000          # Secondary (/boot)
 
+BOOT_MAXSIZE=  56832           # size enough to read /boot whole
+
 PROG=          fd$(BOOT)
 BINDIR=                /usr/mdec
 STRIPFLAG=
@@ -33,6 +35,7 @@
            ${.ALLSRC} ${MACHINE} ${NEWVERSWHAT}
 
 CPPFLAGS+= -DTEXTADDR="0x$(TEXT)" -DBOOT_TEXTADDR="0x$(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
diff -r 5f0a98bb8ceb -r 99a5598183c5 sys/arch/x68k/stand/boot_ustar/boot_ustar.S
--- a/sys/arch/x68k/stand/boot_ustar/boot_ustar.S       Fri Jun 24 23:04:09 2016 +0000
+++ b/sys/arch/x68k/stand/boot_ustar/boot_ustar.S       Sat Jun 25 04:08:57 2016 +0000
@@ -3,7 +3,7 @@
 |         ITOH Yasufumi
 |        minoura%NetBSD.org@localhost
 |
-| $NetBSD: boot_ustar.S,v 1.7 2011/02/21 02:31:58 itohy Exp $
+| $NetBSD: boot_ustar.S,v 1.8 2016/06/25 04:08:57 isaki Exp $
 
 | supports floppy only
 
@@ -60,7 +60,12 @@
                jne     boot_dev_unsupported    | boot from SASI?
                |
                | Floppy
-               |   read first 64KB (XXX: CONSTANT!!)
+               |   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
@@ -69,7 +74,7 @@
                moveq   #0x70,%d1
                orw     %d2,%d1         | PDA*256 + MODE
                movel   %d0,%d2         | read position (first sector)
-               movel   #65536,%d3      | read bytes
+               movel   #(BOOT_MAXSIZE+8192+0x200),%d3  | read bytes
                moval   #(BOOT_TEXTADDR-8192-0x200-32),%a1
                moval   %a1,%a4         | save buffer addr
                IOCS(__B_READ)



Home | Main Index | Thread Index | Old Index