I'm writing a library for "running" co-processors

wilsonsamm

New member
Joined
Aug 10, 2010
Posts
71
Country
England
Region
Derbys.
(crossposted at http://forum.classicamiga.com/forum...a-library-for-quot-running-quot-co-processors)
I'm writing a library (for linux at the moment, but I'd like to see it compile and run on other platforms too) that lets a user (user of the library, i.e. a programmer) to load binaries into a coprocessor's workspace and set it to run. You can also set breakpoints, examine memory etc. etc.

There are several uses for this: You could let an old CP/M program run on an emulated Z80, while trapping the syscalls and translating them to the equivalent syscalls of the host operating system. (Maybe we can use this to bring 68K compatibility to AROS?) Another use is running software on your GPU etc.

Well I thought the Amiga is a perfect example of a computer where one might want to do plenty of this kind of thing. Besides typically having some excellent coprocessors, the Amiga One has a 68K on board if I'm not mistaken, and maybe classic Amigas that are expanded with accelerators and such will now also be able to use the internal CPU for a little extra power

My question is this: Is there enough interest in this among the Amiga community to establish a small dev team?
 
Dear Mr Wilson,

<speaking for myself mode on> enthousiasm is one thing, but expertise is the other requirement in this case...and the lather is quite a showstopper.
Only thing i could help with is beta testing...for making things fool proof you need a proven fool, no?<speaking for myself mode off>
It seems you have a brilliant idea, and a rather smart approach for the bumps in the road.

Grtz, PymerOne.
 
Indeed!
Well I have nothing to test at the moment. I am looking for people who:

- have a knowledge of C
- are willing to learn my very simple API (and make suggestions about how to change it)
- perhaps have some experience writing emulation? Not necessary though!
- have knowledge of programming for Amiga OS (Also not necessary)
- are able to dream and use imagination

If that applies to you and you're interesting in helping the scene out, then get in touch either in here or by PM!
 
Well I'll attach my current progress here. Just unzip the zip file and take a look if you like.

At the moment this doesn't build because some symbols do not resolve at compile time, I will take a look at it sometime this weekend or in the week.

So how does this work?
Simply put, a client program may load the library and call a function that means for example "I'd like exclusive control of a Z80, please". Then that function returns a unique number that identifies that very Z80. Stuff like a function called "poke" that can write a byte at a time to the Z80's memory bank.
So "poke" is used to load (say) a CP/M program into this space, and a breakpoint is set up so that whenever the program counter reaches address 0005 a function in the client program is called. (To call the operating system in CP/M you use CALL 0005) This can then examine the memory of the Z80 to find out what happened (with PEEK and POKE etc.).
The implication is that it would be possible to implement CP/M (or any operating system) on a host computer, where the application program runs on another, emulated (or physical), system.
 

Attachments

  • libasmp-0.0.3.zip
    25.9 KB · Views: 0
Last edited:
Well the solution to the problem I described above is to pass "-ldl" to gcc when compiling cpmexample. as I understand it it links the resulting executable to the library that deals with on-the-fly loading/unloading of object files.
 
After a long time and a couple of rewrites, I have thought the whole problem out again, from scratch. I am learning a lot. Perhaps it's because my C is not good enough?

Anyway I post it here. Perhaps someone will find it useful, perhaps someone will be able to contribute :roll:
 

Attachments

  • dev.zip
    259.2 KB · Views: 0
Ive got something similar to this that I have written up once before that I need to write up again...

so I am willing to devote some time to this *after* I sort out getting some means of
stable development
 
I have only just now noticed this thread.. Forgive me if i'm mistaken, but i think there's a few details you should keep in mind.
I seem to recall that on Classic Amigas, if there's an accelerator present, the onboard cpu is actually totally inactive when the OS boots.
Plus, i see you mentioned the Amiga One platform, and saying that it carries an 68k processor onboard, which is not so. I'm not much of an "NG" fan myself, but if you think you can offer your skills towards the Amiga's future, you might consider helping devs make multi-cores active under AOS 4.x
Trully, this is a big task, not only due to its technical difficulties, but plus the expense of obtaining such an expensive machine..
Good luck anyway! (y)
 
As far as I know, the only machine with two different CPU (one is a re-configurable FPGA) is the about-to-be-launched AmigaONE_X1000. Xena is the re-configurable coprocessor.
 
Co-Processors and Multiple-Instruction sets...

Co-Processors and Multiple-Instruction sets...

The sam440 has a Lattice XP2 series FPGA able to be programmed as a processor or other kind of chip,
The sam460 also has a Lattice series XP2 FPGA chip present,

The A1XE and A1SE boards DO NOT have any kind of 680x0 chip present.

The A1X1000 board based systems have the Xena processor.

I've also got an active project I am writing up on top of the Amiga OS that I have started making the code for publicly available.

I don't as yet have the machine I am buying for actively building more software but I am at least trying to make the code available anyway...

If you want to discuss material further I am more than willing to do so...
 
Im still waiting for someone to hack the Z80 and/or 6502 in my C-128D so it can be used as a co-pro. :D
 
I have only just now noticed this thread.. Forgive me if i'm mistaken, but i think there's a few details you should keep in mind.
I seem to recall that on Classic Amigas, if there's an accelerator present, the onboard cpu is actually totally inactive when the OS boots.

I would also think at an accelerator isn't carrying any bus arbitration logic for running both the oem cpu and the one on the accelerator, so this scenario is probably a no-go :(

how the accelerator actually halts the oem cpu to avoid both of them trying to boot, I don't know..
 
Ive got something similar to this that I have written up once before that I need to write up again...

so I am willing to devote some time to this *after* I sort out getting some means of
stable development

Belxjander if you send me some schematics of your project i'll make you the PCB's.
You can chose if you want them populated or if you want them unpopulated.
And yes i have seen your handy work. ;)

With friendly regards your dutch pal from Natami.org

BTW i have my own project for this but my solution indeed disables the host CPU if the secondary is chosen by pulling halt.(and vice versa)
In theory i can let them both run but without software they would try and do the same thing.
In amiga terms we would need a system that would have N job lists that are none depending where N is the number of CPU's.
This requires a smart rewrite of EXEC of which i am not capable.
I have this user name for a reason you know. ;)

---------- Post added at 18:54 ---------- Previous post was at 18:46 ----------

I have only just now noticed this thread.. Forgive me if i'm mistaken, but i think there's a few details you should keep in mind.
I seem to recall that on Classic Amigas, if there's an accelerator present, the onboard cpu is actually totally inactive when the OS boots.

I would also think at an accelerator isn't carrying any bus arbitration logic for running both the oem cpu and the one on the accelerator, so this scenario is probably a no-go :(

how the accelerator actually halts the oem cpu to avoid both of them trying to boot, I don't know..

A A2630 does have bus arbitration logic with software support i think it could even be used as a coprocessor it's a shame this is not the case.
Belxjander would know this better then me.
 
Back
Top Bottom