Recent Low Vector ROM for Pi
Pages: 1 2
andym (447) 473 posts |
Is there a recent low vector ROM for the Pi available anywhere? Last one I can see is Chris Hall’s October 2016 version. Any newer ones, preferably with the EDID stuff in them? I have no idea or the necessary software to roll my own, unfortunately. |
Jeffrey Lee (213) 6048 posts |
Why not use the latest high vector ROM? The kernel now sticks a dummy page at page zero, so most software which accidentally tries reading from page zero should work OK. |
andym (447) 473 posts |
Oh okay! Not quite sure what that means, but I’ll give it a go! ;-) Will ZeroPain still be required? |
Jeffrey Lee (213) 6048 posts |
Depends on the situation. ZeroPain can emulate some old zero page locations, so might help compatibility with software which is deliberately accessing zero page. Plus it produces a log file entry for any zero page access, so that’s useful for reporting/fixing bugs. |
nemo (145) 2546 posts |
Where is the documentation for the ‘high vector’ build – how much zero page has moved, where has it moved to, how is that detected etc? |
Jeffrey Lee (213) 6048 posts |
Hmm, it’s kind of scattered all over the place.
&0 to &4000, i.e. the processor vectors, low kernel workspace and VDU driver workspace. ScratchSpace has been left as-is (for now). Moving the processor vectors isn’t possible on IOMD, so that hasn’t had any alterations (yet – moving everything else but keeping the vectors at &0 is a future possibility)
Processor vectors have moved to &FFFF0000, i.e. the standard ARM high processor vector location. There’s an OS_PlatformFeatures 0 flag to indicate this, and also OS_PlatformFeatures 32, which should probably be used in preference just in case we decide to move them again in future. OS_Memory 16 has also been extended to report the size & location of things which have been traditionally at &0 to &8000. But just because you can read the address of kernel workspace, you shouldn’t assume anything about its layout or content – firstly because it’s meant to be private to the kernel, and secondly because it is likely to change quite a bit as the SMP work progresses. But if you do need to stick your fingers where they don’t belong, OS_ReadSysInfo 6 has been taught quite a few new locations in recent years in order to allow the rest of the OS/ROM to gracefully deal with the workspace moving. There’s also OS_Memory 20 which can be used to control the compatibility page. |
nemo (145) 2546 posts |
A lot of what I do is very low level. Please do try to keep things in the same place if they haven’t changed. In other words, don’t do what ROL did and move almost everything because the serial input file handle byte became a word. Grrrrr!
Which talks exclusively of the processor vectors and not of all the other stuff that has moved. Presumably OS_Byte &A6 returns the correct high address? I understand the great advantage of moving the first page (the actual “zero page”) but I’m not sure that &1000-&3FFF was any more vulnerable than any other pages. One good reason for moving it is to indirect it to enable multiple graphics contexts. Is the “compatability page” a set of read-only mappings of the real pages, or a few select values poked into some RAM? Is there any documentation of what this “compatibility” implements and guarantees? I don’t see a way of reading the start of the VDU workspace (&1000)… must one infer it from the list of WrchV handlers? Will that always be readable at &1000? |
nemo (145) 2546 posts |
Don’t you dare! That’s a defined part of the API, even if the provisos for using it are basically a secret handshake and magic incantation. By all means add a wrapper to “claim” and “release” it (enabling people without magic knowledge to use it). |
Jeffrey Lee (213) 6048 posts |
I’m not making any promises. If you need access to something, ask for it to be exposed via an API. Or add the API yourself! We can’t get stuck in the situation where we can’t change anything out of fear of breaking someone’s dodgy add-on that peeks and pokes kernel workspace without permission.
No it doesn’t. Have Acorn ever documented that call as working under RISC OS? &A8, &AA, &AC and &AE don’t do anything useful, so why should &A6 be maintained?
One advantage of moving them is that it frees up the low area of the memory map, so that emulators/compatibility software can map in their own pages to those locations and do with them as they wish. Plus there’s the whole “not being shackled to a kernel workspace layout from 1987” thing.
https://www.riscosopen.org/wiki/documentation/show/OS_Memory%2020 It’s a single page at &0 that’s intended to act as a crutch for buggy software that accidentally reads from null pointers. It doesn’t provide an emulation of kernel workspace locations. So it’s mostly empty, apart from the first 64 bytes or so which contain magic values that are intended to make the buggy software behave in a “safe” manner.
Correct. It’s almost like it’s meant to be private or something! |
nemo (145) 2546 posts |
And such things are now your personal decision (or the whim of whoever can be bothered to check in a change)? Acorn is long dead, but I worry that there is no longer a policy to achieve backwards compatibility unless impossible.
Well, this comes down to a largely philosophical question: Do we want to say “if you want this API then you have to use this version of the OS from this supplier, and if you want that API, then get that OS from them ”, or is it reasonable that people might want APIs and functionality to be available across OS versions? If it’s the latter, and I am of that camp, then somebody has to provide such compatibility layers. This puts those somebodies in a position somewhere between users and the appointed high priests. Concrete examples: VDULarge There is a known limitation with VDU24, VDU28, VDU29 and VDU31 that cause a problem with very large displays (theoretical) and large sprites (long standing). My little module solves that (to some extent). It can only do that by manipulating VDU workspace. There is no API to do that that is the very problem it solves. You will argue that such a solution (if not this one) belongs in your OS… but that does not solve the API problem in general. I boycotted RO4-only APIs for precisely the same reason. Acorn used to make updated modules distributable and soft-loadable on older OSes. That went out of fashion for (unsound) commercial reasons. I cannot support that approach. VectorExtend A module that greatly extends and enhances vector behaviour, including the automatic vectorisation of all SWIs, can only be implemented at the very lowest level. Knowing the location of the OS vector heads is insufficient, it needs to free the “chocolate block” vector nodes and reallocate, and completely replaces all kernel vector code. There isn’t a polite way of doing that. Debugging utilities
I’m unimpressed by the argument that such things should not exist, or that such things must be “dodgy”. But you’re entitled to your opinion.
It was part of Arthur and has not been deprecated. An important clue is that it returns the correct value on all versions of RO except the one where zero page moved. Perhaps whoever moved it forgot about &A6? (It requires two extra instructions in the high vector case) |
Steve Fryatt (216) 2105 posts |
No more or less than they are yours, I’d imagine. |
Jeffrey Lee (213) 6048 posts |
We have forums where changes can be discussed. We have public CVS where changes can be viewed. You have ample opportunity to object to any changes that are made before they appear in stable OS releases. Now compare that to the situation where ROL shuffled everything along because they changed a byte to a word.
How can we be backwards compatible if we don’t know what we need to be backwards compatible with? Unless we know what kernel workspace is being used (and how/why), we don’t know whether any change we might make might break compatibility. Therefore we can’t make any changes.
And I would be correct to do so, if it’s something that involves peeking and poking private kernel workspace.
Either you’re mad or I’m misunderstanding you, because it sounds like you don’t support the practice of having APIs that are supported across all OS versions. And yet, APIs which are supported across all OS versions seems to be the exact thing which your modules aim to provide.
Polite or not, it could still ask the OS for the locations of the things it needs, instead of resorting to guesswork or undocumented APIs.
It’s a good job I’m not making that argument, then.
I can use the word “impolite”, if you’d prefer. No [OS_Byte &A6] doesn’t. Have Acorn ever documented that call as working under RISC OS? Arthur was declared obsolete with the release of RISC OS 3, and I can’t see any obvious mention of OS_Byte &A6 in the RISC OS 3 PRMs. To me this is a pretty strong indicator that the call has been deprecated (regardless of whether it was meant to be part of Arthur or not).
How can we know what those two extra instructions should look like, if we have no documentation for the call? There are many different ways in which the returned R1 and R2 values can be combined to make an address, unless we know what the “correct” way is there is no way for the call to be extended to return a 32bit value. |
nemo (145) 2546 posts |
Although there is documentation of calls such as OS_Control that have been deprecated, I can’t find any mention of OS_Byte &A6 being withdrawn. Pardon my candour, but I suspect it has been forgotten. It’s easy to miss – it’s in the initialisation data for the MOS vars. That approach will no longer work for addresses with more than 16bits, hence a couple of extra instructions required.
No, there are two ways, and one of those is too highly contrived to consider. So:
And you dodge the question: How is that API provided to users of other versions of the OS, if not by a module manipulating workspace? Everyone accepts that end users, application authors and hobbyists should not be accessing such things. But some things have to, by definition. Steve added
And the point I am making, and I think it is a reasonable one, is that one should not move things for the sake of moving them, fix things that are not broken, etc. Moving zero page has a benefit to a particular theoretical usage case that cannot be achieved currently. Ok. But moving hundreds of locations as ROL did merely because they changed one byte to a word should be avoided. Move the thing that is changing, don’t move the things that aren’t. There is a huge amount of precedence for that, just look at the sources. That is all I asked for, and got the response “no promises”… which I’m disappointed by. I have just recalled that UKVDU23V includes a reference to the VDU queue, so that is a publicly accessible part of the “private” VDU workspace… at least for the duration of the vector call. |
Rick Murray (539) 13840 posts |
Oooh, handbags at dawn! :-) You do know you are a little late to this party, right? BTW, if it’s a secret handshake and magic incantation, then it is not a defined part of any API. You’ll be referring, no doubt, to the glaring cock-up that is in PRM 5a-41 where it says that scratch space is a “public area” that may be used by any module that is neither in IRQ mode nor going to call something that might also want to use it (it seems FileCore likes to use this). FWIW, the only mentions in PRMs 1-4 are OS_HeapSort (PRM1) and where filing system temporary buffers are claimed (PRM2). However one should probably consider that table to be invalid since it is describing a 26 bit operating system and references to hardware (VIDC20 etc) that no longer exists on most machines. Example? Look at where it says the SVC stack is. Now call OS_ReadSysInfo 6, 0, 16… Now I suppose Jeffrey could add an extra value to OS_Memory 16 if you really need access to this memory, but really shouldn’t you be using a legitimate private claim like all the rest of us? Or should we all consider that 16K to be open season and available for free use as required? I’m sure you can see where that would end up…
Yes/no. Yes, the API and functionality should be available as far as is logical (later builds will always have more features – consider things like VFP or the ability to have display modes greater than FullHD, or the RGB/BGR issues); but the collarary to that is to ask should development of features be deferred, mangled, or just abandoned because it might affect backwards compatibility? The answer to that lies mostly in what it is in question – I doubt anybody will ever add pen pressure readings to OS_Mouse because anything that expects the API to use only R0-R3 will break the moment that suddenly R4 is used. However APIs that were largely undocumented are liable to change. Acorn themselves provided a pretty good example back in the day. It was well known that using
You mean the part where there is no way to set the text cursor to a position >255? I have long said that messing around with OS_Byte to get information from the keyboard, and spitting VDU calls to adjust the behaviour of the text cursor is a horrendous API that has barely changed since the BBC Micro. Ideally we need to consider VDU-anything to be legacy, and have an API suitable for the modern era.
Debugging utilities, by their very nature, will always play fast and loose with the internals of the operating system. I’d bet DDT does a lot of nasty stuff too…
Hmmm, &A6 isn’t in my StrongHelp file. […] After half an hour of rummaging through the source – it looks like you probably ought to pick up the pointer exposed with OS_ReadSysInfo 6,71 which provides a pointer to the OS workspace (akin to that which you would get from OS_Byte &A6 onwards). However, it looks like it’s a two-byte value, so by definition it cannot hold a 32 bit value (Kernel.hdr.KernelWS, around line 303). If you ask really nicely, Jeffrey might alter those initial five entries to be words instead of halfwards. Of course, everything else will be offset by ten bytes and all the OS_Byte calls >&A6 will be wrong too, but hey, it worked for ROLtd right? |
Steve Pampling (1551) 8170 posts |
Hmmm? You had noted that there was a download called PlingSystem hiding in plain sight on the Miscellaneous downloads page.
If the utilities were included in the main OS (and in the aforementioned PlingSystem) then everyone has them, either in the default OS or as a drop in for the older versions like v4.39 but it does require the author to put them forward for inclusion. |
Jeffrey Lee (213) 6048 posts |
And I would be correct to do so, if it’s something that involves peeking and poking private kernel workspace. You’re worried about future versions of RISC OS changing the layout of kernel workspace and breaking your code. My argument is that:
Move the thing that is changing, don’t move the things that aren’t. If my answer disappoints you, try contacting ROOL directly. They’re the ones that make the rules around here. However, do realise that “no promises” doesn’t mean I’m going to completely randomise the kernel workspace on every check in. Generally I try and keep things in the same place, but guaranteeing that is becoming increasingly difficult (many different kernel build configurations to consider, and not much free space left to insert things). Hence, until ROOL decide otherwise, I reserve my right to move stuff around as I deem necessary. |
Jon Abbott (1421) 2651 posts |
Where the OS places it’s internal variable should come out of the build process and nothing outside of the OS should be touching it. Any “low level” tinkering should be done via legal OS calls. If a specific value isn’t currently available via an OS call, I’m sure it will be considered if its requested.
Although it was possibly never officially deprecated, its not a call that was for public use under RISC OS, its always been “Acorn use only”. The only program I’ve ever come across that used it was !65Host, but that does far dodgier things than just poke around in Page Zero.
Why don’t we do this? Linux and Window both randomly allocate their private workspace specifically to stop idiots from poking around in OS private space. |
Chris Mahoney (1684) 2165 posts |
It’s not listed in the Arthur PRMs either; the index of OS_Bytes skips &A6 (and a few others). It looks like it was never intended to be used by third-party developers. Edit: Actually, page 14 says this:
So it seems that &A6 is (or rather, was) documented as providing access to system variables, although the PRM doesn’t appear to document what that particular variable at &A6 is. |
Chris Hall (132) 3554 posts |
Is there a recent low vector ROM for the Pi available anywhere? Last one I can see is Chris Hall’s October 2016 version. Now that ROOL have provided a page of memory at &0xx for those apps that harmlessly read a null pointer and ignore the result and now that a high vector version of Aemulor is available to support such apps as Impression-X, my current recommendation is that users should move to a high vector rom. The transition is now much simpler. My only gripe with current roms is that if you set monitortype to EDID but then run with no monitor connected, the boot process hangs. Previously with no monitor connected on a Raspberry Pi the HDMI system simply doesn’t power up (saving battery drain). It would be nice if the boot process didn’t hang with no monitor connected and EDID configured. (I have an OLED display and only connect an HDMI display to debug things.) |
David Pitt (3386) 1248 posts |
These calls are detailed in the BBC Micro Advanced User Guide by Bray, Dickens and Holmes. &A6 and &A7 Read start address of OS variables &A8 and &A9 Read address of ROM pointer table &AA and &AB Read address of ROM information table &AC and &AD Read address of keyboard translation table &AE and &AF Read VDU variables origin |
Jon Abbott (1421) 2651 posts |
&A6 returned the start of the OS_Byte values, which for RISC OS 3.1 started at &8FA. The complete list of undocumented OS_Byte’s previously referred to the following OS variables:
There’s no reason to maintain any of these as they’ve never been officially documented for RISC OS and should not be used outside of the OS. |
Rick Murray (539) 13840 posts |
Not to mention, the addresses are sixteen bit so are surely functionally useless for RISC OS. So this behaviour is (yet another) BBC MOS throwback… |
David Pitt (3386) 1248 posts |
https://www.riscosopen.org/wiki/documentation/show/OS_ReadSysInfo%206 N.B. This call is for internal use by the operating system and certain utilities (e.g. SoftLoad, ROMPatch). It should not be used by user programs. The purpose of the call is to return information about the Kernel’s internal variables. Item 71:- https://www.riscosopen.org/wiki/documentation/show/OS_ReadSysInfo%206%20Items Is this a modern OS_Byte &A6. |
Jeffrey Lee (213) 6048 posts |
Yes, OS_ReadSysInfo 6 item 71 is a modern replacement for OS_Byte &A6. I can’t remember what it was, but something in the OS was trying to use OS_Byte &A6 (perhaps SpriteExtend?). Extending OS_ReadSysInfo 6 seemed to be more sensible than extending OS_Byte, since:
Perhaps it would make sense for OS_Byte &A6-&AF to return an error, at least for high vector ROM builds. |
David Pitt (3386) 1248 posts |
Did Acorn ever do so for the BBC Micro. The BBC Micro Advanced User Guide referenced above is a third party publication. These calls are not in Acorn’s BBC Micro User Guide. |
Pages: 1 2