Linux support

Have an idea how to make KryoFlux even better? Let us know...
User avatar
Malvineous
Posts: 156
Joined: Sun Oct 31, 2010 10:57 pm
Location: Brisbane, Australia
Contact:

Linux support

Post by Malvineous »

Well, my KryoFlux arrived today (Brisbane, Australia - just over two weeks shipping time) and it works well!

Having looked at the USB DLLs though, I'm wondering how much work is going to be involved in porting it to Linux? I'm quite keen to see this happen (and yes I've seen you have plans to do this) but it looks like it could be a really big job if it's heavily designed around Windows APIs. I'd be happy to help out if I can (I've only written one USB driver for Linux though) but I'm not sure how easily you could plug something like libusb into it. (I imagine it would be best to use libusb so the device can be accessed entirely in user mode, with no kernel drivers required.)

On that note, the device seems to appear under standard Atmel USB IDs when you first plug it in. Is it possible to configure the device to use different USB IDs on power up, to avoid misdetection?

User avatar
IFW
Posts: 3079
Joined: Mon Nov 08, 2010 2:42 pm

Re: Linux support

Post by IFW »

USB IDs have to be assigned and approved by the USB organization, and afaik it can take quite some time and money.
Unless you are developing hardware there is no chance that any other device would come up with an ATMEL development VID/PID.
Each device would have to have a new bootloader flashed as well as the original VID/PID comes from that - the second one comes from our firmware that is being uploaded at boot time.

DTC does not use anything Windows specific apart from WinUSB and to my best knowledge libusb is just a wrapper around WinUSB on Windows platforms.

User avatar
Malvineous
Posts: 156
Joined: Sun Oct 31, 2010 10:57 pm
Location: Brisbane, Australia
Contact:

Re: Linux support

Post by Malvineous »

Thanks for the quick reply! Does this mean you will need to rewrite the USB parts of DTC to use libusb instead of WinUSB before you can release a Linux version? Or are you currently planning on releasing the code first and letting the community do the port?

User avatar
IFW
Posts: 3079
Joined: Mon Nov 08, 2010 2:42 pm

Re: Linux support

Post by IFW »

Yes, USB handling is quite Windows specific, everything else is platform agnostic - but nothing ever uses USB directly in the code, apart from a device access class that can be ported to any platform as needed. Every other part of the code uses the device access class, so no further changes would be necessary.

I believe Mac developers are looking into porting the OS dependant part to libusb - the rest should work as is, with maybe a few cosmetic changes.
Portability is the reason why it's a console application without any fancy GUI - it can be used as a backend for a GUI based system, or as a command line tool directly.
The GUI is cross-platform, but no, I don't have an ETA, maybe the author would give one - but usually we release something "when it's ready". ;)

The source of DTC has been available for developers for a while with a warning that it can and does change.

User avatar
IFW
Posts: 3079
Joined: Mon Nov 08, 2010 2:42 pm

Re: Linux support

Post by IFW »

That would of course also mean that if there is something that compiles on Mac, it would mostly work as is on Linux or vice versa - whichever comes first :)

itix
Posts: 2
Joined: Mon Nov 15, 2010 9:05 pm

Re: Linux support

Post by itix »

Is there any developer documentation available? I am writing drivers to mount KryoFlux as an Amiga floppy drive and I dont really need source code but just information how to read tracks etc.... and how to upload firmware to make it actually usable.

User avatar
IFW
Posts: 3079
Joined: Mon Nov 08, 2010 2:42 pm

Re: Linux support

Post by IFW »

It would be quite a challenge to convert flux transitions to track data - the device reads flux transitions and you need to simulate lots of processing phases to finally get any sort of track data out of that.

Please do get in touch via the softpres ticketing system.

User avatar
Malvineous
Posts: 156
Joined: Sun Oct 31, 2010 10:57 pm
Location: Brisbane, Australia
Contact:

Re: Linux support

Post by Malvineous »

Well I got impatient so started working on some Linux code this morning. It doesn't load the firmware (yet) so you still need to do that through a Windows VM, but the code does the rough equivalent of "dtc -c2" and prints the maxtrack just as a proof of concept.

If anyone's interested here's the .cpp file and you can compile it like this:

Code: Select all

g++ -o kryo kryo.cpp `pkg-config libusb-1.0 --cflags --libs`

User avatar
mr.vince
Posts: 2127
Joined: Tue Oct 05, 2010 5:48 pm

Re: Linux support

Post by mr.vince »

You know we mailed about this... and DTC is already being ported to gcc for the Mac by using libusb, so it should only need minor corrections to work on a Linux box...

Just to make sure you don't double work. ;)

User avatar
Malvineous
Posts: 156
Joined: Sun Oct 31, 2010 10:57 pm
Location: Brisbane, Australia
Contact:

Re: Linux support

Post by Malvineous »

Yes very true but sometimes when you have a new toy you just can't help but tinker :-) Well anyway now I have access to the source I can start a proper Linux port - yay! :-D

Post Reply