[comp.os.os9] GIME & IRQ

jimomura@lsuc.on.ca (Jim Omura) (01/27/91)

     I recently got my CoCo3 back from repair and I was assuming that
I should re-install the diode fix for the IRQ line.  But I put that
IRQ fix in long ago, before I got the upgraded GIME chip.  Since the
problem was in the GIME chip, I was wondering if anybody knew whether
it was necessary to have the diode fix with the new GIME chip?  If
it has already been fixed, I'd rather not tamper with the circuit
again unnecessarily.  I'm going to have to do other work anyway. :-)
-- 
Jim Omura, 2A King George's Drive, Toronto, (416) 652-3880
lsuc!jimomura
Byte Information eXchange: jimomura

kdarling@hobbes.ncsu.edu (Kevin Darling) (01/28/91)

jimomura@lsuc.on.ca (Jim Omura) asks:
> Since the problem was in the GIME chip, I was wondering if
> anybody knew whether it was necessary to have the diode fix
> with the new GIME chip?

Hi Jim! Unless you're using a hacked clock module (perhaps Bruce's),
then yes, it is necessary. The GIME interrupt internals haven't changed.

Clarification: the problem is really that the software expected
different hardware interaction.  Apparently the interrupt hardware
was changed shortly before CC3 production started and yep, as
Murphy's Law dictates <g>, the info didn't get to the programmers.

Basically, the GIME acts as an edge-triggered device.  The stock L-II
interrupt routines expected the more common level-sensitive type.
 best - kevin <kdarling@catt.ncsu.edu>

df1m+@andrew.cmu.edu (David A. Faler) (01/29/91)

This is the first I've hear of a diode fix for the GIME.  What's it
for, and how is it done (if there is a file on the list about it, just
point me to it).

-----------------------------------------
David Faler
Carnegie~-Mellon (~)University
df1m+@andrew.cmu.edu

"It is not just a riot of blots and blurs and disjointed jottings linked by
 spurts of speed. . . it only looks as like it as damn it."
							- James Joyce

Disclaimer:  "Convictions cause convicts."
                                - Kerry Thornley

zambotti@wpowz.enet.dec.com (Walter Zambotti DEC) (01/30/91)

Hello Kevin,

it seems that you may know of how and where to get a copy of the
hacked clock module???

I am also interested in also receiving a copy if at possible.

regards,

Walter Zambotti
Perth Western Australia

p.s.

Quick question :

OS9 keeps a count of all the processes using a particular path descriptor!

It seesm that the PD does not store the full name of that path if it is a block
device file name!

How does OS9 know when multiple processes open the same file (in order
to keep track of file sharing and byte range locking)?

dibble@mcrware.UUCP (Peter Dibble) (02/01/91)

>It seesm that the PD does not store the full name of that path if it is a block
>device file name!
>
>How does OS9 know when multiple processes open the same file (in order
>to keep track of file sharing and byte range locking)?

File names turn out not to be good ways for RBF to identify files.
Comparing them involves a slow string comparison, but
the clincher is that given multiply linked files (not supported by
standard OS-9 utilities, but widely supported anyway.),
a file name, even a full path name, does not identify a
file  one-to-one.

The best (for RBF, and, reluctantly, for pcf) way to identify a file is
the the FD sector number.  Each file has one FD even if it has been
multiply linked with different names.

Now wonder why the PD stores the file name at all. :-)

Peter

kdarling@hobbes.ncsu.edu (Kevin Darling) (02/01/91)

zambotti@wpowz.enet.dec.com (Walter Zambotti DEC) writes:

> it seems that you may know of how and where to get a copy of the
> hacked clock module???

Hi. I think Rainbow magazine had a version of a hacked Clock (to toggle
the GIME) a few months back.  There may be other versions floating
around; I'll check (the only versions I have are unusable upgrade ones).

Basically, all you do is toggle the CART interrupt enable bit in the GIME
Off then back On... this retriggers an IRQ to the cpu if one or more devices
out on the MPI are still requesting service.  You do this after Clock
has finished calling the OS9 polling routine, of course (so that any
called device drivers have had a chance to clear their pending irqs).
   - kevin <kdarling@catt.ncsu.edu>

kdarling@hobbes.ncsu.edu (Kevin Darling) (02/01/91)

zambotti@wpowz.enet.dec.com (Walter Zambotti DEC) writes:

> p.s. Quick question :
> It seems that the PD does not store the full name of that path if it is a
>  block device file name!
> How does OS9 know when multiple processes open the same file (in order
>  to keep track of file sharing and byte range locking)?

You ask tough questions! ;-)  Short answer: it knows because the File
Descriptor sector is the same.  If same FD, then must be same file!
Each RBF Path Descriptor contains the FD LSN (or FD disk byte offset in
the case of OSK) for that file.

(FD pointers are also used whenever you do a "chx" or "chd"... the name
isn't stored, only a pointer to the FD for that directory.  Which is
why if you swap disks, you may need to "chd/x" again.)

Longer answer with details:

RBF keeps a linked list of open files; this list begins in the static
storage for each drive.  So for each open _file_, RBF can check if anyone
is already using it.  This PD list is sorted by their FD offsets.

Now when more than one _path_ is opened to the same file, that new path is
added to another linked list based on any previous path to that file.  

Example: let's say there were paths open to "/d0/startup", "/d0/src/bob.a",
and yet another path to "/d0/startup".  The links are:

 /d0 table ===>  Path Desc 1   ===>  Path Desc 1     ===> none
                 to "startup"        to "src/bob.a"
                     /\
                     ||
                     \/
                 Path Desc 2
                 to "startup"  (more paths would go below \/)

So if you did an I$Read from the second path to "startup", RBF could
easily use just that path's linked list to check on the locking variables
used by it and the other open path(s) to that same file... instead of
searching all PDs using that disk.

Mind you, I'm no expert on RBF internals.  I suspect that only a handful of
people are!  best - kevin <kdarling@catt.ncsu.edu>

zambotti@wpowz.enet.dec.com (Walter Zambotti DEC) (02/01/91)

Hi Kevin,

thanks for the answer to both may questions.  But can you further assist
please.

>Hi. I think Rainbow magazine had a version of a hacked Clock (to toggle
>the GIME) a few months back.  There may be other versions floating
>around; I'll check (the only versions I have are unusable upgrade ones).

I realy like the Rainbow and every week I still wander up to the news
agent to see if my copy has arrived but alas there has been no delivery
to Australia for sveral months now.

This would make it hard to get the clock hack from the Rainbow (bummer).
If you can get a posting of this patch to me somehow that would be
terrific.

I have tried to send mail to you via Xrn (the X news reader) but they
all bounce back.

Several other people on the *.*.EDU net have massaged to exchange mail
with myself if you could try replying to this article maybe the mail
channel can be opened up.

Also thanks for your description to how the FD sectors are used to keep
track of open files.  Makes much more sence now.

regards,

Walter