Raspberry Pi B+: MODE has stopped working
Stephen Cass (2395) 9 posts |
Hi Folks — I just got my hands on the new Pi B+, and installed RISC OS on it. After configuring it to work with my monitor (a ViewSonic), I dropped into BASIC via the CLI and was able to set various MODEs (Teletext, etc.) just fine. But a day later (all I’d done in the meantime was write some trivial BASIC programs in !StrongEd and played with some of the bundled game programs) MODE commands seem to have stopped working: whatever MODE I specify I get the same results: a generic graphics mode (that looks like the old MODE 4 from the original Beeb text-wise, but which supports at 800 × 600 graphics with at least 256 colors). I’ve tried MODE MODE, which once dropped me into something that looked like MODE 0, but once I tried to change modes again from there it’s the MODE 4 lookalike, and MODE MODE has done nothing but a CLS. I’ve tried configuring different monitor types and resolutions, but no joy. Any thoughts? Should I just wipe the flash card and reinstall? Any advice much appreciated! Cheers, Stephen |
Rick Murray (539) 13840 posts |
Are you able to change to different resolutions from the desktop? If not: What is your monitor type set to? I recall a “quirk” that for some reason disabled the monitor definitions that I had set up1, so it was reverting to a “safe” built in mode. I wonder if something similar is happening on your system? 1 Never figured out what was wrong, I just made the settings file read only and locked, so whatever was messing with it…couldn’t. |
Stephen Cass (2395) 9 posts |
Thanks for the reply! I can change different resolutions from the desktop (I currently have the monitor type set to “ViewSonic VA2012wSERIES” @ 1600 × 1200 with a color depth of 16 million.) Cheers, Stephen |
Stephen Cass (2395) 9 posts |
Hmm — just to add, I was able to reproduce this by reimaging my boot SD card. After initially configuring the screen, I used F12 to get into the CLI, started basic, used a MODE 7 command, which worked. Attempting to exit directly from BASIC at this point went even worse however, with my getting a “something has upset Pinboard” warning, and a change in resolution. Restoring the screen config settings so I could see more than a small area of the workspace worked fine, but no more MODE 7 when I dropped into BASIC. Will reimage one more time to see if it’s just MODE 7, or any of the others. |
Stephen Cass (2395) 9 posts |
Okay, indeed invoking a MODE is a one-shot deal, regardless of the MODE, e.g. MODE 32. Except, oddly enough, when I set the screen driver to AUTO: I was able to MODE 7 into a weird interlaced mode. An attempt to enter MODE 0 after that just hung my Pi! S. |
Chris Hall (132) 3554 posts |
Did you install RC12a or Pico? I found issues with Pico, which seemed to disappear. For example it would abort if I used *SLOAD twice. |
Stephen Cass (2395) 9 posts |
I installed RC12a. Final note: I did some more testing and was able to duplicate this with another screen, but if I left the screen driver on the RaspPi-BuiltIn setting that a fresh install starts in (which is not offered again as an option once you select a monitor type in the screen config screen), all the MODE commands work fine, with either screen! Cheers, S. |
Jeffrey Lee (213) 6048 posts |
There are several issues that you’re seeing here:
|
Stephen Cass (2395) 9 posts |
Ah, thanks very much for the explanation! I guess until the fixes percolate through from the development tree I’ll just stick with a install that uses RasPi-BuiltIn for single-tasking Apps, and use a second card for when I want to use Wimp apps. I appreciate you taking the time to spell out the complexities involved, Cheers, Stephen |
Steve Pampling (1551) 8170 posts |
Technically ALL Pi versions are development so the difference is really whether any fixes have been added along with a number of new features. Obviously the RC candidate revisions have a bit more testing. |
Chris Hall (132) 3554 posts |
Whenever a CMOS reset occurs (for the Pi, this will basically be whenever you update the ROM image) the *LoadModeFile command in !Boot will get clobbered. There is a lot packed into this seemingly innocuous statement…. Am I right in my understanding here: Would a simple work around be to add a deliberately blank line to that file? I had thought that it was only when a ‘vanilla’ boot structure on disc was encountered that the RO510Hook etc. bits were used to populate Boot.Choices etc.. Any chance of a fuller explanation please? |
Jeffrey Lee (213) 6048 posts |
Close… it’s actually the ClrMonitor utility in the boot sequence which zaps the LoadModeFile command, rather than the ROM itself. For a fresh Pi ROM the CMOS reset is initiated because the CMOS checksum will be incorrect.
It would have done with old versions of ClrMonitor, but when I fixed the Wimp to throw an error on bad *WimpMode commands I also had to fix ClrMonitor so that it clears both lines of the file (otherwise the boot sequence would stop halfway through with an error). So you’ll have to add two blank lines (or rather, two lines with ‘|’ in them) to avoid the contents being clobbered (if you have a completely empty line ClrMonitor will end up overwriting the newline character). Or make the file read-only.
On the Archimedes there were two CMOS bytes used for configuring the mode – one used for single-tasking stuff (which is the mode the OS would switch to when it displays the startup message and runs the boot sequence), and the configured wimp mode which is what the Wimp would switch into once it starts up. Resetting the CMOS would understandably reset both of these. On the RiscPC the configuration file in the boot sequence was introduced, and the Wimp mode CMOS setting was retired (the *Configure entry is still recognised but it just maps onto the byte used for single-tasking stuff). However one of the main reasons you’d want to initiate a CMOS reset (at least with the Arc) would have been if you display wasn’t working – so Acorn decided to include the ClrMonitor utility in the boot sequence to make sure that the wimp mode still gets reset whenever the user resets their CMOS. Unfortunately for the Pi the combination of the above-mentioned bugs and how the CMOS settings are stored in the ROM image means that you end up with a less than ideal user experience whenever you upgrade your ROM. Finding a different way of storing the CMOS settings (e.g. hardware CMOS or a separate file on the SD card) would solve the main issue, but I’m thinking it would also be good if we made the boot sequence auto-load Configure whenever it detects a CMOS reset, preferably with a message letting the user know what’s just happened. |
Chris Evans (457) 1614 posts |
No quite true the first character (i.e. the L of Loadfile…) is changed to ‘|’ (i.e. |oadfile…) |
Chris Hall (132) 3554 posts |
Very helpful explanation, thanks. As I understand it, the fundamental purpose of the cmos settings was to provide a home for things that could not be determined easily (or at all) in the boot sequence. For example boot file system and boot drive number. Also for things that were hardware like number of CD drives. Adding a HAL and having hardware that has only USB for adding things and a GPU that introduces an extra layer of monitor scaling has made some things more logically determined in a configure file within the boot sequence. I think a hierarchy of where CMOS settings are loaded from and where changed settings are stored would be a useful piece of documentation. Is this precedence for reading correct? Physical CMOS memory on the motherboard (Risc PC and Iyonix and earlier only, if checksum correct) Note CMOS on SD card only works if module SDCMOS is present in rom. Writing precedence will be different as reading needs a sole source (obviuosly) but writing needs to write to all methods available and into boot structure (like ‘savecmos’ does)? |