Author Topic: Mission for a programmer type - USB Floppy equivalent of CPCXP  (Read 5278 times)

0 Members and 1 Guest are viewing this topic.

Offline dcdrac

  • 6128 Plus
  • ******
  • Posts: 923
  • Liked: 205
  • Likes Given: 24
As we know USB Floppy drivers cannot be used with  CPCXP in Windows 7 so a mission for a programmer which I am not, to create something that can do the same job.

Offline Munchausen

  • 6128 Plus
  • ******
  • Posts: 776
  • Country: gb
  • Liked: 213
  • Likes Given: 215
I don't know if it's possible with USB floppy drives, but you can use a kryoflux. KryoFlux - USB Floppy Controller


Or, use a USB floppy drive, copy the dsk image to the normal FAT12 disk and then use software on the CPC to copy it to a real 3" disk. But a bit of a hassle.

Offline Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.820
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3343
  • Likes Given: 6010
Yeah, but the purpose is to make it easier and cheaper :D

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.318
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1031
  • Likes Given: 2473
It's more a hardware problem than a software problem.


USB floppies have an integrated controller and it's functionality usually isn't fully exposed through the USB interface, so I'm afraid, there's nothing to do here.


Anyway, it would be nice to open one and check how it is on the inside to confirm this.

Offline McKlain

  • 6128 Plus
  • ******
  • Posts: 867
  • Country: es
  • Programmable Sound Generator
    • www.mcklain.com
  • Liked: 338
  • Likes Given: 950

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.654
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4180
  • Likes Given: 436
It's more a hardware problem than a software problem.


USB floppies have an integrated controller and it's functionality usually isn't fully exposed through the USB interface, so I'm afraid, there's nothing to do here.


Anyway, it would be nice to open one and check how it is on the inside to confirm this.

Already done. I was hoping to find a nice little USB to Shuggart PCB inside, but instead I found the IC on the PCB is an all in one USB Floppy controller. I opened three different versions and they were all the same.

Bryce.

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.318
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1031
  • Likes Given: 2473
Aw, crap!


And I guess the controller is already hardcoded for ms-dos formats, right?

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.654
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4180
  • Likes Given: 436
I assume so. I can post pictures of the inside later if it's any help.

Bryce.

Offline robcfg

  • Supporter
  • 6128 Plus
  • *
  • Posts: 2.318
  • Country: se
  • 8-Bit Technomancer
    • index.php?action=treasury
  • Liked: 1031
  • Likes Given: 2473
Yes, please!


Not that I hope to discover something that could lead to the use of usb drives for preservation, but still interested in taking a look.


Thanks!

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1980
  • Likes Given: 4650
And I guess the controller is already hardcoded for ms-dos formats, right?


Yes, it can read only the usual formats.


The problem is that you can only send high level commands to it, you do not have real control over the floppy itself, since USB is just a data transfer protocol.
TFM of FutureSoft
Also visit the CPC and Plus users favorite OS: FutureOS - The Revolution on CPC6128 and 6128Plus

Offline Mochilote

  • CPC464
  • **
  • Posts: 49
  • Country: es
    • CPCMania
  • Liked: 76
  • Likes Given: 24
Re: Mission for a programmer type - USB Floppy equivalent of CPCXP
« Reply #10 on: 09:36, 11 February 14 »
A while ago I tried to do it through UFI commands but the specification is very simple and does not control such things as custom sectors numbers and sizes...  :(

Offline TFM

  • Visit the mysteries of the CPC at www.futureos.de
  • Supporter
  • 6128 Plus
  • *
  • Posts: 9.899
  • Country: aq
  • Space Chicken for FutureOS is free!
    • index.php?action=treasury
    • FutureOS - The revolution on CPC!
  • Liked: 1980
  • Likes Given: 4650
Re: Mission for a programmer type - USB Floppy equivalent of CPCXP
« Reply #11 on: 23:13, 11 February 14 »
That's a pity and true of course.


But one still can copy a DSK to the 3.5" disc and get that on the CPC side in use with CPCDSK or what ever.

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

Online Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.654
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4180
  • Likes Given: 436
Re: Mission for a programmer type - USB Floppy equivalent of CPCXP
« Reply #12 on: 16:50, 15 February 14 »
Yes, please!
Not that I hope to discover something that could lead to the use of usb drives for preservation, but still interested in taking a look.

Thanks!

Ok, here's what the USB floppy looks like inside. The PCB is completely inside the drive mechanism, so you only see this once you've removed the frame that holds the disk in place. As you can see, the USB signals go directly to the drive and there's no identifiable USB to Shuggart circuitry.

This particular device is from Freecom, the drive inside is an NEC FD3238T.

Bryce.

Offline Cholo

  • 6128 Plus
  • ******
  • Posts: 517
  • Country: dk
  • Liked: 105
  • Likes Given: 117
Re: Mission for a programmer type - USB Floppy equivalent of CPCXP
« Reply #13 on: 00:46, 16 February 14 »
I remember fooling around with Disk2FDI a while back. Being able to write custom formats on pc is actually a fairly new thing. The Amiga range was actually quite amazing as there was a lot of software that could read/write pc formatted 720k floppies even on a basic Amiga 500.

Alas reading those 880k amiga formatted DD floppies on PC was nearly impossible unless you got special modded hardware. However i believe Disk2FDI was one of the first to find a "loophole". Not really sure but i think there was even checks at hardware level (motherboard?) .. anyways, the trick was to have 2 actually floppies internally in you pc. Then have a real 720k floppy in one and the amiga one in the other. As i understand the program did the noughty thing of stealthy changing the drives around every time the hardware would go "wait that isnt a normal track" so itll check the drive with the pc floppy every time. Always felt that was quite clever.

Of cause hardware has changed a lot so it shouldnt be impossible to hook up a Usb-floppy and write amstrad format floppies to it. However i will take some quite heavy programming i guess. Like it will need rewritten windows drivers (just like the Kryoflux board) so it get recognised as something else than a pc usb drive. Wonder if there is any kind of internal check in the usb drives as well.

Someone else mentioned Kryoflux as a alternative. I wouldnt do that in the current state of the Kryoflux. It supports amiga & c64 floppies currently .. but it feels like they cut amstrad support completely to make the other ones work. With the older drives i could at least get it to read raw dumps of amstrad discs, but i cant even get the current version drives to recognize DDI/FD1 drives anymore.

If you have a 6128+3,5" drive its much easier to copy DSK files onto a 720k pc formatted floppy and read em on the 6128 with the software already mentioned (i personally use Symbos as its recognize the pc floppies automaticly and has that DSK-dedumper program).

Another alternative is to hook up a 3" drive internally in your desktop pc (or a 3,5" of cause) .. ive seen 3" to pc kits being sold on ebay lately too.

Offline awergh

  • CPC6128
  • ****
  • Posts: 259
  • Country: au
  • Liked: 123
  • Likes Given: 250
Re: Mission for a programmer type - USB Floppy equivalent of CPCXP
« Reply #14 on: 13:29, 16 February 14 »
Yeah I wondered about this although I have an LS120 drive attatched to SATA->IDE Converter to give me essentially a SATA 3.5" FDD
I could use a USB one but the LS120 drive works fine even if I have to have cardboard faceplate substitute on it.
I tried writing to it from a vm (virtualbox) in a hope to be able to write to it but virtualbox seems to report write protected all the time even when using normal disks :(

Offline KaosOverride

  • 464 Plus
  • *****
  • Posts: 312
  • Country: es
  • Liked: 195
  • Likes Given: 44
USB floppy drives are very limited at low level commands, but IBM format suport in AMSDOS is here to the rescue.

Because I was planning to test the 720kb Gotek with the CPC, I have make a simple util which converts an standard DATA, SYSTEM or IBM .DSk to a PC .IMG raw image (DATA and SYSTEM are converted on the fly to IBM CPC).

Then the .IMG can be writen to 3.5" with RawWriteWin and USB floppy drive.

After showing this info at Amstrad.es, Mochilote has added support to IBM DSK writing to USB floppy drives on a new CPCDiskXP release!!!!  :laugh:

So thanks to CPCDiskXP you can now write IBM CPC .DSKs on USB floppy drives. This is very helpfull to transfer on your own utils such as WriteDSK and more, whitout help of other people's "real" floppy drive, and then use a FAT12 720Ks to transfer .DSK images thanks to WriteDSK and similar tools. Also unprotected games/utils can be transfered if they work on IBM CPC format and you don't mind using just 154Ks of 720...

Bryce, you got the Gotek 720ks???   The  SFRM72-FU-DL model supports IMAGE mode and READY signal selectable with jumper.

Get the DSK2IMA from https://mega.co.nz/#F!2JkUDb7C!HC85bXhbsB5b6p3kCUuCkQ and give a try.

The IMG format is for the RawWriteWin input, so maybe the Gotek .IMG format has some difference... My SFRM72-FU-DL is travelling from China now and I can't test...  :(

Also, the DSK2IMA has no full error checks, so consider it as Alpha release  :P   (Only works with strict standard DATA, SYSTEM and IBM CPC formats)
Source is given with it, also...

Offline Munchausen

  • 6128 Plus
  • ******
  • Posts: 776
  • Country: gb
  • Liked: 213
  • Likes Given: 215
Now we just need a linux equivalent of cpcdiskxp!

Offline Mochilote

  • CPC464
  • **
  • Posts: 49
  • Country: es
    • CPCMania
  • Liked: 76
  • Likes Given: 24
Now we just need a linux equivalent of cpcdiskxp!
USB devices works perfectly on virtualized machines, you can use for example vmware for linux, create/install a XP virtual machine and use your USB Floppy drive with CPCDiskXP on it  ;)

twinpics

  • Guest
Hi KaosOverride,


Many thanks for you to have found a way to write DSK to a USB floppy disk (and many thanks to Mochilote too).
CPCDiskXP works indeed very well.


But your link to DSK2IMA on mega.co.nz is not valid anymore. Can you tell me where to find DSK2IMA ? I would like to study its sources to try a port to Linux / Mac.

Offline cpcitor

  • The user previously known as FindYWay
  • CPC6128
  • ****
  • Posts: 289
  • Country: fr
  • My heart still runs on traditional CPC.
    • My code for the CPC.
  • Liked: 142
  • Likes Given: 351
Now we just need a linux equivalent of cpcdiskxp!

As often with Linux, integrated tools are so powerful you don't need to write specific tools. When specific tools exist they tend to be context-specific wrappers (GUI or scriptable) around pre-existing generic tools.

I just wrote "something" (actually a bunch of command lines) close to some kind-of equivalent of cpcdiskxp for Linux and a USB drive here: http://www.cpcwiki.eu/forum/technical-support/have-linux-make-a-usb-floppy-write-a-disk-that-a-cpc-can-read/msg150478/

You can now with Linux and a USB floppy drive format disks and read and write IBM-formatted images to/from actual disks that the CPC can read and write to.

Enjoy!
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC.

Offline cpcitor

  • The user previously known as FindYWay
  • CPC6128
  • ****
  • Posts: 289
  • Country: fr
  • My heart still runs on traditional CPC.
    • My code for the CPC.
  • Liked: 142
  • Likes Given: 351
The UFI Command Specification is available online from http://www.usb.org/developers/docs/devclass_docs/usbmass-ufi10.pdf .

As expected, behavior of Linux command ufiformat matches the standard.

While the standard does allow to request formatting one single track, it does only allow a hardware-predefined set of format parameters.

So, no chance to request 40-track, single-sided, 9 sector/track numbered 0xC1 to 0xC9 via the standard.

Perhaps some specific chip accept some non-standard commands allowing lower level access? Manufacturers often add this kind of "hidden" commands that serve them for test purpose (or firmware upgrade  ::) ).


I remember a Linux distribution 20 years ago have some trouble, because the installer detected if a CD-Rom drive was only a reader or a burner by sending it a burn command stub and seeing how it reacted. The trouble was: one CD-Rom controller manufacturer had programmed their chip to react to such a command by performing a firmware upgrade immediately, starting with wiping current firmware and waiting for the new one. Net result was a number of bricked CD-Rom drives. So, chip-specific, non-standard commands definitely exists, they sometimes allow finer control, but one should be careful.


If such a low-level, finer control floppy-format command (and other commands) exist on some USB floppy drives, they would be interesting yet depend on the specific USB-UFI chip. So far, better chances of success in writing regular CPC data format are to be expected with a tower PC and traditional internal drive.
Had a CPC since 1985, currently software dev professional, including embedded systems.

I made the first CPC cross-dev environment that auto-installs C compiler and tools: cpc-dev-tool-chain: a portable toolchain for C/ASM development targetting CPC.