6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 2:31 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Mar 14, 2023 2:38 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
All, As there's been some recent activity around Compact Flash and other IDE based access for the 65(C)02, I thought I'd share the docs I've used over the past few years when designing my own IDE based interface. Between these docs, anyone should be able to fully understand the ATA interface and how to interface it to a system (65xx or other).

Attachment:
Seagate ATA Reference.pdf [615.06 KiB]
Downloaded 96 times

Attachment:
SanDisk CompactFlash Reference.pdf [8.59 MiB]
Downloaded 93 times

Attachment:
Hitachi 3K8 Reference 2.10.pdf [6.49 MiB]
Downloaded 70 times


Hope these are useful to some of you.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 14, 2023 10:21 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
Thanks for posting that stuff.

Rambling thoughts: casually perusing the Seagate ATA manual highlights the considerable differences between ATA (IDE) and SCSI. The equivalent Seagate SCSI manual runs some 230 pages, versus 80 pages for the ATA manual.

Attachment:
File comment: Seagate SCSI Manual (1997)
parallel_1997.pdf [686.84 KiB]
Downloaded 48 times

Most of that is due to the much higher level of intelligence embodied in SCSI. Of course, that intelligence comes at a cost, which is why IDE came into existence—the bean-counters won out over the engineers. :D SATA continues with that thinking; it’s essentially the same, but with a very fast serial connection instead of a parallel one.

Something I’ve often thought about is how to go about adapting SATA peripherals to a 65xx system—high-capacity SATA disks are inexpensive and fast. The principle roadblock to doing so is SATA technical documentation is closely guarded and only available at considerable cost, unlike PATA and SCSI, documentation for both having been widely promulgated.

In my application, I implemented SCSI with a host adapter designed around the AMD/NCR 53C(F)94 bus controller, which has the intelligence required to manage the SCSI bus. While I am intimately acquainted with how SCSI works at the hardware level, most of that knowledge wasn’t a prerequisite to implementing a working subsystem with the 53CF94. I'm not aware of any readily-available controller IC that could take on such a role and allow implementation of SATA (or SAS, for that matter) on a homebrew system. Given the complexity involved, designing a suitable host adapter using off-the-shelf silicon isn’t likely to happen.

The ATA bus is essentially an extension of the 16-bit PC-AT internal I/O bus. That characteristic means a reasonably-functional host adapter can be readily fashioned with off-the-shelf silicon. However, the result will be a “dumb” interface, which means the intelligence required to manage the bus has to be in the device driver. Such an arrangement will be inherently slow on any 65xx system, irrespective of the raw performance of the attached peripherals. Lack of intelligence in IDE, as well as the need to “byte-bang” the interface, is what motivated me to use SCSI; the SCSI driver only has to know how to talk to the host adapter, which handles all aspects of communicating with the addressed peripheral.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 14, 2023 11:41 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
Ah... the PC-AT (I still have the original Tech Reference manuals for it, plus pretty much everything IBM announced through the PS/2 lineup).

I took a temp assignment early 1984 in Boca and wound up reviewing all of the documentation for the PC-AT and EGA adapter before they were announced. I also had an interview during that trip with the manager that provided PC Technical Support to the National Account Division (NAD), which were IBM's largest customer base (mainframes, mid-range and adopting PCs). I landed the job and ended up in Boca around March/April 1984. Funny enough, I had sign off authority for all PC products (starting with the PC-AT) that were marketed and sold through NAD.

So yes... the PC-AT bus was essentially an Intel bus, as the machine used the 80286 and usual support chips. Initially, it used ST-506 based drives and the controller card was based on Western Digital chips (the floppy controller used the Intel 8272 (aka Nec765)) however. IIRC, we never released an IDE drive for the PC-AT... but when we announced the XT-286, I think one was available. We had some other follow-on products that were still based on the PC-AT bus, but moved to Microchannel (yea, I was heavily involved in that too). The early PS/2 machines used ESDI drives and later used SCSI. I think the single plug-in drives for the Model 70 (single drive only and a zero cable machine) was an ESDI with a single PCB plug-in.

In any case... beyond my rambling... yes, IDE was just that... an Intel 16-bit bus adaptation, and moving the disk controller into the drive, which eliminated the controller card. The main advantage, in my humble view, was the IDE drives now did defect mapping onboard. This was a huge plus... as a DOS format (which really didn't format a hard disk) didn't find any defective sectors and mark them as such in the FAT (file allocation table). Obviously, ESDI and SCSI also did defect mapping onboard and provided logical block addressing, moving away from the old CHS interface.

Needless to say, SCSI is an intelligent subsystem... IDE (ATA) isn't. There's a lot you can do with SCSI that you can't with IDE, by design. I found it quite easy to design an IDE interface for my C02 Pocket SBC. Writing the BIOS code wasn't too difficult either. Of course, the performance with IDE is limited with my design, which is programmed I/O (no DMA controller for the 65XX). This also ties the CPU clock rate directly to the read/write performance. Also, the IDE interface is designed to a maximum bus frequency of 8MHz. I know you can usually run up to 10MHz and the IDE interface will survive, but that's beyond the official supported spec.

On the plus side (for 65XX designs), implementing an IDE storage device can be pretty trivial, plus you can get easily buy IDE devices at very low prices. I bought 10- 6GB Microdrives at around $18 each, which are new and sealed in the original stat bags with silicagel packets. My old IBM buddy (we both hired on at the same branch office in NJ back in 1977) was the finance ops controller that oversaw building the manufacturing site in Thailand that produced these drives (everything was sold off to Hitachi later). He was over the house a while back and saw the drives.... picked one up and the stories came out!

Either way... I'll likely stick with these drives for the time being... they just work and allow a very portable pocket-sized system.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 15, 2023 1:47 am 
Offline
User avatar

Joined: Tue Feb 28, 2023 11:39 pm
Posts: 257
Location: Texas
BigDumbDinosaur wrote:
Thanks for posting that stuff.

Rambling thoughts: casually perusing the Seagate ATA manual highlights the considerable differences between ATA (IDE) and SCSI. The equivalent Seagate SCSI manual runs some 230 pages, versus 80 pages for the ATA manual.



Makes sense, the SCSI protocol supports a wider array of device types and many more of them. (I want to say I recall from my fuzzy memory seeing some SCSI scanners and printers back in the day.)

PATA really only needed to address two devices and at the basic level ATA you can get PIO mode out of most IDE drives and CD-ROMs. I don't recall the details, but when I wrote some professional disk cleaning software we were using the low level ATA and ATAPI commands to identify the drives and to execute their secure erase method (if they had them). You ALMOST didn't need to too concerned if you were working with an HDD, SDD, or CD-ROM.

Quote:
Attachment:
parallel_1997.pdf

Most of that is due to the much higher level of intelligence embodied in SCSI. Of course, that intelligence comes at a cost, which is why IDE came into existence—the bean-counters won out over the engineers. :D SATA continues with that thinking; it’s essentially the same, but with a very fast serial connection instead of a parallel one.


Almost, SATA does implement a few new features over PATA, or at least the protocol level they do. (Native Command Queuing springs to mind)

Quote:
Something I’ve often thought about is how to go about adapting SATA peripherals to a 65xx system—high-capacity SATA disks are inexpensive and fast. The principle roadblock to doing so is SATA technical documentation is closely guarded and only available at considerable cost, unlike PATA and SCSI, documentation for both having been widely promulgated.


Some SATA to PATA adapters can be had for not a lot of money. No idea how well they work, but that would save you from having to try and break down the SATA line protocols. (Unless you like reverse engineering that stuff. :mrgreen: )

Did some digging and found this blog post which seems to go into some detail about the signalling that happens with the SATA lines:
https://www.delkin.com/blog/sata-serial-ata/

Maybe someone with more hardware smarts than me can figure it out?

Quote:
In my application, I implemented SCSI with a host adapter designed around the AMD/NCR 53C(F)94 bus controller, which has the intelligence required to manage the SCSI bus. While I am intimately acquainted with how SCSI works at the hardware level, most of that knowledge wasn’t a prerequisite to implementing a working subsystem with the 53CF94. I'm not aware of any readily-available controller IC that could take on such a role and allow implementation of SATA (or SAS, for that matter) on a home brew system. Given the complexity involved, designing a suitable host adapter using off-the-shelf silicon isn’t likely to happen.

The ATA bus is essentially an extension of the 16-bit PC-AT internal I/O bus. That characteristic means a reasonably-functional host adapter can be readily fashioned with off-the-shelf silicon. However, the result will be a “dumb” interface, which means the intelligence required to manage the bus has to be in the device driver. Such an arrangement will be inherently slow on any 65xx system, irrespective of the raw performance of the attached peripherals. Lack of intelligence in IDE, as well as the need to “byte-bang” the interface, is what motivated me to use SCSI; the SCSI driver only has to know how to talk to the host adapter, which handles all aspects of communicating with the addressed peripheral.


I do recall looking over the schematics for the Magic-1 home brew CPU/Computer and he used a 8255 to control handle PATA devices. Which appears to be not terribly different from a VIA, just fewer features, but more I/O ports. (So yea, basically a VIA for the 80x86)

Not sure how much the ATA controllers from the past (or present) handle device or if they just pass thru like the 8255 does. But I'd think if a home brew CPU made from discrete ICs could handle it, the 6502 probably could as well.

When I was working with these things I was using FreeBSD; all I had to do was build up a structure to send to the kernel and it did the hard work sending the command along to the correct drive.
(Heck I recall digging through the kernel some, apparently some Fujitsu drives didn't put their name in the identification block correctly and the kernel had a hack to fix it the right way around.)


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 15, 2023 2:57 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8514
Location: Midwestern USA
floobydust wrote:
So yes... the PC-AT bus was essentially an Intel bus, as the machine used the 80286 and usual support chips. Initially, it used ST-506 based drives...

The Lt. Kernal hard drive subsystem for the C-64 and C-128 initially used ST-506 mechanisms, with an OMTI 5300 SASI-to-ST-506 interface card at the disk end and a custom host adapter at the computer end. Once ANSI ratified the SCSI-1986 standard, several drive manufacturers introduced 20 MB embedded controller drives, which were significantly cheaper than the OMTI/ST-506 arrangement. The cost of the Lt. Kernal came down once the embedded control drives started being used. At the same time, performance improved a small but measurable amount. By 1990, one year before Xetec discontinued the Lt. Kernal, it was possible to attach 320 MB of disk to a C-128, using a pair of 160 MB Seagate embedded controller units.

Quote:
IIRC, we never released an IDE drive for the PC-AT...

IDE, more specifically, the ATA bus interface, was Compaq’s doing. It was they who pushed the hardest to make the EISA bus a standard. As I dimly recall, there were headaches involved with adapting ST-506 mechanisms to EISA, which led to IDE.

Yuri wrote:
Makes sense, the SCSI protocol supports a wider array of device types and many more of them. (I want to say I recall from my fuzzy memory seeing some SCSI scanners and printers back in the day.)

One of my clients at one time had a SCSI flat-bed scanner and also had a machine for cutting vinyl graphics that had a SCSI port. He bought both thinking he could just plug them into his PC. :D I had to fix him up with a host adapter, drivers, etc., and then he was in business.

I used to have two Teac 3-1/2" floppy drives with embedded SCSI controllers that had come out of an old Sun UNIX workstation. I tested them on our shop server, but never found a use for them. They weren’t any faster than a regular floppy drive, but being SCSI, did a lot more than merely read and write a disk. I kind of wish I had hung on to one of them. It would be cool to have one hooked up to POC V1.3. :wink:

Although both of my shop servers have floppy drives, it’s probably been since at least 2010 that I’ve made use of a floppy disk.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 44 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: