[comp.sys.amiga.tech] Disk Questions for WorkBench replacement project

c60c-1ea@web-4g.berkeley.edu (Yen Yuanchi Hsieh) (03/05/89)

Hi there, let's get right on down to the nitty gritty

1)  How does one go about locking the correct disk if two or more
have the same number.  eg. Workbench knows the difference between
SYS1 (disk 1) and SYS1 (disk2).  If disk2's icon is clicked on,
disk 1 is NOT loaded, but the user is asked to insert SYS1:.  How
does Workbench manage to lock the correct drive?

2)  in order to call format or diskcopy correctly, is any special
information passed on to these programs?  For instance, if the
user just clicks on the diskcopy icon, diskcopy asks to be invoked
from the menu.  What's the magic here?  Is it perhaps that the first
arg in WBargs is NOT the program diskcopy, but just the disks to
copy?

3)  same Question as 2) for format.

4)  I seem to be having trouble starting Shell from my replacement
workbench,  I get the newcon: all right, but I also get the error:
 "no K directive", and no Shell alias stuff, etc.  Any suggestions?

I'd really appreciate getting an answer to these questions.  After
I get this stuff working, I'll start on my last chores:
		Info
		LibEdit (for startups, default beep sounds, etc.)
And then I'll be done!!
So, I guess --

5)  Is there anyone out there willing to test/buy/write Info/etc?
I had a few people interested at one time, but they are bogged down
by work.  Please mail to c60c-1ea@WEB.Berkeley.Edu, I'm borrowing
an account here for just this purpose (No, no, it has nothing to do
with working on the Suns, I LIKE my AMIGA :-))

					Thanks very much!

David Navas  c60c-1ea@WEB.Berkeley.Edu

peter@sugar.hackercorp.com (Peter da Silva) (03/06/89)

In article <21173@agate.BERKELEY.EDU>, c60c-1ea@web-4g.berkeley.edu (Yen Yuanchi Hsieh) writes:
> 1)  How does one go about locking the correct disk if two or more
> have the same number.  eg. Workbench knows the difference between
> SYS1 (disk 1) and SYS1 (disk2).  If disk2's icon is clicked on,
> disk 1 is NOT loaded, but the user is asked to insert SYS1:.  How
> does Workbench manage to lock the correct drive?

I believe WB maintains a list of locks. When it gets a DISKCHANGE it unlocks
them and tries again. If you have an open lock, of course, it gets the
same disk from the device list.

I don't believe that any other program can do this, because you'd never
have workbench and your program releasing its lock list at the same time.
For Browser, I just gave up and go by the volume name. If you're replacing
Workbench completely, you can of course do it the way they do it.

Sigh.

> 2)  in order to call format or diskcopy correctly, is any special
> information passed on to these programs?

Good question. I'd like to know this too.

> 3)  same Question as 2) for format.

Ditto.

> 5)  Is there anyone out there willing to test/buy/write Info/etc?
> I had a few people interested at one time, but they are bogged down
> by work.

William LeFevbre at (phil@rice.edu) did a display-only 'info' program for
Browser. You might want to ask him.
-- 
Peter "Have you hugged your wolf today" da Silva      `-_-'
...texbell!sugar!peter, or peter@sugar.hackercorp.com  'U`

w-colinp@microsoft.UUCP (Colin Plumb) (03/07/89)

c60c-1ea@web-4g.berkeley.edu (Yen Yuanchi Hsieh) wrote:
> 1)  How does one go about locking the correct disk if two or more
> have the same number.

I'd suppose it would just keep a lock on the drive.  It's been so long,
I forget what WB's bahaviour is in this area.

> 2)  in order to call format or diskcopy correctly, is any special
> information passed on to these programs?

I think Workbench just Execute()s them.  Note that this is not what happens
when you double-click (argc == 0 and all that).
-- 
	-Colin (uunet!microsoft!w-colinp)

"Don't listen to me.  I never do." - The Doctor

c60c-1ea@web-1a.berkeley.edu (Yen Yuanchi Hsieh) (03/08/89)

In article <821@microsoft.UUCP> you write:
:>c60c-1ea@web-4g.berkeley.edu (David Navas) wrote:
:>> 1)  How does one go about locking the correct disk if two or more
:>> have the same number.

:>I'd suppose it would just keep a lock on the drive.  It's been so long,
:>I forget what WB's bahaviour is in this area.

   Fortunately, I've fixed (hopefully) that problem by doing some real nasty,
   stuff with the DeviceList.  I just pull the correct volume-node to the top
   and then do my regular Lock call.  I don't even want to think what will happen
   with 1.4 ....
:>> 2)  in order to call format or diskcopy correctly, is any special
:>> information passed on to these programs?

:>I think Workbench just Execute()s them.  Note that this is not what happens
:>when you double-click (argc == 0 and all that).
:>-- 
:>	-Colin (uunet!microsoft!w-colinp)

   Actually, Workbench does pass a very funny pointer in place of the Name ptr
in the second (of two) arguments for format.  (IE, it does NOT merely Execute()
it).  The other Name is something like "sys:system/format", and the locks
are NULL, and lock to disk to be formatted (NULL if disk is bad).  Here's the
thing folks, this variable is NOT device dependent, or disk dependent.  The pointer
usually only changes when a DISKINSERTED message is sent, although the information
which is referenced by this mystery pointer has a tendency to do very unstable
things.  What IS this thing?  It's driving me up a wall..


David Navas c60c-1ea@WEB.Berkeley.Edy

simon@copper.columbia.edu (Thor Simon) (03/08/89)

I vaguely recall hearing something in this group earlier during the
discussion of Project D about some copy-protection schemes looking at
the time/date stamp on the disk.  Hunh.  I didn't think there was a
time/date stamp on the format itself.  Maybe I'm wrong, but if not,
this could be a cheap way out, as that would make it two IDs (name and
date) rather than one.

kodiak@amiga.UUCP (Robert R. Burns) (03/10/89)

In article ... (Yen Yuanchi Hsieh) writes:
>c60c-1ea@web-4g.berkeley.edu (David Navas) wrote:
>>1)  How does one go about locking the correct disk if two or more
>>have the same number.

>Fortunately, I've fixed (hopefully) that problem by doing some real nasty,
>stuff with the DeviceList.  I just pull the correct volume-node to the top
>and then do my regular Lock call.  I don't even want to think what will happen
>with 1.4 ....

1.  This solution does not feel multi-tasking safe.  What if two people are
    trying this technique at the same time?
    a.  Note: all access to the DeviceList must be done within Forbid/Permit
	protection.
    b.  Lock will Wait, and thus break any Forbid.  That's when the second
	person using this technique can swizzle you.

2.  My first suggestion is to match the ambiguous volume name to the
    non-ambiguous device name by scanning the device list and matching the
    "task" fields.  This suggestion falls flat when applied to handlers that
    have no corresponding device.

3.  My robust suggestion is to recognize that the "task" fields are actually
    the process message ports for the associated file handler, and to invoke
    the lock directly using the packet interface available at this port.  I
    leave the details to the reader... :-)
-- 
Bob Burns, amiga!kodiak        "five year    .         _
| /_  _|. _ |      Commodore __   service  _/ \_      |_) _ |_  _ )'
|<(_)(_)|(_\|<      /\ |  ||| _` /\  pin" `.(5).'     |_)(_\| )(_\ |
| \ Software    ___/..\|\/|||__|/..\___    /.^.\               Faith

c60c-1ea@web-3a.berkeley.edu (Yen Yuanchi Hsieh) (03/11/89)

Thanks Bob, I should have realized using ->dl_Task message passing was a good
idea, as I have to use this method to get a correct DiskType reading on the
devices.  For those locking disks using this method -- remember, don't
include a lock or a name as the (first and second?) arguments,
leave them NULL.

And if ->dl_Task == NULL and ->dl_LockList != NULL, do a 
DupLock(->dl_LockList).  Hope this helps somebody.

For format (haven't gotten to DiskCopy), pass the device name as the name
argument.  This definitely is what is there for bad disks.  For good disks --
I don't know WHAT to pass.  But the lock on that disk seems sufficient.

Any comments on that?   :-)

David Navas c60c-1ea@WEB.Berkeley.Edu

jms@antares.UUCP (Joe Smith) (03/13/89)

In article <6200@columbia.edu> simon@copper.UUCP (Thor Simon) writes:
>I vaguely recall hearing something in this group earlier during the
>discussion of Project D about some copy-protection schemes looking at
>the time/date stamp on the disk.  Hunh.  I didn't think there was a
>time/date stamp on the format itself.  Maybe I'm wrong, but if not,
>this could be a cheap way out, as that would make it two IDs (name and
>date) rather than one.

AmigaDOS disks have two dates in the root block.  One is updated whenever
anything is written on the disk, the other is set when the disk is formatted
or diskcopied.  The DISKCOPY that comes with Workbench makes a track-for-track
copy of the disk with two exceptions.  1) The name is set to "copy of ..." and
2) the volume creation date is set to the current date/time.  Even if you
you relabel the disk so that it has the same name as the original, Workbench
can tell them apart due to the different volume creation dates.  If you run
a different diskcopy program, one that makes an exact duplicate, then you
should remove the duplicate before exiting the copy program so that
Workbench will not be confused by seeing two disks with the same name and
same creation date in two different drives.

Technical details:

  A block of 512 bytes is treated as 128 words of 32 bits each.  Words 105-107
contain the volume modification date/time.  Words 108-120 have the volume
name.  Words 121-123 contain the volume creation date/time.
-- 
Joe Smith (408)922-6220 | jms@antares.Tymnet.COM or jms@opus.Tymnet.COM
McDonnell Douglas FSCO  | UUCP: ...!{ames,pyramid}!oliveb!tymix!antares!jms
PO Box 49019, MS-D21    | PDP-10:JMS@F74.Tymnet.COM  CA license plate:"POPJ P,"
San Jose, CA 95161-9019 | narrator.device: "I didn't say that, my Amiga did!"

phil@hypatia.rice.edu (William LeFebvre) (03/15/89)

In article <3585@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes:
>In article <21173@agate.BERKELEY.EDU>, c60c-1ea@web-4g.berkeley.edu (Yen Yuanchi Hsieh) writes:
>>...
>> 5)  Is there anyone out there willing to test/buy/write Info/etc?
>> I had a few people interested at one time, but they are bogged down
>> by work.
>
>William LeFevbre at (phil@rice.edu) did a display-only 'info' program for
>Browser. You might want to ask him.

Well, Peter, the version I gave you was display-only.  V1.1 has the
ability to change  the protection bits and the comment (it displays the
date, too, which the version you got didn't do).  As soon as I'm convinced
that sending it to comp.{binaries,sources}.amiga will result in something
positive happening (and as soon as I make it a little more user-friendly,
v1.2) I will send it off to those groups.

The source/binaries groups started back up for a bit and then seemed to
have fallen flat again.  Is this just our site or is this universal?

As for doing Info for a workbench replacement, I think I would be
interested....I'll send mail to Yen Hsieh.

			William LeFebvre
			Department of Computer Science
			Rice University
			<phil@Rice.edu>