Thinking ahead: Supporting multicore CPUs
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 26
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
Rick Murray (539) 13840 posts |
Yes. You can call the kernel directly for for things that don’t directly apply to the UI. I inserted the Wimp in there to show its position relative to the application, libraries, and kernel.
The Wimp is above the kernel.
I don’t think so now, though I’ve not checked… Task swapping is now passed off to the kernel. It used to manipulate the tasks itself (RISC OS 3.5?) and it was rather slow at it – I’m not aware of the exact reasons but possibly because the Wimp was changing memory mapping outside of the kernel so had to keep the kernel aware of what was going on. Mmm, you updated your post. Therefore, so have I.
RISC OS is not Linux. Both the library and the application are nominally the same level. It’s just that with a consistent library, it is easier to think of it as being a layer between the Wimp and the application. For example, DeskLib provides a nice event handling “framework” where you can associate event handling functions to specific events – for instance if the user clicks on my “main” window, DeskLib will manage that from the event dispatch until the point where it calls “main_clickhandler()” (or whatever I called it). It makes Wimp programming simpler.
CLib is part of the SharedCLibrary; but it jumps in using branch points so I suspect that for the most part it is USR/SVC agnostic. Other libraries? The parts that are required1 tend to be linked into the executable.
How do you mean? The Wimp replaces a number of things that just don’t make sense in a multitasking world. For example, key presses are provided by Wimp_Poll events. An application cannot sit waiting on INKEY (like ReadC from stdin) any more. You can still draw to the screen, but under very specific cases (namely, redrawing your own windows). You don’t poll the mouse for position information, the Wimp tells you when something happens. And you don’t idle loop while waiting for something, you poll the wimp (which means, let other stuff have some play time with the processor). No, the Wimp does not entirely replace the kernel, but it does make an important number of changes to the program environment and, dare I say, the paradigm2 of how software is written. 1 The librarian and linking system is quite nice. Libraries are often built out of hundreds of small pieces of source code all of which make their own object file; so when building an executable, the linker only needs to include those object files necessary to satisfy all of the references. Therefore, I don’t think there is one single program of mine that contains the entire 300-odd KiB of DeskLib. 2 I can’t say that word without thinking of Dilbert. |
Steve Pampling (1551) 8170 posts |
I can’t help wondering if a wider reaching 2-layer HAL would be useful. |
Rick Murray (539) 13840 posts |
I’ve lost track of which thread contained the pre-emption discussion… Anyway, take a look at this, it might be helpful: https://groups.google.com/forum/#!topic/comp.sources.acorn/Yql3tT-J0iY |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
David Feugey (2125) 2709 posts |
They should not, but they are – by design – not compatible with PMT. So no choice. |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
Rick Murray (539) 13840 posts |
FileSwitch ought to be reentrant. Think of how DOSFS and SparkFS work. FileCore. There’s your fun scenario. However… Excuse me for what might be a really dumb question, but what are you actually trying to do? You say preempted – but in what context? Wimp apps? Everything?
You see, my (way simpler) proposal was to add a “preempted behaviour” to the existing Wimp. Sure, it is a far cry from what you understand and the preempted command line programs that you may be used to. What you are talking of, however, is something that is a lot more involved than this. I’m worried about how much disruption it may cause existing tasks. Fundamentally, RISC OS is a single user single process operating system with a clever task switcher built into it. Think of it like DOS with Windows 3. Okay, Windows could do a lot of stuff and was nifty, but it was still DOS kicking around underneath it all. Our setup is a similar sort of concept. I am concerned that you think you are able to “forbid” access to certain SWIs. Why? Well…
No. Hardware access should be forbidden from a user mode application period. Doesn’t matter if it is preempted, Wimp, or a five line BASIC program…
Might I suggest before you plan to implement any form of pre-emption, you read the PRMs and understand how everything fits together. The books are laid out as:
At least, you’ll need to read and understand pretty much the entirety of book 1 and the first half of book 3. Then, you’ll know the answers to your questions…
…address zero is traditionally where the processor vectors are located. It is probably just initialising its array contents to zero (and may check this later with a simple is-it-non-zero test).
What virtual memory?
If you read the chapter on modules in PRM book 1, you’ll know how and where modules store their private data. |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
Steffen Huber (91) 1953 posts |
Small correction – Volume 5 was for RISC OS 3.5 (1994), Volume 5a was for RISC OS 3.6 (1995). |
h0bby1 (2567) 480 posts |
aaaaa |
Rick Murray (539) 13840 posts |
It looks like you’re interpreting this rather differently to me. For me, I see the wimp PMT (and only in the wimp) as a means to task switch without having an explicit polling loop; maybe code which is ported, or something else where it is better to tell the system to “just interrupt me” instead of regular polling. |
Steve Pampling (1551) 8170 posts |
Reference my comments about the HAL elsewhere, if the HAL is the only thing talking to hardware1 and the OS talks to the HAL, any programs that want to talk direct to hardware could be fooled by the HAL into thinking they were talking direct. An application in one thread might think it has exclusive access. 1 Layer 1 talks to hardware and layer 2, layer 2 provides the lie that a device that is just slow responding while in reality it is in use. Layer 2 should provide a platform independent view of the hardware to the OS so that the only difference between OMAP3, iMX6 and BCM2835 is the HAL. To the OS any missing hardware is reported as “turned OFF or not present” |
h0bby1 (2567) 480 posts |
aaaaa |
h0bby1 (2567) 480 posts |
aaaaa |
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ... 26