Important software compatibility notice
GavinWraith (26) 1563 posts |
Of course. Sorry about that.
It wants to know if the current task is the Filer. It sets up filters to modify some filer actions – notably the creation and deletion of windows and the plotting of icons. |
Jeffrey Lee (213) 6048 posts |
I’m afraid not. You’d be able to get some test coverage by making the area inaccessible to user mode, but that wouldn’t help test for privileged code reading/writing to it. You’d probably also get a lot of false-positives from user-mode code attempting to legitimately read form zero page (e.g. things like the OS_ChangedBox buffer are stored there) With ZeroPain running my Iyonix is stable enough for me to use it for day-to-day development (running Norcroft, Netsurf, StrongED, PDF, Sunfish). The biggest problem I’m seeing is that Sunfish crashes when dismounting mounts. I don’t think I’ve tried GCC but I’d expect it to be fine, considering it’s a unix port. Maybe install the new ROM on a spare SD card, or have two ROMs on the one card and swap between them by renaming? |
Michael Drake (88) 336 posts |
You could try using Prot1K from Adrian Lees instead. |
Frederick Bambrough (1372) 837 posts |
The latest ROM for the BB -xM seems to have broken alt-click on filer icon text. The writable text box opens & immediately closes. A new ZeroPain generated immediately after shows; Time: Tue Jul 7 17:33:47 2015 R0 = 0066b190 R1 = 0050899c R2 = 006b0c3c R3 = 00000000 0049ec70 : e92ddaf0 : STMDB R13!,{R4-R7,R9,R11,R12,R14,PC} Time: Tue Jul 7 17:33:47 2015 R0 = 0066b190 R1 = 004ef5c0 R2 = 006b0c8c R3 = 00000000 0049ec70 : e92ddaf0 : STMDB R13!,{R4-R7,R9,R11,R12,R14,PC} Time: Tue Jul 7 17:33:47 2015 R0 = 0000000a R1 = 00000000 R2 = 006b0c8c R3 = 00000000 0049c12c : e91ba800 : LDMDB R11,{R11,R13,PC} |
Martin Avison (27) 1494 posts |
@Jeffrey: Thanks, I suspected that would be the case, but I thought it best to get confirmation. I am currently softloading v5.22, so when I flash that I can then softload the new ROM more easily. @Michael: Yes, I am using Prot1k … but it makes things (including Zap!) fail rather than logging, which is not desirable while developing. I have not found an UnProt1k, so I have rebooted several times today! And it is only 1k, not the full 4k. I have made progress with the small problems with Organizer and Reporter – if anyone has been affected please let me know by email to the support address, with the version. |
Jeffrey Lee (213) 6048 posts |
I think the problem with Prot1k and ZeroPain is that ZeroPain does a check on startup using OS_Memory 24 to work out whether the first 16K of memory is user-readable or not. However for performance OS_Memory 24 doesn’t actually check the page tables for most areas – instead it just relies on the DA flags, or for non-DA areas it uses the hardcoded permissions that the OS applies to the area. Plus the OS doesn’t really understand the sub-page attributes, so even if it did check the page tables it might not spot that Prot1k has been fiddling with them. If you recompile ZeroPain without the OS_Memory 24 check then it should run just fine, but since Prot1k only provides partial protection to zero page I’d say it’s still best to test on a real zero page relocation ROM. |
Rick Murray (539) 13840 posts |
Is ZeroPain’s source in the repo? I hope so. The first thing I’ll need to do is to disable the timeout – perhaps the only way to keep Zap working. ;-) Starting the display configuration tool throws many errors in the International module (but then so does opening a TaskWindow, so…). |
Steve Pampling (1551) 8170 posts |
Well the source is available is it not? |
Jeffrey Lee (213) 6048 posts |
Phase 2 of the testing process is due to begin on 1st Jan, 2016. ZeroPain will refuse to run on any ROM built on or after that date. Yes, the source is in CVS. At some point we’ll probably have to put together a plan for how to support unmaintained software – probably a patcher of some kind, as that’s pretty much always going to be better than emulating the old behaviour (even if the emulation was only enabled for specific apps). |
Rick Murray (539) 13840 posts |
It may come to that…
When I find an editor that does the ancillary stuff that Zap does for me, that would be a start. |
Malcolm Hussain-Gambles (1596) 811 posts |
SystemDisc and NewsUK are two things affected by this change too. I’m unsure how or why NewsUK is affected, my guess was the FPEmulator but there are fixes for that… Time: Tue Jul 7 20:07:36 2015 R0 = fa207fc0 R1 = 00019458 R2 = fb4077fc R3 = 0002c84c fc41c348 : e59f1014 : LDR R1,&FC41C364 |
Fred Graute (114) 645 posts |
The ‘Tick’ icon on the toolbar opens the configuration windows. A Select click opens the global choices and an Adjust click opens the mode choices. The Colours and Font sections in mode choices are what you need. Please note that StrongED 4.69f8 only supports bitmap fonts of 8×8 and 8×16. StrongED 4.70a8 supports bitmap fonts of up to 32 pixels wide and any height.
Yes. Click Adjust on the iconbar icon to open the modes menu, then click on Dump. The dialogue box that opens, allows you to grab applications, modules, etc. |
Rick Murray (539) 13840 posts |
This ought to be subtitled “Adventures in debugging”. Here’s some code:
And here’s the compiled result:
What’s this line Had to revert to my older ROM as the debugger (DDT) crashed instantly on the zero-page-moved ROM. Hmm… Nicely, a debug build of my code looks utterly different to the non-debug code. There’s no point continuing here, so I’ll build a non-debug version and settype it as DebImage. Right. On exit from the branch, register R5 is &1694C. The instruction to load R1 from R5+#724 sets R1 to &1CBE8. The next instruction, to load R2 from R1+#12 (with writeback?) sets R2 to be &421905. Ah. Wow. Oh. Holy Hell. This is an embarrassingly STUPID fail. So I’m stepping though the script commands, right? And one of them is the command to call a menu. Now menus replace scripts. So what it does is to tidily exit the script processing and close the file. We jump through all the hoops involved in loading a menu (which can include sub-scripts). Then once that is done, we fall back to the callee routine, the original script loop, which promptly chokes because its file handle has been nuked. Only it works fine on older RISC OS (just reads junk from the processor vectors ;-) ). The “fix”? For now, change this:
to this:
Lessons and morals:
Phew. Still, the thing is working now. ZeroPain had no complaints. |
Rick Murray (539) 13840 posts |
Ah, thanks for that.
Hmmm, mine’s 4.69b5. ;-) Is it possible to:
I find it easier to read the component-colourised code, for instance the white ‘!’ for writeback stands out, while the generic parameter wrappers {} being darker grey are present, but don’t detract from that which is important, the registers. The registers (and (C/S)PSR) are uniquely cream. SWI numbers (or names) and branch addresses are uniquely orange. SWI instructions are uniquely cyan. Load/store instructions are mid grey, branches a darker grey, and generic instructions (the “anything else category”) are white, execept co-processor stuff which is uniquely dark blue. Comments are green and italicised, and condition codes (when specified) are underlined. Undefined instructions are red and italicised. I notice also that when reading a module from memory, the address on the left shows the last four digits of the address and all of the link addresses are absolute. For example, the first branch of the ZeroPain init code in Zap is BL &00001A00 while StrongEd shows it as BL &201DC734. Is it possible to change the addresses to be relative to the start of the code?
Mmm, nice touch, separating RAM and ROM modules. I like that. |
Steve Drain (222) 1620 posts |
Excellent – that’s all of my own creation, but a long time ago. It gives me an excuse to come in as a user and reassure you that StrongED will do all that you want, so far, but you might have to investigate modifying a mode file or two if you have exacting requirements. No doubt you did something like that during your use of Zap.
Yes. That is decided by a rule in the modewhen file and is the default. For typed files it is straightforward, but the mode can be forced by a header line at the start of a file if necessary.
Just an option in choices. I have not had it flashing for a couple of decades. ;-)
I have used my own colour scheme for so long I have forgotten what comes as standard, but that does require some setting up. The more recent versions make this much more flexible. |
Fred Graute (114) 645 posts |
@Rick I’ve created a new thread StrongED queries in the General section to continue this discussion so that this thread can stay focused on ZeroPain and zero page access. |
Alan Buckley (167) 232 posts |
I’ve recompiled it an uploaded the new version to the packages section of www.riscos.info, you can download the zip file from: |
GavinWraith (26) 1563 posts |
Looks like WeatherUK 1.01, DDEUtils 1.73 and FTPc 1.48 (7 Dec 2011) have ZeroPain issues. |
Stuart Swales (1481) 351 posts |
That’s my first ZeroPain PipeDream bug fixed! Nasty timing-dependent one too, in chart file reloading. Would have really helped to have a debugger that worked (see Rick’s post)… 4.53/02 should be making its way over via PackMan soon. The zero page relocation is a very good thing, even if it does stop us using the old trick of STR Rm,[Rn,-Rn] (Rn!=PC) that has come in oh-so-handy in years gone by when debugging interrupt code. |
David Pitt (102) 743 posts |
FileSwitch pain. Time: Thu Jul 9 16:37:14 2015 Location: Offset 0000c84c in module FileSwitch Current Wimp task: NetSurf Last app to start: BASIC -quit "SDFS::RISCOSpi.$.Library.GoToWork2" R0 = 00000005 R1 = fb415ea4 R2 = 00000000 R3 = 00000060 R4 = fa207f7c R5 = 00000000 R6 = 00000000 R7 = fa207dfc R8 = fa207dac R9 = fb413dc4 R10 = fb4157f0 R11 = fa207fb4 R12 = 200001d4 R13 = fa207d30 R14 = 00000002 R15 = fc051d70 DFAR = 00000000 Mode SVC32 Flags nzcv if PSR = 00000113 fc051d28 : e31e0501 : TST R14,#&00400000 fc051d2c : 0a000002 : BEQ &FC051D3C fc051d30 : e49de004 : LDR R14,[R13],#4 fc051d34 : e128f00e : MSR CPSR_f,R14 fc051d38 : e8bd8006 : LDMIA R13!,{R1,R2,PC} fc051d3c : e20ee0ff : AND R14,R14,#&FF ; ="ˇ" fc051d40 : e24f20a8 : ADR R2,&FC051CA0 fc051d44 : e7d221ae : LDRB R2,[R2,R14,LSR #3] fc051d48 : e20ee007 : AND R14,R14,#7 fc051d4c : e1a02e32 : MOV R2,R2,LSR R14 fc051d50 : e3120001 : TST R2,#1 fc051d54 : 1a000002 : BNE &FC051D64 fc051d58 : e49de004 : LDR R14,[R13],#4 fc051d5c : e128f00e : MSR CPSR_f,R14 fc051d60 : e8bd8006 : LDMIA R13!,{R1,R2,PC} fc051d64 : e51b2040 : LDR R2,[R11,#-64] fc051d68 * e4d2e001 * LDRB R14,[R2],#1 fc051d6c : e4d2e001 : LDRB R14,[R2],#1 fc051d70 : e33e0024 : TEQ R14,#&24 ; ="$" fc051d74 : 1a000002 : BNE &FC051D84 fc051d78 : e49de004 : LDR R14,[R13],#4 fc051d7c : e128f00e : MSR CPSR_f,R14 fc051d80 : e8bd8006 : LDMIA R13!,{R1,R2,PC} fc051d84 : e33e0000 : TEQ R14,#0 fc051d88 : 1afffff7 : BNE &FC051D6C fc051d8c : e4d1e001 : LDRB R14,[R1],#1 fc051d90 : e33e0000 : TEQ R14,#0 fc051d94 : 1a000002 : BNE &FC051DA4 fc051d98 : e49de004 : LDR R14,[R13],#4 fc051d9c : e128f00e : MSR CPSR_f,R14 fc051da0 : e8bd8006 : LDMIA R13!,{R1,R2,PC} fc051da4 : e33e0024 : TEQ R14,#&24 ; ="$" -------------------------------------------------------------------------------- Time: Thu Jul 9 16:37:14 2015 Location: Offset 0000c850 in module FileSwitch Current Wimp task: NetSurf Last app to start: BASIC -quit "SDFS::RISCOSpi.$.Library.GoToWork2" R0 = 00000005 R1 = fb415ea4 R2 = 00000001 R3 = 00000060 R4 = fa207f7c R5 = 00000000 R6 = 00000000 R7 = fa207dfc R8 = fa207dac R9 = fb413dc4 R10 = fb4157f0 R11 = fa207fb4 R12 = 200001d4 R13 = fa207d30 R14 = 00000000 R15 = fc051d74 DFAR = 00000001 Mode SVC32 Flags nzcv if PSR = 00000113 fc051d2c : 0a000002 : BEQ &FC051D3C fc051d30 : e49de004 : LDR R14,[R13],#4 fc051d34 : e128f00e : MSR CPSR_f,R14 fc051d38 : e8bd8006 : LDMIA R13!,{R1,R2,PC} fc051d3c : e20ee0ff : AND R14,R14,#&FF ; ="ˇ" fc051d40 : e24f20a8 : ADR R2,&FC051CA0 fc051d44 : e7d221ae : LDRB R2,[R2,R14,LSR #3] fc051d48 : e20ee007 : AND R14,R14,#7 fc051d4c : e1a02e32 : MOV R2,R2,LSR R14 fc051d50 : e3120001 : TST R2,#1 fc051d54 : 1a000002 : BNE &FC051D64 fc051d58 : e49de004 : LDR R14,[R13],#4 fc051d5c : e128f00e : MSR CPSR_f,R14 fc051d60 : e8bd8006 : LDMIA R13!,{R1,R2,PC} fc051d64 : e51b2040 : LDR R2,[R11,#-64] fc051d68 : e4d2e001 : LDRB R14,[R2],#1 fc051d6c * e4d2e001 * LDRB R14,[R2],#1 fc051d70 : e33e0024 : TEQ R14,#&24 ; ="$" fc051d74 : 1a000002 : BNE &FC051D84 fc051d78 : e49de004 : LDR R14,[R13],#4 fc051d7c : e128f00e : MSR CPSR_f,R14 fc051d80 : e8bd8006 : LDMIA R13!,{R1,R2,PC} fc051d84 : e33e0000 : TEQ R14,#0 fc051d88 : 1afffff7 : BNE &FC051D6C fc051d8c : e4d1e001 : LDRB R14,[R1],#1 fc051d90 : e33e0000 : TEQ R14,#0 fc051d94 : 1a000002 : BNE &FC051DA4 fc051d98 : e49de004 : LDR R14,[R13],#4 fc051d9c : e128f00e : MSR CPSR_f,R14 fc051da0 : e8bd8006 : LDMIA R13!,{R1,R2,PC} fc051da4 : e33e0024 : TEQ R14,#&24 ; ="$" fc051da8 : 1afffff7 : BNE &FC051D8C -------------------------------------------------------------------------------- Time: Thu Jul 9 16:37:14 2015 Location: Offset 0000c934 in module FileSwitch Current Wimp task: NetSurf Last app to start: BASIC -quit "SDFS::RISCOSpi.$.Library.GoToWork2" R0 = 00000001 R1 = fb415ea4 R2 = 00000000 R3 = e08ba058 R4 = 0009a066 R5 = 00000033 R6 = 00000000 R7 = fa207dfc R8 = 0000001c R9 = fb413dc4 R10 = fb4157f0 R11 = fa207fb4 R12 = 200001d4 R13 = fa207d2c R14 = 00000002 R15 = fc051e58 DFAR = 00000000 Mode SVC32 Flags nzCv if PSR = 20000113 fc051e10 : 028dd004 : ADDEQ R13,R13,#4 fc051e14 : 08bd800e : LDMEQIA R13!,{R1-R3,PC} fc051e18 : e31e0501 : TST R14,#&00400000 fc051e1c : 128dd004 : ADDNE R13,R13,#4 fc051e20 : 18bd800e : LDMNEIA R13!,{R1-R3,PC} fc051e24 : e20ee0ff : AND R14,R14,#&FF ; ="ˇ" fc051e28 : e24f2e19 : ADR R2,&FC051CA0 fc051e2c : e7d221ae : LDRB R2,[R2,R14,LSR #3] fc051e30 : e20ee007 : AND R14,R14,#7 fc051e34 : e1b02e32 : MOVS R2,R2,LSR R14 fc051e38 : e3120001 : TST R2,#1 fc051e3c : 1a000002 : BNE &FC051E4C fc051e40 : e49de004 : LDR R14,[R13],#4 fc051e44 : e128f00e : MSR CPSR_f,R14 fc051e48 : e8bd800e : LDMIA R13!,{R1-R3,PC} fc051e4c : e51b2040 : LDR R2,[R11,#-64] fc051e50 * e4d2e001 * LDRB R14,[R2],#1 fc051e54 : e33e0024 : TEQ R14,#&24 ; ="$" fc051e58 : 1a000002 : BNE &FC051E68 fc051e5c : e49de004 : LDR R14,[R13],#4 fc051e60 : e128f00e : MSR CPSR_f,R14 fc051e64 : e8bd800e : LDMIA R13!,{R1-R3,PC} fc051e68 : e33e0000 : TEQ R14,#0 fc051e6c : 1afffff7 : BNE &FC051E50 fc051e70 : e5d1e000 : LDRB R14,[R1,#0] fc051e74 : e33e003a : TEQ R14,#&3A ; =":" fc051e78 : 0a000004 : BEQ &FC051E90 fc051e7c : e33e0024 : TEQ R14,#&24 ; ="$" fc051e80 : 1a000008 : BNE &FC051EA8 fc051e84 : e49de004 : LDR R14,[R13],#4 fc051e88 : e128f00e : MSR CPSR_f,R14 fc051e8c : e8bd800e : LDMIA R13!,{R1-R3,PC} |
Martin Avison (27) 1494 posts |
I have been having problems understanding the debug info below from a users Iyonix, which is running RO5.23 from Jul 5th, with the ZeroPain module. Can anyone explain why the code is aborting, rather than being trapped by ZeroPain because it is (wrongly) reading zero page? It almost looks as if it has been failed for an unaligned load, as an identical load with r0=8 was just trapped by ZeroPain.
Note that the Basic code has been ‘working’ (or not failing, at least) for years, so the abort is an effect of the new ROM. ZeroPain does work in other cases, but if the culprit program is Basic the logs provide very little help to identify where the problem is. This, plus the Abort rather than logging, is causing more pain than I expected! |
Jeffrey Lee (213) 6048 posts |
Correct. For simplicity I didn’t bother to add support for unaligned loads (except LDRB). It looks like it’s crashing in VARINT, which I believe is used for the ! operator. But since this is BASIC, I’d expect it to give you a line number of where the problem is. |
Martin Avison (27) 1494 posts |
So the Iyonix now effectively aborts unaligned loads to ZeroPage?
Yes, that was my suspicion.
Indeed it does now for an abort, I just could not understand why it was aborting! The mixture of ZeroPain traps and aborts was confusing me. I should be less confused now. Thanks. Despite the pain, this is the right thing to do! |
Jeffrey Lee (213) 6048 posts |
Correct. For simplicity I didn’t bother to add support for unaligned loads (except LDRB). Correct.
Yeah, I can probably improve the wording of that section.
I think I’ll look at fixing that, since it does make the current version a bit useless for logging aborts from BASIC. |
Martin Avison (27) 1494 posts |
I think that is a shame. It means that the Basic statement A% = !B% on a Pi is ZeroPained if B% = 8 or 9 (because the Basic module will not do unaligned loads), but on an Iyonix 8 is ZeroPained and 9 Data Aborts (because the Basic module does do unaligned loads)
That would be useful … but I am sure you are aware of the complications with LIBRARYs! |