CPCWiki forum

General Category => Technical Support => Topic started by: RobertM on 01:50, 04 March 16

Title: DOS for CPC6128
Post by: RobertM on 01:50, 04 March 16
Hi all,
          I am looking for a Disk Operating System that will work with an IDE drive or something that could easily be modified.

I want it to have the BASIC commands like cat - run - save.

I will be using a file system that is directly compatible with windows like FAT/FAT16/FAT32 - most probably FAT32.

I saw some info on ACMEDOS and it looks like a good candidate but I don't know where it comes from - if I'm allowed to use / modify it.

I can't see to find any Amstrad DOS ROMS - when I search I find only more modern stuff.

Is there a place where these things are hidden? 

I want to use Compact Flash in XTA LBA mode (often called true IDE or 8 bit IDE). I works via 8 or so registers that can just map into the CPC6128s IO map.

I don't want to go fiddling with the CPCs internals. Can I use the expansion bus to unmap / override / disable the internal ROM so that the same addressing space can be used for an external ROM?

Obviously I am new to this and any help would be appreciated.

Title: Re: DOS for CPC6128
Post by: RobertM on 01:55, 04 March 16
Oh and one other thing ...

If I have extra commands loaded so that I can run / save to IDE (and catalog) ... which I assume would be via RSX or TSR or whatever Amstrad calls them ... My question is - will these extensions be lost with a Control-Shift-Escape reset and have to be reloaded or will they survive ???

I am asking because I was thinking of loading the RSXs from disk instead of ROM.
Title: Re: DOS for CPC6128
Post by: PulkoMandy on 08:17, 04 March 16
There is currently no such thing available for the CPC. The only ways to use hard disks are:
- SymbOS, a Windows-95 like operatig system for the CPC, with support for the Symbiface 2 and X-Mass (both IDE based) (uses FAT)
- FutureOS, an OS with a less familiar GUI and support for the same devices (not sure which filesystem is used?)
- BonnyDOS, an expansion ROM which allows to use these same devices in AMSDOS but with a custom filesystem.
The sourcecode for any of these 3 is not available, which means the only way to get them working with other devices is: either make your device compatible with the two above, or  disassemble the tools and patch the sector access routines.


Yes, RSXs are lost on ctrl-shift-esc which is why an expansion ROM is a good idea.


ACMEDOS will be the ROM you are looking for, it will allow to use the X-Mass from BASIC with the usual command and using the FAT filesystem. But his author has not published it yet, so the only thing you can do is wait for it.
Title: Re: DOS for CPC6128
Post by: RobertM on 10:23, 04 March 16
Ok, Thanks PulkoMandy

And thanks to everyone else who has helped on other thread as i have been thrashing out the options.

Unfortunately, waiting is not and option for me if I want to achieve this.

So at this point I am going to call the assessment phase compete as I now view this as a "DoAble" thing.

The hardware resource gathering phase is also complete as I started ordering things from China to cover my options early as shipping takes time. This phase is at least complete for a hardware prototype.

So the next phase is building the hardware and that will be a challenge as I can only make single sided boards here. I do however have adapters for the highest pin density parts.

After that I will need to do the software and there are some challenges there as described below. I am hoping that the sections of Soft968 that relate to RSX's is available online. I lost my copy of Soft968 a long long time ago and when I looked online there were sections missing.

The major challenge now is that I can't plug hardware into an emulator and I can't get any devolved software from my PC to the Amstrad.

To solve this first problem I will have to write a BASIC program to read PulkoMandy's SD card setup and copy it to disk.

Little steps first!

Thanks all.
Title: Re: DOS for CPC6128
Post by: rpalmer on 10:54, 04 March 16
hello everyone,

No one mentions HDOS, which can have drivers to support new media like the SD.

HDOS can support FAT16/31 File systems.

rpalmer
Title: Re: DOS for CPC6128
Post by: rpalmer on 10:56, 04 March 16
I also forgot HDOS has 2 ROMs, the Main ROM to support file systems and a drivers ROM to support devices.
Title: Re: DOS for CPC6128
Post by: Audronic on 11:06, 04 March 16
@rpalmer (http://www.cpcwiki.eu/forum/index.php?action=profile;u=379)


Do you have a link to the Roms Please


Ray
Title: Re: DOS for CPC6128
Post by: rpalmer on 12:16, 04 March 16
The version HDOS released is currently 1.0.
I have developed HDOS-32 which has enhancements to allow for bigger partitions, but is still under development.
There is a known bug in V1.0, which I fixed for HDOS-32.
I will re-visit HDOS-32 so that the bug fix is for version 1.0.

Note:

Although HDOS says it supports SF-II, I dont have one and so cannot verify it is does work as the code supplied appear to not work in WinAPE.
The driver source files are included and can be modified if others have the knowledge to make it work.

Rpalmer
Title: Re: DOS for CPC6128
Post by: Kris on 12:23, 04 March 16
Does HDos support the X-Mass or not ?

Title: Re: DOS for CPC6128
Post by: rpalmer on 12:37, 04 March 16
Sadly not. It also has no support for the Alberio interface as I have no details of either.

rpalmer
Title: Re: DOS for CPC6128
Post by: TotO on 12:49, 04 March 16
Great work!  8)

If it is supposed to work with the SF-II IDE, I don't see why it will not work with X-MASS.
Title: Re: DOS for CPC6128
Post by: Kris on 12:56, 04 March 16
Great work!  8)

If it is supposed to work with the SF-II IDE, I don't see why it will not work with X-MASS.


It was the reason of my question  ;D
I will made some tests this evening and keep you posted here ;)

Title: Re: DOS for CPC6128
Post by: Munchausen on 13:01, 04 March 16
hello everyone,

No one mentions HDOS, which can have drivers to support new media like the SD.

HDOS can support FAT16/31 File systems.

rpalmer

I was just going to mention HDOS :)
Title: Re: DOS for CPC6128
Post by: PulkoMandy on 13:37, 04 March 16
Sadly not. It also has no support for the Alberio interface as I have no details of either.

rpalmer


No details? I provide complete schematics, IO register specifications and an example program for Albireo. I wonder what else I could add?
I'm also available to answer questions if needed.


Shinra Team (http://pulko.mandy.pagesperso-orange.fr/shinra/albireo.shtml)
http://pulkomandy.tk/drop/albireo/Albireo1.0.pdf (http://pulkomandy.tk/drop/albireo/Albireo1.0.pdf)
Title: Re: DOS for CPC6128
Post by: arnoldemu on 15:07, 04 March 16
Although HDOS says it supports SF-II, I dont have one and so cannot verify it is does work as the code supplied appear to not work in WinAPE.
The driver source files are included and can be modified if others have the knowledge to make it work.
If I have time at the weekend I can test this on my sf2.
Title: Re: DOS for CPC6128
Post by: Ast on 16:29, 04 March 16
This project seems really great !
Title: Re: DOS for CPC6128
Post by: rpalmer on 23:29, 04 March 16
PulkoMandy,

I have not the chance to work on HDOS for some time as I have been developing the CPC web browser.
The browser development is now at a stage where mass storage is needed. The reason being that the animation /movie capability is not really testable via 'floppy' as it is too slow for 20 frames/second and since the SF-II driver needs work it takes quite a large amount of time to develop everything to work with out issues all at once. I am also looking at audio playback as well and include audio in movies.

I will soon look back at HDOS drivers for development to include XMASS and Albireo.

rpalmer
Title: Re: DOS for CPC6128
Post by: RobertM on 06:43, 06 March 16
I have started laying out the PCB for the Compact FLASH Interface. It's taking a while because I am too lazy to drill holes so I am making footprints for surface mounting though hole parts.

The BOM looks like -

2 x 50 pin headers
1 x 3v3 Voltage Regulator (LDO)
1 x XC9536XL CPLD
2 x 74HC245 bus transceiver (level translator)
1 x 40 pin header (IDE Socket)
1 x Compact FLASH to 40 pin IDE adaptor
1 x 32MB Compact FLASH card (yes only MB)

Title: Re: DOS for CPC6128
Post by: RobertM on 06:51, 06 March 16
Once I have the Compact FLASH interface card, the next hardware will be a ROM board and I have some questions that I am hoping someone has answer for to same be a lot of time.

1) What size is a normal ROM 8k 16k ?
2) It's written here that the CPC addresses up to 16 ROMS, how can it possibly do that with just the signals on the expansion bus???
3) What size are these expansion ROMs?

Here is what I was expecting to put together -

1 x XC9536XL CPLD for address decoding - has registers (36) if needed and can monitor changes to the HAL memory page switcher
1 x Fn huge FLASH chip that can be CPU programmed - I have 1Mb and 2Mb here
x x perhaps some config switches.

no level translators needed ... all 5 Volt parts except CPLD that is 5 Volt Tolerant LVTTL
Title: Re: DOS for CPC6128
Post by: PulkoMandy on 09:42, 06 March 16
Hi,
The ROMs are 16K and the CPC expects the ROM board to recognize a "ROM number" sent to a specific IO port address and store it.


An example board doing this is the RAMCard from Ram7, which I reverse-engineered and provided some explanations on here: Shinra Team (http://pulko.mandy.pagesperso-orange.fr/shinra/ramcard.shtml)

A simpler implementation using Flash-ROM instead of battery-backed RAM is available as:
- The MegaFlash or FlashGordon boards: MegaFlash - CPCWiki (http://www.cpcwiki.eu/index.php/MegaFlash) / FlashGordon - CPCWiki (http://www.cpcwiki.eu/index.php/FlashGordon) (very similar designs, but different flash chips used)
- The X-Mem board: X-MEM MX4 Board - Cent Pour Cent (http://www.centpourcent.net/store/p55/X-MEM_MX4_Board.html) which adds to the above a 512K RAM expansion and a few extra things (it can also replace the firmware ROM which is a special case).

For the Ramcard, MegaFlash and FlashGordon, the PCB designs and schematics are available if you really want to build it yourself. Only the ramcard is single-side PCB, however.
For the X-Mem, you can just buy it from the store.
Title: Re: DOS for CPC6128
Post by: RobertM on 12:30, 08 March 16
OK, I am still laying out the PCB. It's hard to do in single sided.

Hopefully tomorrow I will have the prototype finished.
Title: Re: DOS for CPC6128
Post by: RobertM on 11:53, 09 March 16
I got delayed today but I am getting closer to a prototype now.

Everything is surface mount - even the through hole parts like pin headers because I couldn't be bothered drilling so may holes.

 [ You are not allowed to view attachments ]

The green lines will be wire links because I am making tis single sided.


Also I haven't forgotten the SD Card, just haven't had time *BUT* I have ordered an SD Wi-Fi card ... that should be interesting to play with!
Title: Re: DOS for CPC6128
Post by: Bryce on 12:17, 09 March 16
Just a warning. Those SMD 2.54mm 50way headers are fine if they are only to be plugged once, but they are terrible if you intend plugging/unplugging the connector regularly, the solder joints fail pretty quickly.

Bryce.
Title: Re: DOS for CPC6128
Post by: RobertM on 12:49, 09 March 16
Hi Bryce,
            I didn't set out to buy all SMD parts. The CPLD and 3v3 regulator are the only genuine SMD parts.

Everything else is just a modified through hole part. The DIP bus transceiver will just be DIP parts that have been squashed (dead bug style).

Here is a pic of a DIP connector -

 [ You are not allowed to view attachments ]

It has 0.25" solder lands so I hope it will hold up for a while cos there will be many plug re-plug cycles when I get the inevitable "it doesn't work" fault.

Hopefully it will hold up for long enough so that I can see that it works and move on from a prototype.
Title: Re: DOS for CPC6128
Post by: Bryce on 13:17, 09 March 16
Yup, that's the one. You'll find that the solder joints along those leads will be very prone to cracking from the upward force of unplugging the connector. Just keep an eye on them, in case they are the source of some unexplainable fault. I wouldn't recommend using them on any batch you build to sell, you'll be plagued by returns after a few weeks.

Bryce.
Title: Re: DOS for CPC6128
Post by: rpalmer on 14:51, 09 March 16
hello everyone,

For those that downloaded the ROMs for HDOS + Drivers.

I have checked the code for SF-II and found it would crash. The attached zip contains a version which does not crash anymore, however I still have trouble getting to work as expected.

It seems I cannot even read the "Identify Packet" data at the initialisation (all i get is 255 for all bytes). I send the command and see no error, but data read in is invalid. I cannot see why this is so. I will continue to work out why, how and if where the problem is.

rpalmer
Title: Re: DOS for CPC6128
Post by: RobertM on 11:08, 10 March 16
Hi all,

I have assumed that I only need Address, Data, IORQ, RD and WR to decode the IDE port ???? I know the Z80 does some strange things like refresh but I am hoping that is enough ???


Next problem lol - the design is 1/2 an inch wider than the blank PCB I have here. So I will have to get larger PCB of change the design.

There are two 50 way connectors so that a Rom board can plug in so maybe I should just cut one out.

A pic - I should have spun the CPLD around 180 cos that programming port is hogging space -

Title: Re: DOS for CPC6128
Post by: Munchausen on 12:29, 10 March 16
Hi all,

I have assumed that I only need Address, Data, IORQ, RD and WR to decode the IDE port ??? ? I know the Z80 does some strange things like refresh but I am hoping that is enough ???


Next problem lol - the design is 1/2 an inch wider than the blank PCB I have here. So I will have to get larger PCB of change the design.

There are two 50 way connectors so that a Rom board can plug in so maybe I should just cut one out.

A pic - I should have spun the CPLD around 180 cos that programming port is hogging space -

If you solder an IDC connector on to your expansion port, you can just use 50-way SCSI cables to connect multiple boards up:

Connector:
 (http://www.vetco.net/catalog/images/PAN-SBE-50S-1.jpg)

Cable:

(http://www.videk.co.uk/shopimages/sections/thumbnails/1568.jpg)
Title: Re: DOS for CPC6128
Post by: RobertM on 12:35, 10 March 16
Yes, that is exactly what I did even though it's a bit sad to loose the original edge connectors but they were badly corroded on the top surface and edge connector were only ever reliable in dust free environments anyway.

I did consider tin plating them but that could only be done by immersion. I also considered silver plating them as that can be done with a cotton swab and solution ... but sadly I ended up using DIP pin headers.
Title: Re: DOS for CPC6128
Post by: Munchausen on 12:44, 10 March 16
Yes, that is exactly what I did even though it's a bit sad to loose the original edge connectors but they were badly corroded on the top surface and edge connector were only ever reliable in dust free environments anyway.

I did consider tin plating them but that could only be done by immersion. I also considered silver plating them as that can be done with a cotton swab and solution ... but sadly I ended up using DIP pin headers.

At least this way you don't need a pass through connector on your PCB :)

What's odd is that I've never had a problem with an edge connector other than on a CPC, and they are everywhere (console cartridges, ISA/PCI cards etc). Probably on the CPC they aren't using the right metal for the contacts.
Title: Re: DOS for CPC6128
Post by: RobertM on 12:53, 10 March 16
Probably on the CPC they aren't using the right metal for the contacts.

Spot on. The CPC used Tin and Lead to plate the connector. The others used Gold but that was expensive back in the day.

Gold isn't *the best* conductor and neither is copper. Silver is the best conductor but silver is hard. Gold works well because it is soft by comparison.
Title: Re: DOS for CPC6128
Post by: Bryce on 13:42, 10 March 16
At least this way you don't need a pass through connector on your PCB :)

What's odd is that I've never had a problem with an edge connector other than on a CPC, and they are everywhere (console cartridges, ISA/PCI cards etc). Probably on the CPC they aren't using the right metal for the contacts.

You've obviously never owned a Spectrum with it's famous "reset if you touch the expansion" problem.

Console cartridges have the advantage of the cartridge case to make sure they can't move.

Edge connectors on PCs are a completely different matter. The cards are held firmly in place with a screw at the top of the card. They are also inside the machine, so they can't be knocked against and the signals go through a buffer, whereas 8-bit edge connectors were commonly directly connected to the CPU.

Bryce.
Title: Re: DOS for CPC6128
Post by: pelrun on 14:35, 10 March 16
Gold isn't *the best* conductor and neither is copper. Silver is the best conductor but silver is hard. Gold works well because it is soft by comparison.


It's not about conductivity, it's about reactivity. Most metals oxidise or tarnish when exposed to air/moisture, and that oxide layer is usually a really poor conductor compared to the original metal. Gold is extremely non-reactive, so no insulating layer forms on it and the end result is a connection that is *much* better than one with oxides in the middle.
Title: Re: DOS for CPC6128
Post by: Bryce on 14:59, 10 March 16
CuTe (Copper Tellurium): Not just a cute name, but one of the best surfaces you can get for low-loss connectivity, by making the copper rigid enough to machine into complex shapes and reduces the oxidation :) Pity it's rare as hens teeth and poisonous too  >:(

Bryce.
 
Title: Re: DOS for CPC6128
Post by: Munchausen on 15:53, 10 March 16
You've obviously never owned a Spectrum with it's famous "reset if you touch the expansion" problem.

Console cartridges have the advantage of the cartridge case to make sure they can't move.

Edge connectors on PCs are a completely different matter. The cards are held firmly in place with a screw at the top of the card. They are also inside the machine, so they can't be knocked against and the signals go through a buffer, whereas 8-bit edge connectors were commonly directly connected to the CPU.

Bryce.

Ah I have most of the spectrum models (I'm missing just one), but I just never used them much except the original 48k. I remember the joystick adapter being a real pain.

In terms of edge connectors and not moving, in general it is an advantage, but I've run many machines on a desk with no case with the backplates removed from the ISA cards and have had no problems. There is an inherent problem on the CPC because an edge connector can be very firmly in place and not moved about and it still wont work due to tarnished contacts.
Title: Re: DOS for CPC6128
Post by: Bryce on 16:01, 10 March 16
Yes, it's also reversed compared to PCs. The edge is on the cards, not the PC. With 8-bit computers it's the other way around (for cost reasons).

Bryce.
Title: Re: DOS for CPC6128
Post by: RobertM on 00:07, 11 March 16

It's not about conductivity, it's about reactivity. Most metals oxidise or tarnish when exposed to air/moisture, and that oxide layer is usually a really poor conductor compared to the original metal. Gold is extremely non-reactive, so no insulating layer forms on it and the end result is a connection that is *much* better than one with oxides in the middle.

That's definitely an issue with connectors generally. Silver oxide is reasonably conductive so for some connectors silver is preferred. Most high end RF connectors are silver - like BNC. A BNC connector ensures there is some wiping action when connecting and this helps displace the oxide to some degree.

On the other hand, I think the issue with edge connectors is more complex than just the connection materials. Other connector properties come into ply.

Edge connectors work perfectly in dust free environments even the old ones as that is where they came from before they ended up in the domestic environment. Vibration is also an issue in a dusty environment.

The old style edge socket had two contacts that were curved and flat in shape, flexed from the cable end and the two curved contacts were connected at the other end as well. This placed a curved shape gap on either side of the contact point so that any vibration would tend to draw dust closer to the center of the contact point and eventually break contact.

New edge connectors have round rather than flat contact surfaces and they are sprung from the opposite end and not connected at the floating end. They also have a different curved shape that is biased greatly to one side ... the inner side where there shouldn't be any dust.

So in a dust environment your only save is to remove dust by the wiping action of removing and re-inserting or blowing the dust out. This is where softer material do better because that have a greater contact surface area and are more malleable so they can absorb the very smallest dust particles.

Title: Re: DOS for CPC6128
Post by: RobertM on 00:21, 11 March 16
If you solder an IDC connector on to your expansion port, you can just use 50-way SCSI cables to connect multiple boards up:

I missed the point of what you meant here. I have already put a pin headers on the expansion port. I was going to use miltiple connectors on a PCB nut I now see you point of having putiple connectors on the cable itself.

I will chop of the extra part of the PCB.

I just have to check that I have enough to decode the IDE port addresses, I have address, data, IORQ, RD and WR. I don't need data so I can add 8 extra inputs to the CPLD. The RESET is interesting. I assume that it's an input or is only active at power on ???

Title: Re: DOS for CPC6128
Post by: RobertM on 08:54, 11 March 16
Well another delay :(

My etch dish is too small lol. I will buy another one tomorrow.

Till then by board will be oxidizing lol.

It's not real good because I don't get good toner coverage but I will get it going.

Title: Re: DOS for CPC6128
Post by: RobertM on 10:29, 11 March 16
Hi,
The ROMs are 16K and the CPC expects the ROM board to recognize a "ROM number" sent to a specific IO port address and store it.


An example board doing this is the RAMCard from Ram7, which I reverse-engineered and provided some explanations on here: Shinra Team (http://pulko.mandy.pagesperso-orange.fr/shinra/ramcard.shtml)

A simpler implementation using Flash-ROM instead of battery-backed RAM is available as:
- The MegaFlash or FlashGordon boards: MegaFlash - CPCWiki (http://www.cpcwiki.eu/index.php/MegaFlash) / FlashGordon - CPCWiki (http://www.cpcwiki.eu/index.php/FlashGordon) (very similar designs, but different flash chips used)
- The X-Mem board: X-MEM MX4 Board - Cent Pour Cent (http://www.centpourcent.net/store/p55/X-MEM_MX4_Board.html) which adds to the above a 512K RAM expansion and a few extra things (it can also replace the firmware ROM which is a special case).

For the Ramcard, MegaFlash and FlashGordon, the PCB designs and schematics are available if you really want to build it yourself. Only the ramcard is single-side PCB, however.
For the X-Mem, you can just buy it from the store.

Hi, PulkoMandy

I looks like you have already done all this. When I go looking for whats out there on the net I see your screen name in lots of places.

One of which is HackaDay - I am a member there to (Hacker404). Congrats for all the featured articles. I also saw your website and various other accounts you have.

I looks like you made one of these already. It also looks like your version is ATA (16 bit) rather than XTA (true 8 bit). I can't see any level translators in your designs so I am guessing they are not needed for the MODE you are using?

I am aiming for XTA 8 bit mode (true 8 bit IDE) and the spec says that I need Vih to the CF of over 4 Volts so I have used 74HCxxx level translators. I thought they may not be necessary but I wanted a prototype that "works" first time if possible.

Also, I haven't given up on the SD card. I have ordered a Wi-Fi SD card (eye-fi) and I will play with that when it arrives.
Title: Re: DOS for CPC6128
Post by: PulkoMandy on 11:11, 11 March 16
Yes, I prototyped something with a Compact Flash in 8bit mode. I did not need any level translators with the card I tested with. However, I had a problem that the card would randomly reset and go back to 16-bit mode. I didn't have time to investigate this further, it could be caused by slight timing differences between the z80 and the CF interface bus (I think I saw notes about this on the retroleum website, with what they did for an early version of the v6z80p).


Also my implementation was hand-wired on protoboard which could cause all kind of interferences, bad contacts, etc, which could be the main problem in the project. I had patched BonnyDOS (with a lot of help from SyX) to use my device instead of the Symbiface (different IO port addresses). It is a relatively simple change but the author of BonnyDOS does not want me to distribute the modified files, sorry.


I have now moved to a solution using the CH376 USB/SD card controller, which opens some more possibilities and ends up being cheaper as CF cards are already becoming obsolete at this point (while MicroSD and USB are lasting a bit longer).
Title: Re: DOS for CPC6128
Post by: RobertM on 06:33, 12 March 16
OK, its (under) etched so now I can see if I can solder 0.8mm pitch QFP on a home made board.

Title: Re: DOS for CPC6128
Post by: gerald on 10:04, 12 March 16
OK, its (under) etched so now I can see if I can solder 0.8mm pitch QFP on a home made board.
With flux, there should be no problem.
Also, it looks like there are two shorted pins just in the middle of the top row of the QFP.
Title: Re: DOS for CPC6128
Post by: RobertM on 10:17, 12 March 16
With flux, there should be no problem.
Also, it looks like there are two shorted pins just in the middle of the top row of the QFP.

Thanks for pointing that out. It's exactly the sort of thing that stuffs me up now that my sight isn't so good.

I scraped it out with a box opener (don't know what they're called in EU). I tested after soldering and all seem good so far.

I hope to finish tomorrow. It's the end of the day here - beer time.
Title: Re: DOS for CPC6128
Post by: RobertM on 10:21, 12 March 16
PS: It ended up under etched because I could see patches or red when I was etching so I panicked thinking they were defects in the resist.

I forgot that I had used red toner.  :doh:
Title: Re: DOS for CPC6128
Post by: RobertM on 05:05, 13 March 16
Getting there slowly.

Now I have to install the Xilinx ISE, write a constraints file, write some VHDL, program the CPLD and then test.

The socket is an IDE socket so in theory I could also use a Hard Drive.

 [ You are not allowed to view attachments ]


 [ You are not allowed to view attachments ]
Title: Re: DOS for CPC6128
Post by: rpalmer on 14:47, 13 March 16
Nice to see a new piece of hardware.

HDOS drivers now can read sectors from the WinAPE SF-II emulation via a driver. So in theory it can handle the XMAS as well (so i understand).

I still have more work to do as I still cannot read the "Device Geometry", but i can read the first sector (aka "Boot Sector") meaning I can get some sort of geometry to work with.
HDOS can perform device initialization which will clear the first sector, meaning after a reset I can no longer know how big the 'IDE device" is which is a big issue to overcome. So i will need to change the behavior of HDOS to handle this type of arrangement, more to come...... ;D

rpalmer
Title: Re: DOS for CPC6128
Post by: RobertM on 23:16, 14 March 16
Well, I wasted a day installing the Xilinx ISE and getting it to work so right now I hate Xilinx. This morning I spent hours trying to work out why Windows 7 has no option to search - didn't find the answer. Then I spent 2 hours trying to find the schematic blow even though I (repeatedly) saved it to the desktop and it shows in desktop with explorer but can't be seen on the desktop!!! So I hate windows 7 to lol.

Anyway, I have programmed some basic logic into the CPLD. It's more complex than it needs to be because I have focused on keeping the read and write windows as wide as they are on the Z80 --- less likelihood of problems while I am still prototyping.

I get different values back from reading the IDE ports from BASIC so it's seeing *something*. Now I will test it and start writing code.

Title: Re: DOS for CPC6128
Post by: RobertM on 08:34, 15 March 16
Well I had a play with and I can read all the ports and everything is as expected *so far*.

Surprisingly everything works so far - both the hardware and the VHDL programming in the CPLD. Well with one exception ... the JTAG programmer couldn't see the CPLDs core voltage reference. After extensive diagnostic processes I discovered that the CPC power wasn't plugged in  :doh:

One take home for me is that the CF card will initialize into IDE mode when it is powered up while in the socket but if you remove it from the socket and re-plug it there is no way to get it back into IDE mode so the next version of hardware will have a way to power down the CF card.

More tomorrow (hopefully).
Title: Re: DOS for CPC6128
Post by: RobertM on 09:37, 17 March 16
Well so much for hopefully lol

I am having a couple of issues now and they are -

1) The specification I m reading for CF cards is as clear as mud when it comes to 8-bit IDE mode. It's mostly focused more modern modes and I expect that I am not interpreting it properly. I don't know of I can read a $sector directly or if I need to read the $sector into the buffer and then read it from there. OR even if the buffer exists in 8 bit mode.

2) I am getting different results at times and sometimes I am getting corruption of the CPC RAM. I suspect that the problem is the PSU, perhaps the addition of the CF Card and interface has pushed it over it's limit. The PSU is getting quite warm.

3) I don't know if I actually have a hardware issue (or perhaps PSU). I even wonder if there may be a problem with the CF card itself.

I am still using BASIC you read write ports. I haven't used a *check if busy* for the card because it shouldn't need it with slow slow BASIC.

I will persevere tomorrow.
Title: Re: DOS for CPC6128
Post by: Munchausen on 14:11, 17 March 16
1) The specification I m reading for CF cards is as clear as mud when it comes to 8-bit IDE mode. It's mostly focused more modern modes and I expect that I am not interpreting it properly. I don't know of I can read a $sector directly or if I need to read the $sector into the buffer and then read it from there. OR even if the buffer exists in 8 bit mode.

Looking into this before I found some posts on other sites about the importance of command ordering and 8-bit IDE mode with CF cards, maybe it's useful for you now: 8-bit compact flash interface « waveguide.se (http://www.waveguide.se/?article=8-bit-compact-flash-interface)

The relevant comments are:

Quote
what I saw in your source code is that you first select the mode and drive (write $E0 to UNIT register) and then set the feature (1 to the FEATURE register) and then the command ($EF set feature to the command register). As it seams many CF-Cards will not work when you change the order (1 to FEATURE, $E0 to UNIT and $EF to COMMAND register). So your source code solved quit a lot of issues

and

Quote
It took me some trial and error before I got it right also. I suspect that changing mode via REG6 in mid-flight is a bit shaky. I read somewhere that the SET FEATURE command should be issued directly after every FEATURE written. The documentation I've found so far is also pretty vague about the 8-bit mode. Perhaps it's not even supported on all cards. It would not surprise me. I have used only SanDisk (4GB and 8GB) and Kingston (2GB) and they have all worked fine so far.
Title: Re: DOS for CPC6128
Post by: RobertM on 00:28, 21 March 16
Looking into this before I found some posts on other sites about the importance of command ordering and 8-bit IDE mode with CF cards, maybe it's useful for you now: 8-bit compact flash interface « waveguide.se (http://www.waveguide.se/?article=8-bit-compact-flash-interface)


That's for that [Munchausen]. I had already read that (and many more pages) it it does clarify an important point.

I wanted to post a comment there because in the text of the page he has written something like *send &FE to the command register* when in fact he means *send &EF to the command register* ... it is however correct in his code.
Title: Re: DOS for CPC6128
Post by: RobertM on 00:50, 21 March 16
Ok I have made enough FAILs now to start over!!! My code is exceptionally longer than other code and it doesn't work.

Here is what I learnt.

Terminology -

IDE - Embedded Drive Electronics - this means nothing as they are all IDE so it just adds confusion.
True IDE - this is often presented in quotes as it seems to be a defacto understanding for which there is no formal or specific specification to.
XTA - IBM XT (and clones) used this. It stands for XT Attachment, was 8 bit and was almost a direct bridge to the IBM XT's 8 bit bus.
ATA - IBM AT Attachment. This was almost a direct bridge to the IMB AT's 16 bit bus.

Trap number 1). The 8 bit mode of CF cards is NOT XTA. It is in fact an 8 bit mode of ATA that is in NO way compatible with XTA.

There is a document tree here lol.

1) The top of the tree is the PCMCIA specification because CF cards are compatible with PCMCIA. This document is not really that important.

2) The CF specification itself is needed to understand how to get the CF card into 8 bit mode (ground on pin on power up). It is not usefull after that as it covers too much - doesn't clarift a lot about 8 bit mode and will lead you down a garden path.

3) The ATA specification (ATA-1) has the needed information without the clutter ... and that is what I will read next.

So now I have to "redo from start" with the software but first I have to fix a printer so I can print some docs.

so far -
ground one pin on power up or tie it to ground. You also need to be able to power cycle the CF for live swapping. this sets IDE mode.
set (feature register) to &01 (feature 8 bit mode)
set (command register) to &EF (execute the "Set Feature" command)
set (head/lba/drive register) to &E0 this sets LBA mode and Drive 0

to read sector
Set (sector count register) to 1 (to read only one sector)
Set (all LBA regesters) to point to wanted sector
Set (command register) to 20 (send read sector command)
Read (data register) 512 times.

none of this is working for me so far


set reg 6 to E0 => LBA mode, Drive 0
Title: Re: DOS for CPC6128
Post by: RobertM on 10:37, 23 March 16
No progress to report.

I am getting gibberish back from the reader and I have noticed that the longer it is switched on the more chance I get gibberish.

I did some voltage measurements and I saw 4.51Volts on the extension board. The CF specification requires 4.7Volts for Voh so yeah that's a problem.

I went and bough a new Switch Mode Plug Pack or Wall Wart or what ever it is were you are and now I have 4.71Volts on the external add on board that I made.

I still get memory corruption on the CPC and I am wondering if there is some other mode that the CPU uses that is triggering the interface to overtake the bus when it shouldn't.

I know the Z80 has some weird interrupt methods but I thought the CPC just uses Mode 0.

I saw another circuit and it had M0 as an input and I don't know why that would be.

Anyway, not giving up but really struggling to understand whats wrong. I don't have a scope and that doesn't help.
Title: Re: DOS for CPC6128
Post by: arnoldemu on 11:22, 23 March 16
I still get memory corruption on the CPC and I am wondering if there is some other mode that the CPU uses that is triggering the interface to overtake the bus when it shouldn't.

I know the Z80 has some weird interrupt methods but I thought the CPC just uses Mode 0.

I saw another circuit and it had M0 as an input and I don't know why that would be.

Anyway, not giving up but really struggling to understand whats wrong. I don't have a scope and that doesn't help.
CPC uses the Z80 in Mode 1.

M0? Not M1? M1 is one of the signals from the Z80.

www.zilog.com/docs/z80/um0080.pdf (http://www.zilog.com/docs/z80/um0080.pdf)

for i/o, check /iorq, /wr, address lines and data lines.

your device should only give data when /iorq, /rd (indicating z80 is trying to read from the port).

If you're doing it at other times you are potentially writing to memory and corrupting it.
Title: Re: DOS for CPC6128
Post by: arnoldemu on 11:23, 23 March 16
please post part of your code, especially the part that writes the commands :)
Title: Re: DOS for CPC6128
Post by: RobertM on 11:33, 23 March 16
CPC uses the Z80 in Mode 1.

M0? Not M1? M1 is one of the signals from the Z80.

http://www.zilog.com/docs/z80/um0080.pdf (http://www.zilog.com/docs/z80/um0080.pdf)

for i/o, check /iorq, /wr, address lines and data lines.

your device should only give data when /iorq, /rd (indicating z80 is trying to read from the port).

If you're doing it at other times you are potentially writing to memory and corrupting it.

Sorry, by mode I meant MODE0 MODE1 MODE2 that the Z80 uses for interrupts. By M0 I really meant the OP FETCH cycle of the Z80.
Title: Re: DOS for CPC6128
Post by: RobertM on 11:46, 23 March 16
please post part of your code, especially the part that writes the commands :)

Well it's written in BASIC and over 100 lines. Ironically it purpose is to allow me to transfer data / programs between the CPC and my PC and if I could do that than I could comply with your request to post my code.

I can do type some of it of you want. It doesn't check the "BUSY" registers because I have assumed that the CF card would be much faster that BASIC code.
Title: Re: DOS for CPC6128
Post by: RobertM on 10:19, 24 March 16
Progress!!!

After buying a new power supply, the code now crashes every single time. No more random lol.

I tried some earlier code and it seems to work - it just reads the ID info and uses the internal buffer.

It seems that when ever I try to read sector zero, I get RAM corruption. Sector one reads but it garbled.

I am going to start over again but this time I will go over all the hardware and probably re-program the CPLD and then try with ASM.
Title: Re: DOS for CPC6128
Post by: RobertM on 08:56, 25 March 16
I found *a* problem.

The Z80 A1 nad A2 signals are reversed by the time they get to the CF card.

They don't go via the CPLD so I can't fix it in VHDL.

I will change the code to match the port number and try that.

Also I read the Z80 timings and M1 and IORQ go low during an interrupt. That may be causing the memory corruption. This is not needed for the MODE 1 interupts that the CPC uses (it's intended for MODE 0) but it reads as if the CPU will do it anyway.
Title: Re: DOS for CPC6128
Post by: cpc4eva on 22:09, 25 March 16
don't know if its already been posted but i just came across this in AA issue 6 March 1986 - article on the Amstrad Computer Show stated that a German company called Vortex were / had been working on a MS DOS board for the CPC 6128.

Anyone know if this did get released ?


Title: Re: DOS for CPC6128
Post by: RobertM on 01:58, 26 March 16
Well I changed the port addressing in my BASIC code to match the fact that two address signals were swapped and after one or two other code edits I had "Hello World" on the CPC6128 screen.

The significance being that I used A hex editor (HxD) on my Windows desktop computer to enter the "Hello World" directly into the beginning of sector 1.

I still get RAM corruption on the CPC. I will change the VHDL and try that. If that doesn't fix it them I will do a mod so that I have access to M1 (OP CODE fetch) inside the CPLD.
Title: Re: DOS for CPC6128
Post by: seanb on 13:53, 26 March 16
"Just about everyone in the Amstrad world was here, with the notable exception of Alan Sugar. But he wasn't really missed"

 :laugh:
Title: Re: DOS for CPC6128
Post by: RobertM on 00:31, 27 March 16
Another new day.

A changed the VHDL so that no IO can occur when M1 is low. In hindsight that shouldn't matter because there is no RD or WR on the INT OP / Vector Fetch cycle of Interrupt modes 0 and 2.

I removed the CF card and tested and I get no memory corruption when the CF card is removed.

There are no direct connections to the CF card except the 5Volts and ground. Everything else goes through a buffer (and level translator) 74HC245. The only thing that can get back is the data bus which goes through a tristate buffer as well. I checked the VHDL for that and it seems fine.

So now I am left with two things that I can think of -

1) A problem in the VHDL that allows the CF to OUTPUT to the Buffer chip when the chip is also outputing to the CF card - and causing higher current drain, dropping the 5Volt rail and effecting the CPC that way.

2) Perhaps I still haven't solved the power issue. I am getting about 4.8Volts on the CF interface board after buying a new 3Amp switchmode - was the highest they had.

Oh for a scope right now.

I  am going to spend some time trying random things because I don't have any test equipment.

Here is what I have in VHDL

M1 disables all access
CF_cs0 is related to IORQ and the Address range FEF0 to FEF7
CF_IORD is related to IORQ and RD
CF_IOWR is related to IORQ and WR
The buffer direction is related to CF_IORD
The buffer output enable ir related to CF_IORD or CF_IOWR

as below

databus buffer direction is -
0, Z80 <= CF card
1, Z80 => CF card

sigaddress_range <= ZA(15) AND ZA(14) AND ZA(13) AND ZA(12) AND -- 0x  F
                ZA(11) AND ZA(10) AND ZA(9)  AND NOT ZA(8) AND  --     E
                     ZA(7)  AND ZA(6)  AND ZA(5)  AND ZA(4) AND      --     F
                     NOT ZA(3);                                      --     0 to 7


sigcf_cs0 <= NOT (sigaddress_range AND (NOT Z_IORQ) AND Z_M1);

sigcf_iord <= NOT (sigaddress_range AND (NOT Z_IORQ) AND (NOT Z_RD) AND Z_M1);

sigcf_iowr <= NOT (sigaddress_range AND (NOT Z_IORQ) AND (NOT Z_WR) AND Z_M1);

sigcfdatadir <= sigcf_iord;

sigcfdata_oe <= NOT ((NOT sigcf_iord) OR (NOT sigcf_iowr));   --NOT ((NOT sigcf_cs0) AND ((NOT Z_RD) OR (NOT Z_WR)));

sigcf_reset <= '1';

the code actually reads the sector or part of the sector (correctly) before crashing. When it crashes I get errors like sn error in line ... and a look at the line shows data corruption - ie incorrect basic keywords inserted into line.
Title: Re: DOS for CPC6128
Post by: RobertM on 02:51, 27 March 16
Ok I did the random things -

Put a wire directly from the 5v (after the switch) to the expansion port.

I found 0.1 Ohms in the crimp connector for the power switch plug and soldered them and re-terminated the other end of the wires on the switch.

Now I get 4.81 Volts on the CF interface board.

Other than that - no change - still getting RAM corruption. Allways seems to be the same line of BASIC code that gets corrupted.

I should go read what the line does - that might be a clue.

I am running out of ideas other than that.
Title: Re: DOS for CPC6128
Post by: TFM on 20:59, 28 March 16
don't know if its already been posted but i just came across this in AA issue 6 March 1986 - article on the Amstrad Computer Show stated that a German company called Vortex were / had been working on a MS DOS board for the CPC 6128.

Anyone know if this did get released ?


Yes, it got released. But it was expensive. I saw it running, but don't know anybody currently who would own it. It was an interesting machine though.
Title: Re: DOS for CPC6128
Post by: RobertM on 13:49, 30 March 16
I haven't given up here. I am just re-thinking my strategy.
Title: Re: DOS for CPC6128
Post by: cpc4eva on 17:35, 05 April 16

Yes, it got released. But it was expensive. I saw it running, but don't know anybody currently who would own it. It was an interesting machine though.


maybe someone out there has one, it would be a rare item indeed.
Title: Re: DOS for CPC6128
Post by: RobertM on 12:51, 01 July 16
OK This was on the back burner for a long time.

I ordered a Disk On Module (DOM) and tried it and it worked first time.

I then made an adapter and tried a 2.5 inch PATA Hard Disk Drive and it works fine to. I had to use a second power supply though.

So the problem wasn't between the 3v3 CPLD and the level translator - the problem was between the level translator and the CF card. The drop in voltage on the 5 Volt line meant that the Voh from the level translator was lower (with noise) than the CMOS Vih of the CFCard (4v7 from memory).

Anyway now I need to worry about software.

I previously looked inside the CPC 6128 and it didn't look like I could fit a ZIF in there for the rom(s?).

Is there an existing TSR or RSX that extends the existing Amstrad Disk functions to an IDE device?

Is it better for me to mod a ROM or just add and external ROM?

My setup is the eight port addresses (I think 4 are used in 8 bit mode) that other older CPC-IDE hardware has. ie - It's a standard 8 bit IDE port like on 8 bit mode of the original IBM AT.

That might sound confusing ! and it is confusing ! There is an 8 bit AT mode that it NOT an 8 bit XT mode and that is what has been used by others and that is what is supported by CF cards! CF cards do NOT! support the 8 bit XT mode.

What I want is to add the RSX "|c" that extends the featured like RUN" load" cat |dir to the hard drive.