Archive for October, 2013

Exploring the BeagleboneBlack

Essentially we need to answer the questions:

a. How to customize linux kernel for the different usage of the BeagleBoneBlack device?
b. How to write linux kernel module for low level hardware control?
c How to trace through and debug system and applications at runtime?

Getting started guide:

http://beagleboard.org/Getting%20Started

The latest images are available here:

http://beagleboard.org/latest-images

On my PC host, “ifconfig -a” gave:

eth2 Link encap:Ethernet HWaddr c4:ed:ba:7c:25:01
inet addr:192.168.7.1 Bcast:192.168.7.3 Mask:255.255.255.252

And this happened when the BBB interface is plugged into the USB of the PC host directly.

On the BeagleBoneBlack interface the IP address is: 192.168.7.2.

Details info is given here:

http://www.circuidipity.com/getting-started-with-beaglebone-black.html

After ssh into the BeagleBoneBlack as root:

cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 297.40
Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls

and so on. And you can view all the /sys interface as well as dmesg for more information.

In the /boot directory is a list of all the dtb (device-tree-blob) used by Angstrom, so to output the original source file:

dtc -I dtb -O dts am335x-boneblack.dtb |more

/dts-v1/;

/ {
#address-cells = <0x1>;
#size-cells = <0x1>;
compatible = “ti,am335x-bone”, “ti,am33xx”;
interrupt-parent = <0x1>;
model = “TI AM335x BeagleBone”;

chosen {
};

aliases {
serial0 = “/ocp/serial@44e09000”;
serial1 = “/ocp/serial@48022000”;
serial2 = “/ocp/serial@48024000”;
serial3 = “/ocp/serial@481a6000”;
serial4 = “/ocp/serial@481a8000”;
serial5 = “/ocp/serial@481aa000”;
};
<…>

To enabling DNS connectivity to internet these are the following steps:

On the host side (192.168.7.1) issue the command:

iptables -A POSTROUTING -t nat -j MASQUERADE
echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward

After that you can “cat /proc/sys/net/ipv4/ip_forward” to ensure the value is 1, or using “sysctl”:

sysctl net.ipv4.ip_forward

net.ipv4.ip_forward = 1

On the BeagleBoardBlack side (192.168.7.2) issue the command:

/sbin/route add default gw 192.168.7.1

At this stage, if you ping an outside IP address (eg, 165.21.100.88, which is the DNS server for SingTel, my ISP provider) it is possible to get a response.

And so the last step is to do this inside the BeagleboardBlack:

echo “nameserver 165.21.100.88” > /etc/resolv.conf

Here is Android JellyBean installation and setup for BBB:

http://code.google.com/p/rowboat/wiki/JellybeanOnBeaglebone_WithSGX

http://www.ti.com/tool/androidsdk-sitara

Here is a performance testing setup for BBB:

http://www.linux.com/learn/docs/727211-beaglebone-black-part-2-linux-performance-tests

And if you are interested to build linux kernel module for it:

http://wiki.beyondlogic.org/index.php/BeagleBoneBlack_Building_Kernel

And the default kernel modules are:

Module Size Used by
fuse 51875 3
ip_tables 8294 0
x_tables 15072 1 ip_tables
g_multi 55905 2
libcomposite 15228 1 g_multi
rfcomm 25106 0
ircomm_tty 14503 0
ircomm 8846 1 ircomm_tty
irda 89974 2 ircomm_tty,ircomm
ipv6 229989 14
hidp 10112 0
bluetooth 146100 4 hidp,rfcomm
rfkill 16510 3 bluetooth
autofs4 17432 2

Kali Linux produced customization for BBB:

http://docs.kali.org/development/custom-beaglebone-black-image

http://docs.kali.org/armel-armhf/install-kali-arm-on-a-beaglebone-black

Analysing the systemd (first user process to be executed by Linux kernel, http://en.wikipedia.org/wiki/Systemd):

[ 2.052319] systemd[1]: Inserted module ‘autofs4’
[ 2.054034] systemd[1]: Set hostname to <beaglebone>.
[ 2.307838] systemd[1]: Starting Forward Password Requests to Wall Directory
Watch.
[ 2.308314] systemd[1]: Started Forward Password Requests to Wall Directory W
atch.
[ 2.308562] systemd[1]: Expecting device dev-ttyGS0.device…
[ 2.308658] systemd[1]: Expecting device dev-ttyO0.device…
[ 2.308735] systemd[1]: Starting Remote File Systems.
[ 2.308808] systemd[1]: Reached target Remote File Systems.
[ 2.308882] systemd[1]: Starting /dev/initctl Compatibility Named Pipe.
[ 2.309059] systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
[ 2.309123] systemd[1]: Starting Delayed Shutdown Socket.
[ 2.309300] systemd[1]: Listening on Delayed Shutdown Socket.
[ 2.309394] systemd[1]: Starting Dispatch Password Requests to Console Direct
ory Watch.
[ 2.309660] systemd[1]: Started Dispatch Password Requests to Console Directo
ry Watch.
[ 2.309937] systemd[1]: Starting Arbitrary Executable File Formats File Syste
m Automount Point.
[ 2.310751] systemd[1]: Set up automount Arbitrary Executable File Formats Fi
le System Automount Point.
[ 2.311283] systemd[1]: Starting udev Kernel Socket.
[ 2.311508] systemd[1]: Listening on udev Kernel Socket.
[ 2.311872] systemd[1]: Starting udev Control Socket.
[ 2.312101] systemd[1]: Listening on udev Control Socket.
[ 2.312172] systemd[1]: Starting Swap.
[ 2.312383] systemd[1]: Reached target Swap.
[ 2.312491] systemd[1]: Starting Journal Socket.
[ 2.312840] systemd[1]: Listening on Journal Socket.
[ 2.313002] systemd[1]: Starting File System Check on Root Device…
[ 2.319574] systemd[1]: Starting udev Kernel Device Manager…
[ 2.351204] systemd[1]: Started Set Up Additional Binary Formats.
[ 2.351465] systemd[1]: Mounting Debug File System…
[ 2.371964] systemd[1]: Starting Apply Kernel Variables…
[ 2.375587] systemd[1]: Starting Journal Service…
[ 2.383259] systemd[1]: Started Journal Service.
[ 2.393031] systemd[1]: Starting Load Kernel Modules…
[ 2.398129] systemd[1]: Mounted Huge Pages File System.
[ 2.398443] systemd[1]: Mounting POSIX Message Queue File System…
[ 2.404412] systemd[1]: Started Machine ID first boot configure.
[ 2.406524] systemd[1]: Starting udev Coldplug all Devices…

Another summary pages:

http://eewiki.net/display/linuxonarm/BeagleBone+Black

http://circuitco.com/support/index.php?title=BeagleBoneBlack

http://circuitco.com/support/index.php?title=Android

Lots of GPIO hardware information:

http://rampic.com/beagleboneblack/

For details on customization this page is absolutely good:

http://icculus.org/~hendersa/android/

In particular a lot of details is covered in Android::Install() and Android::Configure().

Working on my Freescale FREEDOM K20D50M

Quick start demo lab:

http://www.freescale.com/files/32bit/doc/train_ref_material/TWRK20D50MQSLAB.pdf

Tower module:

http://cache.freescale.com/files/microcontrollers/doc/ref_manual/TWR-K20D50M-UM.pdf

All the software download:

https://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=FRDM-K20D50M&fpsp=1&tab=Design_Tools_Tab

In particular in above are two things:

a. Bare metal coding for the ARM M4.

b. Bootloader patch inside the OS QSP zip file: as it come from factor, it is not recognizable in Linux env. But after booting up the K20D50M in bootloader mode, with green light blinking, I immediately apply the patch (http://cache.freescale.com/files/32bit/software/board_support_packages/FRDM-K20D50M_QSP.zip?fpsp=1&WT_TYPE=Board%20Support%20Packages&WT_VENDOR=FREESCALE&WT_FILE_FORMAT=zip&WT_ASSET=Downloads&sr=2) and the result now is that it is recognizable in Linux env.

More useful info:

http://www.element14.com/community/docs/DOC-54161/l/review-for-frdm-k20d50m-a-new-freescale-freedom-board-with-arm-cortex-m4

http://www.element14.com/community/docs/DOC-53804/l/review-for-frdm-k20d50m-the-first-freescale-freedom-board-for-the-kinetis-k-mcus-serie-arm-cortex-m4

http://mcuoneclipse.com/2013/04/15/a-new-freedom-board-frdm-k20d50m-with-arm-cortex-m4/

http://raspberryalphaomega.org.uk/category/hardware/k20d50m/

https://rowley.zendesk.com/entries/23275273-Freescale-FRDM-KL25Z-and-Crossworks

http://mcuoneclipse.com/category/boards/kl25z-freedom-board/

Vickblöm

Research scattered with thoughts, ideas, and dreams

Penetration Testing Lab

Offensive Techniques & Methodologies

Astr0baby's not so random thoughts _____ rand() % 100;

@astr0baby on Twitter for fresh randomness

The Data Explorer

playing around with open data to learn some cool stuff about data analysis and the world

Conorsblog

Data | ML | NLP | Python | R

quyv

Just a thought

IFT6266 - H2017 Deep Learning

A Graduate Course Offered at Université de Montréal

Deep Learning IFT6266-H2017 UdeM

Philippe Paradis - My solutions to the image inpainting problem

IFT6266 – H2017 DEEP LEARNING

Pulkit's thoughts on the course project

Thomas Dinsmore's Blog

No man but a blockhead ever wrote except for money -- Samuel Johnson

the morning paper

a random walk through Computer Science research, by Adrian Colyer

The Spectator

Shakir's Machine Learning Blog