How can I use a specific ram address?

吴若凡 demonsimon at ...9...
Thu Mar 20 15:29:33 CET 2014


Thanks for all replies.
I think I have excluded [0, 0x02200000), and also have changed the
parameter RAM_BASE and RAM_SIZE.

Let me list what I have done to move foc kernel address:
1) modify file base-foc/contrib/kern/arm/bsp/mem_layout_xxxx.cc , change
Sdram_phy_address from 0x0 to 0x02200000.
2) modify file base-foc/contrib/l4/mk/platforms/myplatform.conf, set
PLATFORM_RAM_BASE = 0x02200000 and PLATFORM_RAM_SIZE_MB = 990.
3) modify file base-foc/contrib/kern/arm/bsp/Modules, set
CONFIG_KERNEL_LOAD_ADDR := 0x02200000.
4) modify file base-foc/src/core/myplatform/target.mk, change LD_TEXT_ADDR
value from 0x00140000 to 0x02340000.

Am I right?
What else should I do to make sure foc kernel address is moved and nothing
else can use [0, 0x02200000) ?

Also, I have confirmed that  Attached_io_mem_dataspace can work in this
case, because what I write in uboot can be read correctly in genode.

Here is part of my serial log.

Starting kernel ...
> L4 Bootstrapper
>   Build: #162 Tue Mar 11 13:53:39 CST 2014, 4.7.2
>   Scanning up to 990 MB RAM
>   Memory size is 990MB (02200000 - 40000000)
>   RAM: 0000000002200000 - 000000003fffffff: 1013760kB
>   Total RAM: 990MB
>   mod21: 03ad5000-03b1c000: genode/root-amt.gz
>   mod20: 03a99000-03ad4bfc: genode/terminal_log
>   mod19: 03a3d000-03a985c4: genode/terminal
>   mod18: 0365c000-03a3c438: genode/l4android
>   mod17: 0361c000-0365be1c: genode/nit_fb
>   mod16: 035cd000-0361bc48: genode/nitpicker
>   mod15: 0358e000-035cc004: genode/omapx_xmodem_drv
>   mod14: 0354b000-0358dfa0: genode/part_blk
>   mod13: 0350e000-0354ac70: genode/omapx_fb_drv
>   mod12: 034cf000-0350dc90: genode/omapx_input_drv
>   mod11: 0348f000-034ced18: genode/sd_card_drv
>   mod10: 0344f000-0348e58c: genode/kdb_uart_drv
>   mod09: 03410000-0344e4a0: genode/omapx_i2c_drv
>   mod08: 033d9000-0340f818: genode/omapx_gpio_drv
>   mod07: 033a6000-033d8ec4: genode/omapx_ddr_pwr_drv
>   mod06: 03373000-033a5eac: genode/omapx_appwr_drv
>   mod05: 03338000-03372e3c: genode/timer
>   mod04: 032f2000-03337738: genode/init
>   mod03: 032f0000-032f14c9: genode/config
>   mod02: 03289000-032ef31c: genode/core
>   mod01: 0327f000-03288374: sigma0
>   mod00: 03216000-0327e330:
> /home/android/genode-master-hello/build_foc_pandax/kernel/fiasco.oc/fiasco
>   Moving up to 22 modules behind 3300000
>   moving module 00 { 3216000-327e32f } -> { 3c06000-3c6e32f } [426800]
>   moving module 01 { 327f000-3288373 } -> { 3c6f000-3c78373 } [37748]
>   moving module 02 { 3289000-32ef31b } -> { 3c79000-3cdf31b } [418588]
>   moving module 03 { 32f0000-32f14c8 } -> { 3b1c000-3b1d4c8 } [5321]
>   moving module 04 { 32f2000-3337737 } -> { 3b1e000-3b63737 } [284472]
>   moving module 05 { 3338000-3372e3b } -> { 3300000-333ae3b } [241212]
>   moving module 06 { 3373000-33a5eab } -> { 333b000-336deab } [208556]
>   moving module 07 { 33a6000-33d8ec3 } -> { 336e000-33a0ec3 } [208580]
>   moving module 08 { 33d9000-340f817 } -> { 33a1000-33d7817 } [223256]
>   moving module 09 { 3410000-344e49f } -> { 33d8000-341649f } [255136]
>   moving module 10 { 344f000-348e58b } -> { 3417000-345658b } [259468]
>   moving module 11 { 348f000-34ced17 } -> { 3457000-3496d17 } [261400]
>   moving module 12 { 34cf000-350dc8f } -> { 3497000-34d5c8f } [257168]
>   moving module 13 { 350e000-354ac6f } -> { 34d6000-3512c6f } [248944]
>   moving module 14 { 354b000-358df9f } -> { 3513000-3555f9f } [274336]
>   moving module 15 { 358e000-35cc003 } -> { 3556000-3594003 } [253956]
>   moving module 16 { 35cd000-361bc47 } -> { 3595000-35e3c47 } [322632]
>   moving module 17 { 361c000-365be1b } -> { 35e4000-3623e1b } [261660]
>   moving module 18 { 365c000-3a3c437 } -> { 3624000-3a04437 } [4064312]
>   moving module 19 { 3a3d000-3a985c3 } -> { 3a05000-3a605c3 } [374212]
>   moving module 20 { 3a99000-3ad4bfb } -> { 3a61000-3a9cbfb } [244732]
>   moving module 21 { 3ad5000-3b1bfff } -> { 3a9d000-3ae3fff } [290816]
>   moving module 03 { 3b1c000-3b1d4c8 } -> { 3ae4000-3ae54c8 } [5321]
>   moving module 04 { 3b1e000-3b63737 } -> { 3ae6000-3b2b737 } [284472]
>   Scanning
> /home/android/genode-master-hello/build_foc_pandax/kernel/fiasco.oc/fiasco
> -serial_esc
>   Scanning sigma0
>   Scanning genode/core
>   Relocated mbi to [0x320f000-0x320f387]
>   Loading e-master-hello/build_foc_pandax/kernel/fiasco.oc/fiasco
>   Loading sigma0
>   Loading genode/core
>   find kernel info page...
>   found kernel info page at 0x2202000
> Regions of list 'regions'
>     [  2201000,   2201a7f] {      a80} Kern
> e-master-hello/build_foc_pandax/kernel/fiasco.oc/fiasco
>     [  2202000,   2278fff] {    77000} Kern
> e-master-hello/build_foc_pandax/kernel/fiasco.oc/fiasco
>     [  2290000,   229673b] {     673c} Sigma0 sigma0
>     [  2298000,   229e17b] {     617c} Sigma0 sigma0
>     [  2340000,   248743f] {   147440} Root   genode/core
>     [  3200000,   32153f3] {    153f4} Boot   bootstrap
>     [  320f000,   320f484] {      485} Root   Multiboot info
>     [  3300000,   3b2b737] {   82b738} Root   Module
>   API Version: (87) experimental
>   Sigma0 config    ip:02290100 sp:03214d24
>   Roottask config  ip:0238af84 sp:00000000
>   Starting kernel e-master-hello/build_foc_pandax/kernel/fiasco.oc/fiasco
> at 022011c4
> L2: ID=410004c8 Type=9e300300 Aux=7e460001 WMask=ff S=0
> L2: Type L2C-310 Size = 512kB
> Hello from Startup::stage2
> Per_cpu_data_alloc: (orig: 0xf00651b8-0xf0065b28)
> Boot_alloc: size=0xc
> Boot_alloc: allocated extra memory block @0xf13e1000 (size=400)
> Boot_alloc: @ 0xf13e1000
> Boot_alloc: remaining free block @ 0xf13e1010 (size=3f0)
> Boot_alloc: size=0x80
> Boot_alloc: @ 0xf13e1010
> Boot_alloc: remaining free block @ 0xf13e1090 (size=370)
> Number of IRQs available at this GIC: 96
> Boot_alloc: size=0x180
> Boot_alloc: @ 0xf13e1090
> Boot_alloc: remaining free block @ 0xf13e1210 (size=1f0)
> Cache config: ON
> ID_PFR[01]:  00001231 00000011 ID_[DA]FR0: 00010444 00000000
> ID_MMFR[04]: 00100103 20000000 01230000 00102111
> FPU0: Arch: VFPv3(3), Part: VFPv3(30), r: 4, v: 9, i: 41, t: hard, p:
> dbl/sngl
> Startup::stage2 finished
> SERIAL ESC: allocated IRQ 71 for serial uart
> Not using serial hack in slow timer handler.
> Welcome to Fiasco.OC (arm)!
> L4/Fiasco.OC arm microkernel (C) 1998-2013 TU Dresden
> Rev: rexporte compiled with gcc 4.7.2 for pandax_evb    []
> Build: #128 Tue Mar 11 13:53:25 CST 2014
> Per_cpu_data_alloc: (orig: 0xf00651b8-0xf0065b28)
> Allocate 2416 bytes (2KB) for CPU[4] local storage (offset=1180e48,
> 0xf11e6000-0xf11e6970)
> Number of CPUs: 2
> Calibrating timer loop... Per_cpu_data_alloc: (orig: 0xf00651b8-0xf0065b28)
> done.
> Allocate 2416 bytes (2KB) for CPU[1] local storage (offset=1181e48,
> 0xf11e7000-0xf11e7970)
> SCache config: ON
> IID_PFR[01]:  00001231 00000011G ID_[DA]FR0: 00010444 00000000
> MID_MMFR[04]: 00100103 20000000 01230000 00102111
> AFPU1: Arch: VFPv3(3), Part: VFPv3(30), r: 4, v: 9, i: 41, t: hard, p:
> dbl/sngl
> 0: CPU[1]: goes to idle loop
> Hello!
>   KIP @ 2202000
>   allocated 4KB for maintenance structures
> SIGMA0: Dump of all resource maps
> RAM:------------------------
> [0:2200000;2200fff]
> [0:2279000;228ffff]
> [0:2297000;2297fff]
> [0:229f000;233ffff]
> [4:2340000;2487fff]
> [0:2488000;320efff]
> [4:320f000;320ffff]
> [0:3210000;32fffff]
> [4:3300000;3b2bfff]
> [0:3b2c000;3effffff]
> IOMEM:----------------------
> [0:0;21fffff]
> [0:40000000;ffffffff]
> KIP @ 2202000
>     magic: 4be6344c
>   version: 87014444
>          sigma0  esp: 03214d24  eip: 02290100
>          sigma1  esp: 00000000  eip: 00000000
>            root  esp: 00000000  eip: 0238af84
> MBI @ 320f000
>  mod[3] [3ae4000,3ae54c9) config
>  mod[4] [3ae6000,3b2b738) init
>  mod[5] [3300000,333ae3c) timer
>  mod[6] [333b000,336deac) omapx_appwr_drv
>  mod[7] [336e000,33a0ec4) omapx_ddr_pwr_drv
>  mod[8] [33a1000,33d7818) omapx_gpio_drv
>  mod[9] [33d8000,34164a0) omapx_i2c_drv
>  mod[10] [3417000,345658c) kdb_uart_drv
>  mod[11] [3457000,3496d18) sd_card_drv
>  mod[12] [3497000,34d5c90) omapx_input_drv
>  mod[13] [34d6000,3512c70) omapx_fb_drv
>  mod[14] [3513000,3555fa0) part_blk
>  mod[15] [3556000,3594004) omapx_xmodem_drv
>  mod[16] [3595000,35e3c48) nitpicker
>  mod[17] [35e4000,3623e1c) nit_fb
>  mod[18] [3624000,3a04438) l4android
>  mod[19] [3a05000,3a605c4) terminal
>  mod[20] [3a61000,3a9cbfc) terminal_log
>  mod[21] [3a9d000,3ae4000) root-amt.gz
> :ram_alloc: Allocator 2470784 dump:
>  Block: [02200000,0220001c) size=0000001c avail=00000000 max_avail=00000000
>  Block: [0220001c,02200038) size=0000001c avail=00000000 max_avail=00000000
>  Block: [02200038,02200438) size=00000400 avail=00000000 max_avail=00000000
>  Block: [02200438,02200454) size=0000001c avail=00000000 max_avail=00000000
>  Block: [02200454,02200470) size=0000001c avail=00000000 max_avail=00000000
>  Block: [02200470,0220048c) size=0000001c avail=00000000 max_avail=00016fe4
>  Block: [0220048c,022004a8) size=0000001c avail=00000000 max_avail=00000000
>  Block: [022004a8,02201000) size=00000b58 avail=00000b58 max_avail=00000b58
>  Block: [02279000,0227901c) size=0000001c avail=00000000 max_avail=00016fe4
>  Block: [0227901c,02290000) size=00016fe4 avail=00016fe4 max_avail=00016fe4
>  Block: [02297000,0229701c) size=0000001c avail=00000000 max_avail=00016fe4
>  Block: [0229701c,02297038) size=0000001c avail=00000000 max_avail=00000000
>  Block: [02297038,02297054) size=0000001c avail=00000000 max_avail=00000000
>  Block: [02297054,02297070) size=0000001c avail=00000000 max_avail=00000000
>  Block: [02297070,0229708c) size=0000001c avail=00000000 max_avail=00000000
>  Block: [0229708c,022970a8) size=0000001c avail=00000000 max_avail=00000000
>  Block: [022970a8,022970c4) size=0000001c avail=00000000 max_avail=00000000
>  Block: [022970c4,022970e0) size=0000001c avail=00000000 max_avail=00000000
>  Block: [022970e0,022970fc) size=0000001c avail=00000000 max_avail=3b4d4000
>  Block: [022970fc,02297118) size=0000001c avail=00000000 max_avail=00000000
>  Block: [02297118,02297134) size=0000001c avail=00000000 max_avail=00000eb0
>  Block: [02297134,02297150) size=0000001c avail=00000000 max_avail=00000000
>  Block: [02297150,02298000) size=00000eb0 avail=00000eb0 max_avail=00000eb0
>  Block: [0229f000,0229f01c) size=0000001c avail=00000000 max_avail=3b4d4000
>  Block: [0229f01c,02340000) size=000a0fe4 avail=000a0fe4 max_avail=000a0fe4
>  Block: [02488000,0320f000) size=00d87000 avail=00d87000 max_avail=3b4d4000
>  Block: [03210000,03300000) size=000f0000 avail=000f0000 max_avail=3b4d4000
>  Block: [03b2c000,3f000000) size=3b4d4000 avail=3b4d4000 max_avail=3b4d4000
>  => mem_size=1010847744 (964 MB) / mem_avail=1010846160 (964 MB)
> :region_alloc: Allocator 24718f4 dump:
>  Block: [00001000,02200000) size=021ff000 avail=021ff000 max_avail=021ff000
>  Block: [02201000,02202000) size=00001000 avail=00001000 max_avail=021ff000
>  Block: [02203000,02279000) size=00076000 avail=00076000 max_avail=00076000
>  Block: [02290000,02297000) size=00007000 avail=00007000 max_avail=00076000
>  Block: [02298000,0229f000) size=00007000 avail=00007000 max_avail=6fff0000
>  Block: [3f000000,40000000) size=01000000 avail=01000000 max_avail=01000000
>  Block: [50000000,bfff0000) size=6fff0000 avail=6fff0000 max_avail=6fff0000
>  Block: [bfff1000,c0000000) size=0000f000 avail=0000f000 max_avail=0000f000
>  => mem_size=1932013568 (1842 MB) / mem_avail=1932013568 (1842 MB)
> :io_mem: Allocator 2470be0 dump:
>  Block: [00000000,02200000) size=02200000 avail=02200000 max_avail=02200000
>  Block: [02201000,02202000) size=00001000 avail=00001000 max_avail=02200000
>  Block: [02203000,02279000) size=00076000 avail=00076000 max_avail=00076000
>  Block: [02290000,02297000) size=00007000 avail=00007000 max_avail=00076000
>  Block: [02298000,0229f000) size=00007000 avail=00007000 max_avail=c0ffffff
>  Block: [3f000000,ffffffff) size=c0ffffff avail=c0ffffff max_avail=c0ffffff
>  => mem_size=3274199039 (3122 MB) / mem_avail=3274199039 (3122 MB)
> :io_port: Allocator 247103c dump:
> :irq: Allocator 2471498 dump:
>  Block: [00000000,00000100) size=00000100 avail=00000100 max_avail=00000100
>  => mem_size=256 (0 MB) / mem_avail=256 (0 MB)
> :rom_fs: Rom_fs 24721a8 dump:
>  Rom: [03ae6000,03b2b738) init
>  Rom: [033d8000,034164a0) omapx_i2c_drv
>  Rom: [0336e000,033a0ec4) omapx_ddr_pwr_drv
>  Rom: [0333b000,0336deac) omapx_appwr_drv
>  Rom: [033a1000,033d7818) omapx_gpio_drv
>  Rom: [034d6000,03512c70) omapx_fb_drv
>  Rom: [03556000,03594004) omapx_xmodem_drv
>  Rom: [03497000,034d5c90) omapx_input_drv
>  Rom: [03ae4000,03ae54c9) config
>  Rom: [03513000,03555fa0) part_blk
>  Rom: [02202000,02203000) l4v2_kip
>  Rom: [02202000,02203000) kip
>  Rom: [03417000,0345658c) kdb_uart_drv
>  Rom: [03624000,03a04438) l4android
>  Rom: [03595000,035e3c48) nitpicker
>  Rom: [035e4000,03623e1c) nit_fb
>  Rom: [03a05000,03a605c4) terminal
>  Rom: [03457000,03496d18) sd_card_drv
>  Rom: [03a9d000,03ae4000) root-amt.gz
>  Rom: [03300000,0333ae3c) timer
>  Rom: [03a61000,03a9cbfc) terminal_log
> :core ranges: Allocator 2473f08 dump:
>  Block: [02200000,02201000) size=00001000 avail=00001000 max_avail=00001000
>  Block: [02279000,02290000) size=00017000 avail=00017000 max_avail=00017000
>  Block: [02297000,02298000) size=00001000 avail=00001000 max_avail=3bdf0000
>  Block: [0229f000,0320f000) size=00f70000 avail=00f70000 max_avail=3bdf0000
>  Block: [03210000,3f000000) size=3bdf0000 avail=3bdf0000 max_avail=3bdf0000
>  => mem_size=1020760064 (973 MB) / mem_avail=1020760064 (973 MB)
> int main(): --- create local services ---
> int main(): --- start init ---
> int main(): transferred 963 MB to init
> int main(): --- init created, waiting for exit condition ---



Thanks.



On Wed, Mar 19, 2014 at 4:29 PM, Matthias Lange <mlange at ...235...>wrote:

> On Tue, Mar 18, 2014 at 03:54:59PM +0100, Christian Helmuth wrote:
> > Hello,
> >
> > On Tue, Mar 18, 2014 at 09:22:20PM +0800, 吴若凡 wrote:
> > > I am now facing a problem that I want to use a specific ram address
> [0x0,
> > > 0x2000000), because there is a hareware on board using it, I have to
> write
> > > data to this specific ram region and my hareware will read this region
> to
> > > work.
> > >
> > > I have moved foc kernel address to 0x2000000, and also used
> > > Attach_io_mem_dataspace to reflect physical address [0x0, 0x2000000)
> in my
> > > driver, but I failed to drive my hareware.
> > > I guess maybe the data haven't been written to this ram region
> correctly.
> > > Is  Attach_io_mem_dataspace suitable for this case? If NOT, how can I
> do ?
> >
> > Genode depends on sigma0 to detect RAM regions. Sigma0 itself depends
> > on bootstrap's information. So, I think you have to figure out how to
> > configure bootstrap to exclude (or better to _not_ include) [0x0,
> > 0x2000000) from RAM. Afterwards, Attached_io_mem_dataspace should work
> > as expected. Do you have a serial log of bootstrap's boot messages?
>
> When you build bootstrap you can specify the RAM_BASE either by providing
> it
> on the cmdline or through menuconfig (choose 'Custom Platform'). Another
> important parameter is RAM_SIZE_MB.
>
> Matthias.
>
>
> ------------------------------------------------------------------------------
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and their
> applications. Written by three acclaimed leaders in the field,
> this first edition is now available. Download your free book today!
> http://p.sf.net/sfu/13534_NeoTech
> _______________________________________________
> Genode-main mailing list
> Genode-main at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.genode.org/pipermail/users/attachments/20140320/b56a4fdb/attachment.html>


More information about the users mailing list