RiscPC update Aug2014
Colin Ferris (399) 1814 posts |
No – but it is interesting what the values equate too. probably be able to use the same tactic I used with the Podule modules. I now have a copy of PCSleep – 1.4 24-Jun97 – any later version? A case of using !ARMalyser – and 32 bitting plus sorting out the memory pokes. Probably re-stubbing with StubsG – see if can find the old card – and refitting it. If anyone else would like to recompile the ‘C’ stuff – they are most welcome :-) |
Colin Ferris (399) 1814 posts |
What did Acorn call the 2nd Processor? It’s doesn’t seem to classed with the Podules. Any ideas of how to find the base address? |
Rick Murray (539) 13840 posts |
“OPEN Bus”.
It isn’t a podule or I/O. You talk to the hardware directly…
So try seeing what the addresses used to match up to in your system. |
Colin Ferris (399) 1814 posts |
Here is a bit of code to find out it !PC is running. OSCLI"Unset Diva$Running":DIM b%16,code%640,L%-1:i%=0 FOR pass%=4TO5:P%=code%:[OPT pass%<<1 ]:NEXT In RO4.02 – with no card fitted gives a answer. *where at &3750000 – gives “page mapped out”. IN RO5.21 (24 Aug 2014) Not sure if msr cpsr_c,#0 is correct – would it put the processor into 26bit mode? |
Rick Murray (539) 13840 posts |
Mmm… Shouldn’t it be |
Steve Pampling (1551) 8170 posts |
Or even msr cpsr_c, USR32_mode if you want to use the Generic32 headers and macros. Half of the problem with the code in PCPro is that someone decided that replicating the original compiler headers as a home build with tweaks and embedding of magic numbers nailed in a collection of 26 bit only code.1 Where that didn’t happen changes are much easier. For example !ChooseCfg is largely clean and my notes read as: I suppose if that was in the available macros as ExitNeutral it would be even neater to use and maintain. Alter one macro and recompile rather than shuffle through numerous exit points in some cases. Regular coders will note the lift of an easy exit from the 32 bit web page. 1 Nice at the time, total pain down the road in 32 bit era. |
Colin Ferris (399) 1814 posts |
Just as easy to save the flags mrs r3,cpsr – and use msr cpsr_c,r3 at the end. Have you managed to 32bit compile some of the !PC progs? Is there a SWI call that would return info on where the 2nd processor is mapped in? Rick’s StrawHelp is handy to have standing by – and the PDF RISCOS manuals. Pity StrawHelp doesn’t seem to work with Linux-Slitaz/Wine – wouldn’t it been better to have kept all the extra DLLs etc in ‘HeyRick’ – in a ‘common’ directory – bit like RISCOS! |
Steve Pampling (1551) 8170 posts |
ChooseCfg, GuardDD can be modified to do 26 or 32 bit action based on processor mode. LoadAuto has no source in the 306 archive – refer back to the 235 version Src235/zip.loadauto/zip and change s.misc in the same fashion as the ChooseCfg exit ARMASPI and StdSound.PCSound have no source – could be fun reverse engineering. RunImage needs amendments to s.misc exits and a makefile tweak to point at c.divaserial properly.1 CheckDiva I haven’t really looked at. Working through core modules looking at stuff. All largely untested. It’s a learning exercise for me. I need to do something productive to be able to remember things.
Not that I know. 1 Basically I’d like to be able to program in something other than hacking a few bits of BASIC and looking so at someone elses code helps the learning process |
Steve Pampling (1551) 8170 posts |
Oh, forgot – without a tweak to the Res file the PCConfig seems to fail to display some icons. |
Sprow (202) 1158 posts |
In fact, you can save yourself the bother there. If you’re recompiling the C code (in choosecfg.c) as APCS-32 then when it calls the helper functions in assembler (in misc.s) it’s expecting to have the status flags trashed in both 26 bit configuration and 32 bit configuration. Having looked at the 3 functions in “misc.s” they don’t even need to be in assembler, the original author could have expressed them in C originally using _swix and _swi. |
Steve Pampling (1551) 8170 posts |
I hadn’t looked at that, but the assembler change was an attempt to keep changes bit neutral
I’m very much on baby steps and changing minimal items. Re-writing whole chunks1 of a complicated application hadn’t actually surfaced in my mind. 1 OK, altering the assembler is re-writing things a bit. |
Steve Pampling (1551) 8170 posts |
Ah. I think I see. |
Rick Murray (539) 13840 posts |
Archimedes style programming? Have you seen how much code it takes just to call a SWI? It probably says a lot that one of the labels is “swi_beyond_a_joke”. When I am prototyping some code, I tend to use _kernel_swi()1 and later I usually replace that with custom assembler code. One SWI, two or three instructions (and a branch either side2). Done. 1 It is more of a pain to use as the register block needs to be set up, unlike swi, however the SWI call code is a lot shorter/saner :-) → https://www.riscosopen.org/viewer/view/castle/RiscOS/Sources/Lib/RISC_OSLib/kernel/s/kbody?rev=4.27#l2084 2 I wonder if the inline assembler could improve upon this? Must try it… |
Steve Pampling (1551) 8170 posts |
I think the point is that it goes under the bonnet and you don’t need to know how much.
You have of course always written this code as massively portable and not dependent on particular processor mode behaviour. Yes? No? 1 Elsewhere the suggestion is that custom code is bad in the long term in maintenance terms. I think someone called Rick wrote a 26 to 32 bit migration document somewhere round here that specifically references “pure C” being a simple recompile with correct settings. :-P |
Colin Ferris (399) 1814 posts |
Has anyone here a RO5 memory map. Is it still possible to do a *save xxx of the ro5.21 roms? |
David Feugey (2125) 2709 posts |
Or to make direct access to video memory, for example (would be useful for a kind of directx access :) ) |
Steve Pampling (1551) 8170 posts |
I suspect the best resource is in here: IOMDHAL.castle.RiscOS.Sources.Kernel.Docs.HAL with The “Notes” file being quite informative. 00000000 16K Kernel workspace 26-bit system: 00000000 16K Kernel workspace |
Rick Murray (539) 13840 posts |
Where is the module area in 32 bit systems? [I know I could just look at module addresses, but I don’t have RISC OS running right now] Is the “nowhere” unaddressable or something? |
Steve Pampling (1551) 8170 posts |
Running Verma in RPCEmu displays soft loaded modules in the block starting with RPCEmuHostFS at 200D23F4 and the highest loaded in this setup is TrapDelete at 201A9B14 |
Jeffrey Lee (213) 6048 posts |
256MB from &20000000 and up
When the kernel unmaps a page, it updates the CAM (which is a physical → logical map of RAM used by the kernel) to say that the page is mapped to “nowhere”. On MEMC systems I think it also updated MEMC to map the page to “nowhere” (MEMC worked with a physical → logical translation table, so the only way to get rid of pages was to pile them all ontop of each other at one logical address you don’t care about), but on modern systems with an integrated MMU the kernel is able to properly update the page tables to get rid of the page. |
Colin Ferris (399) 1814 posts |
Here is some info on a podule – not exectly a PCcard. Would it be possible to add a swi call to the ‘Podule_ReadInfo’? – to return the base address of the PCcard? (podule 9). *podinfo8RO 5.21 RO 4.02 00 8 8 Expansion card number. |
Rick Murray (539) 13840 posts |
The x86 card isn’t a podule. You’re thinking of the network card. https://www.riscosopen.org/forum/forums/3/topics/2780?page=2#posts-35371 Or page up a bit. Or download and read the RiscPC TRM. |
Jeffrey Lee (213) 6048 posts |
It looks like the IOMD HAL will map in the full 8MB of I/O space, but it won’t actually expose the logical address of the area reserved for the OPEN bus. So I think the best way of doing things would be to get the IOMD address (physical addr &03200000) and add on 4MB: SYS "OS_Memory",9,&400 TO ,addr% IF addr%=0 THEN ERROR 0,"Not IOMD" addr% += &400000 |
Rick Murray (539) 13840 posts |
|
Steve Pampling (1551) 8170 posts |
When I said “one bit of probing I did came back” that was where I’d been working. Shame about the lack of OS_Memory 25 I suppose. |