News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

CPCSD: new mass storage solution

Started by SyX, 20:16, 01 May 12

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SyX

The last few days Pulkomandy has been working in a prototype  SD card reader/writer for the CPC through the printer port, you can find more details about this project here.

rpalmer

The article speaks of needing to add in a filesystem.

From what I know and have said on the wiki is that HDOS has independent device drivers, so any device can be attached with little effort on the software front. So it is possible to quickly implement the device with an already developed filesystem to support it. Examples of the device drivers can be found on the wiki or I can email the drivers to whom ever wishes to develop a driver for themselves.

Also it is possbile to use the IDE interface with an adaptor card for SD if the article is correct in its use of the signal lines.  The benefit here is that the IDE interface is customisable to allow for more than just one card to be attached, since it uses the 8255 to make-up an IDE port and the 8255 can be adapted to control and SD card intead (or many SD cards). I still have some of the IDE interfaces for sale.

Regards
rpalmer

SyX

Thanks rpalmer, i have passed the info to Pulkomandy :)

Gryzor

The magic of the HxC is that it runs out of the box, no ROMs or meddling with FS necessary. I see quite a few complications in normal use that would prohibit widespread adoption.


On the other hand, it's so cheap that -hell yeah!


Imagine - if we ever see another mega-game released on the CPC, it could be sold with the adapter itself AND an SD card to store all the data, and the price would still be down to earth...

PulkoMandy

Hi there :)
I'm making some progress on this. Yesterday I made some research on the existing FS solutions.

It turns out that none of the existing one are actually extpandable with device drivers ! I was planning to make some tests with RODOS, but actually I didn't find a way to add a driver to it, while the documentation says it should be possible...

I looked at HDOS (could find some infos in the forum, not in the wiki itself), and, I didn't find any info on how to write drivers. Moreover, it seems to be a huge number of RSXs, and most of them just seem to do nothing in the version of the ROM I have. That's not very user friendly :)

Anyway, I hope to see people building their own or getting them from someone else, and add drivers to whatever they think is useful. On my side, given the state of existing solutions and their documentation, it ends up being easier to rewrite my own FS. I have finished the design of disk structures, and I'm now writing the PC tool to access it while SyX does the CPC ROM.

As you may have seen on pushnpop forum, I published the sourcecode for sector read/write :
http://pulkomandy.tk/drop/cpcsd.z80
The schematics
http://pulkomandy.tk/drop/cpcsd.png
And pictures of the prototype
http://pulkomandy.tk/drop/cpcsdA.JPG
http://pulkomandy.tk/drop/cpcsdB.JPG

Jeff_HxC2001

Quote from: PulkoMandy on 08:11, 06 May 12

Anyway, I hope to see people building their own or getting them from someone else, and add drivers to whatever they think is useful. On my side, given the state of existing solutions and their documentation, it ends up being easier to rewrite my own FS. I have finished the design of disk structures, and I'm now writing the PC tool to access it while SyX does the CPC ROM.


Once done, i will probably add the HxC "Direct Access" layer to this new mass storage driver.
;)


PulkoMandy

Nice ! So I don't have to do it ;)

Devilmarkus

When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Gryzor

 
Quote from: Jeff_HxC2001 on 09:17, 06 May 12
Once done, i will probably add the HxC "Direct Access" layer to this new mass storage driver.
;)




Ohhh seeing what the ST HDD mode looks like, I approve :)

TFM

TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

00WReX

I'm also very interested.

I like that it is using the printer port as I do not use this port.

I always have a ROM board & external floppy plugged in, so nice to not clutter those ports and use a previously unused port  :)

Cheers,
Shane
The CPC in Australia...
Awa - CPCWiki

rpalmer

hello Pulkomand,

The reason why a version of the HDOS rom does nothing was simply to show an initial version of what could be developed.

The latest version does have all the RSX's working (and the ROM has to be purchased). The device driver is free, so if you want the latest just contact me.

As for the drivers, I cant see how the drivers source does not explain to developers "how" to create a driver.  I saw the whole source for a given device simple as it can be, but if you need some "HELP" then dont hesitate to contact me for more info/help on this matter.  My current device driver ROM has the ethernet drivers in it and the TCP/IP packet management.

I would also like to add that FutureOS, Symbos, etc are all specific "Programs" which means they may not work with existing basic programs or existing disc software.  HDOS with its driver development and potential to emulate floppy disks on a device, means that existing software can be used with the benefit of speed coming from the new device. I am not saying that HDOS is better then anything else, but i am just saying that any existing s/w like RODOS were created when the only big storage device attachable was floppy and that any new device would require RODOS to be modified (and the source for RODOS and so on may not be available). I also understand from what I have seen on CPCWiki, that there is no independent device driver DOS  existing apart from HDOS.

The requirement of so many RSX's in the HDOS was so that the system can be setup to operate with a new device, rather than trying to determine which device the user wishes to use. The use of a hardwired device would have been possible but any changes to the desired device would be impossible as it would be in ROM and hence fixed forever, so i choose to let the user decide which device to use. This may change if a memory backed memory module were created to allow configurations to exist between power on/off switching.

rpalmer

PulkoMandy

Well, I use a ramcard for my roms so changing the ROM when I need another device is no problem for me.


I have already disassembled part of RODOS to try to understand how it works, so source unavailability is not a problem for me.
On the other hand, I'm not willing to buy your ROM before I could even test anything. Sorry !


I don't think a device driver has to be so complicated. We need to read and write sectors, and get device capacity. Can't think of anything else. RODOS is almost there, but writing my own system is a bit more fun :)

TFM

Hi Pulko, I'm looking forward to your implementation. Do you use a special format for the SD card. I like to support it too.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Jeff_HxC2001

Quote from: PulkoMandy on 10:28, 06 May 12
Nice ! So I don't have to do it ;)

One thing to keep in mind : keep the possibility to have an MBR sector on the sdcard : By this way you can have an FAT32 partition + your FS on the same sdcard  ;)

TotO

Why not handling FAT on the SD Card for CPC too ?
"You make one mistake in your life and the internet will never let you live it down" (Keith Goodyer)

PulkoMandy

FAT is possible, but needs more RAM buffers for managing stuff. It already works on CPC, as you have noticed if you used NoRecess host software for the HxC floppy emulator (this one uses C code). A z80 asm implementation of FAT is also available from the Retroleum project, and should not be too hard to plug in a CPC ROM. Or, you could use R-DOS as already mentionned, I heard support for FAT is at least planned ? (don't know it too well).
The increased RAM usage means more compatibility problems with existing software. We are trying to keep the ROM as close as possible to AMSDOS. remember I'm doing this for fun, and designing my own FS sounds like a lot more fun than using an existing one ! :q


It's all open source anyway, so I hope people will take care of writing their own software for it.

TFM

Quote from: PulkoMandy on 17:55, 08 May 12
... Or, you could use R-DOS as already mentionned, I heard support for FAT is at least planned ?...
Offtopic: What's R-DOS???
The R-DOS I do know is the DOS-enhancement ROM for the RAM drive from Dobbertin providing a 444 KB RAM disc C under BASIC, CP/M 2.2 and CP/M Plus (dk'tronics compatible).
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

PulkoMandy

Oops. I'm mixing them all up now.
I meant HDOS here.


We are using R-DOS and RODOS as sources of ideas on how to do things. I was planning to add support for the SD card to RODOS directly (the user manual seemed to imply it was just about providing the code to read and write sectors), but it turns out that it also needs a lot of patching in the code of RODOS itself : all commands withe extra drive numbers are rejected by RODOS... And I don't like the on disk structures, and, I think it uses too much RAM :)


Our filesystem is making some progress. For now I do a version in C/C++ for PC, it is easier to prototype and design the disk structures. I have the simplest operations in place (reading and writing on a non-fragmented device). I need to add directories support and removing files (which will create some fragmentation, needs some more support). Then, we port everything to z80 assembly code and put it in the ROM.

TFM

Actually RDOS can be patched here, instead of a RAM disc you would have an SD-disc. But it's just one idea.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Badstarr

Proud owner of 464 GTM64 6128 GTM65, GX4128 and a 464/6128 Plus Hybrid a 20 year long ambition realised! :-)


PulkoMandy

I'm stil lwondering why no one tried it on CPC before.


Actually I worked from a version for the Thomson MO5. It seems very easy to make this work on other computers as well.

TFM

Quote from: PulkoMandy on 17:19, 14 May 12
I'm stil lwondering why no one tried it on CPC before.
Maybe it's the limited speed.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

PulkoMandy

Well, it's still quite ok. Since there is no speed up delay and seek time (unlike floppies), I think it *feels* about as fast.
But I still have to try it in filesystem mode, loading a 16K picture from the first sectors isn't a good test :)


BTW, the code for the filesystem is coming along. I have the basic file operations working on PC (catalog, read and write files). I still have some work to do on these (handle fragmentation, directories, and more than 32 entries per user). Meanwhile, SyX is working on the expansion ROM. He has the logic to interface with AMSDOS done (overriding RSX, reserving memory, and so on), now we need to convert the FS code to z80 and see how it goes.

Powered by SMFPacks Menu Editor Mod