Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #354

Re: Code or SWI to read word of logical memory?

From "neil f" <news@anf.nildram.co.uk>
Newsgroups comp.sys.acorn.programmer
Subject Re: Code or SWI to read word of logical memory?
Date 2011-05-27 14:36 +0100
Organization Aioe.org NNTP Server
Message-ID <iro9d1$eio$1@speranza.aioe.org> (permalink)
References <irnnlr$ul7$1@speranza.aioe.org> <8Oh*fa+Dt@news.chiark.greenend.org.uk> <iro5et$3t2$1@speranza.aioe.org> <iro6gm$6s0$1@speranza.aioe.org>

Show all headers | View raw


"neil f" <news@anf.nildram.co.uk> wrote in message 
news:iro6gm$6s0$1@speranza.aioe.org...
>
> "neil f" <news@anf.nildram.co.uk> wrote in message 
> news:iro5et$3t2$1@speranza.aioe.org...
>>
>> "Theo Markettos" <theom+news@chiark.greenend.org.uk> wrote in message 
>> news:8Oh*fa+Dt@news.chiark.greenend.org.uk...
>>> neil f <news@anf.nildram.co.uk> wrote:
>>>> I need to read and write a word or two of memory during execution of a
>>>> program. Is it possible to do this via a snippet of assembler from 
>>>> Basic?
>>>> Alternatively, is there a SWI that I can call when necessary for the
>>>> read/write operation? I've mapped in the memory locations I'm 
>>>> interested in
>>>> using OS_Memory 13, so I can supply a logical address to a routine.
>>>
>>> Do you mean physical memory?
>>>
>>> Logical memory = what the programmer sees (aka virtual memory on systems
>>> with page files)
>>> Physical memory = how the memory chips are actually connected
>>>
>>> If you really mean logical memory, you can either just read it normally
>>> (PRINT !address%) or else drop into supervisor mode to access memory 
>>> that
>>> user mode doesn't have read permissions for (see OS_EnterOS).
>>>
>>> Note that on RISC OS applications share logical address space (they all
>>> think they start at &8000) so you have to be sure that the right 
>>> application
>>> is paged in.
>>>
>>> Theo
>>
>> Hi Theo. I'm messing around with a Beagle XM. I started out looking at 
>> just GPIO access but after a few days absorbing the TRM etc I'm finding 
>> all sorts of memory mapped registers I'd like prod and play with.
>>
>> Peter xxx and Tank have been knocking up some useful module code, but 
>> it's limited to specific register ranges and all very well behaved. It 
>> won't let me stray 'off piste', which is what I'd like to do to really 
>> get to know what the various interfaces can provide. All I need for that 
>> is to map in some physical address ranges to logical ones (which 
>> OS_Memory 13 seems to be designed for) and then have a read routine and a 
>> write routine that can access any register in the mapped in range.
>>
>> So I'd like to map register X physical to logical address, then supply 
>> that logical address to a read or write routine to monitor and manipulate 
>> various XM I/O processes.
>>
>> I've got as far as mapping physical registers to logical addresses, which 
>> seems to work fine. But any moves to read from those addresses just 
>> produce data aborts at the moment. Even just using plain SYS"OS_EnterOS" 
>> followed straight away with SYS"OS_LeaveOS" gives a data abort. I would 
>> have thought that was practically a NOP but it still throws up an error.
>>
>> -Neil.
>
> Sorry, I meant SWI "OS_EnterOS" in the above of course.
>
> E.g the following gives a data abort when run:
>
> DIM code% 100
> FOR pass%=0 TO 3 STEP 3
> P%=code%
> [
> OPT pass%
> SWI "OS_EnterOS"
> SWI "OS_LeaveOS"
> ]
> NEXT pass%
> CALL code%
>
> Shouldn't it just do nothing?
>
Whoops. Just noticed I'd left the MOV PC, R14 off the end. Now it does what 
I'd expect - i.e. nothing.

Peter van der Vos kindly wrote and posted a very simple memory access module 
in response to my request for GPIO access routines on the ROOL forum. 
Unfortunately that module doesn't allow wide-ranging access of the kind I 
need now, so I thought I'd try to write something simple myself.

Now all I need to do is work out what to put between those two SWIs :-) 

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Code or SWI to read word of logical memory? "neil f" <news@anf.nildram.co.uk> - 2011-05-27 09:34 +0100
  Re: Code or SWI to read word of logical memory? Theo Markettos <theom+news@chiark.greenend.org.uk> - 2011-05-27 11:42 +0100
    Re: Code or SWI to read word of logical memory? "neil f" <news@anf.nildram.co.uk> - 2011-05-27 13:29 +0100
      Re: Code or SWI to read word of logical memory? "neil f" <news@anf.nildram.co.uk> - 2011-05-27 13:47 +0100
        Re: Code or SWI to read word of logical memory? "neil f" <news@anf.nildram.co.uk> - 2011-05-27 14:36 +0100
          Re: Code or SWI to read word of logical memory? Theo Markettos <theom+news@chiark.greenend.org.uk> - 2011-05-28 00:20 +0100
            Re: Code or SWI to read word of logical memory? "neil f" <news@anf.nildram.co.uk> - 2011-05-29 21:31 +0100
              Re: Code or SWI to read word of logical memory? Theo Markettos <theom+news@chiark.greenend.org.uk> - 2011-05-29 23:40 +0100
            Re: Code or SWI to read word of logical memory? Jeremy Nicoll - news posts <jn.nntp.scrap007@wingsandbeaks.org.uk> - 2011-06-01 02:07 +0100
              Re: Code or SWI to read word of logical memory? Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-06-01 04:24 +0200
          Re: Code or SWI to read word of logical memory? Tank <webmaster@tankstage.co.uk> - 2011-05-28 06:54 +0100
            Re: Code or SWI to read word of logical memory? "neil f" <news@anf.nildram.co.uk> - 2011-05-28 22:36 +0100
              Re: Code or SWI to read word of logical memory? Tank <webmaster@tankstage.co.uk> - 2011-05-29 08:38 +0100

csiph-web