Author Topic: Apple II Disk II Controller  (Read 14269 times)

0 Members and 1 Guest are viewing this topic.

Offline LegionTopic starter

  • Frequent Contributor
  • **
  • Posts: 360
Apple II Disk II Controller
« on: March 28, 2014, 03:32:26 pm »
One of the things that got me interested in electronics was listening to Steve Wozniak talk about designing the first Apple computers. One of the stories that gets told is how he was able to reduce the number of chips used in the floppy disk controller significantly from contemporary designs.

Has anyone ever found a technical analysis of the Disk II that examines in detail how he was able to accomplish this? All the articles I find are very high level and qualitative meant for someone unfamiliar with electronics.
 

Offline Orpheus

  • Regular Contributor
  • *
  • Posts: 120
Re: Apple II Disk II Controller
« Reply #1 on: March 28, 2014, 04:52:19 pm »
The key was using the CPU to act as a controller for the FDD. By contrast, the FDDs on the later Commodore C64 and Atari 800 [still] had dedicated on-board controllers that were more powerful computing devices (but less suited for floating point math) than the main CPU!

He also used Group-Code Recording, which was a Run Length Limited (RLL) scheme that limited the number of "1" bits in a row, and used this limited set of allowable 6-bit chunks (IIRC) to store 4-bit nybbles and 7400 series digital logic to do that conversion. RLL had long been used on data tapes.

There was also some advantage in that RLL let him use cheaper soft-sectored disks vs hard sectored, but the details of that escape me. It's been a LONG time.

I don't think you'd find anything remarkable in the schematics. I still have some working Apple ][+ computers. I never got around to offloading my extensive notes, records and unfinished novels to a more modern medium. I really should (if the disks are still readable) but I doubt I ever will
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16281
  • Country: za
Re: Apple II Disk II Controller
« Reply #2 on: March 28, 2014, 06:51:20 pm »
Another key was that he used 2 ROMs on the board. The first one was the actual code to operate the drive, and the other was used as a replacement for a lot of discrete logic and used a shift register to do the data decode from the disk raw data. As the actual ROM decode logic was mostly on the main board, this saved a lot of logic, enabling the controller to be made with barely more than the 2 ROMs, a few buffers and logic tied to the PROM pins that did all of the work that was not done in software. As well the software controlled the stepper motors and head directly, leaving only the really fast stuff to be done in hardware. Thus the sector layout was initially 13 sectors but later code was optimised and gave 16 sector (IIRC) simply by reducing the dead time between sectors used for the processor to do data handling. The processor had to do all the read and write data prep and give it to the controller directly, but this saved using another processor to offload the work to the drive controller like other systems did. Meant you could do things like having odd track spacings, your own data format and such for copy protection. As well you could step during a write and have the read give good data if you do it at the same time in the code.
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Apple II Disk II Controller
« Reply #3 on: March 28, 2014, 10:52:41 pm »
Another key was that he used 2 ROMs on the board. The first one was the actual code to operate the drive, and the other was used as a replacement for a lot of discrete logic and used a shift register to do the data decode from the disk raw data. As the actual ROM decode logic was mostly on the main board, this saved a lot of logic, enabling the controller to be made with barely more than the 2 ROMs, a few buffers and logic tied to the PROM pins that did all of the work that was not done in software. As well the software controlled the stepper motors and head directly, leaving only the really fast stuff to be done in hardware. Thus the sector layout was initially 13 sectors but later code was optimised and gave 16 sector (IIRC) simply by reducing the dead time between sectors used for the processor to do data handling. The processor had to do all the read and write data prep and give it to the controller directly, but this saved using another processor to offload the work to the drive controller like other systems did. Meant you could do things like having odd track spacings, your own data format and such for copy protection. As well you could step during a write and have the read give good data if you do it at the same time in the code.
I do love Woz - he is a big fluffy happy bearded genius, a true engineer.

The last time I got to play with an original Apple ][ with monitor and disk drives was playing Lode Runner (Broderbund software?) back in the early 80's in the local computer shop. The software developers found a way to use hardware interrupts to cycle the "bell" piezo transducer for proper sound FX. Sound didn't seem to be a consideration back then, but developers found a way around it.

Too expensive for me though. A friend got a chinese cloned version in a vile silver case, then I think there was some rip off abomination called the Micro Professor.
 

Offline VK3DRB

  • Super Contributor
  • ***
  • Posts: 2252
  • Country: au
Re: Apple II Disk II Controller
« Reply #4 on: March 29, 2014, 01:02:54 am »
I once bought a rotten Apple in the early 80's. It was built by a couple of crims using a chair seat as a desk at the infamous Golden Centre in the seedy Tsim Sha Tsui district in Hong Kong. According to The Bulletin magazine, the second floor of the Golden Centre had the world's biggest commercial software piracy going on - including pirating mainframe software. The place was run by Chinese crime syndicates. The cops used to raid the place every so often, but a tip off would come in and the crooks would all close up shop.

There was one shop there called "IBN" with the eight IBM bars logo, with the words: "Improved Business Nohow"  :-DD

The switch mode power supply in the rotten Apple said "Made in Japan". Almost every component was underrated and I had to rebuild it ground up. The workmanship was terrible, definitely not of the high standard of Japanese manufacturing and design.

At the Golden Centre I saw Ashton Tate's dBase II software for a CPM card, complete with manual for $2. Printed inside the front cover in Chinese and English were the words, "Reprinted with permission from Ashton Tate". $2 was a lot cheaper than $695 recommended retail price.
« Last Edit: March 29, 2014, 01:15:31 am by VK3DRB »
 

Offline JonnyBoats

  • Regular Contributor
  • *
  • Posts: 141
  • Country: us
    • BitsConnect
Re: Apple II Disk II Controller
« Reply #5 on: March 29, 2014, 08:03:27 pm »
In http://twit.tv/show/triangulation/144 with Steve Gibson talks about reverse engineering this controller and then discussing it with Woz.
 

Offline lchvdlch

  • Newbie
  • Posts: 1
Re: Apple II Disk II Controller
« Reply #6 on: December 15, 2014, 04:13:56 pm »
I found a good explanation about its inners: http://www.metafilter.com/114962/jmp-TRIGSPIKES#4301468 which seems pretty complete (at least for me).
 

Offline TerraHertz

  • Super Contributor
  • ***
  • Posts: 3958
  • Country: au
  • Why shouldn't we question everything?
    • It's not really a Blog
Re: Apple II Disk II Controller
« Reply #7 on: December 16, 2014, 05:42:24 am »
I loved the Apple II disk system too. At the time it came out I was working in the first store in Sydney to import Apple (I & II), and I bought the second Apple II that came to Australia (so far as I know.)
When the disk system became available I got one of those too. But for some reason the guy (Rudi Hoess) who ran Computerland took a long time, like about a year, to get around to importing any manuals for the disk drives. So I didn't have any manual, or the schematic.

I commonly had to service other more traditional floppy disk drives and controllers, so to me the ultra-low parts count was really amazing. Without any manuals or schematics the curiosity was killing me. So I reverse engineered the entire thing, including disassembling the core of the Apple-DOS code that interfaced to the drive.

Ha ha... and found that the very inner-most part of it, that did the bit-banging when reading/writing to the drive, could be sped up a lot by unrolling the inner loops. This allowed a considerably higher data density on the disk. Which I got working.

I was a young service tech in a computer store, and didn't understand concepts like 'time critical commercial value'. I did nothing with it. Except mentioned it to one of the regular store customers, who got *very* interested. He asked for a copy of all my notes and code, which I was happy to give him. After which I heard he went to USA. Not so long after that, Apple Pro-DOS came out, which had the increased floppy disk data density about the same as my improved version.
I've always wondered if there was some connection, and if  I should be shot for gross stupidity and naivety. Or if the better way of coding it was just obvious enough to be inevitable.

Still have all my notes and stuff from back then. Someday, if I every get a break from current chores I should write up that story, with pics and code.
Collecting old scopes, logic analyzers, and unfinished projects. http://everist.org
 

Offline SeanB

  • Super Contributor
  • ***
  • Posts: 16281
  • Country: za
Re: Apple II Disk II Controller
« Reply #8 on: December 16, 2014, 06:26:28 am »
I think you got done over.......

But the notes and pics would be interesting though. Need any dead disk controllers? I have some around.
 

Offline TerraHertz

  • Super Contributor
  • ***
  • Posts: 3958
  • Country: au
  • Why shouldn't we question everything?
    • It's not really a Blog
Re: Apple II Disk II Controller
« Reply #9 on: December 16, 2014, 07:25:00 am »
I think you got done over.......
Maybe, maybe not. I'm pretty sure it would have occurred to others to do that too. Not like I was the only kid in the world who could disassemble 6502 code.
Quote
But the notes and pics would be interesting though. Need any dead disk controllers? I have some around.

A few months ago I dug out the boxes of my 'early projects' including that Apple II stuff, meaning to do a writeup for my noblog thing of my early years electronics stuff.  They're sitting in a corner...
What I really do need is some way to read Apple II disks to a PC. Web searches tell me there are now ways to do this, but I haven't pursued it yet. So many more urgent things.
Not sure if those old floppies would be readable still. Being so low density, maybe. But I do have stacks of printouts and notes on paper.
I'll try to find time. Ha ha. I still didn't get to that Nebushadnezzar/odd music synth thing yet. Stuff like http://everist.org/no-rezone/ has kind of pushed most other things down on the stack. Dammit.
Collecting old scopes, logic analyzers, and unfinished projects. http://everist.org
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Apple II Disk II Controller
« Reply #10 on: December 16, 2014, 07:27:41 am »
TerraHertz - looks like you were stitched up like a kipper. I know the feeling... Unless you go on and tell me you replaced the disks with tinfoil that is  :-DD
 

Offline TerraHertz

  • Super Contributor
  • ***
  • Posts: 3958
  • Country: au
  • Why shouldn't we question everything?
    • It's not really a Blog
Re: Apple II Disk II Controller
« Reply #11 on: December 16, 2014, 08:31:57 am »
TerraHertz - looks like you were stitched up like a kipper. I know the feeling... Unless you go on and tell me you replaced the disks with tinfoil that is  :-DD

Err... aren't you mixing metaphors? "replaced the disks with tinfoil" doesn't make sense, even as a backhanded dig. Anyway, I can't recall if I gave that guy any disks. What I know I gave him was paper printouts of the code changes, and photocopies of the handwritten notes. Oh wait, no, I lent him the original notes, and he photocopied them. At least he gave the originals back.
And I think it's really very unlikely my notes ended up being the basis for Apple Pro-DOS.
Collecting old scopes, logic analyzers, and unfinished projects. http://everist.org
 

n45048

  • Guest
Re: Apple II Disk II Controller
« Reply #12 on: December 16, 2014, 09:17:23 am »
This site might be of interest: http://mysite.du.edu/~etuttle/math/apple.htm

It does contain a lot of technical information (and not specifically about the disk drive) but still an interesting read. I just bought myself an Apple IIe from eBay for $200 with a bunch of accessories. You can still find bargains out there if you're patient.
 

Offline 6E5

  • Regular Contributor
  • *
  • Posts: 78
  • Country: us
Re: Apple II Disk II Controller
« Reply #13 on: December 16, 2014, 09:45:25 am »
I have a Commodore 1571 disk drive, so that's more powerful than the 8Mhz z80 inside my 128? Why does the floppy disk drive need more power than the actual computer?
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Apple II Disk II Controller
« Reply #14 on: December 16, 2014, 03:33:45 pm »
The larger the government, the smaller the citizen.
 

Offline jaxbird

  • Frequent Contributor
  • **
  • Posts: 778
  • Country: 00
Re: Apple II Disk II Controller
« Reply #15 on: December 16, 2014, 04:17:17 pm »
I have a Commodore 1571 disk drive, so that's more powerful than the 8Mhz z80 inside my 128? Why does the floppy disk drive need more power than the actual computer?

Don't think so.

But, a cool (unintentional I guess) feature of a C64 with the 1541 drive was that you could actually execute code on the 1541's 6502 in parallel with the C64's 6510. Not sure if that is possible with the 1571.

Analog Discovery Projects: http://www.thestuffmade.com
Youtube random project videos: https://www.youtube.com/user/TheStuffMade
 

Offline Kevman

  • Regular Contributor
  • *
  • Posts: 146
Re: Apple II Disk II Controller
« Reply #16 on: December 17, 2014, 05:16:21 pm »
I have a Commodore 1571 disk drive, so that's more powerful than the 8Mhz z80 inside my 128? Why does the floppy disk drive need more power than the actual computer?

Meh, probably not. But that's because the 128 is a very late 8bit computer.

The Commodore 1541 used a 1Mhz 6502. And the C64 used... A 1Mhz 6502. Some Commodore disk drives used a 2Mhz 6502.

Some people interested in Disk Drive design may find this interesting...

http://www.linusakesson.net/programming/gcr-decoding/index.php
 

Offline jaxbird

  • Frequent Contributor
  • **
  • Posts: 778
  • Country: 00
Re: Apple II Disk II Controller
« Reply #17 on: December 17, 2014, 05:24:05 pm »
... the C64 used... A 1Mhz 6502.

Nah, it was a MOS 6510 is the C64, a slightly extended version of the 6502. But you are right that the 1541 used a 6502, also used in the Vic20.

Analog Discovery Projects: http://www.thestuffmade.com
Youtube random project videos: https://www.youtube.com/user/TheStuffMade
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2616
  • Country: 00
    • My random blog.
Re: Apple II Disk II Controller
« Reply #18 on: December 18, 2014, 02:02:40 am »
speaking of 6502


Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline miguelvp

  • Super Contributor
  • ***
  • Posts: 5550
  • Country: us
Re: Apple II Disk II Controller
« Reply #19 on: December 18, 2014, 03:31:39 am »
He seems to have gone his research via google.

Pretty unsure presentation with very unsure facts nor non facts :)

I do like the 6502, but Z80 was my first love and the 8080 was there first and Motorola killed them all with the 68000 later on, but even if the Amiga was the best, as Microsoft has often proven and now Apple, you don't have to be the best, just the best known.
 

Offline Rasz

  • Super Contributor
  • ***
  • Posts: 2616
  • Country: 00
    • My random blog.
Re: Apple II Disk II Controller
« Reply #20 on: December 18, 2014, 08:42:34 am »
Microsoft has often proven

Microsoft proved that all it takes is for your mother to know CEO of IBM ;-)
Who logs in to gdm? Not I, said the duck.
My fireplace is on fire, but in all the wrong places.
 

Offline george graves

  • Super Contributor
  • ***
  • Posts: 1257
  • Country: us
Re: Apple II Disk II Controller
« Reply #21 on: December 18, 2014, 09:58:11 am »
The key was using the CPU to act as a controller for the FDD. By contrast, the FDDs on the later Commodore C64 and Atari 800 [still] had dedicated on-board controllers that were more powerful computing devices (but less suited for floating point math) than the main CPU!

He also used Group-Code Recording, which was a Run Length Limited (RLL) scheme that limited the number of "1" bits in a row, and used this limited set of allowable 6-bit chunks (IIRC) to store 4-bit nybbles and 7400 series digital logic to do that conversion. RLL had long been used on data tapes.

There was also some advantage in that RLL let him use cheaper soft-sectored disks vs hard sectored, but the details of that escape me. It's been a LONG time.

I don't think you'd find anything remarkable in the schematics. I still have some working Apple ][+ computers. I never got around to offloading my extensive notes, records and unfinished novels to a more modern medium. I really should (if the disks are still readable) but I doubt I ever will

This would be a fascinating video on the topic!

Offline 0xdeadbeef

  • Super Contributor
  • ***
  • Posts: 1575
  • Country: de
Re: Apple II Disk II Controller
« Reply #22 on: December 18, 2014, 10:53:02 am »
By contrast, the FDDs on the later Commodore C64 and Atari 800 [still] had dedicated on-board controllers that were more powerful computing devices (but less suited for floating point math) than the main CPU!
Hm, how would a MOS 6510 qualify for floating point math? And why should it be in any way better for this than a MOS 6502? Heck, the 6502/6510 didn't even have an integer multiplication in hardware.
Trying is the first step towards failure - Homer J. Simpson
 

Offline woodchips

  • Frequent Contributor
  • **
  • Posts: 594
  • Country: gb
Re: Apple II Disk II Controller
« Reply #23 on: December 18, 2014, 06:50:04 pm »
Must have read the Motorola application note AN764 describing the 8" floppy disc interface for the Exorciser development system.

This is one of the cleverest pieces of hardware and software design I have come across, how to read and write an 8" floppy with no interleave using a 1MHz 6800. Based around the 6852 synchronous serial interface chip. App note on bitsavers under 6800 and exorciser.

With that in front of you doing the same with a 5.1/4" disc, half the data rate, is easy, well easish anyway. But the hard work has been done. Congratulations to Larry A Parker.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf