Harinezumi
Stephen Unwin (1516) 153 posts |
@Rick, think I’ve got it. Check your email shortly. |
Rick Murray (539) 13806 posts |
Hi, Does anybody reading have the sources to ANSILib (if not built from parts of the SharedCLib code?). If so – can you spot anything that would cause it to trip up on a NON-booted RISC OS 3.50 machine? Here is a spool of the harinezumi start text, with debugging messages added, as it appears on RISC OS 3.50 if run directly as the machine starts.
It is worth pointing out here that going into *BASIC and typing the commands directly give the expected results. Subsequently running the start_msg program…fails. Here is a spool of the exact same program (same build, everything) when run after the boot sequence has done its thing (though in my case, none of the PreDesk apps were started as it is a 3.70 boot running under a 3.50 ROM and choking slightly… ;) ). At any case, the results are obvious:
Something happens in the boot sequence to ‘fix’ this. If you Shift-boot directly to the Desktop and then try running start_msg, it will fail. As a result of this, I would not advise using Harinezumi on RISC OS 3.50. We can see garbage is being returned in the registers; and I since I also use _kernel_swi() for the calls to OS_GBPB to scan for files... that it "appears to work" may be luck rather than design. A work-around (for me) would be to use custom assembler code snippets instead of _kernel_swi(), which is something I want to do in the long run to make the code more efficient, but it’ll take a bit of jiggling of the code to implement and I don’t have time right now. |
Rick Murray (539) 13806 posts |
Update: Stepped through the BootRun file bit by bit. The magic that makes it all suddenly work is when CallASWI is loaded. And… the docs say: I think the sanest solution would be to instruct the user to pre-load this module on older versions of RISC OS. Stephen – if/when you are reading, before the line that calls Harinezumi; add: You should (fingers crossed!) find Harinezumi now works. |
Jeffrey Lee (213) 6048 posts |
I suspect the problem you’re facing is that StrongARM compatible versions of the Shared C Library/ANSILib (they’re both built from the same sources, available here) are reliant on OS_CallASWIR12 for calling SWIs. For RISC OS 3.7+ this SWI is in ROM, but for earlier versions CallASWI is needed. The stubs code will RMEnsure CallASWI and cause the program to fail to start if it’s not present – except it looks like that code is disabled for ANSILib for some unknown reason. I’m a bit surprised that you aren’t getting a “SWI not known” error back from _kernel_swi() (you are being a good boy and checking for errors, aren’t you?) As long as you stay away from any functions that take SWI numbers as parameters you should be able to implement your own code to RMEnsure the module. Or as you mention you could replace the _kernel_swi() calls with your own veneers for the SWIs. |
Rick Murray (539) 13806 posts |
Hi, Sorry – being a not-so-good boy. It never in my wildest imagination occurred to me that OS_Word (etc) would fail. Of course, being me, I’d probably freak out and be like “WTF d’you mean OS_Module is SWI not known!!?!??!”. Still, I’ve suggested to Stephen (above) to manually load CallASWI, and it’ll be the impetous to get me to write some assembler. No, I don’t write code that takes SWI numbers as parameters (that’s getting a little too close to deep magic for my liking). I hope (!) to write sufficient code that I can look to replacing all of the kernel.h stuff. Being stuck with ANSILib means the program is larger than I’d have liked, so the ability to shed some things wouldn’t go amiss. It looks like the kernel part of ANSILib is ~15K, that’s a lot when you don’t need most of it! Thanks for the quick reply. |
Stephen Unwin (1516) 153 posts |
Where might I find CallASWI ? |
Rick Murray (539) 13806 posts |
Ah… interesting… <scratches chin> I looked in the kernel init code and I saw this:
Harinezumi is stuck with ANSILib as it, on >RO3.6 & <RO5, alters the memory allocation in situ and writes the new value where OS_GetEnv will pick it up. This can mean reducing a 20Mb application workspace down to 256Kb. [just reading the _kernel_system() code. whoo-eee] |
Rick Murray (539) 13806 posts |
RMEnsure CallASWI 0.00 RMLoad <Boot$Dir>.Utils.CallASWI At least, that’s where it is on my setup. Take a look there, tell me if it’s the same for you. If not, I’ll get a copy over to you. |
Stephen Unwin (1516) 153 posts |
Googled it. |
Jeffrey Lee (213) 6048 posts |
The ROOL version of CallASWI (which is newer than the iyonix.com one) is available from this page in the “System resources” (aka PlingSystem) download. |
Rick Murray (539) 13806 posts |
Hi,
http://www.heyrick.co.uk/software/harinezumi/ The changes are:
Stephen – this one ought to work without the CallASWI module. ;-) |
Steve Pampling (1551) 8155 posts |
Use? No. Have in the back recesses1 of “my room”2 Yes. 1 The piling system is totally out of control and the project for the next few months involves much work. 2 Reasonable size house, 3 managerial cats with just us two support staff, but I get to have a room which I only have to share with the managers and the wife doing e-mail. |
Stephen Unwin (1516) 153 posts |
Stephen – this one ought to work without the CallASWI module. ;-) Yes that seems to work now. I’ve removed the CallASWI module to make sure. Looking at the BootLog, the Boot started time is wrong, but that’s my fault, I’ve not used the thing for a while and the system clock is slightly slow! :( Corrected that now! But, I also notice that the Memory available is being reported in BootLog as 29360128 bytes (28672KiB) The ROOL version of CallASWI (which is newer than the iyonix.com one) is available from this page in the “System resources” (aka PlingSystem) download. I tried this and the !SysMerge file makes reference to !System.310.Modules.310Support directory that does not exist in the archive. |
Rick Murray (539) 13806 posts |
Phew! ;-)
Explanation is complicated, but in a nutshell while your computer (running in a 26 bit configuration) can have up to 256MiB (or is it 512MiB), but any one application can only have up to 28MiB [this, for a throwaway comment, is related to why application slots are limited to 28MiB when running Aemulor]. You know, you kinda oughta get yourself a RISC OS 3.70 ROM set off eBay or the like. It’s a nicer version of RISC OS. ;-) |
Stephen Unwin (1516) 153 posts |
You know, you kinda oughta get yourself a RISC OS 3.70 ROM set off eBay or the like. It’s a nicer version of RISC OS. ;-) I have a set of 3.70 ROMS and 4.02 ROMS I could put in, but this is my second RISC PC I use occasionally for games. Some of the older games became less compatible the more I upgraded so I try to keep this one simple. Besides, how would you test for backwards compatability? :) |
Rick Murray (539) 13806 posts |
Hi, Version 0.03alpha of Harinezumi is now available. Yup, two releases in one day! This is more a cosmetic look’n’feel version. But look on the bright side, I’ve not broken it as much as Google broke their YouTube app… You might even like it, it’s nicer than the “we’re not Linux really!” behaviour. Essentially, I have added
http://www.heyrick.co.uk/software/harinezumi/ The changes are:
|
Chris Evans (457) 1614 posts |
How does Harinezumi compare to Reporter? |
Rick Murray (539) 13806 posts |
Reporter reports on stuff. It can be used to diagnose a broken boot, certainly, but it does not influence how the system boots. Harinezumi is not primarily intended to report. That is a useful side effect. Actually, what Harinezumi does is replace the default boot process so that it is managed entirely by Harinezumi. Potential pros (not yet implemented):
1 One thing I know is that the FreePool emulation (we must do this by necessity as shelling out to CLI to do a FreePool would trash our program!) does not perform the final step of releasing the memory into the free pool because it fails with “cannot move memory, application in use” because RISC OS’s memory allocation is a little… simplistic. I’m going to poke around the kernel and see if it is feasible to replicate the OS_ChangeDynamicArea code, and if not I might look to using |
patric aristide (434) 418 posts |
ISTR there was a “multiple boot” program on my A4000, never tried it though. Unfortunately I currently don’t have access to a computer capable of runnnig RISC OS. Will give harinezumi a try asap! |
Martin Bazley (331) 379 posts |
Next question: How does this compare to ROOL’s own BootFX, recently added to the RPi distro? How much of each other’s functionality do they duplicate? Do they conflict? |
Steve Revill (20) 1361 posts |
BootFX provides splash screens and progress bars and stuff like that. The progress bar part is intended to be of general use, once booting is finished – but hasn’t had much polish beyond the requirements of the boot sequence. In order to provide the progress bar in pre-desktop booting, it does rely on the Repeat command using new parameters which in turn call BootFX SWIs to update the progress bar. If harinezumi replaces the Repeat command, it should call the BootFX_BarUpdate SWI (the x-form so if BootFX is present, it can fail silently) to update the progress bar. I’ve not done a spec for BootFX yet, but the info required is: SWI BootFX_BarUpdate (0x59140) In... R0 - %age to position bar at Out... All preserved harinezumi will need to figure out how many things need to be executed so that it knows what the correct %age update needs to be as it iterates over them. Ultimately, if it works out to be a worthwhile feature, I’d be a lot happier seeing the harinezumi stuff either being integrated into the BootCommands module, or made standard in the boot sequence. Because messing about with the boot sequence is pretty fundamental so it’d be nice to have things that end up with wide-spread adoption being part of the core distribution. |
Rick Murray (539) 13806 posts |
[post deleted – why can’t I delete my own posts!] The forum was having a hiccup, and everytime I switched my phone’s browser back from TheRegister, it looked like it submitted the same thing (over and over). I’m justr glad it was a forum post and not “I agree to buy a car”. ;-) |
Rick Murray (539) 13806 posts |
Doable. I calc %ge off the amount of BootRun executed in quiet mode, so I can have a version that uses BootFX in no time. Can you mail me a copy of BootFX? I want to see how it looks/feels with the rubbish-on-screen mode.
That’s doable too. If there is a place on the ROOL repo, I’d be happy to gift the code to you (it is mostly written in C). My standard licence is the EUPL, but if it is less hassle / going to be part of the core system in time, I’m happy to let it assume the standard ROOL licence. Then, y’all can giggle at my code. (^_^) |
Steve Pampling (1551) 8155 posts |
Speaking as someone who asked for this type of feature I, for one, would be rather happy to see it bundled in as part of the boot. Again this is something that might well be usefully integrated if the logging is transparent to the user and logs are aged out after a specified period. I play with IT kit most of my waking time but most other users don’t and the Boot is a bit opaque at the moment so fixing it is a bit of a challenge. |
Steve Revill (20) 1361 posts |
I could, but it wouldn’t be too useful because it is designed to do the splash screen stuff when it’s part of a ROM build. I suppose you could fake it up by loading it right at the beginning of the boot sequence and then doing a “MODE MODE” in BASIC to cause a mode change (and get the splash screen/progress bar plotted). It also only has resources for the Raspberry Pi and assumes a 1920×1080 screen mode, although it will work in other modes, the text window and progress bar will be in an odd place. In fact, the text window will probably be off-screen so won’t have the desired effect at all; you will still have pre-desktop text printed full screen. |