2014-03-13

Slitaz -- arm-toolchain


slitaz-arm-toolchain-20140310.tar.bz2
https://github.com/pirandr/slitaz-arm/blob/master/slitaz-arm-toolchain-20140310.tar.bz2

file 49745.431 kb


slitaz-arm-toolchain-20140311.tar.bz2
https://github.com/pirandr/slitaz-arm/blob/master/slitaz-arm-toolchain-20140311.tar.bz2

file 50066.873 kb


Summary - arm
Running command : Not running
Wok revision : 16068
Commits to cook : 0
Current cooklist : 0
Broken packages : 7
Blocked packages : 0

Packages: 275 in the wok - 267 cooked - 8 unbuilt - Server date: 2014-03-13 13:51 CET


http://mirror.slitaz.org/arm/rpi/linux-3.10.32+.tazpkg

Comparison of current ARM cores





Comparison of current ARM cores
http://en.wikipedia.org/wiki/Comparison_of_current_ARM_cores

RasppberryPi

SoC: Broadcom BCM2835 (CPU + GPU. SDRAM is a separate chip stacked on top)
CPU: 700 MHz ARM11 ARM1176JZF-S core
GPU: Broadcom VideoCore IV,OpenGL ES 2.0,OpenVG 1080p30 H.264 high-profile encode/decode
Memory (SDRAM):256 MB / 512 MB


MK802 II
Main Chip: Allwinner A10/ 1GHz Cortex-A8
Memory: 1GB
Storage: 4GB, Micro SD 2-32GB Memory
GPU: Mali400


Radxa Rock
SOC Rockchip RK3188
CPU ARM Cortex-A9 quad core @ 1.6Ghz
Memory 1GB / 2GB DDR3 @ 800Mhz
Storage 4GB / 8GB NAND Flash, Micro-SD SDXC up to 128GB
GPU Mali400-mp4@533Mhz, OpenGL ES 2.0


2014-03-10

raspi - mkimage

raspi - mkimage

1.  imagetool-uncompressed.py and first32k.bin

first32k.bin
file 32.768 kb

imagetool-uncompressed.py
https://github.com/raspberrypi/tools/blob/master/mkimage/imagetool-uncompressed.py

#!/usr/bin/env python2

import os
import re
import sys

try:
   kernel_image = sys.argv[1]
except:
   kernel_image = ""

if kernel_image == "":
  print("usage : imagetool-uncompressed.py <kernel image>");
  sys.exit(0)
   
re_line = re.compile(r"0x(?P<value>[0-9a-f]{8})")

mem = [0 for i in range(32768)]

def load_to_mem(name, addr):
   f = open(name)

   for l in f.readlines():
      m = re_line.match(l)

      if m:
         value = int(m.group("value"), 16)

         for i in range(4):
            mem[addr] = int(value >> i * 8 & 0xff)
            addr += 1

   f.close()

load_to_mem("boot-uncompressed.txt", 0x00000000)
load_to_mem("args-uncompressed.txt", 0x00000100)

f = open("first32k.bin", "wb")

for m in mem:
   f.write(chr(m))

f.close()

os.system("cat first32k.bin " + kernel_image + " > kernel.img")

2.  (With latest fw, you don't need to run python imagetool-uncompressed.py)
http://elinux.org/index.php?title=RPi_Kernel_Compilation&diff=next&oldid=131522

Revision as of 02:49, 25 May 2012 (view source)
Srwarren (Talk | contribs)
(With latest fw, you don't need to run python imagetool-uncompressed.py)

3. Bootloader offset #16
https://github.com/raspberrypi/linux/issues/16

QEMU patches for Raspberry Pi emulation



QEMU patches for Raspberry Pi emulation
https://github.com/Torlus/qemu-rpi
About
================================================================================
This project aims at providing a basic chipset emulation of the Raspberry Pi,
to help low-level programmers or operating system developers in their tasks.
[..]
Emulated chipset parts are at the time of this writing:
- System Timer.
- UART.
- Mailbox system.
- Framebuffer interface.
- DMA.
- eMMC SD host controller.
The emulation is quite incomplete for many parts, however it is advanced enough to boot a Pi-targetted Linux kernel, along with a SD image of a compatible Linux distribution.

Here is the new command line:
/path/to/qemu-system-arm -kernel kernel.img -cpu arm1176 -m 512
-M raspi -no-reboot -serial stdio -sd 2012-12-16-wheezy-raspbian.img
-device usb-kbd -device usb-mouse
-append "rw earlyprintk loglevel=8 panic=120 keep_bootcon rootwait dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1024 bcm2708_fb.fbheight=768 bcm2708.boardrev=0xf bcm2708.serial=0xcad0eedf smsc95xx.macaddr=B8:27:EB:D0:EE:DF dhci-bcm2708.emmc_clock_freq=100000000 vc_mem.mem_base=0x1c000000 vc_mem.mem_size=0x20000000 dwc_otg.lpm_enable=0 gdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait"




2014-03-07

SliTaz ARM


Welcome to SliTaz ARM

http://arm.slitaz.org/
This website provides information, notes and links about the SliTaz GNU/Linux port to the ARM architecture. SliTaz currently support the ARM v6 (armel) architecture and work is on the stove for armv6hf (hard float).

Build distro's

To create some custom ARM SliTaz flavors we use a tool called 'sat' which stands for SliTaz ARM Tool. Sat is a cmdline tool written in SHell script and in the spirit of SliTaz, light, fast and easy to use! Get the code via Mercurial Hg repository or download latest tarball: tip.tar.bz2
$ hg clone http://hg.slitaz.org/slitaz-arm
You may want to browse the slitaz-arm Hg repo and have a look at the README to get started. Once sat is cloned and installed you can generated a distro in a single command line from your local slitaz-arm repo:
# sat mirror && sat gen --flavor=base

Raspberry Pi

Currently the SliTaz official ARM port works on the Raspberry Pi and can be used to setup a small server. DirectFB is ported and provides a nice and light GUI support. A new tool is also on the stove to create custom Rpi flavors with an official Kernel, custom boot options and more.
Official Raspberry Pi website: www.raspberrypi.org

Packages

All SliTaz ARM packages are automatically built by the ARM Cooker. To properly handle the SLITAZ_ARCH variable, the recommended Package Manager is spk. One way to start with the Spk Toolset is to generate a distro and include the latest Hg version with 'sat gen --spk' and then emulate the system to try it out.
On a SliTaz ARM system you simply run 'spk-up --list' to get the latest packages list. The current ARM packages mirror URL:

Prebuilt ARM Toolchain

To compile SliTaz packages to ARM you need a working cross compilation toolchain. You can build your own with 'cross' or use our prebuilt toolchains available from the SliTaz Mirror:

Cross compiling

SliTaz provides all the necessary tools for cross compiling Open Source software. The cookutils package provides 'cross' which is used to create cross compilation toolchains and 'cook' is used to cross compile SliTaz packages.
README, howto and doc: cross - cook.

ARM emulator

On SliTaz you need to install 'qemu-arm' package which provide the Qemu CPU emulattor for the ARM platform. If you have built a distro with the sat tool you can emulate it with:
# sat emu
 
© 2014 - SliTaz GNU/Linux 

2014-03-06

Slitaz -- libtool minefield


libtool minefield
This lead me to
http://www.metastatic.org/text/libtool.html
which describes my problem accuratedly. I'm a bit more chicken so I used this sed script instead
https://github.com/pirandr/slitaz-arm/blob/master/cross-compiled/libtool-minefield
1. http://forum.slitaz.org/topic/chroot#post-18810
Avoiding libtool minefields when cross-compiling
http://www.metastatic.org/text/libtool.html
2. Cross Toolchain
http://cook.slitaz.org/cross/arm/toolchain.cgi
Target host : arm
C Compiler  : arm-slitaz-linux-gnueabi-gcc
CFLAGS      : -O2 -march=armv6
Packages log: binutils eglibc gcc-final gcc-static libtool linux-headers

Broadcom Gives Developers Keys to the VideoCore® Kingdom

Broadcom Gives Developers Keys to the VideoCore® Kingdom
The Raspberry is a bit weird anyway with its proprietary GPU and bootcode on that proprietary GPU.
Android for All: Broadcom Gives Developers Keys to the VideoCore® Kingdom
Posted: Feb. 28, 2014
http://blog.broadcom.com/chip-design/android-for-all-broadcom-gives-developers-keys-to-the-videocore-kingdom/
Today, Broadcom is releasing the full source of the OpenGL ES 1.1 and 2.0 driver stack for the Broadcom VideoCore® IV 3D graphics subsystem used in the BCM21553 3G integrated baseband SoC. VideoCore IV is used in many Broadcom products, including the BCM2835 application processor, which runs the popular Raspberry Pi microcomputer.
Download BCM21553 GPU Documentation
http://www.broadcom.com/docs/support/videocore/VideoCoreIV-AG100-R.pdf

Download BCM21553 Graphics Driver
http://www.broadcom.com/docs/support/videocore/Brcm_Android_ICS_Graphics_Stack.tar.gz

Related Story

Happy Birthday, Raspberry Pi! More Than 2.5M and Counting
http://blog.broadcom.com/raspberry-pi/happy-birthday-raspberry-pi-more-than-2-5m-and-counting/

A birthday present from Broadcom
http://www.raspberrypi.org/archives/6299

2014-03-04

Slitaz -- Cortex-A8

Cortex-A8

1. MK802 II
  • Main Chip: Allwinner A10/ 1GHz Cortex-A8
  • Memory: 1GB
  • Storage: 4GB
  • GPU: Mali400
  • Expansion: Micro SD 2-32GB Memory
2. custom kernel
tc@box:~$ uname -a
Linux box 3.0.42-slitaz #1 PREEMPT Tue Oct 9 19:22:19 UTC 2012 armv7l GNU/Linux

3. Machine: sun4i and Sourcery toolchain
tc@box:~$ dmesg | head -5
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Linux version 3.0.42-slitaz (root@slitaz) (gcc version 4.5.1 (Sourcery G++ Lite 2010.09-50) ) #1 PREEMPT Tue Oct 9 19:22:19 UTC 2012
[ 0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
[ 0.000000] CPU: VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] Machine: sun4i

4. Tiny Core on mk802
http://forum.tinycorelinux.net/index.php/topic,14476.0.html
Tiny Core on mk802                                                                       
« on: November 28, 2012, 03:11:25 PM »   
                               
I see someone has Tiny Core on the tiny mk802.
                           
10+ Years Contributing to Linux Open Source Projects.

Slitaz -- rootfs

rootfs
make more ARM SoC available so the work here wouldn't really be lost unless the custom hardware is really different.
even if the custom hardware is really different

boot section: bootloader,kernel (custom)
rootfs: almost the same

2014-03-03

Slitaz -- slitaz-arm-toolchain-20140228.tar.bz2 -2

slitaz-arm-toolchain-20140228.tar.bz2 -2
https://github.com/pirandr/slitaz-arm/blob/master/slitaz-arm-toolchain-20140228.tar.bz2

file 85363.318 kb
/cross/arm/sysroot/lib/libc-2.13.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped
1. clean-tools Clean: /cross/arm/tools
# cross --help
Usage: cross command --option
Commands:
howto Man[like] page and howto
info Display cross-tools info
testsuite Execute a small testsuite
check Check build host environment
download Download necessary sources
show-log Show a compile log
binutils Compile Binutils
linux-headers Install Kernel headers
gcc-static Compile GCC static
glibc Compile GNU Glibc
gcc-final Compile final GCC
compile Compile everything at once
clean Clean-up build environment
clean-tools Clean: /cross/arm/tools
gen-prebuilt Create a prebuilt toolchain archive

   clean-tools)
       # Remove crap :-)
       init_compile
       echo "Cleaning   : $tools ($(du -sh $tools | awk '{print $1}'))"
       for file in share/info share/man share/local
       do
           echo -n "Removing   : $file"
           rm -rf $tools/$file && status
       done
       echo -n "Stripping  : shared libs and binaries"
       find $tools/bin -type f -exec strip -s '{}' 2>/dev/null \;
       find $tools/lib -name cc1* -exec strip -s '{}' 2>/dev/null \;
       find $tools/lib -name lto* -exec strip -s '{}' 2>/dev/null \;
       find $sysroot -name "*.so*" -exec ${TARGET}-strip -s '{}' 2>/dev/null \;
       sleep 1 && status
       echo -n "Tools size : " && du -sh $tools | awk '{print $1}' ;;

2. README
Move this arm cross compilation toolchain to /usr/cross then add tools
to your PATH environment and test the toolchain:
# mv arm /cross
/usr/cross
should be /cross

2014-03-02

Slitaz -- slitaz-arm-toolchain-20140228.tar.bz2

slitaz-arm-toolchain-20140228.tar.bz2
https://github.com/pirandr/slitaz-arm
1. slitaz-arm-toolchain-20140228.tar.bz2
https://github.com/pirandr/slitaz-arm/blob/master/slitaz-arm-toolchain-20140228.tar.bz2

root 2 days ago Initial
0 contributors
file 85363.318 kb

2.
root@slitaz:/# /tmp/libc-2.13.so
GNU C Library (EGLIBC) stable release version 2.13, by Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.6.3.
Compiled on a Linux 3.2.14 system on 2014-02-28.
Available extensions:
crypt add-on version 2.1 by Michael Glad and others
GNU Libidn by Simon Josefsson
Native POSIX Threads Library by Ulrich Drepper et al
Support for some architectures added on, not maintained in glibc core.
BIND-8.2.3-T5B
libc ABIs: UNIQUE
For bug reporting instructions, please see:
<http://www.eglibc.org/issues/>.

3.
root@slitaz:~# file /cross/arm/sysroot/lib/libc-2.13.so
/cross/arm/sysroot/lib/libc-2.13.so: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, not stripped

4. Compiler executable checksum: cde56a52bb4f2dbe8ce593dcc61b0f63
root@slitaz:~# echo 'int main() { return 0; }' > test.c

root@slitaz:~# arm-slitaz-linux-gnueabi-gcc -v -o test-0302 test.c
Using built-in specs.COLLECT_GCC=arm-slitaz-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/lto-wrapper
Target: arm-slitaz-linux-gnueabi
Configured with: ../gcc-4.6.3/configure --prefix=/cross/arm/tools --libexec=/cross/arm/tools/lib --target=arm-slitaz-linux-gnueabi --enable-shared --enable-c99 --enable-long-long --enable-__cxa_atexit --with-system-zlib --enable-plugin --disable-multilib --disable-libssp --disable-checking --disable-werror --with-pkgversion=SliTaz --with-bugurl=https://bugs.slitaz.org/ --with-sysroot=/cross/arm/sysroot --enable-languages=c,c++
Thread model: posix
gcc version 4.6.3 (SliTaz)
COLLECT_GCC_OPTIONS='-v' '-o' 'test-0302'
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/cc1 -quiet -v test.c -quiet -dumpbase test.c -auxbase test -version -o /tmp/ccCh87O3.s
GNU C (SliTaz) version 4.6.3 (arm-slitaz-linux-gnueabi)
compiled by GNU C version 4.6.3, GMP version 5.0.4, MPFR version 3.1.0-p4, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=65536
ignoring nonexistent directory "/cross/arm/sysroot/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/include
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/include-fixed
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/../../../../arm-slitaz-linux-gnueabi/include
/cross/arm/sysroot/usr/include
End of search list.
GNU C (SliTaz) version 4.6.3 (arm-slitaz-linux-gnueabi)
compiled by GNU C version 4.6.3, GMP version 5.0.4, MPFR version 3.1.0-p4, MPC version 0.8.2
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=65536
Compiler executable checksum: cde56a52bb4f2dbe8ce593dcc61b0f63
COLLECT_GCC_OPTIONS='-v' '-o' 'test-0302'
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/../../../../arm-slitaz-linux-gnueabi/bin/as -meabi=5 -o /tmp/ccqIAVNV.o /tmp/ccCh87O3.s
COMPILER_PATH=/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/../../../../arm-slitaz-linux-gnueabi/bin/
LIBRARY_PATH=/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/:/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/../../../../arm-slitaz-linux-gnueabi/lib/:/cross/arm/sysroot/lib/:/cross/arm/sysroot/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-o' 'test-0302'
/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/collect2 --sysroot=/cross/arm/sysroot --eh-frame-hdr -dynamic-linker /lib/ld-linux.so.3 -X -m armelf_linux_eabi -o test-0302 /cross/arm/sysroot/usr/lib/crt1.o /cross/arm/sysroot/usr/lib/crti.o /cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/crtbegin.o -L/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3 -L/cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/../../../../arm-slitaz-linux-gnueabi/lib -L/cross/arm/sysroot/lib -L/cross/arm/sysroot/usr/lib /tmp/ccqIAVNV.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /cross/arm/tools/lib/gcc/arm-slitaz-linux-gnueabi/4.6.3/crtend.o /cross/arm/sysroot/usr/lib/crtn.o
5.
root@slitaz:~# readelf -A test-0302
Attribute Section: aeabi
File Attributes
Tag_CPU_name: "6"
Tag_CPU_arch: v6
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align_needed: 8-byte
Tag_ABI_align_preserved: 8-byte, except leaf SP
Tag_ABI_enum_size: int
Tag_DIV_use: Not allowed
root@slitaz:~#

2014-03-01

Slitaz -- sysroot / mirror

sysroot / mirror
Checking build dependencies...
Using packages DB: /cross/arm/sysroot/var/lib/tazpkg
Installing dep (pkg/local): libxml2-dev-2.8.0-arm.tazpkg
Connecting to mirror.slitaz.org (46.105.127.17:80)
zlib-1.2.8.tazpkg 100% |*******************************| 35924 0:00:00 ETA
Connecting to mirror.slitaz.org (46.105.127.17:80)
glibc-base-2.14.1.ta 100% |*******************************| 1270k 0:00:00 ETA
Installing dep (pkg/local): libxml2-2.8.0-arm.tazpkg
setup-mirror|-sm Change the mirror url configuration.

# tazpkg setup-mirror (IN chroot)

http://cook.slitaz.org/cross/arm/packages/

Or path/to/your_arm_packages

Slitaz -- tazpkg install

tazpkg install  --root= option
But I think eglibc is installed in /cross/arm/sysroot.
I use Eglibc with cross to build the ARM cross toolchain and used the glibc-base package to provide libc in ARM.
How do I "use" the glibc-base package in this way? (How do I tell arm-setup

install
file:///usr/share/doc/tazpkg/tazpkg.en.html

specify the root system where you want to install the packages via the --root= option:

# tazpkg install path/to/package-1.0.tazpkg --root=/mnt/rootfs