[ -e build/qemu ] || \ ( cd build ; mkdir -p qemu ) [ -e build/qemu/Makefile ] || \ ( . ./setup-env ; cd build/qemu ; \ ${OMDIR}/openmoko/trunk/src/host/qemu-neo1973/configure \ --target-list=arm-softmmu ) [ -e build/qemu/openmoko ] || \ ( . ./setup-env ; cd build/qemu ; mkdir openmoko ; \ for f in ${OMDIR}/openmoko/trunk/src/host/qemu-neo1973/openmoko/* ; do \ ln -s $f openmoko/`basename $f` ; \ done ) [ -d stamps ] || mkdir stamps touch stamps/qemu ( cd build/qemu ; make ) make[1]: Entering directory `/home/dmitri/moko/build/qemu' make -C arm-softmmu all make[2]: Entering directory `/home/dmitri/moko/build/qemu/arm-softmmu' make[2]: Nothing to be done for `all'. make[2]: Leaving directory `/home/dmitri/moko/build/qemu/arm-softmmu' make[1]: Leaving directory `/home/dmitri/moko/build/qemu' [ -e images/openmoko ] || mkdir -p images/openmoko ln -sf `pwd`/openmoko/trunk/src/host/qemu-neo1973/openmoko/env images/openmoko/env ( cd images ; ../openmoko/trunk/src/host/qemu-neo1973/openmoko/download.sh ) Retrieving available builds list... Kernel is... uImage-2.6-moko9-r0_0_1754_0-fic-gta01.bin Root filesystem is... openmoko-devel-image-fic-gta01-20070415224624.rootfs.jffs2 U-boot is... u-boot-gta01bv4-r4_37837828d89084879bee2f2b8c7c68d4695940df_0_1804.bin Now use openmoko/flash.sh to install OpenMoko to NAND Flash. rm -f images/openmoko/env [ -d stamps ] || mkdir stamps touch stamps/images ( cd build/qemu ; openmoko/flash.sh ../../images/openmoko ) /usr/bin/pngtopnm /usr/bin/ppmtorgb3 make[1]: Entering directory `/home/dmitri/moko/build/qemu/openmoko' make[1]: `splash.gz' is up to date. make[1]: Leaving directory `/home/dmitri/moko/build/qemu/openmoko' Using 'uImage-2.6-moko9-r0_0_1754_0-fic-gta01.bin' as the kernel image. Using 'openmoko-devel-image-fic-gta01-20070415224624.rootfs.jffs2' as the root filesystem image. Using 'u-boot-gta01bv4-r4_37837828d89084879bee2f2b8c7c68d4695940df_0_1804.bin' as bootloader. make[1]: Entering directory `/home/dmitri/moko/build/qemu/openmoko' # Making an empty/erased flash image. Need a correct echo behavior. echo -en \\0377\\0377\\0377\\0377\\0377\\0377\\0377\\0377 > .8b cat .8b .8b > .16b # OOB is 16 bytes cat .16b .16b .16b .16b .16b .16b .16b .16b > .512b cat .16b .16b .16b .16b .16b .16b .16b .16b >> .512b cat .16b .16b .16b .16b .16b .16b .16b .16b >> .512b cat .16b .16b .16b .16b .16b .16b .16b .16b >> .512b cat .512b .16b > .sec # A sector is 512 bytes of data + OOB cat .sec .sec .sec .sec .sec .sec .sec .sec > .8sec cat .8sec .8sec .8sec .8sec .8sec .8sec .8sec .8sec > .64sec cat .64sec .64sec .64sec .64sec .64sec .64sec .64sec .64sec > .512sec cat .512sec .512sec .512sec .512sec > .2ksec cat .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec .2ksec > .16ksec # Neo NAND is 128k sectors big cat .16ksec .16ksec .16ksec .16ksec .16ksec .16ksec .16ksec .16ksec > openmoko-flash.image rm -rf .8b .16b .512b .sec .8sec .64sec .512sec .2ksec .16ksec make[1]: Leaving directory `/home/dmitri/moko/build/qemu/openmoko' neo_gsm_switch: GSM disabled. U-Boot 1.2.0-moko7 (Apr 19 2007 - 13:30:07) DRAM: 128 MB NAND: Bad block table not found for chip 0 Bad block table not found for chip 0 64 MiB *** Warning - bad CRC or NAND, using default environment Please wait, programming the NAND flash... Video: 640x480x8 31kHz 59Hz USB: S3C2410 USB Deviced mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' 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_bl_switch: LCD Backlight now on. GTA01Bv4 # GTA01Bv4 # setenv dontask y GTA01Bv4 # nand createbbt Create BBT and erase everything ? Erasing at 0x0 -- 0% complete. Erasing at 0xa0000 -- 1% complete. Erasing at 0x144000 -- 2% complete. Erasing at 0x1e8000 -- 3% complete. Erasing at 0x28c000 -- 4% complete. Erasing at 0x330000 -- 5% complete. Erasing at 0x3d4000 -- 6% complete. Erasing at 0x478000 -- 7% complete. Erasing at 0x51c000 -- 8% complete. Erasing at 0x5c0000 -- 9% complete. Erasing at 0x664000 -- 10% complete. Erasing at 0x708000 -- 11% complete. Erasing at 0x7ac000 -- 12% complete. Erasing at 0x850000 -- 13% complete. Erasing at 0x8f4000 -- 14% complete. Erasing at 0x998000 -- 15% complete. Erasing at 0xa3c000 -- 16% complete. Erasing at 0xae0000 -- 17% complete. Erasing at 0xb84000 -- 18% complete. Erasing at 0xc28000 -- 19% complete. Erasing at 0xccc000 -- 20% complete. Erasing at 0xd70000 -- 21% complete. Erasing at 0xe14000 -- 22% complete. Erasing at 0xeb8000 -- 23% complete. Erasing at 0xf5c000 -- 24% complete. Erasing at 0xffc000 -- 25% complete. Erasing at 0x10a0000 -- 26% complete. Erasing at 0x1144000 -- 27% complete. Erasing at 0x11e8000 -- 28% complete. Erasing at 0x128c000 -- 29% complete. Erasing at 0x1330000 -- 30% complete. Erasing at 0x13d4000 -- 31% complete. Erasing at 0x1478000 -- 32% complete. Erasing at 0x151c000 -- 33% complete. Erasing at 0x15c0000 -- 34% complete. Erasing at 0x1664000 -- 35% complete. Erasing at 0x1708000 -- 36% complete. Erasing at 0x17ac000 -- 37% complete. Erasing at 0x1850000 -- 38% complete. Erasing at 0x18f4000 -- 39% complete. Erasing at 0x1998000 -- 40% complete. Erasing at 0x1a3c000 -- 41% complete. Erasing at 0x1ae0000 -- 42% complete. Erasing at 0x1b84000 -- 43% complete. Erasing at 0x1c28000 -- 44% complete. Erasing at 0x1ccc000 -- 45% complete. Erasing at 0x1d70000 -- 46% complete. Erasing at 0x1e14000 -- 47% complete. Erasing at 0x1eb8000 -- 48% complete. Erasing at 0x1f5c000 -- 49% complete. Erasing at 0x1ffc000 -- 50% complete. Erasing at 0x20a0000 -- 51% complete. Erasing at 0x2144000 -- 52% complete. Erasing at 0x21e8000 -- 53% complete. Erasing at 0x228c000 -- 54% complete. Erasing at 0x2330000 -- 55% complete. Erasing at 0x23d4000 -- 56% complete. Erasing at 0x2478000 -- 57% complete. Erasing at 0x251c000 -- 58% complete. Erasing at 0x25c0000 -- 59% complete. Erasing at 0x2664000 -- 60% complete. Erasing at 0x2708000 -- 61% complete. Erasing at 0x27ac000 -- 62% complete. Erasing at 0x2850000 -- 63% complete. Erasing at 0x28f4000 -- 64% complete. Erasing at 0x2998000 -- 65% complete. Erasing at 0x2a3c000 -- 66% complete. Erasing at 0x2ae0000 -- 67% complete. Erasing at 0x2b84000 -- 68% complete. Erasing at 0x2c28000 -- 69% complete. Erasing at 0x2ccc000 -- 70% complete. Erasing at 0x2d70000 -- 71% complete. Erasing at 0x2e14000 -- 72% complete. Erasing at 0x2eb8000 -- 73% complete. Erasing at 0x2f5c000 -- 74% complete. Erasing at 0x2ffc000 -- 75% complete. Erasing at 0x30a0000 -- 76% complete. Erasing at 0x3144000 -- 77% complete. Erasing at 0x31e8000 -- 78% complete. Erasing at 0x328c000 -- 79% complete. Erasing at 0x3330000 -- 80% complete. Erasing at 0x33d4000 -- 81% complete. Erasing at 0x3478000 -- 82% complete. Erasing at 0x351c000 -- 83% complete. Erasing at 0x35c0000 -- 84% complete. Erasing at 0x3664000 -- 85% complete. Erasing at 0x3708000 -- 86% complete. Erasing at 0x37ac000 -- 87% complete. Erasing at 0x3850000 -- 88% complete. Erasing at 0x38f4000 -- 89% complete. Erasing at 0x3998000 -- 90% complete. Erasing at 0x3a3c000 -- 91% complete. Erasing at 0x3ae0000 -- 92% complete. Erasing at 0x3b84000 -- 93% complete. Erasing at 0x3c28000 -- 94% complete. Erasing at 0x3ccc000 -- 95% complete. Erasing at 0x3d70000 -- 96% complete. Erasing at 0x3e14000 -- 97% complete. Erasing at 0x3eb8000 -- 98% complete. Erasing at 0x3f5c000 -- 99% complete. Skipping bad block at 0x03ff0000 Skipping bad block at 0x03ff4000 Skipping bad block at 0x03ff8000 Skipping bad block at 0x03ffc000 Creating BBT. Please wait ...Bad block table not found for chip 0 Bad block table not found for chip 0 Bad block table written to 0x03ffc000, version 0x01 Bad block table written to 0x03ff8000, version 0x01 GTA01Bv4 # setenv bootcmd 'setenv bootargs ${bootargs_base} ${mtdparts}; bootm 0x32000000' GTA01Bv4 # setenv menu_1 'Set console to USB: setenv stdin usbtty; setenv stdout usbtty; setenv stderr usbtty' GTA01Bv4 # setenv menu_2 'Set console to serial: setenv stdin serial; setenv stdout serial; setenv stderr serial' GTA01Bv4 # setenv menu_3 'Power off: neo1973 power-off' GTA01Bv4 # setenv splashimage 'nand read.e 0x36000000 splash 0x5000; unzip 0x36000000 0x33d00000 0x96000' GTA01Bv4 # dynpart mtdparts mtdparts=neo1973-nan GTA01Bv4 # nand write.e 0x32000000 u-boot 0x31828L NAND write: no identifier 'u-boot' is not a number GTA01Bv4 # dynenv set u-boot_env no identifier 'u-boot_env' is not a number Offset or partpoweroff pcf_write: Power-off requested. Saving Environment to NAND... Erasing Nand...GTA01Bv4 # openmoko/flash.sh: line 78: 26877 Terminated $qemu -mtdblock "$script_dir/$flash_image" -kernel "$script_dir/$1" -serial stdio -nographic -usb -monitor null 0<&0 openmoko/flash.sh: line 85: kill: (26877) - No such process Please wait, programming the NAND flash... neo_gsm_switch: GSM disabled. U-Boot 1.2.0-moko7 (Apr 19 2007 - 13:30:07) DRAM: 128 MB NAND: 64 MiB *** Warning - bad CRC or NAND, using default environment Video: 640x480x8 31kHz 59Hz USB: S3C2410 USB Deviced mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' 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_bl_switch: LCD Backlight now on. GTA01Bv4 # GTA01Bv4 # nand write.e 0x32000000 splash 0x5000 NAND write: mtdparts variable not set, see 'help mtdparts' incorrect device type in splash 'splash' is not a number GTA01Bv4 # openmoko/flash.sh: line 78: 26898 Terminated $qemu -mtdblock "$script_dir/$flash_image" -kernel "$script_dir/$1" -serial stdio -nographic -usb -monitor null 0<&0 openmoko/flash.sh: line 85: kill: (26898) - No such process Please wait, programming the NAND flash... neo_gsm_switch: GSM disabled. U-Boot 1.2.0-moko7 (Apr 19 2007 - 13:30:07) DRAM: 128 MB NAND: 64 MiB *** Warning - bad CRC or NAND, using default environment Video: 640x480x8 31kHz 59Hz USB: S3C2410 USB Deviced mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' 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_bl_switch: LCD Backlight now on. GTA01Bv4 # GTA01Bv4 # nand write.e 0x32000000 kernel 0x179765L NAND write: mtdparts variable not set, see 'help mtdparts' incorrect device type in kernel 'kernel' is not a number GTA01Bv4 # openmoko/flash.sh: line 78: 26906 Terminated $qemu -mtdblock "$script_dir/$flash_image" -kernel "$script_dir/$1" -serial stdio -nographic -usb -monitor null 0<&0 openmoko/flash.sh: line 85: kill: (26906) - No such process Please wait, programming the NAND flash... neo_gsm_switch: GSM disabled. U-Boot 1.2.0-moko7 (Apr 19 2007 - 13:30:07) DRAM: 128 MB NAND: 64 MiB *** Warning - bad CRC or NAND, using default environment Video: 640x480x8 31kHz 59Hz USB: S3C2410 USB Deviced mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' mtdparts variable not set, see 'help mtdparts' 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_bl_switch: LCD Backlight now on. GTA01Bv4 # GTA01Bv4 # nand write.jffs2 0x32000000 rootfs 0x19e4000L NAND write: mtdparts variable not set, see 'help mtdparts' incorrect device type in rootfs 'rootfs' is not a number GTA01Bv4 # openmoko/flash.sh: line 78: 26917 Terminated $qemu -mtdblock "$script_dir/$flash_image" -kernel "$script_dir/$1" -serial stdio -nographic -usb -monitor null 0<&0 openmoko/flash.sh: line 85: kill: (26917) - No such process All done. Read the qemu manual and use a commandline like the following to boot: $ arm-softmmu/qemu-system-arm -M neo -m 130 -mtdblock openmoko/openmoko-flash.image -kernel openmoko/openmoko-kernel.bin -usb -show-cursor Append '-snapshot' to make the flash image read-only so that every time emulation starts in the original unmodified state. [Enter] for AUX button, [Space] for POWER. ( cd build/qemu ; arm-softmmu/qemu-system-arm \ -M neo -m 130 -usb -show-cursor \ -mtdblock openmoko/openmoko-flash.image \ -kernel openmoko/openmoko-kernel.bin ) neo_gsm_switch: GSM disabled. pcf_write: charging in Qualification Mode. pcf_write: charge voltage 4.20V. neo_lcd_rst_switch: LCD reset. jbt6k74_command: Display on. neo_bl_switch: LCD Backlight now on. pcf_write: Power-off requested.