Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2002 20:50:03 -0700 (PDT)
From:      Tim Kientzle <kientzle@acm.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: misc/43543: cdboot does not handle 'relaxed' ISO9660 discs
Message-ID:  <200210010350.g913o3dN020727@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR misc/43543; it has been noted by GNATS.

From: Tim Kientzle <kientzle@acm.org>
To: Giorgos Keramidas <keramida@FreeBSD.org>
Cc: bug-followup@FreeBSD.org
Subject: Re: misc/43543: cdboot does not handle 'relaxed' ISO9660 discs
Date: Mon, 30 Sep 2002 20:43:56 -0700

 I don't see the point of this.  FreeBSD/UFS
 is case sensitive, and the boot loader should
 always be called '/boot/loader'.  (I doubt
 the hard-disk boot blocks look for anything
 other than the all-lowercase version.)
 
 Supporting the all-uppercase '/BOOT/LOADER' is
 a concession to ISO9660, which encourages the
 use of all-uppercase names for compatibility
 (i.e., MSDOS).  Note that the uppercase version
 appears only in the internal disc catalog; the
 running system will see the lowercase RockRidge
 names, which are stored separately.  (With the
 -U option, mkisofs will put lowercase chars
 into the catalog.  People are starting to recommend
 that option for bootable discs of this sort,
 hence the need for my patch.)  The "/boot/loader"
 name should never appear in mixed case.
 
 In fact, case-insensitive comparisons are arguably
 wrong.  If someone has both "/boot/loader" and
 "/BoOt/LoAdEr" on the same disk, you want to
 always grab "/boot/loader".  With your change,
 you'd get whichever one appeared first in
 the catalog.  (In fact, my original patch should
 probably be modified to try the lower-case version
 first, then the uppercase.)
 
 Code size is not an issue.  CD sector sizes
 are 2048, the current code is under 1200 bytes.
 You'd have to add a lot to change the disc usage
 at all.  Beyond that, 'no emulation' booting is
 supposed to allow arbitrarily large boot files,
 so there should be no practical limitation.
 
 Tim Kientzle
 
 Giorgos Keramidas wrote:
 
 > On 2002-09-30 15:21, Tim Kientzle <kientzle@acm.org> wrote:
 > 
 >>Alter 'cdboot' to try both filenames.
 >>The following patch accomplishes this.
 >>
 > 
 > Nice idea.  But will this work for "/Boot/Loader" too?
 > Is it possible to look for the name in any capitalisation?
 > 
 > Perhaps by changing the bit in find_file that compares the filenames
 > to ignore differences in lowercase and uppercase letters?  I haven't
 > looked in x86 asm for a while, but how about something like this?
 > 
 > * Note: This grows the size of the code a lot, and I haven't checked
 > to see if it actually works, as I am in the middle of a long running
 > buildworld.  It's just an idea.
 > 
 > %%%
 > Index: cdboot.s
 > ===================================================================
 > RCS file: /home/ncvs/src/sys/boot/i386/cdboot/cdboot.s,v
 > retrieving revision 1.9
 > diff -u -r1.9 cdboot.s
 > --- cdboot.s	7 Nov 2001 01:20:33 -0000	1.9
 > +++ cdboot.s	1 Oct 2002 01:25:09 -0000
 > @@ -365,9 +365,22 @@
 >  		ret				# End of file, so not found
 >  ff.checkname:	lea DIR_NAME(%bx),%di		# Address name in record
 >  		push %si			# Save
 > -		repe cmpsb			# Compare name
 > +ff.cmpname:	push %ax
 > +		lodsb				# fetch name char
 > +		dec %di
 > +		cmp $65,%al			# less than 'A' ?
 > +		jb ff.lcase
 > +		cmp $90,%al			# above 'Z' ?
 > +		ja ff.lcase
 > +		add $32,%al			# convert to lowercase
 > +		stosb				# store back in name
 > +		dec %di
 > +ff.lcase:	pop %ax
 > +		cmpsb				# Compare lowercase char.
 > +		jnz ff.out			# Not a match.
 > +		loop ff.cmpname			# Keep looking in name.
 >  		jcxz ff.match			# We have a winner!
 > -		pop %si				# Restore
 > +ff.out:		pop %si				# Restore
 >  		jmp ff.nextrec			# Keep looking.
 >  ff.match:	add $2,%sp			# Discard saved %si
 >  		clc				# Clear carry
 > %%%
 > 
 > 
 > 
 
 
 

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210010350.g913o3dN020727>