Download TMQ Vol V.ii - tim
Transcript
Volume V.11 THE MISOSYS QUARTERLY - directory data address mark to be generated in software. The method employed 1nLDOS and subsequently in the Model 4 DOS was to assume that a system data sector was being read if the cylinder being read was the directory cylinder as containedin the drive control table data structure. Fetch the table value and compare it to the requested cylinder; if they are the same and no other error was encountered, then report an error 6 because the read directory access service calls want to see that return code. Because of the derived address mark, it required that the entire cylinder on a hard drive where the directory was contained had to be reserved. The hard disk drive has no way of knowing the exact file being read; it's job is only to translate drive/cylinder/sector information to what is necessary to communicate with the controller. If a normal file was stored in the cylinder space unused by the directory, any attempt to read one of its sectors would return an error 6. So it is necessary to allocate the entire cylinder of a hard drive where the directory is stored. A hard drive could have up to 256 sectors per cylinder; so it could conceivably waste 222 sectors of space. Now we get to the point where problems in ERN get serious. Early hard drive formatters overlooked entering the correct ERN for the DIR/SYS file in the ERN field when the drive was formatted. This caused no problems when the drive partition being formatted contained only 32 sectors; it was correct. If it contained 64 sectors, programs which read DIR/SYS until EOF read past the last directory record. That's wrong. If a drive contained 256 sectors per cylinder, the ERN was erroneously entered as zero! That's because the calculation for cylinder size only used an 8-bit register which overflows to zero for an exact value of 256. An attempt to read that DIRJSYS file gets one an BOF for the first sector. These problems were soon fixed, but programs still exist which incorrectly calculate the length of the directory. Now then, let's look at file size. First a question. What do you really want to find out when asking the size of a file? Are you interested in how many pages it will take Letters to MISOSYS Winter 1990/1991 to print it out? Or are you interested in knowing how much disk space does it occupy? The answer could require a totally different calculation. Most folks want to know the latter. Since disk space is allocated in chunks called granules (NEWDOS afficionados refer to these as lumps) a one byte file takes up as much disk space as a 4096 byte file if the granule size is 16 sectors. If you request a directory, you are looking at file space calculated as if the file occupied the entire last granule. In fact, this space is allocated to the file, so it is entirely correct to figure it that way. Copy a six-sector file from a double density disk to a single density disk then request a directory on each. Surprisingly, the file has magically become larger on the single density disk! No it hasn't, but because the SDEN disk uses 5-sector granules whereas the DDEN disk uses 6-sector granules, it takes two granules to store that file on the SDEN disk but only one to store it on the DDEN disk. Confusing, isn't it? Now the size of the DIR/SYS ifie on a drive partition which can contain the maximum sized directory could be different based on the granule size of the partition. Let's assume a 64-sector cylinder. At 32 sectors per granule (SPG), that DIR/ SYS would take up 16K since it would need the two granules. At 16 SPG, it would need three granules and take up only 12K; the additional granule of 4K would still be unusable. At 8 SPG, the DIR/SYS file would take up five granules or 10K. In no case should it ever take up more than 16K because that would have to imply an ERN larger than 34; the size of a granule cannot be greaterthan 32). So your particular case claiming a DIR/SYS size of 48.00K had to be caused by some error. You now should see where were wrong to change the ERN to X'BB'. You were correct to change the value in the Granule Allocation Table from X'C3' to X'FF'. When you changed the DIR/SYS record value in X'17' from X'05' to X'Ol', you were telling the system that your DIR/ SYS file used two granules. Since your drive assigns six heads per logical drive, that should typically be allocated in granules of 32 sectors; so you would be correct in showing the directory using two gran- -12- Volume V.li ules. Now how did it get wrong? I can't tell you that. But a formatter should set the number of records in the DIR/SYS entry equal to the actual number of records in the file. Anitek's speedup Fm Alan Varga: Hi, Roy. I recently purchased a 6.7 mHz turbo speed-up kit from Anitek. They recommended that I upgrade my memory from 150 ns chips to 120's, which I've done. I had bought their 5.1 mHz speed-up kit a couple of months ago, replacing the Z80, PAL (0) and 74xx245 (Ui!) chips. I've now replaced the Z80 and 74xx245 (Ui!) chips again with the ones in the Turbo kit, and everything works fine. However, when I replace the PAL chip (U3) I can'tgetpast the 6.3.x logo without locking up. I called Anitek and they had two suggestions. First, there is a one line program which can be run in Model ifi BASIC after booting with <SHIFT><BREAK>. It is: 10 POKE 16912,40: PRINT PEEK(16912);: POKE 16912,104: PRINT PEEK(16912);: GOTO 10 This program runs fine at 6.7 mHz, so they are sure that all of my chips are OK. Their other suggestion was that my DOS has a timing problem during the booting process. Anitek is running DOSPLUS 3.5 ona hard disk, but l want to run 6.3.1 from floppy. They think that LS-DOS isn't waiting long enough for a response back from the drive controller before trying to read whatever comes after the bootstrap routines. Is there a patch I can make to verify this? Fm Roy Soltoff: Alan, What makes you Letters to MISOSYS