[comp.sys.m6809] OS9 CHD command

ac@utgpu.UUCP (03/30/87)

   In the process of trying to debug a problem I am having with my OS9
level II software (probably due to a bad disk controller) I discovered
an interesting (mis??)feature of the CHD command.  Basically my 
discovery went something like this.  Since my Os9 level II system would
not run with my disk controller I zapped it to run a 1MHz instead of 2MHz.
Everything seemed to work fine then until I issued a CHD command at which
point my system would crash.  Next I found that CHD would work OK as long
as the disk was not write protected.  Eventually I got to borrow someone
else's controller and when I booted OS9 level II it worked fine including
CHD.  Then I fired up debug and zapped $FFD8 to slow down the processor
and the CHD problem showed up again.  (I would appreciate it if some of
you try the slowdown zap on your machines to see if CHD still works.)  I
also noticed that at fast speed there was a distinct difference in the
seeking noises the drive made when I issued CHD against a protected
verses unprotected disk.  At least this discovery was consistent with
it crashing in one case and not the other since up until this point I
had no reason to believe CHD would even notice the difference.  At
this point I decided to play around with CHD on OS9 level I version 2.00.00 
for comparison.  It also exibited this diffence of seeking depending on
whether the disk was write protected or not.  So I looked more carefully
at the disk I was doing the CHD on and found what was happening.  Not
only does the shell open directories with update for CHD commands but
it updates the 'last modified' date in the directory's file descriptor.
In other words, put a disk in a drive, do a CHD to some directory on the
disk and you just actually wrote on that disk!!!!  This is something of a
shock since in the past I have occasionally put a master in a drive
without write protecting it and then used CHD while browsing it.
I also tried version 1.00.00 and noticed the lack of extra seeking noises
for protected disks with it so this feature showed up in 1.00.01 or 
2.00.00.       

-- 

Name:     Mark Acfield (University of Toronto Computing Services)
Path:     ihnp4!utgpu!ac   
Alias:    ac@utoronto.bitnet

rsanders@watdcsu.UUCP (03/31/87)

In article <1987Mar30.153438.8840@gpu.utcs.toronto.edu> ac@gpu.utcs.toronto.edu (Mark Acfield) writes:
>
>   In the process of trying to debug a problem I am having with my OS9
>level II software (probably due to a bad disk controller) I discovered
>an interesting (mis??)feature of the CHD command.

(Long description of problem ommited)

>Not only does the shell open directories with update for CHD commands but
>it updates the 'last modified' date in the directory's file descriptor.
>In other words, put a disk in a drive, do a CHD to some directory on the
>disk and you just actually wrote on that disk!!!!  This is something of a
>shock since in the past I have occasionally put a master in a drive
>without write protecting it and then used CHD while browsing it.
>I also tried version 1.00.00 and noticed the lack of extra seeking noises
>for protected disks with it so this feature showed up in 1.00.01 or 
>2.00.00.       

He mentions that the problem (CHD writing) is apparent in OS9 Level I 2.00.00
on the CoCo 1 and 2, and OS9 Level II 2.00.01 on the CoCo 3.

Given that I dont get a writeprotect error on 2.00.00 when CHDing to a
protected disk I assume that if CHD cannot write it traps that error
and does not complain.

The question becomes two fold. First is this description really accurate?
How about it Microware? Does CHD really update the Date on the disk?
I know it has to read to get the pointer to the directory. ( ie the shell
does not just remember the pathname). And second, is this a desirable behaviour? 
   
-- 
  Roger Sanderson: {clyde|decvax|ihnp4}-\
                             {tektronix}-+--> watmath!watdcsu!rsanders
                     {ubc-vision|utzoo}-/