Thought I'd create a thread for any Fujinet enthusiasts out there
I'm not overly familiar with Fujinet but did notice that the developers were working on an RC2014 version and so I naturally thought this might eventually fit in with the Digicool MECB system ... so I've been tracking their progress. While they have been working on the software side of things I thought I'd just play with a simple interface version of the Fujinet for the Digicool MECB and had my first prototype built (the red USB cable goes to my laptop so that I can monitor commands going to the ESP32 module via the MECB bus - it's not needed for normal operation):
To my surprise, after a bit of hacking, I managed to talk to the board via the Fujinet protocol so that I could connect up to my local Wifi network. From that point, the card runs a web-server that can be user to configure the system. For example, I was also able to attach the microSD card and share a file from there. It should technically be possible to connect to remote server files in a similar fashion (though I haven't got that far yet).
It's still very early days and there isn't much in the way of software to work on the CPU side of things but it'll be interesting to see how things progress in future.
Hi Emil, that is very impressive, I'm still trying to get a grip on the software requirements to perform such a task. Ive been a bit occupied with some other tasks. I assume you are using a couple of 74LVC245 chips there. Best regards, David.
The preliminary design I based this on (https://github.com/FujiNetWIFI/fujinet- ... Rev0.3.pdf) used a 74HCT245 (with pull-up resistors - which I guess helps to get it over the line with respect to registering logic changes) for the input register and a 74HCT574 for the output register (the original schematic suggests that the ESP32 pins are "unofficially 5v tolerant" - I'm not sure how reliable or true that statement is though).
BTW, I've updated my GitHub with the current design over here:
Hi Emil, Oh I see. I had assumed you had made a port based parallel interface. I'm not convinced a bit bash SPI is the best way to go for this considering the CPU load to do this. (someone posted an improved SPI schematic on the fujunet rs232 thread recently which looks interesting) But then Ive done nothing either. I'm still wading through the available documents and examples such as they are. As i see it the hard part will be to implement the higher level drivers and since you have the packet transfer working now thats a big positive on the way ahead.
Setting up the C cross compilers was not too difficult when I did it. There are two to choose from and a choice of run-time libraries. I forget the details now. I have some examples saved somewhere I can lookup.
edit: example using zcc here: https://github.com/DavidJRichards/SC126 ... main/T6963 the c file has a comment showing the incantations to drive the build.
Don't get me wrong, I'm still impressed, well done David.
Yes, I totally agree, I feel the bit-bash approach was an odd choice - it makes the CPU do a lot of unnecessary work. For a while it seemed like it was the SPI the approach that was being taken (and for which there was some support for in the firmware and driver side of things). I guess I'm not too fussed about the performance at the moment ... just getting the functionality would be nice even it if isn't a speed demon (and having something to work with is better than nothing). However, I also agree, the hard part is integrating it into a higher level system (e.g. an OS).
I'm stuck with a lot of work-related work at the moment so don't have much time to play with more interesting things but will have a look at the zcc example when I get a chance - thanks for pointing it out.
LOL, so I was sitting around at my son's band rehearsal and gave this a whirl ... I managed to get a "Hello, world" to compile - so that's a great start. I don't know if it'll actually run though (I didn't bring my CPU board with me).
Thanks for the link. Once I wrap my head around the Fujinet library this will have to be another project on my list (I'm thinking it might initially be a simpler alternative to adapting the IDE drive for the purpose ... though in the long term I believe it should be easy enough to adapt for that also). The 6502, despite being an incredibly popular CPU in early computing, never really had a default goto OS i.e. every platform had its own thing (very specifically tied to its own hardware). So it's nice to see something like this - having access to a basic assembler, BASIC, and an editor makes this a useful self-contained system.
I'm slowly making progress with understanding Fujinet, the documentation is really hard to find and the library code is not particularly self-explanatory (i.e. many of the parameters are not explained and the required sequence of library calls to achieve something is not entirely obvious or under what circumstances you would use one call over another - fortunately tapping into the debugging logs on the ESP32 helps with trying to understand if I'm doing something wrong). I've got to the point where I can extract the directory of a host device ... now I'm moving on to the point of trying to read a file or disk on that host. I'm going to try adapt FLEX for the 6809 first (mainly as I'm quite familiar with the 6809 and so it is a bit easier to work with ... but that requires creating the Fujinet library for 6809 - so a bit of work is involved to get to the stage where I can start talking with the device again). If that works relatively easily then I'll probably move on to FLEX for 6800 (since the 6809 and 6800 are quite similar) ... and then CP/M-68K (which shifts my learning to setting up the CP/M calls needed) ... and then CP/M 6502 (by which point I should understand the calls a bit better and then just have to worry about how to do things with the 6502).
My use-case it quite a bit different to all of the other versions of Fujinet. As far as I'm aware all the other versions are assuming it is plugged into the same system e.g. C64, Apple, Atari, etc where as with the Digicool MECB we can plug-and-play different CPUs with the same Fujinet card plugged in. So I'm thinking to have simple config files in the root directory of the SD card that define where the disk images are for each platform/OS - during initialisation code on the CPU card will first read that config file, set up the host drive slots and then boot from the first disk of that set. If a different CPU is plugged in then it'll reconfigure with whatever is needed for that CPU. Conceivably it should be possible to write simple applications for each OS to allow changes in configuration without having to remove the SD card. This is all very long term, but is the idea I have in mind ... I'm not sure if I'll run into any stumbling blocks along the way e.g. While it is possible to read/write files on the SD card, it's not yet possible to do a file seek - this would've solved a lot of the sector size issues that I'll face in moving between different OS implementations and would've made coding a LOT simpler. Fujinet disk image handling does allow random sectors to be read/written but they are always 512 bytes in size.
Hi Emil, not CP/M but this 6502 retro-os: https://github.com/6502-retro/6502-retro-os/
Dave the developer, helped me port it to my MECB system.
Its very good and includes a micro-sd filing system too. its not FAT based but it is tuned for a low power system and has an accompanying set of PC tools.
I'd imigine it would be a good contender to add Fujinet into it.
Best regards, David
p.s. I've invited you to my discord log made when porting to MECB