Module Name:    src
Committed By:   isaki
Date:           Sat Jun 25 04:08:57 UTC 2016

Modified Files:
        src/sys/arch/x68k/stand/boot_ustar: Makefile boot_ustar.S

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


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/x68k/stand/boot_ustar/Makefile
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/x68k/stand/boot_ustar/boot_ustar.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/x68k/stand/boot_ustar/Makefile
diff -u src/sys/arch/x68k/stand/boot_ustar/Makefile:1.21 src/sys/arch/x68k/stand/boot_ustar/Makefile:1.22
--- src/sys/arch/x68k/stand/boot_ustar/Makefile:1.21	Wed Apr 16 14:33:43 2014
+++ src/sys/arch/x68k/stand/boot_ustar/Makefile	Sat Jun 25 04:08:57 2016
@@ -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 @@ NEWVERSWHAT=	"${BOOT}"
 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 @@ vers.c:	${VERSIONFILE}
 	    ${.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

Index: src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S
diff -u src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S:1.7 src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S:1.8
--- src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S:1.7	Mon Feb 21 02:31:58 2011
+++ src/sys/arch/x68k/stand/boot_ustar/boot_ustar.S	Sat Jun 25 04:08:57 2016
@@ -3,7 +3,7 @@
 |         ITOH Yasufumi
 |	  [email protected]
 |
-| $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 @@ ASENTRY_NOPROFILE(entry)
 		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 @@ ASENTRY_NOPROFILE(entry)
 		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)

Reply via email to