Configuring a
BBC Model B
Although the BBC Model B does not have the benefit of the battery-backed CMOS RAM introduced in the Master Series, a limited number of start-up options can be "configured" on this machine.
These are: the default filing system when using DNFS, the action of BREAK and shift-break, disc drive timings and the default screen mode.
These options can be controlled by hardware or software means. The hardware method is to set the keyboard links. The software method is by using OSBYTE 255.
Keyboard Links
On every BBC Model B keyboard, there is a set of eight links. On the most common type of BBC keyboard ("type 1"), the keyboard PCB is cream coloured and the set of links is towards the bottom-right of the keyboard, just past the space bar. The left-most link is number 1.
For type 2 keyboards with a purply coloured PCB, the links are on the right-hand side of the circuit board and oriented vertically. Helpfully, these links are numbered 1 to 8.
If you intend to change the link options frequently then I would recommend soldering in an 8-way DIL switch which will allow you to play about at will and without having to turn your BBC off.
The default state is that each of the links is unmade. When the BBC reads the keyboard links, it records the result in a single byte in memory with one bit for each link. When a link is unmade or a DIL switch is off, the bit is SET (ie. "1") for that link. Beware of this because logic would dictate that when a link is unmade or off, this would translate into a clear bit ("0") but with the keyboard link system, this is the opposite of what happens.
The actions of the 8 links are as follows:
| Link | Link unmade or switch off | Link made or switch on |
| 1 | Default filing system: DFS | Default filing system: NFS |
| 2 | Not used | Not used |
| 3 | Disc drive timings | Disc drive timings |
| 4 | Disc drive timings | Disc drive timings |
| 5 | SHIFT-BREAK to boot | BREAK to boot |
| 6 | +4 to screen mode | +0 to screen mode |
| 7 | +2 to screen mode | +0 to screen mode |
| 8 | +1 to screen mode | +0 to screen mode |
Links 3 and 4 set the disc drive timings. For the 8271 disc controller, the timings are as follows:
| Link setting | Step Time | Settle time | Head Load |
| Link 3 made, Link 4 made | 4 ms | 16 ms | 0 ms |
| Link 3 made, Link 4 unmade | 6 ms | 16 ms | 0 ms |
| Link 3 unmade, Link 4 made | 6 ms | 50 ms | 32 ms |
| Link 3 unmade, Link 4 unmade | 24 ms | 20 ms | 64 ms |
Links 6, 7 and 8 set the screen mode. In the default state, all links are unmade so the mode is 4+2+1 = 7. To change to mode 0, you would need to make all three links. To change to mode 6, you would just need to make link 8.
The link setting is updated after a hard reset (ie. CONTROL-BREAK or power-on). Obviously, when soldering links the machine will be off so the new settings will be detected when the BBC is turned back on. With a DIL switch in place, the links can be moved at any time but the settings will not be updated until the next hard break.
Osbyte 255
The value of the keyboard link settings is held in the BBC's memory and this location can be read or written to using Osbyte call 255. Each of the 8 links occupies one bit of a byte of memory so the settings available to Osbyte 255 are as follows:
| Link | Bit | Value | Bit set | Bit clear |
| 1 | 7 | 128 | Default filing system: DFS | Default filing system: NFS |
| 2 | 6 | 64 | Not used | Not used |
| 3 | 5 | 32 | Disc drive timings | Disc drive timings |
| 4 | 4 | 16 | Disc drive timings | Disc drive timings |
| 5 | 3 | 8 | SHIFT-BREAK to boot | BREAK to boot |
| 6 | 2 | 4 | +4 to screen mode | +0 to screen mode |
| 7 | 1 | 2 | +2 to screen mode | +0 to screen mode |
| 8 | 0 | 1 | +1 to screen mode | +0 to screen mode |
The default setting of Osbyte 255 is that all bits are set, ie. 128+64+32+16+8+4+2+1 = 255. To set NFS as the default filing system, bit 7 is cleared and the values for the remaining "set" bits are added up, ie. 64+32+16+8+4+2+1 = 127. Thus, *FX 255,127 will set NFS as the default filing system and leave all the other settings unchanged.
The new value assigned to Osbyte 255 takes effect after the next soft reset (ie. BREAK or SHIFT-BREAK) and the default value is restored after a hard reset.
To read the last loaded settings of the keyboard links (which may have changed since the last hard reset), you can read Osbyte 255. From BASIC this would be done as follows:
A%=255
X%=0
Y%=255
PRINT ~USR &FFF4
This call will return a four-byte hexadecimal number, ie. 8 characters. The rightmost two characters are the setting of the A register, which will be the value we gave it, ie. &FF or 255. The next two characters are the X register which returns the settings of the links. The number returned can be translated into the link settings using the table above.