Running 8-bit Acorn kit with no OS

discussion of beeb/electron applications, languages, utils and educational s/w
crj
Posts: 328
Joined: Thu May 02, 2013 4:58 pm

Running 8-bit Acorn kit with no OS

Postby crj » Thu Oct 26, 2017 11:35 pm

This is a peculiar question. It's a bridge I'm not actually crossing yet, but it intrigued me so I figured it might interest other people, too.

Suppose you are writing a ROM but (for reasons I won't go into) there's a significant risk it'll end up in the OS slot rather than a sideways ROM slot. If this should happen, you want to bring the machine up far enough to silence the sound system and display a message on screen saying what's happened. If it could also display a menu and navigate it using some simple keystrokes, so much the better.

Fortunately, the hardware vectors for the OS ROM are up the top, where the paged ROM entry points are down the bottom, so they don't clash. We're past the first hurdle.

It would be easy enough to lift some code fragments from the OS1.20 dissassembly, but I'm wondering if by any chance someone has already done the work?

Here's the kicker, though: suppose you might end up plugged into any of an Electron, BBC B, BBC B+, Master or Master Compact. How would you tell which? Normally you'd ask the OS, of course, but in my scenario that's not an option!

(Hmm. On the Electron, without MODE 7, you'd need to set aside an extra 0.75K for a character set. That's a pain.)

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

Re: Running 8-bit Acorn kit with no OS

Postby jgharston » Thu Oct 26, 2017 11:50 pm

crj wrote:It would be easy enough to lift some code fragments from the OS1.20 dissassembly, but I'm wondering if by any chance someone has already done the work?
Acorn Econet Bridge, Acorn FileStore, CUBE 65MOS.

crj wrote:Here's the kicker, though: suppose you might end up plugged into any of an Electron, BBC B, BBC B+, Master or Master Compact. How would you tell which? Normally you'd ask the OS, of course, but in my scenario that's not an option!
You have to prod the hardware until you see something that looks like the hardware you are looking for. There's no other way.

I think to distinguish between BBC and Master hardware you could see if ACCCON at &FE34 exists. It's read/write on the Master, but on the BBC it's a mirror of the write-only ROMSEL at &FE30.

Code: Select all

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

User avatar
tricky
Posts: 1922
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Running 8-bit Acorn kit with no OS

Postby tricky » Fri Oct 27, 2017 12:29 pm

B vs master, could you start an ADC conversion and see if it finished.

The debug os that I uploaded in one of the troubleshooting threads can be set as sideways ROM or OS and initialises the hardware, and plays sound and displays Teletext and bitmapped modes without using any ram, so doing it with ram should bee easy ;)

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

Re: Running 8-bit Acorn kit with no OS

Postby crj » Fri Oct 27, 2017 2:11 pm

tricky wrote:The debug os that I uploaded in one of the troubleshooting threads can be set as sideways ROM or OS and initialises the hardware, and plays sound and displays Teletext and bitmapped modes without using any ram, so doing it with ram should bee easy ;)

Any chance you could point me at that? Google isn't finding it, and it sounds useful, especially if there's assembler rather than just object file.

I'm intrigued to know how it displays teletext without any RAM at all, though. I thought the Video ULA's wrap-around trick meant there was no way to fetch screen data from ROM.


Detecting the BBC Master looks like it may be the easy part. And maybe, if you just want sound, video and keyboard you don't care if you're in a Master or a Compact. Similarly, B v. B+ probably doesn't matter.

But how to detect an Electron... Having now myself pored over the details of the Electron ULA, I'm contemplating detecting the presence of a System VIA in non-Electrons by writing values to DDRB,A at &FE42,3 then reading them back. On the Electron, that would be the screen start address and relatively harmless. That may be the simplest option.

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

Re: Running 8-bit Acorn kit with no OS

Postby 1024MAK » Fri Oct 27, 2017 2:23 pm

I think Tricky means, the code runs from ROM and does not need any RAM to run. If there is a fault with the RAM used for the display, this will been seen as corruption on screen. If the RAM used for the screen is okay, then there will be no on-screen corruption.

Normally, with defective RAM, the OS falls over soon after starting up due to data corruption caused by the faulty RAM. Hence the OS code that tells the sound chip to shut up (actually it turns the volume down for all channels) and the code to set-up the video chips never get executed.

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

User avatar
myelin
Posts: 204
Joined: Tue Apr 26, 2016 9:17 pm
Location: San Francisco, CA, USA
Contact:

Re: Running 8-bit Acorn kit with no OS

Postby myelin » Fri Oct 27, 2017 4:33 pm

crj wrote:But how to detect an Electron... Having now myself pored over the details of the Electron ULA, I'm contemplating detecting the presence of a System VIA in non-Electrons by writing values to DDRB,A at &FE42,3 then reading them back. On the Electron, that would be the screen start address and relatively harmless. That may be the simplest option.

What's at &FE05 on the BBC? It's the bank select register (moved from &FE30) on the Electron. As the Elk has the keyboard mapped into slots 8 and 9, and BASIC in slots 10 and 11, you should be able to flip back and forth between those two and see different data. BASIC and the MOS are in the same ROM in the Elk also, so if someone's removed that chip and put yours in, you should see your code appearing and disappearing when switching when you flip banks.

(I just checked and it's empty space between the 6845 and the 6850, which is probably mapped onto the CTRC data register at &FE01.)
SW/EE from New Zealand, now in San Francisco, making BBC/Electron hardware projects for fun.
So far: fast serial port, 32k flash cart, USB cart interface, 3-cart expansion, Elk PiTubeDirect.

User avatar
vanekp
Posts: 345
Joined: Thu Nov 30, 2000 7:09 am
Location: The Netherlands

Re: Running 8-bit Acorn kit with no OS

Postby vanekp » Fri Oct 27, 2017 5:28 pm

SHEILA Integrated Description Section
address circuit number
(offset from&FE00)
&00-&07 6845 CRTC Video controller
&08-&0F 6850 ACIA Serial controller
&10-&1F Serial ULA Serial system chip
&20-&2F Video ULA Video system chip
&30-&3F 74LS161 Paged ROM selector
&40-&5F 6522 VIA SYSTEM VIA
&60-&7F 6522 VIA USER VIA
&80-&9F 8271 FDC Floppy disc controller
&A0-&BF 68B54 ADLC ECONET controller
&C0-&DF uPD7002 Analogue to digital converter
&E0-&FF Tube ULA Tube system interface

Can all be found in the Advanced users guide.
Peter.

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

Re: Running 8-bit Acorn kit with no OS

Postby crj » Fri Oct 27, 2017 6:11 pm

myelin wrote:What's at &FE05 on the BBC?

It's a non-standard address for the 6845 CRTC's register access port. You write to &FE00 (or 2,4,6) which register you want to access, then access it through &FE01(,3,5,7).

Before the video is set up, it's probably safe to write there. One could make sure by writing to &FE04 first, which would choose a CRTC register on the Beeb, but write (harmlessly) to the cassette data register on the Elk.

So that's also a possibility, yes!

An idea I'm liking more, though, is writing to &FE15.

On the Beeb, this is the Serial ULA. Provided I don't write a 1 to bit 7 (which would switch on the cassette motor relay) I don't give a damn what state it's in.

On the Elk, it's an alias for the interrupt-clear and paging register. When used for paging, bits 4-7 are 0.

So yes, toggling back and forth between Basic and the keyboard is a pretty clean and easy test. Result. (-8

User avatar
tricky
Posts: 1922
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: Running 8-bit Acorn kit with no OS

Postby tricky » Sat Oct 28, 2017 6:22 am

Uses no RAM to run tests, displaying mode 7/0 is to test the RAM.
There isn't much to the code really, and I can't find the version with the ROM header, but there are plenty of examples around here and on beeb wiki/mdfs.
The code is for (the great) beebasm, by RichTW, which is what a few of use use for beeb/atom?/elk? development, but should be easily changed to your favourite assembler.
For some reason I have the ROM image on a disc image, but it can be extracted with beebem or the MMC utils or a few other ways.
Attachments
SelfTestOS.zip
replaces the OS for self test mode on a beeb/master
(9.92 KiB) Downloaded 13 times

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

Re: Running 8-bit Acorn kit with no OS

Postby crj » Sun Oct 29, 2017 12:14 am

A useful crib - thanks!


Return to “software: other”

Who is online

Users browsing this forum: No registered users and 5 guests