Ruud's Commodore Site Home  Email

1541IDE




Current state

!!! Froosen !!!
To make good use of an harddisk inside a 1541, you must be able to make use of the space above the 170 KB the 1541 is familiar with. And you must be able to creat subdirectories. And that takes a lot more then just a bit of hacking the original Kernal as I thought :(


What is it - the original idea

The IDE-harddisk has 16 datalines and 7 controllines. Get rid of the floppy disk of your 1541 and you'll end up with two free 6522 ports. Add the unused A-port of the other 6522 and there you'll have the needed 23 lines.

The big advantage of the above proposal is that there is relatively less soldering to do then when building a real IDE-interface. But you still need to replace the Kernal and power supply.
The disadvantage is that, because you control the IDE-HD by software, your data-throughput is lower then with a real IDE-interface. FYI, with this data throughput I mean the dataflow from the onboard 6502 to the IDE-HD or vica versa, not the one from/to the C64 or other IEC-computer!
What every other disadvantages you can think of, don't forget that the biggest advantage still is the huge amount of data you can store on an harddisk !!!


Parallel loaders

Using the free A-port means that we cannot use a number of parallel speedloaders using this port (Speeddos, Dolphin-DOS etc.). On the other hand there exists some excellent serial speedloaders. IMHO it is a matter of making a patch for them.
For those die-hards who insist on having a parallel loader, IMHO one could add an extra 6522 to the system by piggybacking it on top of an other. .


Additional ideas

I already mentioned to add an extra 6522 for people who need the parallel port. Why not add even a second extra 6522? In this way we solve two minor problems:
Another advantage: maybe it is possible to use both the floppy drive and the harddisk together. In this way we could have a convenient way to copy the contents of a floppy directly to the harddisk!

Another idea is developing a circuit that contains a real IDE-interface plus space for the needed extra RAM and ROM. I'm working on this idea as well but to be honest, I think I favour the above idea as being the most simplest one of the two.

Yet another idea is using only 8 bits of the IDE drive. OK, this means waisting half of the capacity of the drive but I have more then enough drives laying around doing nothing at all. And the half of a 3.4 GB drive is still equivalent to 10000 floppy sides!


The Kernal

Whatever system we choose, we'll need a filesystem and software to handle it. The original 16 KB won't do. So we have to replace the original ROM(s) with a 27256. When dealing with a 1541-II, one only needs to replace the original (EP)ROM and to add addressline A14. When dealing with another type of drive, some more work has to be done like using a 24 pin -> 28 pin converter, adding the missing addresslines and using A15 plus an invertor for selecting this EPROM.

The main idea anyway is to use the original Kernal as much as possible. At the point the Kernal starts to address the hardware for the original floppy disk, we have to break in and JMP/JSR to our own routines. And these new routines will all be placed in the $8000-$BFFF part. So even obsolete original routines won't be overwritten. The reason for this is compatibility; there could be software are around relying on these routines so replacing them could lead to unexpected errors.


Extra RAM needed?

During the first days of writing code I run into the following problem. A harddisk sector contains 512 bytes. So I decided to place two 1541-sectors on one harddisk-sector. The problem is that, when writing data to an harddisk sector, I have to write ALL 512 bytes. So saving one sector means I first have to read the according harddisksector, then I have to replace the data of the according half and then I have to write these 512 bytes to the harddisk again. The problem is: where do I store these extra 256 bytes???

There are three solutions: I already found out that, when using an harddisk, I must store more info then with a normal disk. Some variables used for GCR en/decoding can be used for this purpose. But the moment I want to be able to handle more then one IDE-device and/or partition, I'll surely need more RAM. So I decided to go for the extra RAM option.


The original interface

AFAIK all known versions of the 1540 and 1541 can be used. But the codes on the board for the various ICs vary from version to version. Therefore I will refer to the 6522 handling the floppy disk as #1 and the to the 6522 with free A-port and handling the IEC-bus as #2.

Both the A-ports will be used to handle the datalines: port A of #1 will handle the databits D0..7, port A of #2 will handle D8..15. Port B of #1 will handle the controllines:
* PB0 : addressline A0
* PB1 : addressline A1
* PB2 : addressline A2
* PB3 : LED
* PB4 : write protect sensor
* PB5 : future use
* PB6 : IOWR
* PB7 : IORD
* CA2 : CS0
* CB2 : CS1


As you can see the original LED is still be used. The IDE-interface has its own pin to connect a LED to but this one will only light up when the HD is active and therefore cannot be used to flash codes or whatever.

The idea is to replace the original "write protect sensor " with a switch, just like the one CMD-harddisk already has. Advantage: I can keep on using the original routines handling the original write-protect sensor.

When cutting lines, makes sure the one to the SO-input of the 6502 is cut as well. Then connect this input to +5V through a 10K resistor. We don't need it right now but the resistor enables us to use it in the future.


The interface with extra 6522's

The use of the pins is exactly as above with the exception of PB3 (the LED): in this case I will use the original PB3 to drive the LED because no alterations of the original circuit and software are needed.


A real IDE interface

I also designed and partly build a real interface based on the IDE interface I designed for the C64. The biggest advantage is that it is just a matter of placing of the PCB between the original board and and the 6502. The disadvantage is constructing the board, that is, by hand as I did. If you want to spend some money on making a real PCB, then that is a different matter. The design is made in EAGLE 4.15 and free.


The LPT interface

This idea is already working: 1541LPT: No more floppies anymore!. The disadvantage of this idea is that you are stuck with a big PC alongside your 1541. The advantage is, at least for me, the development of software is easier. Handling large harddisks means we need another filesystem. But writing the software for it is another story. I feel that using this configuration I have more grip on the developing of the original idea. Things can be tested much more easily IMHO. And when things work out fine, I can port it to one of the other systems.


Future expansions

The 1541 has 2 KB of RAM onboard. By piggybacking some IC's you can enlarge this number. Extra RAM always comes in handy, certainly because one of my ideas is to let the HD equipped 1541 act as two or more 1541 drives. Read about it in the next section.

In a PC one can connect two devices to one IDE-port. So why can't we? :)

Modern PC's have at least two IDE-ports. This is something that can be realised for our system as well by adding a 74LS139. CA2 and CB2 will steer the AB-inputlines of this 139. Outputs Y0 and Y1 steer the CS0 and CS1 line of the first port and Y2/3 steer CS0/1 of the second port.
Hmmm, what about using CA2 and CB2 of the other 6522 as well? We could end up with 16 devices in this way :)

As CMD and our Czech friends do supply an RTC with their HD-system, I'm thinking of implementing one as well. I want to use the DS12887 for four reasons: Those people who are unfamiliar with the DS12887, it is the Dallas-version of the Motorola MC146818, the RTC used in PC's. The main difference is that the DS1287 is an stand-alone IC; you don't need an external battery/accu or crystal anymore. Of course all SW we develop must be able to run on a system without a RTC onboard. This can be realised by first checking if a RTC is onboard and if not, letting all routines concerning the RTC return a "not valid" value.


Filesystem format

A proposal for a filesystem.

After some weeks I found out that the task to convert the original ROM into one using the new filesystem was impossible for the moment. So I decided to split up the development in several steps: I finished the sources for step 1 but I am still busy with soldering the cable, so testing has to wait for the moment.


My ideas used in the steps


To be continued.....





Having questions or comment? You want more Info?
You can email me here.