Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!apple!motcsd!mcdcup!mcdchg!tellab5!vpnet!dattier From: dattier@vpnet.chi.il.us (David W. Tamkin) Newsgroups: comp.sys.cbm Subject: Re: @: (save/replace) bug? Message-ID: <1991Mar20.211941.23042@vpnet.chi.il.us> Date: 20 Mar 91 21:19:41 GMT References: <1991Mar20.095745.9860@cc.newcastle.edu.au> <1991Mar20.065653.28557@evax.arl.utexas.edu> Reply-To: dattier@ddsw1.mcs.com (David W. Tamkin) Organization: VPnet Public Access Unix, Villa Park, Illinois 60181-2206 Lines: 65 cs4344af@evax.arl.utexas.edu (David "Fuzzy Fox" DeSimone) posted <1991Mar20.065653.28557@evax.arl.utexas.edu>, and I'm glad he did, because it says most of what I planned to say and saves me the typing, but I have a few things to add: | In article <1991Mar20.095745.9860@cc.newcastle.edu.au> | c8923075@cc.newcastle.edu.au (Chris (Polar) Baird) writes: | >Could someone please explain what the 'save/replace' bug was? | I believe it was Compute's Gazette, although it could have been RUN, in | which a definitive article was printed that finally explained this | extraordinarily elusive CBM DOS bug. It was "Transactor" that uncovered it and found a way to reproduce it. Other magazines have also covered it, but none I've seen in the depth of the T. | The bug itself came from the fact that the 1541 DOS was actually ported | from the Commodore 4040 device, which had two disk drives, called drive 0 | and drive 1. Yes, and the 1540, the 1541, and the original 1571 all copied code that assumed there were two drives and enough buffers for handling two at once. The @: code required borrowing a buffer normally used for the disk in the other slot. Since it didn't exist, anything could happen. [Fuzzy Fox details some ways around it:] | 1. Don't use @-save. If you are unsure of your DOS, just stay away | from it. Scratch, then save. This helps when the disk is full, anyway. Sorry. Several people posting to this thread have recommended scratching and then saving as the cure. It isn't. Scratching and then saving (unless you follow one of the other items Fuzzy Fox enumerated) can also fall afoul of the bug. Scratching, initializing, and saving will work, though. | The new 1571 ROMs (upgraded!) do not have this bug, and I believe the | 1581 does not have it either. It is still best to avoid the use of | @-save if possible. The 1571 with upgrade ROM's, the 1581, and the MSD drives all can save @: with impunity. You might still want to avoid it to keep from getting into the habit in case you sometimes use a drive that cannot handle it safely. | 2. Always give an absolute drive reference to drive 0. When | you open a file, open it as "0:filename". When you initialize the disk, | use the command "I0:". That's right. Even when you open a file for reading or loading, specify drive 0:. (The series in "Transactor" showed that a previous open for reading without specifying the drive can drag up the bug.) However, the initialize command is "i0" with no colon. "i0:" is accepted by the 1571 but gives a syntax error on the 1581. | 3. Validate the disk after @-save. Yup. That'll do it too. And another way around it: 4. Initialize the disk (preferably specifying the drive number, "i0") *immediately* before using save @: or open @:. David Tamkin PO Box 7002 Des Plaines IL 60018-7002 dattier@vpnet.chi.il.us GEnie:D.W.TAMKIN CIS:73720,1570 MCIMail:426-1818 708 518 6769 312 693 0591