English Amiga Board

English Amiga Board (http://eab.abime.net/index.php)
-   Coders. System (http://eab.abime.net/forumdisplay.php?f=113)
-   -   Amiga and Raspberry Pi (http://eab.abime.net/showthread.php?t=92931)

bwldrbst 05 June 2018 15:49

Amiga and Raspberry Pi
This subject seems to come up every now and then and people have a few different ideas:
  • Connect a RPi to your Amiga via a null modem cable and use it as a (slow) network adapter.
  • Connect a RPi to your Amiga via some other means - Parallel port, Floppy port, SCSI, SPI adapter, or just somehow plug it into a Zorro slot - and let the Amiga use the RPi's resources.
  • Figure out how to plug the RPi directly into a 68000 socket and use an emulator as a poor man's Vampire.
The first option is easy, the third is (I believe) unrealistic. I've been thinking a lot about the second option and have something that is starting to work.

The goal of this little project is to make features of the RPi available to AmigaOS friendly software. A server process running on the Amiga communicates with its counterpart on the RPi. Client applications on the Amiga use the server to open a bi-directional communication channel with the RPi using an interface that looks a bit like talking to an Exec device.

Here's a couple of similar looking projects for other old computers:
Some examples of the client software that might be written are:
  • Got no battery backed up clock? Sync it from the RPi on boot.
  • Mouse died? Use a USB mouse (or keyboard or drawing tablet...) plugged into the RPi.
  • Need some easily backed up storage space? Mount a disk plugged into the RPi (or just use some space on its SD Card)
  • Can't afford a network card? Use the RPi's network connection directly, similar to the way UAE can expose the host OS's networking.
So far, I have clock sync and USB mouse control working. I'm sure there's plenty more applications you imaginative people can think of.

At the moment I'm running this with a null modem to USB RS232 adapter but it shouldn't be too hard to adapt to other connection methods. I'd love to have this software use a parallel to GPIO connection, similar to a Plipbox but being able to support a range of connections is important.

The RPi part of the system can be found at https://github.com/adkennan/AmiPiBorg. It's written in Go and can be fetched with "go get ..." and built with "go build". It generates an executable named AmiPiBorg and expects to find a serial port called /dev/ttyUSB0.

The Amiga side can be found at https://github.com/adkennan/AmiPiBorg-amiga. It currently needs SAS/C to build but I'm open to switching to other compilers. If you wanted to try it, build the server, then the library then each of the clients. Everything will be put in the "bin" directory. Start the server, AmiPiBorg, first then try a client.

I'm at a point with this where I need to make some decisions and I'm hoping to get a little feedback. I have the basic communications protocol working and I'm reasonably happy with how it looks on the Amiga side. Some things that I think need attention are:
  • The RPi side is pretty hacky and could do with a clean up.
  • As the RPi side is written in Go, I'm interested in something like https://github.com/gokrazy/gokrazy to pretty much make it plug-and-play.
  • As I want the RPi side to be hands-off defining a configuration protocol and implementing Amiga-side tools (CLI and/or GUI) will be required.
  • The Amiga side collects some stats as it goes and just dumps them to stdout on exit. It'd be nice to have tools for querying stats or inspecting what it's doing while running.
  • Similarly, right now a bunch of debug messages are just printf'd. Some controllable logging would be nice.
  • Modularize the I/O bit so different physical connections can be used and actually develop software support for said connections.
Which all seems like a lot of procrastination before I give you a dirt cheap network adapter that doesn't need a TCP stack running on the Amiga.

I'd like to know if you think this project is interesting and could be something you'd use or even like to hack on. If so, what sort of features would you like to see? Running from a Workbench 1.2 floppy? A fancy MUI front end? A parallel port adapter and 3d printed case sold for $$$ on Ebay? A nice dark ale? Let me know what you think :)



PerspexSphinx 06 June 2018 22:50

Sounds fascinating. A parallel port adapter I would think would be Interesting. Is a clockporrt adapter possible?
To be able to use RPI’s Mouse, Graphic Tablet, Keyboard, USB and SD card would definitely be fantastic.
Perhaps somehow link to Amiberry? Boot off Raspberry Pi (I suppose that’s a bit fanciful)?
Of course if it was super user-friendly and simple on both platforms would be nice.

bwldrbst 08 June 2018 00:38

I think a clockport adapter would be possible. It would just need drivers on each side to understand the protocol, same as any other connection.

Unfortunately what I'm talking about wouldn't let you boot from the Raspberry Pi. Unless you had it connected to a floppy port and emulated a floppy drive to bootstrap the whole thing but that's way beyond my current scope!

TroyWilkins 08 June 2018 02:58

Ooooooh, I love this idea, and the potential for this is HUGE. Personally, I like the idea of communication via the zorro connector the most, but that has 2 problems that I can see:

1, not all Amigas have the same zorro connectors (although there are some adapters for some, but that still leaves A600, CDTV, and CD32 people in the cold), and

2, that would be rather complex.

But the potential is too great to ignore in my humble opinion, and the only real limitations would be what could be done in software.

Have you seen the project where a guy connected an RPI into a cartridge that could be 'played' on an unmodified NES? That sort of gives a bit of an idea of what could be possible, and what sort of challenges there can be, although given we're talking about a computer and not just a relatively dumb 8-bit console, the potential is so much greater.

Niklas 08 June 2018 15:05

Me and a friend are doing an Amiga 500 trapdoor expansion card that has an FPGA, an SRAM, and a Raspberry Pi 3 on it. The memory in the SRAM is shared between the A500 and the Raspberry. The A500 "sees" a DRAM interface and the Raspberry communicates with the FPGA via SPI. While prototyping we are using a DE10-Lite card (https://www.altera.com/solutions/par...ite-board.html). It is up and running and both sides (A500 and RPi) can read and write to the shared memory simultaneously. Next steps are adding a real-time clock and then making a proper PCB. We will release the design once it's complete.

Eriond 08 June 2018 21:43

As Niklas mentioned, all data necessary to build and develop for this "thing", will be publicly available as soon as we feel it's stable and proven working.
Meanwhile, here is a picture from our early prototyping:


The ribbon cables on the left go to 3 x ASIX Omega logic analyzers, which have helped us tremendously during this project.

gulliver 08 June 2018 23:06


It seems like a great idea.

Are you planning on doing a Zorro II version?

The A500 trapdoor expansion resembles a Zorro II slot from the point of view of the available signals. The form facotr is the big difference. I say it, because whilst Zorro II is not as good as Zorro III, it will only require minor modifications to your current project and will open up the door to make it much more compatible with lots of Amigas (A2000, A3000, A4000, and all their variants).

Maybe you could just provide an adaptor that turns your unmodified A500 Pi card in a ZorroII compatible one (many hardware expansion manufacturers did this in the past).

bwldrbst 09 June 2018 01:46

@Troy, an internal expansion like a Zorro card is really appealing as it would look so much neater, even though only one of my Amigas could use it. I'm using the serial port for now because it's easy to develop for and am planning to support parallel ports because every Amiga has one, they're reasonably high speed, have a common connector and should require a minimal amount of additional hardware to talk to a Raspberry Pi.

@Niklas & @Elrond, that looks really cool, can't wait to see it in action. Have you got a driver interface on the Amiga for communicating between the two machines?

kolla 09 June 2018 10:06

Very nice :)

An idea for your software, when you get so far... let the "pi side" act as a proxy for the Amiga, so that Amiga software can continue to use legacy code and protocols, and then let the Pi side translate those to new fancy and cpu heavy protocols.

* web/ftp socks proxy, so Amiga can reach IPv6 only sites (I do this already using tinyproxy)
* https proxy, proxy for websites that do https, doing the validation of the remote https server certificate, while providing the content to the Amiga over http (I do this already using nginx.)
* telnet/rsh/ssh hop-host, let the Linux side offer telnet service to the Amiga side, and also password-less rsh connection, from which the user can use ssh on the linux side to reach the world (I do this already, pretty awesome to remote control my linux based clusters from the Amiga shell, arexx and GUIs)

Just for show... the systems I do this for, currently:

* A3000 s/CSPPC - Pi2b stuck into ISA slot for 5V power, with short USB extender and wifi USB dongle out the back of the A3000, connected to A3000 via Deneb and USB ethernet, acting as NAT gateway, tinyproxy, telnet +rsh/ssh etc, and with additional console to the serial port, like on the A600

* CD32/TF328 - Pi zero W connected to the riser card's serial port, Roadshow with PPP over the serial port between the CD32 and the Pi, Pi acting as NAT server, wireless gateway, tinypropxy, telnet+rsh/ssh etc :)

* CD32/SX32+Plipbox - Pi zero W with USB ethernet dongle connected to plipbox on the SX32 parallel port, again NAT server, wireless gateway, tinyproxy... yadida... :)

* A1200/Blizz1260 + pcmcia ethernet - pi zero W with USB ethernet dongle connected to the pcmcia ethernet, doing... you can guess by now

* A600 w/Vampire V600 - pi zero W built into case, usb ethernet to Vampire SD-card slot, acting as NAT server, gateway to the world over the Pi wifi, tinyproxy, telnet + rsh/ssh (In addition, I have console of the Pi on the A600 serial port)

* CDTV w/Vampire V500 - pi zero W, usb ethernet to Vampire SD-card slot, NAT server, gateway over the Pi wifi, tinyproxy, telnet + rsh/ssh...

* MiST FPGA board - pi zero connected to the serial pins, pi with USB wifi dongle, MiST with Roadshow and PPP, the pi doing the usual stuff :)

* MiSTer FPGA board - pi zero not needed, as MiSTer has the linux side built in, PPP between Amiga side and Linux side for now, hopes for something faster in the future :)

* Minimig + rs232 bluetooth - the "pi" is really a remote G4 mac mini in this case, with Linux, offering the same services to the Minimig as the Pis do on my other system.

The idea of offering a bsdsocket.library to the Amiga is a good one, then much of the mentioned proxying can happen very transparently :)
I am currently very busy with conference and being away on vacation out July, but I will try to find time to look at your project too.


kolla 09 June 2018 10:24

Oh - another idea that has been lingering on my mind for years... http://usbip.sourceforge.net - given an IP link and a driver for Poseidon, any Amiga could have USB via a remote system ;)

TroyWilkins 09 June 2018 10:35

A thought I had, I don't know how feasable it would be, so feel free to discard if this is useless... Anyway, the Janus library, as used with emulation systems such as the PC emulators, could this be useful for this? I don't know enough about it to say yes or no, but hopefully other people here may know if it could be useful for this sort of project?

Niklas 09 June 2018 14:31


Originally Posted by gulliver (Post 1247361)
Are you planning on doing a Zorro II version?

We haven't discussed a Zorro version, but it sounds like a reasonable thing to do. The changes needed for a Zorro version should be straight-forward, I think.


Originally Posted by bwldrbst (Post 1247387)
@Niklas & @Elrond, that looks really cool, can't wait to see it in action. Have you got a driver interface on the Amiga for communicating between the two machines?

It's nice to hear that more than the two of us are finding this idea interesting. :)

Currently, the interface works roughly as follows. At first the trapdoor expansion card looks like a regular 512 kB memory expansion, which shows up at the regular place in the Amiga memory map (at $C00000 if the A500 has an 8371 Agnus, or at $80000 if it has an 8372/8375 Agnus). A program running on the Amiga that is aware that the memory is in fact implemented by this Raspberry Pi trapdoor card will allocate a block of memory in that range, and then there is a mechanism (a "magic handshake") such that the address of that block can be sent to the Raspberry via the FPGA. After that the Amiga and the Raspberry can communicate asynchronously by reading and writing to that block of shared memory. We will (at the very least) provide examples of how to do this.


Originally Posted by kolla (Post 1247414)
An idea for your software, when you get so far... let the "pi side" act as a proxy for the Amiga, so that Amiga software can continue to use legacy code and protocols, and then let the Pi side translate those to new fancy and cpu heavy protocols.

I think of the Raspberry Pi on our expansion card as a co-processor to the Amiga, connected through an interface with a decent bandwidth (theoretically ~7 MB/s on the Amiga side, ~3 MB/s on the Raspberry side). Hopefully there should be many applications that can take advantage of this.


Originally Posted by kolla (Post 1247414)
I am currently very busy with conference and being away on vacation out July, but I will try to find time to look at your project too.

You definitively sound like a power-user for an expansion like this, so I'm looking forward to you getting your hands on it. :)


Originally Posted by TroyWilkins (Post 1247419)
Anyway, the Janus library, as used with emulation systems such as the PC emulators, could this be useful for this?

Not sure how useful Janus.library would be for this project, but I will look into it. Thanks for the suggestion!

All times are GMT +2. The time now is 13:14.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.

Page generated in 0.05325 seconds with 11 queries