Acorn's Second Processors and the Tube - what, and why

for bbc micro/electron hardware, peripherals & programming issues (NOT emulators!)
User avatar
BigEd
Posts: 1703
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Acorn's Second Processors and the Tube - what, and why

Postby BigEd » Tue Dec 12, 2017 7:43 pm

I thought I'd try my hand at explaining what the Second Processors are all about. I may well be duplicating some existing explanation - I'll be happy to accept corrections, clarifications and links. See for example the first few paragraphs of Acorn's Tube Application Note, the various resources on JGH's ADFS.net, and various pages on BeebWiki.

Pretty much every 1980's home computer had a keyboard, and most plugged into a telly or a monitor. A few had the screen built in. Similarly, if there wasn't a cassette recorder built in, there'd be audio in and out for cassette storage, and there'd usually be a speaker or a beeper or sound from the telly. All of those facilities constitute Input and Output, also known as I/O, and are the means by which the user interacts with the machine, and specifically with the software that's running on the machine.

Acorn's BBC Micro was particularly well-equipped with I/O, and as with with many other micros it could also be connected to joysticks, a printer, a disk drive, a network, a speech chip, a serial device such as a modem, and other devices.

Acorn realised two things about all this I/O hanging off a 2MHz 6502: it takes code and RAM to deal with the devices, and it takes CPU time too. While the CPU is putting characters or graphics on the screen, or moving data to or from the floppy, it's not running the application. With 16k of Machine Operating System, 16k of Disk Filing System, 20k of RAM available to the video and up to 3k of RAM in use by the OS and filing system, there can be as little as 6k of RAM left for a Basic program's code and data. (Or as much as 28k, but that's less relevant.)

Another thing Acorn realised is that a 2MHz 6502 isn't always fast enough or even an appropriate CPU for all purposes.

And so the BBC Micro includes a Tube interface, which adds very little cost to the base system, and is just a little-used 40 way IDC socket underneath the keyboard. (The later Master machine also includes an internal Tube interface, and aftermarket inventions allow for a Tube interface to be added to the cost-reduced Electron and even the earlier Atom computer. So all of Acorn's 8-bit offerings are Tube capable.)

Physically, then, the Tube is a 40 way socket. To use it, you add an external box and connect with a 40 way cable.

Logically, at a low level, the Tube is a fairly simple 8-bit peripheral, occupying 8 addresses in the host's memory space, which offer four channels from the host to the Second Processor and four channels from the Second Processor to the host.

But the beauty of the Tube is that it's almost invisible, both to the computer user and to the software. If you have an unexpanded Beeb, you type at the keyboard, look at the screen, and interact with software running within 32k of RAM on a 2MHz 6502. If you have a 6502 Second Processor plugged in, you type at the keyboard, look at the screen, and interact with software running within 64k of RAM on a 3MHz 6502. Suddenly your Basic program has 47k of space to operate in and runs a lot faster.

The reason the Tube is almost invisible is that Acorn's Machine Operating System has a compact and well-defined interface, and all well-behaved software which uses that interface for all I/O purposes can run unmodified either on a base Beeb or on one with a 6502 Second Processor attached. Almost all games are not in that category, but they can run as they were if the Second Processor is removed or disabled. Elite, famously and perhaps uniquely, does come in one or two versions which can use the Second Processor, in which case the game has more features and better graphics.

But there's much more, because the Second Processor doesn't even have to be a 6502. With the Z80 Second Processor, you can run a Z80 version of Basic, or other application programs, or the CP/M operating system and any number of programs which run on that. With an x86 Second Processor, you can run DOS and GEM. With a 6809 Second Processor, you can run the Flex OS. With an ARM Eval System you can run any ARM code you care to write, or the ARM version of BBC Basic. With a 32016 Second Processor you can run PanOS, with various compilers available. (Indeed, Acorn made a Scientific Workstation which was basically a Master integrated with a monitor, a 32016 Second Processor, a SCSI interface and a hard drive.)

These days, there's even more, because there's the FPGA-based Matchbox copro, Sprow's ARM copro, John Kortink's copros, and the most impressive and inexpensive PiTubeDirect copro, which is just a cheap Raspberry Pi and a simple level shifter circuit.

With the Matchbox, you can run all the above flavours and also a PDP-11. With the Pi, you can run all the above in emulation and also a full-speed 1GHz ARM copro.

It's even better than that, as RobC has demonstrated: the Pi's full-speed ARM copro can emulate another micro entirely, such as a ZX81 or a Jupiter ACE.

Edit to add a few more points:

The Tube is unique in being part of the design of the computer from the beginning, including the design of the OS. The idea is there's only one application processor, which is the Beeb itself if that's all there is, or is the Second Processor if there is one. The application sees the same OS facilities in both cases. It's a different kind of challenge to add multiple processors or to add processors to other 80s micros. It's perhaps more likely to add an accelerator of some kind and to keep the application running on the original machine.

Elite, and a couple of other programs, do in fact run the application on the Second Processor and also some acceleration code on the host. For example, application-specific drawing commands or update information can be sent to the host which then computes the display update before drawing it. As the protocol is application-specific it can be more efficient. The host can use more of its CPU resources to offload from the Second Processor.

The Pi as a Second Processor is unusual in having multiple CPU cores available. As yet we haven't seen aggressive use of that. The Pi also has I/O of its own, including video out, solid state storage, and possibly network connectivity. The one case I'm aware of using this is hoglet's Atom display gadget which uses the Pi's video out.

Now that there's a modern wave of affordable Second Processors, it's possible we'll see modern retro games and other software which makes use of them. There are a few hundred Pi and Matchbox installations already, in addition to anyone already running an original Second Processor or Master Turbo.
Last edited by BigEd on Wed Dec 13, 2017 9:36 am, edited 1 time in total.

northernbob
Posts: 71
Joined: Fri Nov 24, 2017 6:49 am
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby northernbob » Wed Dec 13, 2017 8:27 am

ok ive read that, and will rethink about it next week,

I came across an idea a few months ago, which might apply here....

see attached.

http://www.bbcbasic.co.uk/qb2bbc/index.html

article is from here....

http://www.petesqbsite.com/sections/exp ... index.html

download...

http://www.petesqbsite.com/sections/exp ... /Multi.zip
Attachments
Multi_Processing_Core_for_QB.doc
(40 KiB) Downloaded 14 times

User avatar
BigEd
Posts: 1703
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby BigEd » Wed Dec 13, 2017 9:37 am

I've added a few more points to the bottom of the head post.

User avatar
kieranhj
Posts: 608
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby kieranhj » Wed Dec 13, 2017 10:51 pm

BigEd wrote:I've added a few more points to the bottom of the head post.

Thanks for the write up BigEd. I have always been fascinated by the Tube architecture - such a unique & forward thinking aspect of Acorn’s design but seemingly forever underused.

As you articulate above, the Tube is a copro not a multi core design. The IO was intended to be essentially text passed back & forth. This means it doesn’t lend itself to real time applications like games particularly well. Elite is the exception that proves the rule, as people keep telling me when I point out the coding challenges...

I desperately want to get stuck into some 6502 copro coding but have to be disciplined and finish my existing big project. At least the 256 byte transfer bug has been fixed in b-em which will help a lot!

As with Elite, I think (3D) maths is the sweet spot for taking advantage of copro power for games rather than any typical fast paced sprite affair. A C&C style RTS or even a turn-based strategy game also come to mind. However, with all of these projects, the real work comes in designing & writing a new 3D vector or sim game in the first place more than figuring out how to get the most out of the copro on the other side of the Tube interface.

At some point I will get round to writing some 3D rendering routines to learn more but trying to do solid triangles, for instance, is always going to be bottlenecked by the speed the host can write to screen memory at 2MHz.

Given that there are many more copros available now, both real and emulated, with MHz to spare maybe there would be mileage in a good higher level language (like C?) implementation to facilitate more rapid development? Graphics are not going to be real time per-se but could build libraries on top of the OS VDU plot routines.

That said, my personal interest would be to see what could be achieved with a vanilla 4Mhz Master Turbo (I’m lucky enough to have one) as existed BITD.
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

crj
Posts: 830
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby crj » Thu Dec 14, 2017 2:22 am

kieranhj wrote:The IO was intended to be essentially text passed back & forth. This means it doesn’t lend itself to real time applications like games particularly well.

I'm not sure either part of that is really true. By having four FIFOs, the Tube supports a fairly rich set of binary protocols, and filing system operations are at least as significant a use as keyboard input and VDU output. Meanwhile, the IO processor has nothing better to do than listen for commands from the Tube, and the Tube can interrupt the parasite, so latency is minuscule in comparison to screen refresh rates. Also, data can be transferred back and forth at 100Kbytes/sec.

The actual issue is finding a meaningful division of labour between the two CPUs. Most games are graphics-intensive, and plotting code has to reside in the IO processor, along with any sprite data. That leaves little for the second processor to do.

However, if a game were designed from the outset to run on a second processor it could take advantage of this by having (relatively) huge worlds and (relatively) sophisticated AI for opponents.

After all, dividing the workload between CPU and GPU is common practice for modern game designers!

Alas, only a small proportion of Beebs ever had a second processor, and those that did tended not to be in the hands of keen gamers. So Elite is the only game which ever properly took advantage of the opportunity (and even then, my understanding is that the Tube version was coded so as to present players with an unexpected challenge at the first championship, more than as a commercial venture).

User avatar
1024MAK
Posts: 7202
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby 1024MAK » Thu Dec 14, 2017 4:11 am

Nice write up Ed. Although I do need to pick up on a few points.

The Tube hardware in the Beeb is not that special. There are plenty of other computers from the 1980s and 1990s that have equivalent signals available on an expansion port. And if someone wanted to, the Beeb's 1MHz bus could do a similar thing.

What sets the Beeb apart, however, is the separation of the language from the machines OS, and the comprehensive features of the OS (including the support for the Tube).
The second thing that makes the difference, is Acorns concept and actual released products. Which of course contain the Tube ULA.

Other manufacturers went down various different routes. Timex developed the Timex FDD 3000 for example.
Memotech developed the FDX system. Commodore developed the Commodore 128. I'm sure there are other examples of systems with either another CPU, or greatly expanded I/O (where the original CPU was already powerful enough).

I suspect Acorn may have developed the idea about using different processors with the Beeb after developing the 6809 CPU cards for the various Acorn System 2/3/4/5 computers (link).

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

crj
Posts: 830
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby crj » Thu Dec 14, 2017 4:20 am

1024MAK wrote:The Tube hardware in the Beeb is not that special. [...]The second thing that makes the difference, is Acorns concept and actual released products. Which of course contain the Tube ULA.


That wasn't emphasised much at the time, but is a big part of the cleverness of the Tube architecture.

In the BBC Micro itself, the only hardware supporting the Tube was some tracks on the circuit board, one output from a 74138 decoder and a 40-way connector. Literally nothing else. The Tube ULA lived in the second processor, so users didn't have to pay for it until they needed it. (As a bonus, they didn't have to perfect the Tube ULA at the same time as all the other stuff they had to think about to get the BBC Micro out the door.)

User avatar
BigEd
Posts: 1703
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby BigEd » Thu Dec 14, 2017 8:51 am

I do recommend following RobC's lead if you'd like to use a high level language to implement something which uses today's extra-fast second processors.

I should have mentioned also, that there were a number of dual-Z80 designs back in the day where one of them handles the floppy drive, and Commodore's floppies also had a 6502 (originally, two 6502s) to handle the floppy drive and to present a filesystem-level facility to the host.

Rich T-W had a nice idea, for a fractal program on the Beeb, to use a second processor, if present, as a maths accelerator. This is the inverse of the usual approach, and means the program executed on the Second Processor needs to load code onto the host and inject it into a vector to run it. (This is, as it happens, known technology.)

User avatar
fordp
Posts: 953
Joined: Sun Feb 12, 2012 9:08 pm
Location: Kent, England
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby fordp » Thu Dec 14, 2017 12:52 pm

1024MAK wrote:Nice write up Ed. Although I do need to pick up on a few points.

The Tube hardware in the Beeb is not that special. There are plenty of other computers from the 1980s and 1990s that have equivalent signals available on an expansion port. And if someone wanted to, the Beeb's 1MHz bus could do a similar thing.

What sets the Beeb apart, however, is the separation of the language from the machines OS, and the comprehensive features of the OS (including the support for the Tube).
The second thing that makes the difference, is Acorns concept and actual released products. Which of course contain the Tube ULA.

Other manufacturers went down various different routes. Timex developed the Timex FDD 3000 for example.
Memotech developed the FDX system. Commodore developed the Commodore 128. I'm sure there are other examples of systems with either another CPU, or greatly expanded I/O (where the original CPU was already powerful enough).

I suspect Acorn may have developed the idea about using different processors with the Beeb after developing the 6809 CPU cards for the various Acorn System 2/3/4/5 computers (link).

Mark

There are you tube videos explaining this better. The machine Acorn was developing (Proton?) was going to have two processors built in with application processor and operating system processor. When they modified the design for the BBC they had to drop the built in second processor to hit the time scales and price points. They also had to add things like Mode 7 and other features the BBC insisted on. This made the BBC but also explains the lack of RAM. The engineers were not willing to drop the second processor idea and hence the tube interface. What is strange in hindsight is why the 1 Mhz bus was not used for the second processor as it would have been easy to hook a tube chip to the 1MHz bus and have a second processor there!
FordP (Simon Ellwood)
Time is an illusion. Lunchtime, doubly so!

User avatar
Pablos544
Posts: 317
Joined: Tue Jul 15, 2014 4:25 pm
Location: London, UK
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby Pablos544 » Thu Dec 14, 2017 3:58 pm

Very lovely BigEd :o To people like me this is a real light. Very simple and well understood informational but not boring. Awesome bro =D>

User avatar
kieranhj
Posts: 608
Joined: Sat Sep 19, 2015 10:11 pm
Location: Farnham, Surrey, UK
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby kieranhj » Fri Dec 15, 2017 5:27 pm

crj wrote:I'm not sure either part of that is really true. By having four FIFOs, the Tube supports a fairly rich set of binary protocols, and filing system operations are at least as significant a use as keyboard input and VDU output.

Yes, that's true they did put in a separate FIFO for all of the expected I/O channels to make it a useable environment.

crj wrote:Meanwhile, the IO processor has nothing better to do than listen for commands from the Tube, and the Tube can interrupt the parasite, so latency is minuscule in comparison to screen refresh rates. Also, data can be transferred back and forth at 100Kbytes/sec.

I guess this is the bit where I find theory and practical application diverge, from my limited experiments to date. Yes, you can transfer 100Kb/s but this maxes out all available cycles on the Host CPU so you're spending all your time LDA'ing from the Tube FIFO and STA'ing somewhere in Host RAM. My only point is that in practice there is a balance that has to be found between Host cycles spent moving data over the Tube and doing something meaningful. We know that shifting large amounts of data around is not the 6502's strongest feature. If we had DMA on the other hand... :D

crj wrote:The actual issue is finding a meaningful division of labour between the two CPUs. Most games are graphics-intensive, and plotting code has to reside in the IO processor, along with any sprite data. That leaves little for the second processor to do.

However, if a game were designed from the outset to run on a second processor it could take advantage of this by having (relatively) huge worlds and (relatively) sophisticated AI for opponents.

Completely agree! I guess my other point was that designing & writing (new) games is difficult enough for most people which is why we've not seen anyone take advantage of modern copros despite their (relative) availability. At least for anything beyond simple demos. It's a big undertaking either way, although I would love to do this as a future project.

crj wrote:After all, dividing the workload between CPU and GPU is common practice for modern game designers!

Indeed. Although I made the point previously that in our case, unfortunately, the balance of power is the wrong way around - we have a (relatively) high powered CPU and a weedy "GPU" (in the form of the original 2MHz Host CPU.) I reckon that even a 200+MHz Pi copro isn't going to be as useful to most gaming scenarios compared with a simple sprite chip (e.g. VIC or NES PPU.)

crj wrote:Alas, only a small proportion of Beebs ever had a second processor, and those that did tended not to be in the hands of keen gamers. So Elite is the only game which ever properly took advantage of the opportunity (and even then, my understanding is that the Tube version was coded so as to present players with an unexpected challenge at the first championship, more than as a commercial venture).

Absolutely. My guess is that Elite was almost accidentally designed in such a way that made it relatively easy to create a 2nd processor version based on the line rendering routines and they would have done this at Acorn's behest to showcase the hardware, rather than it being in any way commercial, as you say.

My final slightly tongue-in-cheek point is that since joining Stardot I've seen at least three new threads of "where is all the 2nd processor software?" So my conclusion is perhaps "it's harder than it looks".
Bitshifters Collective | Retro Code & Demos for BBC Micro & Acorn computers | https://bitshifters.github.io/

crj
Posts: 830
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby crj » Fri Dec 15, 2017 6:53 pm

kieranhj wrote:Completely agree! I guess my other point was that designing & writing (new) games is difficult enough for most people which is why we've not seen anyone take advantage of modern copros despite their (relative) availability. At least for anything beyond simple demos. It's a big undertaking either way, although I would love to do this as a future project.


That kind of thing is, of course, an amusing project in itself. But, like the idea of a blitter for the BBC Micro, I'm not sure it serves any wider purpose. If you have a Raspberry Pi and just want to play a fun game of modern design, you're better off running something on the Pi natively, or on a self-contained emulator, rather than using it as a Beeb second processor. If you're wanting to retain retrocomputing authenticity then you can't really use a gigahertz of ARM that's been bolted on the side, since nothing of the kind could ever have existed back in the day.

It would be really interesting to see a few more games for the 6502 second processor, though!

Absolutely. My guess is that Elite was almost accidentally designed in such a way that made it relatively easy to create a 2nd processor version based on the line rendering routines and they would have done this at Acorn's behest to showcase the hardware, rather than it being in any way commercial, as you say.

I don't know what the division of labour is, but I'm assuming the low-level rendering primitives run on the host, while the 3D geometry engine and hidden line removal is on the parasite. The key there is that the volume of data that has to flow between the two components is small compared with the work each component has to do.

If I were trying to achieve the same for a more traditional game, I'd want to put the sprites in the host processor, but the logic for how to render them in the second processor. Each frame, I'd have the parasite work out what needed rendering where, Y-axis sort, notice overlaps, map the memory needed for save-unders, and build a list of what sprite fragments to render where, in what order.

My final slightly tongue-in-cheek point is that since joining Stardot I've seen at least three new threads of "where is all the 2nd processor software?" So my conclusion is perhaps "it's harder than it looks".

Where are all the 2nd-processor games, perhaps. I've used tons of software on the second processor over the years: the school's Level 2 Fileserver before it got an SJ Rsearch one, HiWordWise+ for my first paying gig, HiBasic for assembling 16K ROM images, HiView for word-processing my A-level Computing project, etc.

User avatar
BigEd
Posts: 1703
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby BigEd » Mon Jan 22, 2018 10:05 pm

This (rumour) seems worth noting:
The Tube was Acorn's way of resolving how a single machine could be all things to all people, as during the design phase one engineer wanted a dual-processor system, another reckoned one would do, chip designer Andy Hopper wanted it to be 16-bits and Chris Curry wanted anything as long as the machine cost less than £300. Hauser recounted how coming up with the idea of the Tube solved everything and how "we had a good drink after that and got rather self-congratulatory".

(From the commentary in nosher.net's huge annotated collection of computer adverts.)

paulb
Posts: 811
Joined: Mon Jan 20, 2014 9:02 pm
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby paulb » Mon Jan 22, 2018 11:55 pm

BigEd wrote:This (rumour) seems worth noting:
The Tube was Acorn's way of resolving how a single machine could be all things to all people, as during the design phase one engineer wanted a dual-processor system, another reckoned one would do, chip designer Andy Hopper wanted it to be 16-bits and Chris Curry wanted anything as long as the machine cost less than £300. Hauser recounted how coming up with the idea of the Tube solved everything and how "we had a good drink after that and got rather self-congratulatory".

(From the commentary in nosher.net's huge annotated collection of computer adverts.)


A nice find! There is a lot of interesting stuff in the text accompanying each page of adverts, and tempting as it might be to skip to the next page, it can be worth taking the time to read it through.

It also complements a remark made in another thread, a few months ago maybe, about how CP/M support was supposed to have been a requirement for the BBC Microcomputer, and second processors were Acorn's way of meeting that requirement with a lower-cost 6502-based machine.

User avatar
jgharston
Posts: 3011
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby jgharston » Tue Jan 23, 2018 2:03 am

crj wrote:
My final slightly tongue-in-cheek point is that since joining Stardot I've seen at least three new threads of "where is all the 2nd processor software?" So my conclusion is perhaps "it's harder than it looks".

Where are all the 2nd-processor games, perhaps. I've used tons of software on the second processor over the years: the school's Level 2 Fileserver before it got an SJ Rsearch one, HiWordWise+ for my first paying gig, HiBasic for assembling 16K ROM images, HiView for word-processing my A-level Computing project, etc.

Plus, any properly-written software will use the extended capaibilies of the second processor automatically. Ask the operating system how much memory is available. Use the API to access I/O functions. Use "how much memory have I got?" to find out how much memory you have, not "where is the start of my memory?". etc. etc.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

Coeus
Posts: 712
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby Coeus » Tue Jan 23, 2018 12:42 pm

jgharston wrote:Plus, any properly-written software will use the extended capaibilies of the second processor automatically. Ask the operating system how much memory is available. Use the API to access I/O functions. Use "how much memory have I got?" to find out how much memory you have, not "where is the start of my memory?". etc. etc.


There is an issue, though, if you are writing in assembler and expect your code to be loaded from disc into RAM rather than running from ROM because, without external tools, all but the simplest 6502 assembler is not relocatable. This is one area in which CP/M scores over the Acorn MOS because there is a fixed address for transient programs to be assembled for. The concept of a transient program which can run from a know address seems to have been transferred to modern operating systems.

paulb wrote:It also complements a remark made in another thread, a few months ago maybe, about how CP/M support was supposed to have been a requirement for the BBC Microcomputer, and second processors were Acorn's way of meeting that requirement with a lower-cost 6502-based machine.


Are you saying the machine was cheaper because it was 6502-based or is it more the case of now having to license CP/M or the implications of supporting CP/M on the design?

The question of "How would the BBC Micro have been it had a Z80 and CP/M?" is an interesting one and like so many things there are positives and negatives to each.

CP/M was designed as an operating system to take advantage of floppy discs so the assumption is that all software other than a small boot ROM would be distributed on and loaded from disc. That in turn dictates that most of the address space is devoted to RAM rather than ROM for those programs to be loaded into so that is another thing that would have pushed up the cost at a time when RAM was expensive.

Loading everthing from floppy disc is also pretty slow compared to running software from ROM and running software from ROM is also what enables a tape-based machine with no discs at all. I am sure the education market would have swallowed the cost, as the RM380Z was very much more expensive and that had been adopted a few years previously, but would it have had any takeup in the home if the basic specification had to have floppy discs and more RAM compared to the actual BBC micro design? What about the library of CP/M software - was there much of interest to the education and home markets or was it mostly business-oriented?

So for me, a 2nd processor was a stroke of genuis for providing extra flexibility and the ability to do some limited parallel processing is a bonus rather the main point. Even so I can't help thinking Acorn were thinking or parallelism otherwise why have a FIFO in the Tube ULA deep enough to hold a whole VDU sequence? Surely the idea there has to have been to let the 2nd processor stuff the bytes in faster than the I/O processor could actually consume them and then move on to something else while the I/O processor was updating the screen.

User avatar
jgharston
Posts: 3011
Joined: Thu Sep 24, 2009 11:22 am
Location: Whitby/Sheffield
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby jgharston » Tue Jan 23, 2018 1:40 pm

Coeus wrote:There is an issue, though, if you are writing in assembler and expect your code to be loaded from disc into RAM rather than running from ROM because, without external tools, all but the simplest 6502 assembler is not relocatable. This is one area in which CP/M scores over the Acorn MOS because there is a fixed address for transient programs to be assembled for. The concept of a transient program which can run from a know address seems to have been transferred to modern operating systems.
Yes, when moving to the 32016 and ARM the API defined the start of user memory being fixed, and the top being variable, instead of both ends being variable. A lot of 6502 code ended up being coded to start at &1900 regardless of what machine it actually ended up running on. Ironically, it's very simple to write a 6502 run-time code relocator, which VIEW used from very early days to move itself as high up in memory as possible.

I'm sure I've got the Acorn 6502 relocator on mdfs.net, but I can't remember where it is!

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.25
(C) Copyright J.G.Harston 1989,2005-2015
>_

Coeus
Posts: 712
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby Coeus » Tue Jan 23, 2018 2:15 pm

jgharston wrote:...A lot of 6502 code ended up being coded to start at &1900 regardless of what machine it actually ended up running on.


And presumably this is one of the reasons some don't like ADFS as it raises OWHWM still further compared to DFS, unless you are on a Master.

It is also possible, of course, to use the RAM on either side of your code for data. The BCPL ROM does this when running in the 6502 2nd processor - it is copied to its usual address but sets up the heap to include segments both above and below it.

jgharston wrote:Ironically, it's very simple to write a 6502 run-time code relocator, which VIEW used from very early days to move itself as high up in memory as possible.


It is probably more straightforward to have the code to do the relocation run at a fixed address whilst relocating the code to be relocated. The disc-based AMPLE for the Music 500 did this. The AMPLE file which you execute is actually a reloactor - it loads the rest of the code at OSHWM and then refers to a table to patch the addresses that need changing.

What would be a good trick would be to make the relocator able to run at any address so it could be part of the main file, loaded at any suitable address and then relocates the rest of that block of code as soon as it starts running. On the original 6502 I think that means no subroutine calls within the code (calling OS is fine) and using only branches. Often one can use a branch anyway as the state of the flags is known otherwise one might need to resort to such as CLC:BCC xxxx

User avatar
BigEd
Posts: 1703
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby BigEd » Tue Jan 23, 2018 2:20 pm

Coeus wrote:Are you saying the machine was cheaper because it was 6502-based or is it more the case of now having to license CP/M or the implications of supporting CP/M on the design?


BTW, in an earlier thread we have Steve Furber recollecting:
So when the BBC came round looking for a machine, their initial spec was a Z80 running CPM, okay. Now what Acorn offered them was a 6502 running a proprietary operating system. But it said, this is the front end of a two processor machine and, you know, we’re selling the front end as the main machine to keep the costs down but we can add a Z80 running CPM later through our second processor port, which of course we did. The Z80 running CPM did come. But that was Acorn’s strong interest in putting this tube port on for second processors, because that’s how the machine had originally been conceived before the BBC even turned up.


But downthread Richard Russell takes a different view:
Memory can sometimes play tricks, as I know only too well myself, and this is one of those occasions. I happen to have been recently going through some of my saved documents from 1981, and I have both the BBC's specification (as written by John Coll) and Acorn's response to it. The spec doesn't ask for a specific CPU or operating system, indeed the only references to the CPU are in the section on the memory map...


In a subsequent post Richard shares a scan of the original Outline Specification, which for some reason I transcribed into a standalone thread here, in which Richard linked to more scans.

User avatar
1024MAK
Posts: 7202
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby 1024MAK » Tue Jan 23, 2018 7:11 pm

Just as a matter of interest, here are my thoughts on what I think would have been possible in the early 1980s.

It would have been possible to design and market a Z80A CPU based home computer that could be compatible with CP/M and which could load some programs from cassette tape. A full CP/M system would of course been very expensive for an ordinary user. But the base system could have been supplied with a couple of internal expansion slots and then the extra (expensive) DRAM and the (expensive) floppy disk controller system, along with suitable disk drive (or dual drive) could be added at a later date.

Just as the BBC B has a form of bank switching, so a machine as described above could also have used bank switching to select between "cassette mode" and CP/M mode.

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

User avatar
1024MAK
Posts: 7202
Joined: Mon Apr 18, 2011 4:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby 1024MAK » Tue Jan 23, 2018 7:18 pm

BigEd wrote:BTW, in an earlier thread we have Steve Furber recollecting:
So when the BBC came round looking for a machine, their initial spec was a Z80 running CPM, okay. Now what Acorn offered them was a 6502 running a proprietary operating system. But it said, this is the front end of a two processor machine and, you know, we’re selling the front end as the main machine to keep the costs down but we can add a Z80 running CPM later through our second processor port, which of course we did. The Z80 running CPM did come. But that was Acorn’s strong interest in putting this tube port on for second processors, because that’s how the machine had originally been conceived before the BBC even turned up.

Maybe the mix-up with CP/M is because the plan had been for the Proton to be expandable to have a Z80 co-processor so that it could run CP/M?

Mark
For a "Complete BBC Games Archive" visit www.bbcmicro.co.uk NOW!
BeebWiki‬ - for answers to many questions...

Coeus
Posts: 712
Joined: Mon Jul 25, 2016 11:05 am
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby Coeus » Tue Jan 23, 2018 11:18 pm

1024MAK wrote:Just as a matter of interest, here are my thoughts on what I think would have been possible in the early 1980s.

It would have been possible to design and market a Z80A CPU based home computer that could be compatible with CP/M and which could load some programs from cassette tape. A full CP/M system would of course been very expensive for an ordinary user. But the base system could have been supplied with a couple of internal expansion slots and then the extra (expensive) DRAM and the (expensive) floppy disk controller system, along with suitable disk drive (or dual drive) could be added at a later date.

Just as the BBC B has a form of bank switching, so a machine as described above could also have used bank switching to select between "cassette mode" and CP/M mode.

Mark


I think what you describe is very close what Research Machines subsequently did with the RM480Z which had the usual small boot/monitor ROM (COS) plus BASIC in ROM which could, I think, be paged out. When booting you chose whether to enter the ROM basic or boot a network-modified version of CP/M (CP/NOS?) from a fileserver.

Thinking of which, the other thing about the BBC and CP/M I think the comment I remember was someone from Acorn mentioning that the guys from the BBC knew their stuff and asked about CP/M. That's not the same thing as it being a requirement in the spec. It may just have been a verbal conversation but even so "it could if you use the tube feature to add the Z80 second processor we are designing" is still a better answer than "no, you didn't formally ask for that"

I think I may have read somewhere that it was those looking to adopt the machines in education who assumed it was necessary to use the ubiquitous technology of the day, i.e. CP/M in this case, rather than something novel. If that is indeed correct then kudos to the BBC for recognising that showing capabilities, sparking interest, and understanding principles were more important that familiarity with particular software.

northernbob
Posts: 71
Joined: Fri Nov 24, 2017 6:49 am
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby northernbob » Tue Feb 27, 2018 6:05 pm

http://www.apollo-accelerators.com/wiki/doku.php/fpu

does this have anything in common witht he pi accelertor model?(pi tube system)

Assume the vampire is a more advanced version of a similar idea.

havent really used an amiga since about 96, so alot of the info on the vampire is as clear as mud...its written by hardcore amiga fans and not aimed at nuubs.

Just wondering about the major differnces. the vampire is more of a hardware accelerator and the pi is software (emulator) based? obviously the amiga is far more complex system.....

anyone have a vampire/amiga?

paulb
Posts: 811
Joined: Mon Jan 20, 2014 9:02 pm
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby paulb » Tue Feb 27, 2018 10:25 pm

northernbob wrote:http://www.apollo-accelerators.com/wiki/doku.php/fpu

does this have anything in common witht he pi accelertor model?(pi tube system)


No, this appears to be something that replaces the CPU with a FPGA-plus-other-stuff board, at least as far as I can tell from the manual. What they've done looks quite fancy, although I don't know how much they've leaned on other people's work.

So it would be more like various CPU board options discussed here recently. A bit like what the NuLA does for the ULA (Beeb video chip), but for the CPU.

northernbob
Posts: 71
Joined: Fri Nov 24, 2017 6:49 am
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby northernbob » Fri Mar 02, 2018 7:24 am

ahh right its basically a replacemnt cpu. Not an enhancement/accelerator for the existing cpu. thats cheating :P

Been doing more research on gui types for the next and an amaerican chap in the Indigo team, came up with this vid.

https://youtu.be/gySZMY8qJAY

DId this gui ever make it over onto the dragon? Ive never seen a dragon 64k, my best mate had a dragon 32k, lovely keyboard, awful graphics!

Seems so painful now....running an os (gui)from a floppy )

northernbob
Posts: 71
Joined: Fri Nov 24, 2017 6:49 am
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby northernbob » Mon Mar 05, 2018 7:16 am

Afraid am having trouble getting this concept across to the speccy coders am working with on the indigo operating system.

They have no experience of using a copro system and dunno how to write for it.

Is anyone here capable of making a video to demonstrate it? esp if its an emulated z80 on the pi.

WHat about creating a diagram of how the tube system works, i know thats highly conceptual, but we need this educational tool. AM not a gifted teacher, ive avoided going into education, because i know i dont have the gift for it. I cant inform a whole community of a semi geeks, to rethink something they thought they understood for 30yrs!

I need some help with this please. Anyone wanna join me?

crj
Posts: 830
Joined: Thu May 02, 2013 4:58 pm
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby crj » Mon Mar 05, 2018 6:11 pm

northernbob wrote:WHat about creating a diagram of how the tube system works

This is my best shot, given a few minutes of scribbling on paper. It probably needs throwing at Visio or similar if it seems useful...

Image

User avatar
BigEd
Posts: 1703
Joined: Sun Jan 24, 2010 10:24 am
Location: West
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby BigEd » Mon Mar 05, 2018 6:42 pm

Nicely done!

SteveBagley
Posts: 150
Joined: Sun Mar 15, 2015 8:44 pm
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby SteveBagley » Mon Mar 05, 2018 11:20 pm

In terms of how the software works, you need to think about the two processors as effectively being independent systems -- except they can send messages to each other (conceptually this would be the same as if two processors linked via serial, or even a TCP/IP socket) via the TUBE ULA. This appears to both processors as various memory register, and if one processor writes to a memory register in the TUBE ULA the other can read the value from a register TUBE ULA -- in the same way that one processor could send data to over an RS232 port to another processor. Then it's just a protocol running over the link to allow the two machines to communicate effectively.

As an example, If the second processor wants to print a character, it writes it to one of the TUBE's registers and carries on (just like you would write to the Z80 SIO, for instance). It's then up to the software running on the BBC to check whether there's data available (by checking the registers -- just as you'd poll the Z80 SIO) and if so reading the byte and causing it to be printed on screen.

Steve

northernbob
Posts: 71
Joined: Fri Nov 24, 2017 6:49 am
Contact:

Re: Acorn's Second Processors and the Tube - what, and why

Postby northernbob » Tue Mar 06, 2018 1:08 am

the tube ula and the emulated second processor is all written in assembly lang?

tbh, untill someone makes a vid of this running on a spectrum,(or spec next) I dont think anyone is gonna be convinced.

what we really need is a demo of GEM, or similar. running on a spectrum, like in wifi sheeps vid of the master>>pi setup.

or something impressive like that. need something dramatic to make folk sit up and take notice.

if there was a way to demo a ram disk of 100mb on the second processor side(pi0) that might be dramatic enough to get folk interested.

ON a side note ive been talking to some tandy lads in america about the copro concept, but they seems to not like the idea of mixing old and new tech, bloody luddite colonists :P
ofcourse some folklike that in spec community, some refuse to move beyond colour clash in their games!! most are more progressive.