Toolbox problem on beagleboard?
Pages: 1 2
Terry Swanborough (455) 53 posts |
I have been asked by someone to port !RiscPCB to run on the beagleboard it already runs on the iyonix computer OK, when I run it with alignment exceptions off it runs OK but with them on it crashes, When the pointer enters the main window. After removing most of the main loop code it still crashed which led me to investigate other areas, it seems that I had used the toolbox to change the pointer shape when it entered the main window, if I remove this option it cures the error. I have listed the toolbox modules in my boot file I tried adding a pointer shape change in another simple toolbox program and that also crashed? ColourDbox 0.23 01 Jul 2003 |
Jeffrey Lee (213) 6048 posts |
Are you using ROL’s version of the toolbox modules? If so then I suspect that’s what the problem is, as 2003 is far too old for them to have been compiled by an ARMv7-safe compiler. You could try using the versions which are supplied in the OMAP ROM image, but obviously that’s no good if you need any of the newer features (a quick look at CVS suggests that ROOLs toolbox modules are mostly 11 years old) |
Tank (53) 375 posts |
Twas me who asked you !! |
patric aristide (434) 418 posts |
Where exactly can I find the ROOL Toolbox modules? None in the self extracting HD4 file and unfortunately I never managed to use the *.tar,bz files. |
David Pitt (102) 743 posts |
The ROOL Toolbox modules are in the ROM. *help toolbox will show what variant is in use, in OS5.17 it is 1.57, in the ROL Toolbox it is 1.71. The ROOL Toolbox modules can be seen here |
patric aristide (434) 418 posts |
Are you sure about that, David? Mine claimed to be 1.52 and still does so after downloading and installing the modules from ROOL. |
patric aristide (434) 418 posts |
Ok so these should be correct then: ColourDbox 0.19 (04 May 2000) |
David Pitt (102) 743 posts |
Sorry, my spelling mistake, the OS5.17 ROM Toolbox module is indeed 1.52. |
Terry Swanborough (455) 53 posts |
After some more investigating it seems that even though I had the toolbox modules I listed in the boot sequence the loaded modules are :- I still get the error with these modules loaded if I turn on the pointer shape control via the toolbox. So its seems that there may be a problem with the toolbox unless I have done something very silly :-) BTW tank how did you determine that the error was in the sprite extend module, can you tell where a module is loaded in memory without looking at the sources? I just get an error of PC=&FC31AFb8 |
Jeffrey Lee (213) 6048 posts |
*modules will list the start address of each module. That makes it quite easy to work out which ROM module you’re in. Modules in the RMA will be a bit harder, since they might not be listed in increasing address order, and you’re not given any indication of where each module ends, etc. There’s also the *where command (supplied by the DebugTools module – see this wiki page) which is an easier/more reliable way of finding out where a crash was. Unfortunately, working out which source line caused the error is a little bit trickier. Terry/Tank, are you two looking into this bug? If not, does the current version of RiscPCB work well enough on the BB for people to recreate the bug? Or is there a simple testcase that can be used? (I’ve never really used the toolbox, so I’ve got no idea how much code is required to get it to change the pointer shape when entering/exiting windows) |
Colin Ferris (399) 1818 posts |
Terry which version of !RiscPCB are you using – 0.47? ie have you recompiled? Use the ‘*WHERE’ command in a tast window to determine the module and offset of the error. |
Terry Swanborough (455) 53 posts |
I am recompiling a newer version of RiscPCB using the C/C++ version 5.68 which I think by default should compile OK for ARM7 type chips. Jeffrey I have a simple toolbox application that I used to use as a template I will see if I can upload it somewhere so people can try it. There is very little code involved when using the toolbox you just assign a sprite to use for the pointer shape and the toolbox controls this in the background. when I upload the file I will add some instructions. |
David Pitt (102) 743 posts |
I have a minimal SpriteExtend wrecker on my site It is written in AppBasic but the actual pointer change is set using ResEd. The application opens a window, just move the pointer over it. *showregs |
Terry Swanborough (455) 53 posts |
Hi I have uploaded a simple C program that shows the error at For those that have never used the toolbox go into !test directory double click on the res file Cheer’s Terry |
Colin Ferris (399) 1818 posts |
Using the info from D Pitt :- r1 = 1 Can this be correct? |
Jeffrey Lee (213) 6048 posts |
Yes, that’s the same conclusion that Tank came to. Now your mission (if you choose to accept it!) is to work out why that code (line 1093 of SpriteExtend.Sources.SprOp) ended up with a bad sprite area pointer in the first place. |
Tank (53) 375 posts |
Terry, as Jeffrey said, use the *Where command to show which area of memory the error is located in, and *Showregs to do a register dump. [a few minutes later] |
Jeffrey Lee (213) 6048 posts |
Yes, it was this thread. Although I did fix the crash, it doesn’t look like we ever got to the bottom of why the toolbox was passing in a bad pointer in the first place. Have you still got a copy of the program? It would be good to look into what was going wrong. With this SpriteExtend crash I think it’ll definitely be the toolbox at fault, since ‘1’ certainly isn’t a valid sprite area pointer. We should probably also add to SpriteExtend a simple check for any obviously invalid sprite/area pointers so that the SWIs just return errors instead of misbehaving in machine-dependent ways. |
Trevor Johnson (329) 1645 posts |
[Edit: Oops, that’s the ‘TextGadgets’ module – sorry.] |
André Timmermans (100) 655 posts |
Just looking at the code pointed by Jeffrey I can see that R0 is the SpriteOp opcode used (SetPointerShape) and as it is greater than 0×0100 R1 is the sprite area pointer. If you look at the description of Wimp_CreateWindow, value 1 is used to refer to the Wimp Sprite Area. My guess is that the calling code forgot to replace that value with the actual sprite area pointer used by the Wimp. |
Alan Buckley (167) 233 posts |
I’ve just had a look at the code in CVS and in the Toolbox/Window/c/events code to change the pointer in subroutine events_pointer_over_window it first checks to see if the pointer is in the clients sprite area by trying the sprite op to set the pointer shape. If that fails it then tries the WIMP sprite area. You could try putting a dummy sprites file called “Sprites” in the application directory and see if that stops the crash by ensuring there is a valid client area sprite pointer. This may (or may not) prove my theory. Looking at toolbox/toolbox/c/task it appears that the client sprite pointer is set to 1 (which is supposed to mean use the WIMP sprite area) if no “Sprites” file is loaded. |
Jeffrey Lee (213) 6048 posts |
That sounds like a good analysis, Alan.
I think it would be best if we implemented both fixes. |
David Pitt (102) 743 posts |
A dummy Sprites file does indeed evade the crash in both of the test applications above. |
Alan Buckley (167) 233 posts |
I agree. Fixing the toolbox code as well would make it a lot clearer on what was happening. Unfortunately I haven’t the tools to do the either of the fixes, but it should be obvious what needs to be done from my description of the problem above. |
Jeffrey Lee (213) 6048 posts |
I’ve now checked in some fixes to both the toolbox and SpriteExtend. I’ll see if ROOL can upload any new ROM images (or update the toolbox downloads). Thanks for the help everyone! |
Pages: 1 2