9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] dossrv vs. camera sd fat
@ 2008-09-14 16:00 erik quanstrom
  0 siblings, 0 replies; only message in thread
From: erik quanstrom @ 2008-09-14 16:00 UTC (permalink / raw)
  To: 9fans

it seems that the check in dossrv/dossubs.c:/^isdosfs does not
agree with the layout on the sd stick in my camera.

it turns out that although the first and last bytes of the magic
(jump instruction) have traditional values, the jump offset is
0.  i suspect this is an oversight.  (who boots from a camera
sd?)

this is the change i made last night that at the time seemed
a bit over-agressive:

; diff -c dossubs.c /n/dump/2008/0913/sys/src/cmd/dossrv/dossubs.c
dossubs.c:22,31 - /n/dump/2008/0913/sys/src/cmd/dossrv/dossubs.c:22,29
  	/*
  	 * Check if the jump displacement (magic[1]) is too short for a FAT.
  	 */
- 	if(buf[0] == 0xEB && buf[2] == 0x90 /*&& buf[1] >= 0x30*/)
+ 	if(buf[0] == 0xEB && buf[2] == 0x90 && buf[1] >= 0x30)
  		return 1;

i thought perhaps the test should be

- 	if(buf[0] == 0xEB && buf[2] == 0x90 && (buf[1] >= 0x30 || buf[1] == 0))

however, after a bit more digging, the ecma-107 standard says:
(http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-107.pdf, page 11.)

"This field shall be reserved for system use.
Its content is not specified by this ECMA Standard
and shall be ignored in interchange."

it seems like the isdosfs checks are actually contrary
to the standard, though they generally seem to work
i assume since most fat are ment to be bootable.

anyone with any perspective on this?

- erik




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-14 16:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-14 16:00 [9fans] dossrv vs. camera sd fat erik quanstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).