Monthly Archives: February 2013

Deploy ownCloud from Source using Git

ownCloud Logo

ownCloud Logo

ownCloud is a great piece of open source software. It allows you to share files easily like Dropbox or Google Drive (including fancy drag and drop upload on newer browsers), but gives you the control of your data, since you can host an instance yourself!

My goal was to test the latest ownCloud 5 snapshot from Github. I do have SSH access on destination server, so my goal was to deploy it directly using Git. Be warned: The master branch from Github can (and will) contain bugs! But you get bleeding edge and you can help testing the software.  Read more »

Cortex-M3 supervisor call (SVC) using GCC

The Cortex-M3 has a new assembler instruction SVC to call the supervisor (usually the operating system). The ARM7TDMI used to call this interrupt SWI, but since this interrupt works differently on Cortex-M3, ARM renamed the instruction to make sure people recognize the difference and implement those calls correctly. The machine opcode however is still the same (bits 0-23 are user defined, bits 24-27 are ones).

On the Cortex-M3, other interrupts can interrupt the processor during state saving of the SVC interrupt (late arrival interrupt handling). Those late arriving interrupts most certainly leave the registers corrupted after execution. Therefor we cannot read the parameters form registers r0 to r4 directly as we could on the ARM7TDMI using SWI interrupts. Fortunately, the Cortex-M3 saves all registers used in standard C procedure call specification (ABI) on the stack. So the SVC handler can get the parameters directly from the stack.

Cortex-M3 stack frame

Cortex-M3 stack frame

Read more »

Build DKMS modules for specific kernel

After upgrading my kernel, somehow DKMS missed to build the NVidia stub modules for the NVidia-binary driver. A oneliner can solve this:

$ sudo /usr/lib/dkms/dkms_autoinstaller start 3.5.0-23-generic

Linaro embedded toolchain on Ubuntu 64-Bit

Linaro provides a specialized toolchain for embedded (bare metal) development. But after installing, I could not execute the binary:

$ gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc
-bash: gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc: No such file or directory

Also ldd claims its not dynamically linked:

$ ldd gcc-arm-none-eabi-4_7-2012q4/bin/arm-none-eabi-gcc
 not a dynamic executable

The truth is: it is dynamically linked, but against 32-Bit libraries. And since I have not yet installed any 32-Bit library, ldd doesn’t work properly. According to the readme, you should install the 32-Bit variant of libc and libncurses. Since Ubuntu is Multi-Arch, you can easily install those libs:

sudo apt-get install libc6:i386 libncurses5:i386

Now you should be able to run the Linaro toolchain on 64-Bit variants of Ubuntu.

Ubuntu: Bash prompt with Git branch

On several Git Video Tutorials people have these nice colored Git specific Bash prompts. When you are starting to work with Git, you realize that its really helpful to have the branch name around all the time. There easy and also many complex bash prompts out there, e.g. fully customizeable Git prompt scripts, one short scriptone script with functions or just a simple PS1 line.

I created one out of all of these. It shows a standard Ubuntu prompt on non Git directories, and an altered prompt inside git repositories. Inside a Git repository it shows the relative path to the Git’s root directory.

Git bash prompt

Git bash prompt

I created a Gish for it. Simple get it using curl and source it from your ~/.bashrc file:

curl https://gist.github.com/raw/4699573/git_bash_prompt.sh -o ~/.git_bash_prompt.sh
echo ". ~/.git_bash_prompt.sh" >> ~/.bashrc