CVS log for floppy-darwin/floppy.cpp

Up to floppy-darwin/
Request diff between arbitrary revisions
1.59 Sun Jun 23 3:03:07 2002 by dgatwood
CVS Tags: RELEASE_0_96, HEAD
Diffs to 1.58

Removed unnecessary test delays, cleaned up some debugging noise, and
cleaned up a compile warning.


dgatwood@mklinux.org

1.58 Fri Jun 21 21:34:15 2002 by dgatwood
Diffs to 1.57

Cleaned up debug messages, added ALLOC_DEBUG to dprintf flags.


dgatwood@mklinux.org

1.57 Fri Jun 21 21:11:21 2002 by dgatwood
Diffs to 1.56

Checking in leak-debugging code, along with a fix for a nasty bug where
we leaked semaphores like a sieve.


dgatwood@mklinux.org

1.56 Sun Jun 2 1:34:42 2002 by dgatwood
CVS Tags: RELEASE_0_95
Diffs to 1.55

Still working on 800k GCR formatting, but now I know what's wrong.  The
track image is either too long or the first and last blocks are just
getting hosed somehow.  If I weren't able to format it as a 720k floppy,
I'd say the floppy was just defective....

Fixed a formatting bug where the first block might not get detected
because the SWIM chip wasn't really updating its 'last sector seen'
way too fast.  Reworked the debugging in that function.

Fixed another bug where unformatted media would cause the driver itself
to wedge (this time by not releasing a critical lock).  Removed a bunch
of old cruft that made the block size be zero for an unformatted disk.


dgatwood@mklinux.org

1.55 Sat Jun 1 5:08:16 2002 by dgatwood
Diffs to 1.54

Some minor bug fixes.  Formatting now works for 720k MFM floppies as
well as the 1440k that I got working last night.  In addition, the
format code now properly checks to make sure the end of the track
didn't overwrite the first sector's address mark.  This should
dramatically reduce the misformats.

Note that not finding sector 0/1 can also be a sign of a bad disk.
It is believed that if a disk can be formatted, this code should
be able to do the job, but there are no guarantees.

Two major formatting issues still remain:

* 800k(GCR) support
* Setting DMAByteBoundryAlignment back to 8

The latter probably won't hurt anything, but I didn't want to make
that change until I could test it.  I may test tomorrow before
releasing an updated package.

Note that the updated package (0.95) will not include formatting
tools, since this support is so experimental, and requires a great
deal of work on the command line.  Currently, the format tools are
a total hack.  Before I make formatting support available in binary
form, the tools will have to, at the very least, not suck.


dgatwood@mklinux.org

1.54 Wed May 29 7:22:06 2002 by dgatwood
Diffs to 1.53

This update documents a number of timing details that are essential
to the correct operation of the SWIM3 controller.  Many if not most
of these details are relevant to other SWIM and IWM controllers on
Macintosh hardware.  Developers, take note.  :-)

Fixed a bug where the interrupt handler routines could read the status
of the wrong SWIM chip.  I'm not sure if this could ever actually occur,
though, since the chip should only be sending an interrupt when asked
to do something, and the two driver instances are wrapped by a mutex
to keep them from ever doing an operation at the same time.  This is
one of those "theoretical" bugs.

Fixed a bug where if you write to a block in a given track without
reading from the track first, then read from a different block in
that track, you could get back the data from a different track,
since writing doesn't necessarily cause the track to be read.  This
is a deferred read on write bug introduced late in the life of the
Copland driver, or possibly after it moved to Mac OS X Server, since
the comments in the code still talked about reading the track
before writing until recently.  :-)

Fixed a race condition in signal handler as triggered by a hardware
race condition between the DMA controller's interrupt and the floppy
controller's interrupt.  The DMA interrupt is now ignored.

Found actual timing information and determined that the drive reports
itself ready after seeking and after power-up before it is actually
ready, much as we already suspected.  Corrected the amount of delay
in the workaround.

Fixed a timing bug where the driver was out of spec, since the drive
requires a period of rest after writing before a head switch or seek
is permitted.

Fixed a bug where the wrong variable was checked for return status
of a function when determining the reason for failure of a read or write.

Forced the driver to report 720k and 800k as (potentially) valid formats
for disks formatted single-sided, since there's no easy way to tell
if the back side can be correctly formatted without trying it.  (Okay,
there is.  You could switch heads and wait for an index mark.  I'll
fix this for real eventually, time permitting.)

Improved detection of unformatted/bad disks by test-reading block 0
immediately on insertion as part of the media test.  There might be a
better way, but my first attempt caused the I/O Kit to wedge.  If
that turns out to no longer be an issue, I'll take out this hack
later.

Fixed bug in dbdma support code (in two places) where data was being sent
in weird sizes for large DMA transactions.  This was caused by some bad
math.

Fixed an issue in the old (unused) dbdma support code that was
inherited by MkLinux along with the floppy driver (but only used for
a few weeks until I could write a better one).  Anyway, I wanted to
make it a little better just in case someone was brave enough to try
to use it....  :-)  The issue was that it could set dbdma interrupts
too often (in theory) for really long requests.  Not that it matters,
since we ignore DMA interrupts anyway, but why waste the PCI
bandwidth....  Also fixed the DMA block size bug in the old code.

Fixed numerous missing cast warnings and incorrect long vs. int errors in
printf and IOLog statements.

Fixed a number of missing casts in other places to get rid of some warnings.

Fixed bug where polling for a disk could be very slow (potentially
causing mount delays) in rare cases.

Fixed an issue where excessive use of delay() for multi-millisecond delays
was causing some mouse jerkiness.  Replaced all delays over a millisecond
with FloppyTimedSleep.

Cleaned up PrintRegs() to print certain registers on the SWIM III.
Turned it off by default to avoid slowing things down unnecessarily.

Finished format support.

Fixed a bug in format support where you couldn't change from GCR to MFM
encoding on a disk and vice-versa.

Fixed a bug in format support where you couldn't reformat a single-sided
disk as double-sided.  If I ever add support for index mark detection
on the back side to determine double-sidedness, we will want to add
the ability to format double-sided floppies as single-sided.  We
do not want to do that currently, though, since a disk must be
formatted as double-sided in order to show up as double-sided currently
(meaning that the disk would end up being formatted double-sided,
but the driver would only know about one side, which would be bad. :-)

Fixed a huge delay on disk insertion caused by doing a RecalDrive from
track 40.  This only occurred for the second and subsequent disks
inserted.  Fixed by believing the SWIM 3's current track register
and seeking from the current head position to track zero, and -then-
doing a RecalDrive.  :-)

Added a delay after recalibrate drive to match the one used after
seeking, with a little extra just to be safe (since a Recal only
occurs after an error condition or when formatting, both of which
are more delicate states than a normal read or write).

Made the gap length be an unsigned int instead of an unsigned char.
Another driver's code suggests that it isn't unreasonable to allow
for a longer postamble after you've written a track, although from
what I can see, they were just being cautious/overly pessimistic.

Changed cachedTrack to a signed char, since it can go from -1
through 80.

Changed the GCR track format to match that used in Mac OS X
Server 1.0.  This still needs to be tested and verified.

Removed all the retry code when waiting for an interrupt, since
if an interrupt is missed, it won't ever happen anyway.  Added
diagnostic printf calls to indicate when a wait for an interrupt
times out.

Removed the hack where the GCR track setup code was basically
return'ed out.

Removed unnecessary waits.  Fixed waits in mode set code.  Turns
out the pulse between phase changes must be at -least- 1 msec, not
exactly 1 msec.  And it should be less than 2 msec.  When I had
it "exactly" 1 msec.  according to the SWIM3 chip's internal
timer, the chip started consistently failing to notice the state
changes.  Oops.

Fixed a theoretical timing bug in format switch code.  SWIM needs
a delay when switching between GCR and MFM.  I'm not sure if this is
still true for SWIM3.

Fixed a timing bug where (in theory) the drive power could be
turned back on immediately after it is turned off.  The spec
requires a rest period.

Fixed a timing bug in RecalDrive which could potentially cause
stepping beyond track 0 (thrashing) on faster machines.  The
track 0 sensor lies to us for a few milliseconds after track
zero is reached.  The amount of time differs according to the
drive in question.  The smaller timing values used in newer
drives are used, but the older drives' timing information is
also recorded in the comments.

Fixed several sub-millisecond timing bugs that are not worth noting
in detail.

Updated copyright dates at top of files, added MkLinux copyright
and license notices to a bunch of files that were missing it.


dgatwood@mklinux.org

1.53 Mon Apr 29 23:50:37 2002 by dgatwood
Diffs to 1.52

Fixed some compile warnings.


dgatwood@mklinux.org

1.52 Wed Apr 17 0:33:11 2002 by dgatwood
Diffs to 1.51

Second cut at run-time-enableable debug support.  It works now.


dgatwood@mklinux.org

1.51 Tue Apr 16 0:43:17 2002 by dgatwood
Diffs to 1.50

First cut at making debugging run-time configurable.  The property
"SWIM3 Debug" can be changed in the plist to turn debugging on before
loading, but in general, the setProperties method should be used to
turn debugging on/off on-the-fly.


dgatwood@mklinux.org

1.50 Fri Apr 12 22:03:23 2002 by dgatwood
CVS Tags: RELEASE_0_91, RELEASE_0_9
Diffs to 1.49

Debugging message cleanup


dgatwood@mklinux.org

1.49 Fri Apr 12 21:49:32 2002 by dgatwood
Diffs to 1.48

Fix for the random stack corruption panic.  The panic occurred when
doAsyncReadWrite requests were handled synchronously.  Changing back
to spawning a thread made the panic go away.  Dunno.  :-)


dgatwood@mklinux.org

1.48 Tue Apr 9 7:31:07 2002 by dgatwood
Diffs to 1.47

Made some insignificant changes to the location of increments of the
buffer position.  I would hope that this would not change the correctness
of the code (except possibly to improve it in one hypothetical case
that I don't think occurs yet).

Added a build style to generate preprocessor output to feed to a program
that parses and generates call trees.

Increased the size of buffers slightly just in case we're getting an
off-by-one read or write past the end of a buffer somewhere.  :-)


dgatwood@mklinux.org

1.47 Sat Apr 6 3:43:59 2002 by dgatwood
CVS Tags: RELEASE_0_8
Diffs to 1.46

Massive changes for PowerBook support.  Verified both drives work
correctly and independently now.  Need to back-port a plethora of changes
to the MkLinux sources, as it has trouble dealing with simultaneous
floppies as well.


dgatwood@mklinux.org

1.46 Tue Apr 2 3:28:34 2002 by dgatwood
CVS Tags: RELEASE_0_7
Diffs to 1.45

Turned off debug messages in the .cpp files.


dgatwood@mklinux.org

1.45 Tue Apr 2 3:10:53 2002 by dgatwood
Diffs to 1.44

Still working on it.


dgatwood@mklinux.org

1.44 Tue Apr 2 0:42:09 2002 by dgatwood
Diffs to 1.43

Okay, calling it 0.7.

dgatwood@mklinux.org

1.43 Tue Apr 2 0:40:47 2002 by dgatwood
Diffs to 1.42

Updated some copyrights and stuff.

1.42 Sat Mar 30 6:09:28 2002 by dgatwood
Diffs to 1.41

re-disabled most of the debugging output.  Apparently missed a little bit.
Will try back later.


dgatwood@mklinux.org

1.41 Sat Mar 30 5:50:31 2002 by dgatwood
Diffs to 1.40

Turns out the write support issues were a hardware problem.  While
really noisy, this code reads and writes.  Cleanup pending.


dgatwood@mklinux.org

1.40 Thu Mar 28 6:33:04 2002 by dgatwood
Diffs to 1.39

Addded a small delay that looks like it really isn't necessary while
trying to track down the bogus write protect issues.   Also, fixed
the write protect issue.  It was caused by differing opinions of the
correct size for type Boolean between the C and C++ portions of the
code.  And they say size doesn't matter....


dgatwood@mklinux.org

1.39 Thu Mar 28 5:11:17 2002 by dgatwood
Diffs to 1.38

Fixed a double free (IOFree).  Fixed a number of subtle timing bugs that
turned out to be caused by a small error in the design of WaitForOSEvent
(or more accurately, the design of the Mac OS X rewrite of the above).
Added a warning around debugging code that was royally hosing the ability
to do certain things.  (Ironically, it allowed MS-DOS disks to work, but
caused HFS disks to fail.)

Remaining bug count: 1 (read-only problem)


dgatwood@mklinux.org

1.38 Sun Mar 24 1:51:03 2002 by dgatwood
Diffs to 1.37

Cleanup of debug messages.


dgatwood@mklinux.org

1.37 Sun Mar 24 0:34:09 2002 by dgatwood
Diffs to 1.36

Okay, so that change this morning was wrong.  I wasn't thinking.  Anyway,
this reverts that change, adds a lot of debugging, fixes some errors,
and in general, fails slightly less badly.  Still trying to figure out why
dbdma isn't behaving itself.


dgatwood@mklinux.org

1.36 Sat Mar 23 21:52:37 2002 by dgatwood
Diffs to 1.35

Got a nasty panic from the locks, which don't like to be released by a
thread that isn't holding them.  Yes, I know that's a reasonable thing
for them to refuse to do, but oddly enough, this code was based on other
code that supposedly works.  Oh well.  I've rewritten it to use a
semaphore as a lock.  Dirty, yes, but it should work.  Man, I'm
really getting some use out of this new version of the non_bsd_sleep
and non_bsd_wakeup stuff.  ;-)


dgatwood@mklinux.org

1.35 Sat Mar 23 19:43:40 2002 by dgatwood
Diffs to 1.34

Fixed DBDMA descriptor address.  In one of the changes in the code used to
map the DBDMA descriptor ranges, I omitted the offsets into the dbdma
controller's register space.  This caused the dbdma commands to be written
into the wrong channel, in  this case the DBDMA_SCSI0 channel (external
SCSI on most machines).  Oops....


dgatwood@mklinux.org

1.34 Sat Mar 23 9:45:24 2002 by dgatwood
Diffs to 1.33

Not quite doing reads and writes.  It appears to be reading zeroes.


dgatwood@mklinux.org

1.33 Sat Mar 23 8:06:14 2002 by dgatwood
Diffs to 1.32

Added async read and write, fixed a directionality problem.  Will test
momentarily.

dgatwood@mklinux.org

1.32 Sat Mar 23 6:17:12 2002 by lgerbarg
Diffs to 1.31
Added interrupt tear down code

1.31 Thu Mar 21 22:33:02 2002 by lgerbarg
Diffs to 1.30
Fix for errors caused by the fact that I should not commit fixes while the building is being evacuated...

1.30 Thu Mar 21 21:58:35 2002 by lgerbarg
Diffs to 1.29
Fixing stupid workloop allocation bug

1.29 Thu Mar 21 21:48:38 2002 by lgerbarg
Diffs to 1.28
First cut of workloop code

1.28 Thu Mar 21 21:28:30 2002 by dgatwood
Diffs to 1.27

Committing some changes.

dgatwood@mklinux.org

1.27 Thu Mar 21 10:51:08 2002 by dgatwood
Diffs to 1.26

Hideously messy stuff.  This was "working" before the latest changes --
it couldn't quite eject, though, because the event was occurring before
the wait.  Moved to semaphores to get preposting behaviour.  Praying.


dgatwood@mklinux.org

1.26 Thu Mar 21 3:24:30 2002 by dgatwood
Diffs to 1.25

Added locking for hardware lock section.  Bloody MkLinux code worked on a
wing and a frigging prayer.  I'm going to fix this in the MkLinux source
when I get done with this.  :-)


dgatwood@mklinux.org

1.25 Wed Mar 20 7:58:30 2002 by dgatwood
Diffs to 1.24

Working on trying to keep it from panicking when the driver unloads, but
still not there.  For now, you still have to reboot each test, which is
a pain in the....  Anyway, added code to try to help figure out why the
I/O Kit never creates an IOMedia nub.  Also added code to allow callback
into the c++ parts of the code for media change notification, should
that become necessary.  Also, a subtle one-line fix for detection of
disk ejection.  Also, changed the device to be non-removable (this is
-not- the same as ejectable, AFAICT, but refers to whether the drive
itself can be removed) since we don't support removal of the floppy
drive on PowerBooks in the current rev.

The current state is that the floppy core code detects the media, determines
correctly whether it is GCR or MFM encoded, and basically plays with the
drive a bit.  It does not currently show up in /dev, so it is not possible
to test eject or other functionality.  Read/write is still not implemented.

Best guess: another three or four hours of debugging, and it should be
working.  :-)


dgatwood@mklinux.org

1.24 Tue Mar 19 6:53:21 2002 by dgatwood
Diffs to 1.23

Major changes to get around lack of the bsd sleep() function.  Wrote my own.


dgatwood@mklinux.org

1.23 Sat Mar 16 8:16:32 2002 by dgatwood
Diffs to 1.22

Major cleanup of compile warnings.  We're down to some crusty stuff in fd.c and a few missing prototypes here and there, mostly for stuff where I'm pretty sure about the  syntax....

Also, made some changes that should cause the OS to probe for media, though I can't test this because I'm not near a machine with SWIM3 hardware at the moment.


dgatwood@mklinux.org

1.22 Sat Mar 16 2:59:59 2002 by dgatwood
Diffs to 1.21

Fixed a NULL pointer dereference in probe code.  Fixed a second NULL pointer dereference caused by temporarily removed code that I'd never reenabled.  Reenabled everything that had been temporarily enabled except for the pieces that have not yet been done (correct sleep/delay behaviour for long sleeps, and add support for read, write, and format).  Changed a bunch of NOTYETDAG ifdefs to IOKITREPLACED or PDMSUPPORT, as appropriate.  For basic support, the only requirements left are the NOTYETDAG items.  Also fixed the arguments so that it can spawn a media scan thread.

dgatwood@mklinux.org

1.21 Thu Mar 14 10:51:47 2002 by lgerbarg
Diffs to 1.20
Added APSL to files that contain Apple code

1.20 Thu Mar 14 9:02:45 2002 by lgerbarg
Diffs to 1.19
Fixing mismatched provider types

1.19 Thu Mar 14 8:44:36 2002 by dgatwood
Diffs to 1.18

Updated a code comment to reflect the current wrapper state.  This driver is failing to probe at the moment, but it's getting close to at least having some of the basic functionality (eject, etc.) working, albeit no read and write.  Looks like the OSDynamicCast is failing....  We'll get it next commit, hopefully....

dgatwood@mklinux.org

1.18 Thu Mar 14 8:41:07 2002 by dgatwood
Diffs to 1.17

Making error messages distinct....

dgatwood@mklinux.org

1.17 Thu Mar 14 8:29:01 2002 by lgerbarg
Diffs to 1.16
Really the last set of linkage fixes...

1.16 Thu Mar 14 8:25:19 2002 by dgatwood
Diffs to 1.15

Good golly, miss Molly.  This should actually link after this change....  Maybe....

dgatwood@mklinux.org

1.15 Thu Mar 14 8:20:34 2002 by lgerbarg
Diffs to 1.14
Fixing even more C++ to C linkages

1.14 Thu Mar 14 8:01:29 2002 by lgerbarg
Diffs to 1.13
Fixing C++ to C linkages

1.13 Thu Mar 14 7:58:44 2002 by lgerbarg
Diffs to 1.12
Fixing C++ to C linkages

1.12 Thu Mar 14 7:51:15 2002 by lgerbarg
Diffs to 1.11
Fixing the class declarations in function headers

1.11 Thu Mar 14 7:47:44 2002 by lgerbarg
Diffs to 1.10
Added fake info strings

1.10 Thu Mar 14 7:38:13 2002 by lgerbarg
Diffs to 1.9
Minor fixes

1.9 Thu Mar 14 7:19:42 2002 by dgatwood
Diffs to 1.8

Trying this frigging commit again.


dgatwood@mklinux.org

1.8 Thu Mar 14 6:30:19 2002 by lgerbarg
Diffs to 1.7
Removed unneeded glue I got when I used ATA as the base for the device object

1.7 Thu Mar 14 6:14:06 2002 by lgerbarg
Diffs to 1.6
Added Impendence device object

1.6 Thu Mar 14 5:40:26 2002 by lgerbarg
Diffs to 1.5
Driver object break out

1.5 Thu Mar 14 5:20:58 2002 by dgatwood
Diffs to 1.4
Fixed some stupid stuff I broke a minute ago.

dgatwood@mklinux.org

1.4 Thu Mar 14 5:01:51 2002 by dgatwood
Diffs to 1.3

Updated pieces.


dgatwood@mklinux.org

1.3 Wed Feb 6 9:23:35 2002 by dgatwood
Diffs to 1.2

Major work on this little puppy.  It took until just now to get it
buildable again.  The fd.c file still needs to be made buildable.

Remaining work:

1.  Make fd.c buildable
2.  Write interface routines to look like block_io() and friends
3.  Write read/write routines
4.  Write interrupt handler pass-thrus to match read/write routines
5.  Write some trivial glue code for dbdma support
6.  Anything else I haven't thought of....


dgatwood@mklinux.org

1.2 Wed Feb 6 3:31:50 2002 by dgatwood
Diffs to 1.1

Some work on integration.


dgatwood@mklinux.org

1.1 Fri Jan 4 23:17:58 2002 by dgatwood
Initial revision

1.1.1.1 (vendor branch) Fri Jan 4 23:17:58 2002 by dgatwood
CVS Tags: macos-10-1; Branch: dgatwood-1
Diffs to 1.1

My pet project.  Working on porting MkLinux's floppy driver to Mac OS X
to support the beige G3 machines, the Wallstreet PowerBook, and any older
machines as appropriate.  This is the first import.  It builds, but does
not actually do anything yet.


dgatwood@mklinux.org


This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric revision using the type-in text box.

Diffs between and
Unidiff
Context diff

Created by cvsweb 1.0

cvsadmin@mklinux.org