2014年9月6日 星期六

Control Raspberry Pi via VNC and setup virtual server on router/AP

The setup concept is like following diagram

VNC client<-->Internet<-->router<-->Raspberry Pi
  1. Setup VNC server
    • sudo apt-get install tightvncserver
    • vncserver -geometry 1024x768 -depth 24 and set password, this password is only used for VNC login
    • You will require a password to access your desktops.

      Password: 
      Warning: password truncated to the length of 8.
      Verify:   
      Would you like to enter a view-only password (y/n)? n

      New 'X' desktop is raspberrypi:1

      Creating default startup script /home/pi/.vnc/xstartup
      Starting applications specified in /home/pi/.vnc/xstartup
      Log file is /home/pi/.vnc/raspberrypi:1.log
    • :1 is desktop number which stands for VNC port is 5901
  2. Setup virtual server on router/AP
    • Enter virtual server settings in router
    • Name: RPi
    • IP address: loca network address of RPi, 192.168.x.y for example
    • Public port: choose a valid port number, 8899 for example
    • Private port: 5901
    • Protocol: choose both TCP and UDP
  3. Connect to Raspberry Pi
    • Check your worldwide IP address on Internet, w.x.y.z
    • Open VNC client and enter address like w.x.y.z:8899
    • Connect and it should work

2013年7月6日 星期六

風迷藏

孟堯的取樣我真的滿喜歡的
而且他一直在進化

這麼好聽的團
因為鼓手貝斯離開停團還是有點難過
志翔太強了我沒自信能彈出那種tone跟動態
期待他從澳洲回來之後
重新出發的風迷藏

2013年6月9日 星期日

Remote debugging EDK2 BeagleBoardPkg on qEmu

Get ARM none EABI toolchain

arm-none-eabi-gdb included
http://www.codesourcery.com/sgpp/lite/arm/portal/package7813/public/arm-none-eabi/arm-2010.09-51-arm-none-eabi-i686-pc-linux-gnu.tar.bz2

Get module symbol information

Check Build/BeagleBoard/DEBUG_ARMGCC/FV/FVMAIN_COMPACT.Fv.map
Get .textbaseaddress and .databaseaddress

Load symbol information

arm-none-eabi-gdb
(gdb) add-symbol-file <BEAGLEROOT>/Build/BeagleBoard/DEBUG_ARMGCC/ARM/ArmPlatformPkg/PrePi/PeiUniCore/DEBUG/ArmPlatformPrePiUniCore.dll 0x0080008180 -s data 0x008001b5e4

add symbol table from file <BEAGLEROOT>/Build/BeagleBoard/DEBUG_ARMGCC/ARM/ArmPlatformPkg/PrePi/PeiUniCore/DEBUG/ArmPlatformPrePiUniCore.dll" at
.text_addr = 0x80008180
data_addr = 0x8001b5e4
(y or n) y

Reading symbols from <BEAGLEROOT>/Build/BeagleBoard/DEBUG_ARMGCC/ARM/ArmPlatformPkg/PrePi/PeiUniCore/DEBUG/ArmPlatformPrePiUniCore.dll...warning: section data not found in <BEAGLEROOT>/Build/BeagleBoard/DEBUG_ARMGCC/ARM/ArmPlatformPkg/PrePi/PeiUniCore/DEBUG/ArmPlatformPrePiUniCore.dll
done.

Start ARM qEmu

qemu-system-arm -M beagle -s -S -serial stdio -sd beagle.img
-s for waiting for gdb connection
-S for stopping execution when qEmu starts up

Connecting qEmu using GDB

(gdb) target remote :1234
Remote debugging using :1234
0x40014000 in ?? ()

Example

(gdb) b _ModuleEntryPoint
Breakpoint 1 at 0x80008188: file /home/kurt/programming/edk2/src/beagle/Build/BeagleBoard/DEBUG_ARMGCC/ARM/ArmPlatformPkg/PrePi/PeiUniCore/OUTPUT/Arm/ModuleEntryPoint.iii, line 39.

Connecting qEmu using DDD

sudo apt-get install ddd
ddd --debugger arm-none-eabi-gdb

In DDD using GDB command line

Get module symbol information
Load symbol information
Connecting qEmu using GDB




2013年6月7日 星期五

Build EDK2 BeagleBoardPkg on Mac OS X

Install XCode


Install MacPorts


Install ARM toolchain 

sudo port install arm-none-eabi-gcc 

Within Darwin section in  BeagleBoardPkg/build.sh

Change XCODE32 to ARMGCC

Build

./build.sh

Linaro image tools for Mac OS X

Not available yet
https://bugs.launchpad.net/linaro-image-tools
My workaround is making image on the Ubuntu and load it to Mac
Looking forward tools for Mac OS X
Temporarily switch back to Ubuntu 

Build and install Linaro qEmu on Mac OS X

Download source code

https://launchpad.net/qemu-linaro/

Configure and build 

./configure --target-list=arm-softmmu \
--prefix=/Users/<user_name>/qemu/linaro/1.4.0-2013.03/

make

Tricky modification and install

Search LIBTOOL in config-host.mak
Change libtool to glibtool

make install

2013年6月6日 星期四

Build and install Linaro qEmu on Ubuntu

Install necessary packages

sudo apt-get install build-essential autoconf libtool libpixman zlibc libsdl-dev libsdl1.2-dev texinfo

Download and unpack Linaro qEmu

tar zxf qemu-linaro-<version>.gz

Build and install Linaro ARM qEmu

mkdir -p /home/<user_name>/bin/qemu/linaro-<version>/
cd $QEMU-LINARO-<version>-ROOT
./configure --target-list=arm-softmmu,arm-linux-user --prefix=/home/<user_name>/bin/qemu/linaro-<version>/arm
make 
make install

ARM EABI big endian

./configure --target-list=arm-softmmu,armeb-linux-user --prefix=/home/<user_name>/bin/qemu/linaro-<version>/armeb

Build BeagleBoardPkg using gcc-arm-linux-gnueabi

Install ARM EABI GCC

sudo apt-get install gcc-arm-linux-gnueabi

Modification in BeagleBoardPkg/build.sh

#
# Pick a default tool type for a given OS if no toolchain already defined
#
...
#TARGET_TOOLS=ARMGCC
TARGET_TOOLS=ARMLINUXGCC
...

undefined reference to `__stack_chk_fail'
undefined reference to `__stack_chk_guard'

Append -fno-stack-protector to DEBUG_ARMLINUXGCC_ARM_CC_FLAGS
Append -fno-stack-protector to RELEASE_ARMLINUXGCC_ARM_CC_FLAGS