[okl4-developer] OKL4 on Neo1973 (emulated)

David Mirabito davidm at ok-labs.com
Wed Dec 5 10:01:43 EST 2007


Hi Damien,

I have had some experience in booting OKL4 on qemu and hardware, and 
we've bumped into some of these problems along the way as well.

The steps you've tried are correct, and you will find that if you build 
an image without wombat it will boot just fine. The issue here is that 
by default qemu loads the elf to 0x30800000, which is only 8MB from the 
start of physical RAM. With wombat included my image.boot is 9.9MB and 
if we look at the one particular segment in image.boot:
      LOAD           0x242000 0x30700000 0x30700000 0x7d0000 0x7d0000 
RW  0x1000
we can begin to see what's going on. The rootfs will be from 0x30700000 
to 0x30ed0000 in memory, overwriting the ELF header at 0x30800000. After 
unpacking the file, u-boot presumably goes back to read the start 
address, which has since been trashed with random data and things start 
to go downhill.

The workaround we currently have is to modify the qemu sources 
themselves so that the image is initially loaded a little bit higher. 
Ideally, I suppose the load address would be passed in on the command 
line, but this will get us running for now:

in file hw/neo1973.c, around line 401 we find:
    load_image(s->kernel, phys_ram_base + 0x00800000);
I simply changed this to
    load_image(s->kernel, phys_ram_base + 0x02000000)

rebuild and then start OKL4 with
    bootelf 0x32000000
and you should again see the text console.

(Note that the 0x02000000 offset is a number I found purely by trial and 
error, this will allow an image.boot to specify upto 32MB of segments)

To address you other questions, to modify Linux's config you can 
directly modify
   linux/kernel-2.6.11-v2/l4linux_config_gta01
which is copied to .config in the build directory as part of the build.

Alternatively, you can:
#cd linux/kernel-2.6.11-v2
# cp linux/kernel-2.6.11-v2/l4linux_config_gta01 .conifg     // If you 
wish to base off our confguration

Then edit
    arch/l4/Makefile
to comment out the line preventing 'make menuconfig' from working. For 
me it is around line 98:
    include $(KBUILD_SRC)/$(ARCH_DIR)/sys-$(SYSTEM)/Makefile
becomes
    #include $(KBUILD_SRC)/$(ARCH_DIR)/sys-$(SYSTEM)/Makefile

Standard Linux configuration should now work. Don't forget to un-comment 
the line and copy your new .config to l4linux_config_gta01 where the 
build system will find it.

I see you've sent another mail about drivers under OKLinux. I will 
address your other questions there, this reply is already long enough! :)

 - David Mirabito

Damien Schulz wrote:
> Hi,
>
> I'm currently trying to get OKL4 (including Wombat) to work on:
>   1.) an emulated Neo1973 platform,
>   2.) and later on real the hardware.
>
> The emulator I'm using is the patched one from OpenMoko (revision 3552) and 
> seems to support only hardware revision GTA01Bv4. OpenMoko works fine with this 
> emulator. Unfortunately I had no luck to get OKL4 and Wombat to work with this 
> version of the emulator.
>
> This is what I tried so far:
>
> 1.) downloaded OKL4 1.5.2
>
> 2.) built OKL4:
>     ./tools/build.py machine=gta01 project=iguana wombat=true
>
> 3.) downloaded the patche Qemu (revision 3552):
>     svn co https://svn.openmoko.org/trunk/src/host/qemu-neo1973
>     cd qemu-neo1973
>
> 4.) built Qemu:
>     ./configure --target-list=arm-softmmu
>     make
>
> 5.) downloaded OpenMoko:
>     openmoko/download.sh
>     openmoko/flash.sh
>
> 6.) started emulation:
>     arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock 
> openmoko/openmoko-flash.image -kernel 
> ~/OKL4/okl4_release_1.5.2/build/images/image.boot -usb -show-cursor -snapshot 
> -nographic
>
> 7.) bootelf 0x30800000
>
> This seems to load the OKL4 kernel but always produces an error "qemu: fatal: 
> Trying to execute code outside RAM or ROM at 0xe79a2002" (attached you will find 
> my error log).
>
> Btw. I just tried an older version of Qemu (rev3435) and with that version 
> (using 'bootelf 0x31000000') a text console comes up. Do I have to modify 
> something in OKL4 in order to also boot with the current version of Qemu as the 
> boot address seems to have been changed in the newer revision? Which hardware 
> revision OKL4 should work for?
>
> The next goal I want to achieve is to run a graphical console or even X in the 
> emulated environment. Therefore I have to modify the L4Linux configuration in 
> order to use the particular LCD driver, but there isn't something like 'make 
> menuconfig' in the kernel path. So how can I configure L4Linux to use a LCD 
> driver. Is it even possible to let Linux access the SD-Slot?
>
> Any help would be appreciated. Thanks in advance.
>
> Cheers,
>   ~Damien
>
>
>
>   
> ------------------------------------------------------------------------
>
> user at mobile:~/OpenMoko/071203/qemu-neo1973$ arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image -kernel ~/OKL4/okl4_release_1.5.2/build/images/image.boot -usb -show-cursor -snapshot -nographic
> neo_gsm_switch: GSM disabled.
>
>
> U-Boot 1.2.0-moko9_r0 (Aug 19 2007 - 19:17:12)
>
> DRAM:  128 MB
> NAND:  64 MiB
> Found Environment offset in OOB..
> Video: 640x480x8 31kHz 59Hz
>
> NAND read: device 0 offset 0x25c000, size 0x5000
>
> Reading data from 0x260e00 -- 100% complete.
>  20480 bytes read: OK
> USB:   S3C2410 USB Deviced
> In:    serial
> Out:   serial
> Err:   serial
> pcf_write: charging in Qualification Mode.
> pcf_write: charge voltage 4.20V.
> neo_lcd_rst_switch: LCD reset.
> jbt6k74_command: Display on.
> neo_vib_switch: Buzz, buzz.
> neo_vib_switch: Vibrator stopped.
> neo_bl_switch: LCD Backlight now on.
> GTA01Bv4 # bootelf 0x30800000
> Loading kernel.text @ 0x30000000 (67380 bytes)
> Loading kernel.rodata @ 0x30010734 (14405 bytes)
> Loading kernel.kdebug @ 0x30013f79 (17655 bytes)
> Loading kernel.init @ 0x30018470 (8232 bytes)
> Loading kernel.data @ 0x3001a800 (7036 bytes)
> Loading kernel.got @ 0x3001c37c (4 bytes)
> Loading kernel.got.plt @ 0x3001c380 (12 bytes)
> Loading kernel.kdebug-data @ 0x3001c38c (896 bytes)
> Clearing kernel.bss @ 0x3001c70c (9440 bytes)
> Loading kernel.kspace @ 0x30020000 (16384 bytes)
> Loading kernel.kip @ 0x30024000 (2708 bytes)
> Loading kernel.traps @ 0x30025000 (4096 bytes)
> Loading ig_server.text @ 0x30030000 (62868 bytes)
> Loading ig_server.rodata @ 0x3003f594 (6435 bytes)
> Loading ig_server.data @ 0x30048eb8 (536 bytes)
> Loading ig_server.got @ 0x300490d0 (16 bytes)
> Clearing ig_server.bss @ 0x3004a000 (73728 bytes)
> Loading ig_naming.text @ 0x30028000 (30256 bytes)
> Loading ig_naming.rodata @ 0x3002f630 (2324 bytes)
> Loading ig_naming.data @ 0x30026000 (216 bytes)
> Loading ig_naming.got @ 0x300260d8 (16 bytes)
> Clearing ig_naming.bss @ 0x300260e8 (108 bytes)
> Loading event.text @ 0x3005c000 (27816 bytes)
> Loading event.rodata @ 0x30062ca8 (2252 bytes)
> Loading event.data @ 0x30064574 (216 bytes)
> Loading event.got @ 0x3006464c (16 bytes)
> Clearing event.bss @ 0x3006465c (148 bytes)
> Loading vtimer.text @ 0x30068000 (33980 bytes)
> Loading vtimer.rodata @ 0x300704bc (3296 bytes)
> Loading vtimer.data @ 0x3006519c (276 bytes)
> Loading vtimer.got @ 0x300652b0 (16 bytes)
> Clearing vtimer.bss @ 0x300652c0 (112 bytes)
> Loading vserial.text @ 0x30078000 (32416 bytes)
> Loading vserial.rodata @ 0x3007fea0 (2564 bytes)
> Loading vserial.data @ 0x300668a4 (260 bytes)
> Loading vserial.got @ 0x300669a8 (16 bytes)
> Clearing vserial.bss @ 0x300669b8 (124 bytes)
> Loading vbus.text @ 0x30088000 (31268 bytes)
> Loading vbus.rodata @ 0x3008fa24 (2500 bytes)
> Loading vbus.data @ 0x300723e8 (260 bytes)
> Loading vbus.got @ 0x300724ec (16 bytes)
> Clearing vbus.bss @ 0x300724fc (112 bytes)
> Loading vtouch.text @ 0x30098000 (32620 bytes)
> Loading vtouch.rodata @ 0x3009ff6c (2448 bytes)
> Loading vtouch.data @ 0x300738fc (272 bytes)
> Loading vtouch.got @ 0x30073a0c (16 bytes)
> Clearing vtouch.bss @ 0x30073a1c (128 bytes)
> Loading vlcd.text @ 0x300a8000 (31300 bytes)
> Loading vlcd.rodata @ 0x300afa44 (2440 bytes)
> Loading vlcd.data @ 0x300743cc (272 bytes)
> Loading vlcd.got @ 0x300744dc (16 bytes)
> Clearing vlcd.bss @ 0x300744ec (116 bytes)
> Loading devicecore.text @ 0x300b8000 (31912 bytes)
> Loading devicecore.rodata @ 0x300bfca8 (2452 bytes)
> Loading devicecore.data @ 0x3007563c (216 bytes)
> Loading devicecore.got @ 0x30075714 (16 bytes)
> Clearing devicecore.bss @ 0x30075724 (140 bytes)
> Loading vmlinux.text @ 0x30500000 (1224704 bytes)
> Loading vmlinux.exit.text @ 0x3062b000 (1056 bytes)
> Loading vmlinux.rodata @ 0x3062b420 (66297 bytes)
> Loading vmlinux.__ksymtab @ 0x3063b71c (11800 bytes)
> Loading vmlinux.__ksymtab_gpl @ 0x3063e534 (1256 bytes)
> Loading vmlinux.__ksymtab_strings @ 0x3063ea1c (28948 bytes)
> Loading vmlinux.__param @ 0x30645b30 (100 bytes)
> Loading vmlinux.data @ 0x30646000 (139264 bytes)
> Loading vmlinux.data.cacheline_aligned @ 0x30668000 (2240 bytes)
> Loading vmlinux.init.text @ 0x30669000 (51984 bytes)
> Loading vmlinux.init.data @ 0x30675b10 (2088 bytes)
> Loading vmlinux.init.setup @ 0x30676340 (336 bytes)
> Loading vmlinux.initcall.init @ 0x30676490 (240 bytes)
> Loading vmlinux.con_initcall.init @ 0x30676580 (4 bytes)
> Loading vmlinux.init.ramfs @ 0x30677000 (134 bytes)
> Loading vmlinux.exitcall @ 0x30678000 (92 bytes)
> Clearing vmlinux.bss @ 0x30678060 (132840 bytes)
> Loading rootfs @ 0x30700000 (8192000 bytes)
> ## Starting application at 0xe79a2003 ...
> qemu: fatal: Trying to execute code outside RAM or ROM at 0xe79a2002
>
> R00=00000001 R01=33f14ae4 R02=50000000 R03=c0001078
> R04=e79a2003 R05=00000001 R06=33f14ae0 R07=00000002
> R08=33f17fdc R09=00000000 R10=00000000 R11=00000000
> R12=33f1492c R13=33f14ab4 R14=33f8d2a4 R15=e79a2002
> PSR=20000153 --C- A svc32
> s00=00000000(       0) s01=00000000(       0) d00=0000000000000000(       0)
> s02=00000000(       0) s03=00000000(       0) d01=0000000000000000(       0)
> s04=00000000(       0) s05=00000000(       0) d02=0000000000000000(       0)
> s06=00000000(       0) s07=00000000(       0) d03=0000000000000000(       0)
> s08=00000000(       0) s09=00000000(       0) d04=0000000000000000(       0)
> s10=00000000(       0) s11=00000000(       0) d05=0000000000000000(       0)
> s12=00000000(       0) s13=00000000(       0) d06=0000000000000000(       0)
> s14=00000000(       0) s15=00000000(       0) d07=0000000000000000(       0)
> s16=00000000(       0) s17=00000000(       0) d08=0000000000000000(       0)
> s18=00000000(       0) s19=00000000(       0) d09=0000000000000000(       0)
> s20=00000000(       0) s21=00000000(       0) d10=0000000000000000(       0)
> s22=00000000(       0) s23=00000000(       0) d11=0000000000000000(       0)
> s24=00000000(       0) s25=00000000(       0) d12=0000000000000000(       0)
> s26=00000000(       0) s27=00000000(       0) d13=0000000000000000(       0)
> s28=00000000(       0) s29=00000000(       0) d14=0000000000000000(       0)
> s30=00000000(       0) s31=00000000(       0) d15=0000000000000000(       0)
> FPSCR: 00000000
> Aborted (core dumped)
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer
>   




More information about the Developer mailing list