Setting up memory maps - DryOS Development - CHDK Forum supplierdeeply

Setting up memory maps

  • 5 Replies
  • 2776 Views
Setting up memory maps
« on: 09 / May / 2009, 09:16:40 »
Advertisements
I see that many of the boot.c codes use system control coprocessor register c6 to setup what appears to be a memory map, like this in the SX10 code:
Code: (asm) [Select]
MOV     R0, #0x3D
MCR     p15, 0, R0,c6,c0
MOV     R0, #0xC000002F
MCR     p15, 0, R0,c6,c1
MOV     R0, #0x33
MCR     p15, 0, R0,c6,c2
MOV     R0, #0x40000033
MCR     p15, 0, R0,c6,c3
MOV     R0, #0x80000017
MCR     p15, 0, R0,c6,c4
LDR     R0, =0xFF80002D
MCR     p15, 0, R0,c6,c5
All of my ARM architecture manuals only discuss c6 as the Fault Address Register.  Where can I find documentation on this additional function?

Re: Setting up memory maps
« Reply #1 on: 09 / May / 2009, 11:02:40 »
Answering my own question -- I checked the CPU id and found that it is an ARM946.  Looking at the correct manual answers my questions about how it works:  http://infocenter.arm.com/help/topic/com.arm.doc.ddi0201d/I1039570.html

*

Offline reyalp

  • ******
  • 11862
Re: Setting up memory maps
« Reply #2 on: 09 / May / 2009, 16:49:20 »
Don't forget what the H stands for.

Re: Setting up memory maps
« Reply #3 on: 10 / May / 2009, 12:48:08 »
That was helpful, thanks.

A further question on the same topic -- how do I determine a safe location in RAM to install the modified copy of the firmware image?  How is MEMISOSTART determined?  On the Adding support for a new camera page it says:
Quote
MEMISOSTART: points to the start of the memory pool used by the firmware (you can find this address at the end of the first piece of code in the firmware for DryOS)
Where in the code should I look?  I see a memcpy() of the data from 0x1900 to 0x20740 and then a bzero() of the bss from 0x20740 to 0x47550.  After the stack setup, I see three data words, 0x6b4, 0x664 and 0x668 that don't make sense as instructions, but appear to be pointers to some global state low in memory.
« Last Edit: 10 / May / 2009, 12:51:06 by hudson »


*

Offline reyalp

  • ******
  • 11862
Re: Setting up memory maps
« Reply #4 on: 10 / May / 2009, 15:02:47 »
MEMISOSTART is directly after the end of the canon BSS. You should be able to see this by looking at existing ports.

This is "reserved" slightly later in the code, where
LDR R0, <end of BSS>
is replaced with
LDR R0, =new_sa

What camera are you working on ?
Don't forget what the H stands for.

Re: Setting up memory maps
« Reply #5 on: 10 / May / 2009, 15:16:42 »
This is "reserved" slightly later in the code, where
LDR R0, <end of BSS>
is replaced with
LDR R0, =new_sa
I found that sequence it a few jumps later after copying the interrupt handlers, twiddling a bunch of bits in 0xC000xxxx, and setting up the stacks for the different modes.  Thanks for the pointer.

Quote
What camera are you working on ?
5D Mark II.  I've posted some of the details on the wiki.

 

Related Topics