[comp.sys.amiga] Format of libraries on disk , L:DISK-VALIDATOR , speeddir

bryce@COGSCI.BERKELEY.EDU (Bryce Nesbitt) (05/23/87)

[ If you can't read this, you need a newer version of news ]

In article <8705231146.AA11986@ingres.Berkeley.EDU> Doug Merrit typed:
> I've been trying to figure out how you can look at the contents of a
> library file and determine that it is indeed a library, and not a
> "real" executable (they both start with magic number 0x000003f3). Can
> anyone tell me, or better yet, tell me where this is documented?

The "cheap" way is to look at the code.  It is probably a library if it
starts like:

	moveq	#XX,d0
	rts

"Wack" would be able to show this to you.  Libraries also have an ID string
near the start.  You could use TYPE as hex and look for:

	000003E9	;hunk_code
	XXXXXXXX	;Size, BCPLized
	70XX4E75	;The above code.  The XX's are because while all
			;supplied libraries return zero, I feel it would
			;make more sense to return 20, -1 or $BADC0DE.

[ Click into CLI.  Type as hex, redirect to RAM disk.  Fire
up editor, strip junk, toss to clipboard.  Start assembly at priority -1.
Click into terminal.  Upload clipboard to vi...]

...
0050: 000003E9 000000A2 70004E75 4AFC0000    ........p.NuJ...
...   ^^^^^^^^ ^^^^^^^^ ^^^^^^^^
0070: 002B0000 00486963 6F6E2E6C 69627261    .+...Hicon.libra
0080: 72790069 636F6E20 33332E31 32372028    ry.icon 33.127 (
0090: 3232204A 756C2031 39383629 0D0A0000    22 Jul 1986)....
...

-=> Single tasking? Just say *NO!* <=-


For the full scoop on libraries see the Skeleton code in Appendix K of 
the RKM.


> Question two: although I have a list of info about gurus online, I was
> surprised that I couldn't seem to find that documented in the RKM (or
> anywhere else), either...

Appendix C or E      : exec/alerts.h or exec/alerts.i
Intuition Appendix A : DisplayAlert

Also in the Infominder version of the RKM, under exec, the description for
Alert.  That documentation, however, clearly states that more documentation 
is needed. (like the format for the frame pointed to by A5 8-).


> Doug Merritt	ucbvax!ingres!hatcher

That's the nutty old UUCP format.  Your nice new, slick domain format is:

hatcher@ingres.Berkeley.EDU


In article <who_cares> Scott Turner typed:
> While I'm on the disk-validator... Anyone out there want to recode this thing?
>
> [Just] think, we could kill two
> birds with one stone. Faster rebuilds, and peace of mind for C-A corporate.

Hold on a sec.  Rewind and check that logic.  Peace of mind because someone
just cloned your property and is giving it away free?

If you are writing a new disk validator don't go and burn your source code
because of this.  I would like a vaidator that can't .period. can't be
fooled by a corrupt disk.  ( Same goes for the Mac :-).

Diskdoctor could easily be modified to be l:disk-validator.  It would
need to be modified to bring up a window to track the progress of the
repair.  (With <do it> and <cancel> buttons so you don't *have* to let
it try to validate a disk.)


In article <??> someone@something@somwhere.abstraction typed:
> [speeddir's] block count will be wrong if sparse blocks are in effect.

This was known at the time it was written.

Background:  ExNext reads all of a file's extension blocks to count the
number of total blocks in the file.  Speeddir divides file size by
bytes_per_block.  This produces a bad count if "sparse" or partially
full blocks exist in a file.  The first is slow but slightly more
correct.

1> Can anything other than a sector editor produce a sparse file?
2> Is there *any* use for a sparse file at the filesystem level?
   Name *one* use that could not be better served in another manner,
   I'm curious!

The solution to retain the advantages of both ExNext and speeddir is to
have the filesystem fill in the already reserved slot for the number
of blocks in the file.  For most updates to a file this would take
0 extra time.  (for some it may mean an extra write to the I-node)

-------------
         Ack!  (NAK,EOT,SOH)
 |\ /|  .
 {o O} .  bryce@cogsci.berkeley.EDU -or- ucbvax!cogsci!bryce
 ( " ) 
   U      Ban the BPTR!  (Rotating message, just like the surgeon general. :-)