Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: D Finnigan Newsgroups: comp.sys.apple2.programmer Subject: Quarter tracks and ProDOS Date: Tue, 31 Mar 2020 20:42:34 -0000 (UTC) Organization: Mac GUI Lines: 426 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Tue, 31 Mar 2020 20:42:34 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="c029cda1e8cc4c80c6c5db8b6516456b"; logging-data="31996"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+TNqIxFFNZ/vaDJdbmLk+N" User-Agent: Mac GUI Usenet Cancel-Lock: sha1:91X+754XUolszQi+4bmXLbDXbdw= Xref: csiph.com comp.sys.apple2.programmer:5456 Discussion cut from apple2infinitum.slack.com: ----------------- beevik 12:52 PM thanks 12:56 I've been mucking about with an emulator, adding quarter-track support. And it's interesting to step the RWTS code, observing how it moves the head in quarter-track steps. Never knew it did that. 12:56 I always thought it just moved a half track at a time Disk Blitz 12:57 PM It moves it by quarter tracks? Or is it just turning on the destination phase before it turns off the current phase? beevik 12:58 PM The latter, but I believe that would have the effect of moving a quarter-track at a time 12:58 Although I guess the timing is important too Disk Blitz 12:59 PM Yeah, the timing is the trick. It takes quite a long time (in cpu time) for the head to settle in a quarter track position. beevik 12:59 PM Sather says 20ms. an eternity Disk Blitz 1:06 PM @Christopher Mosher documented the findings in his emulator here: https://github.com/cmosher01/Epple-II/blob/master/src/disk2steppermotor.cpp src/disk2steppermotor.cpp ``` /* epple2 Copyright © 2019, Christopher Alan Mosher, Shelton, CT, USA. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or Show more cmosher01/Epple-II | Added by GitHub :+1: 2 xot 1:08 PM Nice. Tom Greene 1:33 PM That stepper motor discussion was epic :+1: 3 beevik 1:45 PM reading it now. it explores a lot of things I had questions about The Equalizer 1:54 PM Jobs was ousted in '85, which i think the IIgs was being developed? But thought i read/heard that he still wanted it to not compete with the Macintosh line as he felt the // line was dead. Scully continued with the IIgs as he knew it was their cash cow to get Mac line going. And thought i heard about the WDC yields but thought that was why GTE was making many? Disk Blitz People will never get it out of their head that “Jobs hobbled the IIgs to favor the Mac”. That simply isn’t what happened. Jobs left Apple a year and a half before the IIgs ws released. At that stage, they were still aiming for the IIgs to be an 8MHz machine. The shift to using the 4MHz processor happened at the last minute due to WDC not being able to have sufficient yields of 8MHz parts. Posted in #general | Yesterday at 10:49 AM | View message JBrooksBSI 1:54 PM I've been mucking about with an emulator, adding quarter-track support. You might try testing with ProDOS 2.5 as the new loader uses 1/4 track steps because: Head seeks are faster when two phases active Quieter and less violent impact when the seek hits a stop Allows 1/4 track reads (not used currently) :astonished: 1 2 replies Last reply 24 hours agoView thread Disk Blitz 1:55 PM How are head seeks faster with 2 phases active? The Equalizer 1:55 PM i think it settles faster? Disk Blitz 1:57 PM It can’t possibly settle faster. JBrooksBSI 1:57 PM Empirically measured, but I believe it is because there is a stronger pull when seeking to 1/4 tracks (ie, past the next even track) 1:58 Read happens during settle instead of waiting for settle 1:59 Tested on full-height and 1/2 height drives, on II, III, and IIGS Disk Blitz 2:00 PM There are 2 coils. So turning on ph0+ph2 turns that coil off (same as ph1+ph3). 2:00 Turning on neighboring phases makes the head bounce back and forth between the 2 until it settles. Which would be slower than just pulling it to the next phase. JBrooksBSI 2:01 PM I tested seeking to 1/4 tracks instead of seeking to 1/2 tracks. I don't see how that turns a coil off. 2:02 The bounce is only when the head reaches the midpoint, but the seeks are leading the head Disk Blitz 2:03 PM When the 2 phases are on in the single coil they negate each other and the spindle can move freely the same as if it is unpowered. JBrooksBSI 2:07 PM Sadly I haven't been able to keep up with the Applesauce thread, so missed the latest seek discussion 2:08 But still not following how seeking to 1/4 tracks would result in both phases being driven by a single coil and negating each other Disk Blitz 2:09 PM Seeking to quarter tracks wouldn’t. Quarter tracks require both coils to be activated. JBrooksBSI 2:10 PM Right, which is what I am doing. Seeks have both coils activated most of the time (edited) 2:11 So instead of stepping from track 0 to track 0.5, I step to track 0.75 Disk Blitz 2:12 PM So, if the head in on ph0, you are talking about turning on ph2+ph3? Sorry, ph1+ph2? (edited) JBrooksBSI 2:13 PM I'd have to look at the code as it has been awhile. I did the initial R&D in 2015, then made the P8 2.5 loader last year 2:13 But, conceptually, the seek is to track 0.75, not 0.5 beevik 2:13 PM @JBrooksBSI What does your pattern of stepper bits look like as you seek through consecutive quarter-tracks? JBrooksBSI 2:14 PM And the code uses a 160-track (ie 1/4 track) approach 2:14 I don't remember offhand as I did a lot of experimentation, then changed it to make sure it worked on the old full-height Disk II & AppleIII drives 2:15 But easy to test beevik 2:15 PM But you only do read/writes to half-tracks, right? JBrooksBSI 2:15 PM http://prodos8-releases.s3-website-us-east-1.amazonaws.com/ProDOS_2_5_a8_143k.dsk 2:15 Currently P8 does reads/writes to half-tracks beevik 2:16 PM How much faster did your quarter-track seek trick make things? JBrooksBSI 2:16 PM If I get time, I plan to do a high-density disk format which reads on 1/4 tracks and writes on micro-tracks 2:16 Hmmm, I used to know that, but don't remember now. :slightly_smiling_face: 2:17 The test I used is to make the index block for the ProDOS file out to track 35, forcing the boot loader to seek way out, then come way back for the data blocks. beevik 2:18 PM Worst case? JBrooksBSI 2:19 PM Right, how fast can we cycle through the phases and move the head without leaving it behind. Particularly on the oldest DiskII drives which are slow (heavy? oldest? not sure why) JBrooksBSI 2:24 PM Untitled *Step 1/4 tracks D2Seek sta :ModTrk+1 :Loop lda D2CurTrk Click to expand inline (46 lines) 2:24 Here is the P8 2.5 loader seek code Disk Blitz 2:26 PM The head stepping mechanisms are completely different for the Disk II and the UniDisk+. Disk II uses a rotating disk with a groove in it that the head rides in, whereas the later drives are directly belt driven. 2:30 Ah, shortening the wait time for each step would definitely increase the seek time. JBrooksBSI 2:30 PM Older full height drives need almost 3x longer seek delay vs 1/2 height drives in my testing Disk Blitz 2:34 PM Yeah, it is pretty simple to spin the stepper motor too quickly in a Disk II and have the head pop out of the groove. It is a pretty weak spring loaded connection. And if the rails are dirty, it is even easier to do. 2:34 You can yank around the newer drives all you want without needing to worry about that. JBrooksBSI 2:36 PM Right. I think I used 1ms seek delay per 1/4 track on the half-height drives 2:37 Though IIRC, seeking to 1/4 tracks seemed to get the head moving from a stop faster 2:39 I don't remember what the normal seek delay time was in RWTS, but I think it was much longer than 3-4ms 2:43 To see the fast seek on half-height drives using the P8 2.5 loader, change the LDY #$B1 to LDY #$3C on Block 0:$178 2:44 The loader will load the PRODOS file at $2000 and jump to it, so you can copy any large SYS file to the P8 2.5 disk as PRODOS, then boot to see how the seek timing/pattern works Disk Blitz 2:50 PM The original seeking used a table of delay values. It had increased delays for the acceleration and deceleration phases of the movement. 2:52 Looks like it ranged from 2.8 - 4.8ms. With an initial delay of 11.2ms. beevik 2:53 PM OFFTBL HEX 702C26221F1E1D1C1C1C1C1C Disk Blitz 2:55 PM Screen Shot 2020-03-30 at 12.54.36 PM.png Screen Shot 2020-03-30 at 12.54.36 PM.png JBrooksBSI 2:55 PM Untitled * step by 1/2 tracks with both phases on. End at 1/4 track D2Seek pha ;Save exact track ora #1 ;Align to closest 1/4 trk for fast step sta DestTrk Click to expand inline (57 lines) 2:56 Here is an earlier fast seek which moves from 1/4 trk to 1/4 track, keeping both coils on pretty much all the time JBrooksBSI 2:56 PM It was faster than the current P8 2.5 seek code, but didn't work on AppleIII 3 replies Last reply 1 day agoView thread beevik 3:07 PM The acceleartion-based RWTS seek delays appear to be about double the 2.8-4.8ms. There is an "on" wait time followed by an "off" wait time. Totals range from 5.6ms to 9.2ms. (edited) 3:09 Then there's a 25ms final settle time after all tracks have been traversed beevik 3:15 PM So. it. is. very. slow. JBrooksBSI 3:17 PM Right, so if IIRC, RWTS has an ON & OFF delay for each 1/2 track step, so stepping one track is: 11.3ms (0.1 + 11.2) 9.2ms (4.8 + 4.4) 25ms settle time =45.5 ms 3:18 vs ~4ms for P8 2.5 on half-height drives and ~12ms on older full-height drives beevik 4:11 PM how do you detect the difference between a full-height and half-height drive? JBrooksBSI 4:14 PM The loader currently doesn't detect, it just uses the worst-case full-height seek time. My plan was to default to half-height timing, and if there is a seek error, then revert to full-height timing beevik 4:15 PM yeah I was wondering if you could do it by testing/benchmarking 4:16 that prodos speedup is pretty great JBrooksBSI 4:21 PM What does your pattern of stepper bits look like as you seek through consecutive quarter-tracks? The code to seek from track 0 to track 1 will do the following: Turn on phase 0 & 1 (seek to trk 0.25) Wait 1ms (1/2 height) or 3ms (full-height) Turn off phase 0 & 1, and immediately turn on phase 1 (seek to trk 0.50) Wait 1ms (1/2 height) or 3ms (full-height) Turn off phase 1, and immediately turn on phase 1 & 2 (seek to trk 0.75) Wait 1ms (1/2 height) or 3ms (full-height) Turn off phase 1 & 2, and immediately turn on phase 2 (seek to trk 1.00) Wait 1ms (1/2 height) or 3ms (full-height) Leave phase 2 on, letting head settle during sector seek/read 4:26 IIRC, it was faster to step only to 1/4 tracks, but not by very much, and the seek code was larger & more complex when stepping only 1/4 tracks, so I opted for the current seek which alternates 1/4 and 1/2 track positioning. 4:26 But this was quite a while back, so the details are a bit fuzzy 4:28 The new ProDOS 2.5 loader will also find the PRODOS file on any root directory block anywhere on the volume, not just blocks 2-4 on track 0. This is needed for >51 files in volume root. Disk Blitz 4:38 PM How does that change things for software that wants to parse the disk (or disk images)? Like always starting to look for the directory in block 2? (edited) 4:39 Thinking about Applesauce, Ciderpress, Cadius, diskm8, AppleCommander, DiskBrowser, etc. 4:40 Or is the idea that tools will need to be modified to support 2.5 specifically? JBrooksBSI 4:56 PM The root dir is always block 2, but blocks 3,4,5 no longer have to be (potentially unused) root dir blocks. They can be used for data, recovering up to 1.5KB per volume. Similarly, the root dir can grow beyond 4 blocks, with the dir linked-list traveling all over the volume, similar to subdir linked-lists 4:57 So far, most disk utils seem happy to just follow the next-dir-block linked list. It was really only the boot loader that was limited to only looking in blocks 2-5 for PRODOS. beevik 4:59 PM I'm curious about this: 3. Turn off phase 0 & 1, and immediately turn on phase 1 (seek to trk 0.50) Why turn off 1 and then turn it back on? Why not just turn off 0? Disk Blitz 5:00 PM Ok. Yeah, I’m walking the linked list from the root dir on block 2. So hopefully should be just fine. JBrooksBSI 5:01 PM The one new thing P8 2.5 does is write the number of root dir blocks into the volume hdr of block 2, so apps which open the root dir and ask for the size can know how many blocks to read. Pre-2.5 volumes default that byte to 0 which P8 2.5 interprets as (old-format fixed 4 block root dir). A non-zero size means the number of blocks in the root dir 5:02 So any util which reads the volume and walks to root dir linked-list should be fine, but any util which allows the root to grow (presumably only newer utils) should also update the byte containing the root dir block count 5:04 The boot loader code has to be very compact, fitting in blocks 0 & 1, so there is one routine to turn phases on or off. The code flow is to turn off the phases for the current head position, then calc phases for the next head position, then turn on those phases. beevik 5:04 PM I see JBrooksBSI 5:04 PM See code here: https://apple2infinitum.slack.com/archives/C1J89GVL4/p1585596279219000 JBrooksBSI Untitled Untitled Plain TextClick to open Posted in #general | Yesterday at 2:24 PM | View message beevik 5:05 PM Your stepper phase sequence is very similar to the one RWTS uses, although RWTS passes through the "quarter-track" phases ephemerally. (edited) 5:05 It's essentially a gray code pattern JBrooksBSI 5:05 PM Yes. Also no delay before phase-on, settle delay, or large 'first-step' delay (edited) 5:08 Though I would like to add half-height timing and 'first-step' delay if I have room beevik 5:08 PM The first step is a bit different. In RWTS, the pattern I observed is: 0000 0001 0011 0010 0110 0100 1100 1000 The first step is a half-step instead of a quarter-step. JBrooksBSI 5:13 PM Ok. Will have to check out the code and refresh my memory. :slightly_smiling_face: qkumba 5:14 PM keep in mind that the boot PROM leaves one phase on when it transfers control to $801. JBrooksBSI 5:16 PM Right. My seek always starts by turning off phases for current head pos