<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ball Dawg!</title>
	<atom:link href="http://www.balldawg.net/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.balldawg.net</link>
	<description>Just some ninja monkeys, nothing to see here.  Move along.</description>
	<lastBuildDate>Sun, 19 Aug 2012 17:30:42 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>VIA APC: Misc</title>
		<link>http://www.balldawg.net/index.php/2012/08/via-apc-misc/</link>
		<comments>http://www.balldawg.net/index.php/2012/08/via-apc-misc/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 19:04:51 +0000</pubDate>
		<dc:creator>Andrew Rankin</dc:creator>
				<category><![CDATA[APC]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Redsleeve Linux]]></category>

		<guid isPermaLink="false">http://www.balldawg.net/?p=513</guid>
		<description><![CDATA[Just a little information about the on board NAND memory on the stock APC: [root@BTLocal sbin]# ./mtdinfo Count of MTD devices:           17 Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6, mtd7, mtd8, mtd9, mtd10, mtd11, mtd12, mtd13, mtd14, mtd15, mtd16 Sysfs interface supported:      yes [root@BTLocal mnt]# cat /proc/mtd dev:    size   erasesize  name mtd0: [...]]]></description>
				<content:encoded><![CDATA[<p>Just a little information about the on board NAND memory on the stock APC:</p>
<pre class="brush: sh">
[root@BTLocal sbin]# ./mtdinfo
Count of MTD devices:           17
Present MTD devices:            mtd0, mtd1, mtd2, mtd3, mtd4, mtd5, mtd6, mtd7, mtd8, mtd9, mtd10, mtd11, mtd12, mtd13, mtd14, mtd15, mtd16
Sysfs interface supported:      yes

[root@BTLocal mnt]# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00d00000 00010000 &quot;filesystem-SF&quot;
mtd1: 00280000 00010000 &quot;kernel-SF&quot;
mtd2: 00050000 00010000 &quot;u-boot-SF&quot;
mtd3: 00010000 00010000 &quot;u-boot env. cfg. 1-SF&quot;
mtd4: 00010000 00010000 &quot;u-boot env. cfg. 2-SF&quot;
mtd5: 00010000 00010000 &quot;w-load-SF&quot;
mtd6: 00100000 00100000 &quot;w-load-NAND&quot;
mtd7: 00900000 00100000 &quot;u-boot env. cfg. 1-NAND&quot;
mtd8: 00900000 00100000 &quot;u-boot-NAND&quot;
mtd9: 00800000 00100000 &quot;kernel-NAND&quot;
mtd10: 00600000 00100000 &quot;initrd-NAND&quot;
mtd11: 10000000 00100000 &quot;filesystem-NAND&quot;
mtd12: 00200000 00100000 &quot;u-boot-logo&quot;
mtd13: 00400000 00100000 &quot;kernel-logo&quot;
mtd14: 40000000 00100000 &quot;android-data&quot;
mtd15: 08000000 00100000 &quot;android-cache&quot;
mtd16: 25900000 00100000 &quot;LocalDisk&quot;
</pre>
<p><span id="more-513"></span></p>
<p>Mounting the android rootfs NAND in RedSleeve:</p>
<pre class="brush: sh">
[root@BTLocal /]# mount -t yaffs2 -oro /dev/mtdblock11 /mnt
[root@BTLocal /]# cd /mnt
[root@BTLocal mnt]# ll
total 256
drwxr-xr-x 1 root root         8192 Dec 31  1999 acct
drwxrwxr-x 1  501         501  8192 Dec 31  1999 bin
drwxrwx--- 1 1000        2001  8192 Dec 31  1999 cache
dr-x------ 1 root root         8192 Dec 31  1999 config
lrwxrwxrwx 1 root root           17 Dec 31  1999 d -&amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; /sys/kernel/debug
drwxrwxr-x 1 1001        1001  8192 Dec 31  1999 data
-rw-rw-r-- 1 1001        1001   139 Jun 22 03:29 default.prop
drwxrwxr-x 1 1001        1001  8192 Jun 22 03:27 dev
lrwxrwxrwx 1 root root           11 Dec 31  1999 etc -&amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; /system/etc
-rwxrwxr-x 1 1001        1001 94092 Jun 22 03:41 init
-rw-rw-r-- 1 1001        1001  1677 Jun 20 22:00 init.goldfish.rc
-rwxrwxr-x 1 1001        1001 19625 Jun 20 22:00 init.rc
drwxr-xr-x 1  508 500  8192 Dec 31  1999 lib
drwxrwxrwx 1 root root         8192 Dec 31  1999 LocalDisk
drw-rw-rw- 1 root root         8192 Aug 17 14:49 lost+found
drwxrwxr-x 1 root        1000  8192 Dec 31  1999 mnt
drwxrwxr-x 1 1001        1001  8192 Jun 22 03:27 proc
drwxrwxr-x 1 1001        1001  8192 Dec 31  1999 sbin
d--------- 1 1000        1000  8192 Dec 31  1999 sdcard
drwxrwxr-x 1 1001        1001  8192 Jun 22 03:27 sys
drwxrwxr-x 1  501         501  8192 May 30  2011 system
drwxrwxr-x 1 root root         8192 Dec 31  1999 udisk
-rw-rw-r-- 1 1001        1001     0 Jun 20 22:00 ueventd.goldfish.rc
-rwxrwxr-x 1 1001        1001  3950 Jun 20 22:00 ueventd.rc
drwxrwxr-x 1  501         501  8192 Dec 31  1999 usr
lrwxrwxrwx 1 root root           14 Dec 31  1999 vendor -&amp;amp;amp;amp;amp;amp;amp;amp;amp;gt; /system/vendor

[root@BTLocal mnt]# df -h
[...]
/dev/mtdblock11       256M  116M  141M  45% /mnt

</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.balldawg.net/index.php/2012/08/via-apc-misc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIA APC: Building the Kernel</title>
		<link>http://www.balldawg.net/index.php/2012/08/via-apc-building-the-kernel/</link>
		<comments>http://www.balldawg.net/index.php/2012/08/via-apc-building-the-kernel/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 13:30:58 +0000</pubDate>
		<dc:creator>Andrew Rankin</dc:creator>
				<category><![CDATA[APC]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[apc.io]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[VIA]]></category>

		<guid isPermaLink="false">http://www.balldawg.net/?p=474</guid>
		<description><![CDATA[[This post is being actively updated so some parts may be incomplete] Lets first take a look at the current kernel before hopping into trying to make a new one.  If you&#8217;ve downloaded the pre-build packages from the APC site and extracted it, the current kernel image is called uzImages.bin, if you&#8217;ve already compiled u-boot [...]]]></description>
				<content:encoded><![CDATA[<p><em>[This post is being actively updated so some parts may be incomplete]</em></p>
<p>Lets first take a look at the current kernel before hopping into trying to make a new one.  If you&#8217;ve downloaded the pre-build packages from the APC site and extracted it, the current kernel image is called uzImages.bin, if you&#8217;ve already compiled u-boot you can see a little more information on it by running the &#8216;mkimage -l&#8217; command:</p>
<pre class="brush: sh">
[rar@ares apc-firmware-v1.0]$ ../apc-io-apc-8750-2740910/u-boot/tools/mkimage -l uzImage.bin
Image Name:   Linux-2.6.32.9-default
Created:      Wed Mar 14 05:32:38 2012
Image Type:   ARM Linux Kernel Image (uncompressed)
Data Size:    2969192 Bytes = 2899.60 kB = 2.83 MB
Load Address: 0x00008000
Entry Point:  0x00008000
</pre>
<p>Things to take note here are the<strong> Load Address</strong> and <strong>Entry Point</strong> fields, they&#8217;re required for making a vmlinuz file into a uImage file and as far as I can tell they&#8217;re device specific.</p>
<p><em>[more coming soon]</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.balldawg.net/index.php/2012/08/via-apc-building-the-kernel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIA APC: Redsleeve Linux Install</title>
		<link>http://www.balldawg.net/index.php/2012/08/via-apc-redsleeve-linux-install/</link>
		<comments>http://www.balldawg.net/index.php/2012/08/via-apc-redsleeve-linux-install/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 13:29:15 +0000</pubDate>
		<dc:creator>Andrew Rankin</dc:creator>
				<category><![CDATA[APC]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Redsleeve Linux]]></category>
		<category><![CDATA[apc.io]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[redsleeve]]></category>
		<category><![CDATA[VIA]]></category>

		<guid isPermaLink="false">http://www.balldawg.net/?p=482</guid>
		<description><![CDATA[[This post is being actively updated so some parts may be incomplete] I was able to boot the stock APC kernel and U-Boot with the redsleeve rootfs on an SD card.  To do so you need to: Create a partition on the SD card in some linux readable format (I used ext3) Extract the redsleeve [...]]]></description>
				<content:encoded><![CDATA[<p><em>[This post is being actively updated so some parts may be incomplete]</em></p>
<p>I was able to boot the stock APC kernel and U-Boot with the redsleeve rootfs on an SD card.  To do so you need to:</p>
<ul>
<li>Create a partition on the SD card in some linux readable format (I used ext3)</li>
<li>Extract the redsleeve rootfs on the card (striping the first layer of the contents of the tar ball)</li>
<li>Extract the kernel_modules_WM8710.120130.1629.tgz (found in the binary apc firmware download) over the rootfs</li>
<li>Modify /etc/fstab to make /dev/mmcblk0p1 your root partition and comment out the /dev/sda1 /boot partition.  Also, change the root partition type to be whatever you made it in step one.</li>
<li>Add /etc/init/ttyS0.conf with the following contents:</li>
</ul>
<pre class="brush: sh">
#
start on stopped rc RUNLEVEL=[2345]
stop on starting runlevel [016]

respawn

pre-start exec /sbin/securetty ttyS0
exec /sbin/agetty -L /dev/ttyS0 115200 vt102
</pre>
<p><span id="more-482"></span></p>
<ul>
<li>Finally move the SD card to your APC and boot the standard kernel with the following options:</li>
</ul>
<pre class="brush: sh">
nandrw r ${kernel-NAND_ofs} 0x1000000 ${kernel-NAND_len}
setenv bootargs mem=512M root=/dev/mmcblk0p1 init=/sbin/init noinitrd ro console=ttyS0,115200n8
bootm 0x1000000
</pre>
<p>This will boot you to a login prompt where you can setup networking and install openssh-server with will allow you to ssh in.</p>
<p>So what do we have?</p>
<pre class="brush: sh">

[root@localhost proc]# lspci
00:01.0 IDE interface: VIA Technologies, Inc. Device 1359
00:02.0 Ethernet controller: VIA Technologies, Inc. VT6120/VT6121/VT6122 Gigabit Ethernet Adapter (rev 84)
00:04.0 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 90)
00:05.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 90)
00:06.0 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 90)

[root@localhost proc]# cat /proc/cpuinfo
Processor : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS : 532.24
Features : swp half thumb fastmult vfp edsp java
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xb76
CPU revision : 7

Hardware : WMT
Revision : 0000
Serial : 0000000000000000

root@localhost proc]# free -m

total used free shared buffers cached
Mem: 449 441 8 0 23 266
-/+ buffers/cache: 151 297
Swap: 0 0 0

[root@BTLocal ~]# cat /proc/mtd
dev: size erasesize name
mtd0: 00d00000 00010000 &quot;filesystem-SF&quot;
mtd1: 00280000 00010000 &quot;kernel-SF&quot;
mtd2: 00050000 00010000 &quot;u-boot-SF&quot;
mtd3: 00010000 00010000 &quot;u-boot env. cfg. 1-SF&quot;
mtd4: 00010000 00010000 &quot;u-boot env. cfg. 2-SF&quot;
mtd5: 00010000 00010000 &quot;w-load-SF&quot;
mtd6: 00100000 00100000 &quot;w-load-NAND&quot;
mtd7: 00900000 00100000 &quot;u-boot env. cfg. 1-NAND&quot;
mtd8: 00900000 00100000 &quot;u-boot-NAND&quot;
mtd9: 00800000 00100000 &quot;kernel-NAND&quot;
mtd10: 00600000 00100000 &quot;initrd-NAND&quot;
mtd11: 10000000 00100000 &quot;filesystem-NAND&quot;
mtd12: 00200000 00100000 &quot;u-boot-logo&quot;
mtd13: 00400000 00100000 &quot;kernel-logo&quot;
mtd14: 40000000 00100000 &quot;android-data&quot;
mtd15: 08000000 00100000 &quot;android-cache&quot;
mtd16: 25900000 00100000 &quot;LocalDisk&quot;

[root@localhost etc]# uname -a

Linux localhost 2.6.32.9-default #14 Wed Mar 14 17:32:30 CST 2012 armv6l armv6l armv6l GNU/Linux

</pre>
<p>If you&#8217;d like the board to always boot redsleeve you&#8217;ll need to modify the u-boot environment:</p>
<pre class="brush: sh">
setenv bootargs mem=512M root=/dev/mmcblk0p1 init=/sbin/init noinitrd ro console=ttyS0,115200n8
setenv redsleeve &quot;nandrw r ${kernel-NAND_ofs} 0x1000000 ${kernel-NAND_len}; bootm 0x1000000&quot;
setenv bootcmd &quot;run redsleeve&quot;
saveenv
</pre>
<p>This will change the env settings and write them to flash, so make sure you have a backup of your default environment if you&#8217;d like to set it back at some point.  You can see the full <a href="http://balldawg.net/files/RedSleeve_VIA_Boot.txt">output from the boot process here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.balldawg.net/index.php/2012/08/via-apc-redsleeve-linux-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIA APC: Building and Exploring Das U-Boot</title>
		<link>http://www.balldawg.net/index.php/2012/08/via-apc-building-and-exploring-das-u-boot/</link>
		<comments>http://www.balldawg.net/index.php/2012/08/via-apc-building-and-exploring-das-u-boot/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 13:06:57 +0000</pubDate>
		<dc:creator>Andrew Rankin</dc:creator>
				<category><![CDATA[APC]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[u-boot]]></category>
		<category><![CDATA[apc.io]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[VIA]]></category>

		<guid isPermaLink="false">http://www.balldawg.net/?p=472</guid>
		<description><![CDATA[[This post is being actively updated so some parts may be incomplete] I don&#8217;t know what the developers working on APC are thinking, but the u-boot code on github does not compile out of the box &#8211; and it&#8217;s not just a difference in environments &#8211; there are actually coding issues.  My guess is that&#8217;s [...]]]></description>
				<content:encoded><![CDATA[<p><em>[This post is being actively updated so some parts may be incomplete]</em></p>
<p>I don&#8217;t know what the developers working on APC are thinking, but the u-boot code on github does not compile out of the box &#8211; and it&#8217;s not just a difference in environments &#8211; there are actually coding issues.  My guess is that&#8217;s not the latest version or at least not the version they shipped and they haven&#8217;t taken the time to update it on github.   Also note that they didn&#8217;t just &#8220;add on a board&#8221; as described in the README that comes with the boot loader, they went and hacked up the actual boot loader code.  On top of all this, it&#8217;s a <strong>very</strong> old version of u-boot and enough changes have been made that it&#8217;s not exactly a &#8220;copy over and hope for the best&#8221; type of situation.</p>
<p><strong>Building U-Boot</strong></p>
<p>All the whining aside, the errors that need to be addressed are:</p>
<ul>
<li>In u-boot/board/wmt/wmt.c, you&#8217;ll need to add a dummy method called &#8216;nand_init&#8217;, otherwise you&#8217;ll get linker complaints:</li>
</ul>
<pre class="brush: cpp">

void nand_init(void) {}

</pre>
<p><span id="more-472"></span></p>
<ul>
<li>It&#8217;s missing the file u-boot/include/_exports.h, I downloaded a v1.1.4 package of u-boot and copied it over.</li>
<li>In u-boot/arm920t/wmt/mmc.c, the method &#8220;mmc_get_dev&#8221; throws and error since it doesn&#8217;t return a value by default, I added a &#8220;return 0&#8243; on line 1261.</li>
<li>Finally, you&#8217;ll need to edit the Makefile and set CROSS_COMPILE = arm-none-eabi- for the arm architecture &#8211; or just set the environment variable before running a make.</li>
</ul>
<p>At this point the following should build the default u-boot:</p>
<pre class="brush: sh">

export PATH=$PATH:$MYTOOLS/bin
cd $CURRENT_PATH/u-boot/
make wmt_config
make all -j2
</pre>
<p>You can try out what you&#8217;ve built before flashing it to SF:</p>
<pre class="brush: sh">
WMT # nfs 0x1000000 192.168.15.250:/nfsroot/u-boot.bin
EEP-less strapping = TRUE

File transfer via NFS from server 192.168.15.250; our IP address is 192.168.15.251
Filename &#039;/nfsroot/u-boot.bin&#039;.
Load address: 0x1000000
Loading: *.################################################################
done
Bytes transferred = 325188 (4f644 hex)
WMT # go 0x10000000
## Starting application at 0x10000000 ...
</pre>
<p><strong>Exploring U-Boot<br />
</strong><br />
Lets first take a look at the u-boot environment:</p>
<pre class="brush: sh">

WMT # printenv

ipaddr=192.168.0.2
ethaddr=90:2B:34:52:F7:0D
serverip=192.168.0.1
gatewayip=192.168.0.1
netmask=255.255.255.0
memtotal=460M
mmcid=0
mbsize=52M
scriptcmd=mmcinit ${mmcid}; fatload mmc ${mmcid}:1 0 scriptcmd; if iminfo 0; then autoscr 0; fi
wmt.display.logoaddr=500000
logocmd=nandrw r ${wmt.nfc.mtd.u-boot-logo} ${wmt.display.logoaddr} 180000;nandrw r ${wmt.nfc.mtd.kernel-logo} ${wmt.kernel.animation.addr} 200000;display show
wmt.gpo.lcd=0:1:0:d8110040:d8110080:d81100c0
wmt.i2c.param=0:1,1:1
wmt.eth.param=0x11
wmt.ui.storage=7
wmt.vd.debug=0
wmt.camera.param=1:0:0
wmt.gpo.cmos=1:0:3:D8110040:D8110080:D81100C0
wmt.webview.param=11
wmt.audio.i2s=vt1603:f2:f2:f1:f1:100
wmt.audio.rate=single:44100
wmt.pwbn.param=100:100:100
wmt.l2c.param=1:3e420000:70000007
wmt.display.hdmi.vmode=auto
wmt.sd0.param=1:0
wmt.sd1.param=0:0
wmt.sd2.param=0:0
wmt.ge.param=1:-1:0:0
android_bootargs=init=/init
mmcargs=setenv bootargs mem=${memtotal} root=/dev/ram0 rw initrd=0x01400000,32M console=ttyS0,115200n8 mbtotal=${mbsize} ${platform_bootargs}
mmcboot=mmcinit ${mmcid}; fatload mmc ${mmcid}:1 1000000 uzImage.bin 400000; fatload mmc ${mmcid}:1 1400000 initrd.gz 400000; if iminfo 0x1000000; then run mmcargs; bootm 0x1000000; fi
wmt.mali.param=1:4:-1:-1
wmt.wifi.param=5370
wmt.gpo.wifi=6:1:6:d8110040:d8110080:d81100C0
nandargs=setenv bootargs mem=${memtotal} root=${filesystem-NAND_mtd} noinitrd rootfstype=yaffs2 rw console=ttyS0,115200n8 mbtotal=${mbsize} ${android_bootargs} ${platform_bootargs}
nandboot=nandrw r ${kernel-NAND_ofs} 0x1000000 ${kernel-NAND_len}; if iminfo 0x1000000; then run nandargs; bootm 0x1000000; fi
bootcmd=run scriptcmd; run mmcboot; echo No MMC card found; run nandboot; echo No kernel found
wmt.plla.param=1:800:1,2:5,2:3
wmt.io.bat=0
wmt.io.ts=0
wmt.io.gsensor=0:40:1:-1:0:-1:2:-1:4:1
wmt.camera.i2c_gpio=1:6:6:d8110017:d8110057:d8110097:d81100D7:d8110497:4:4:d8110017:d8110057:d8110097:d81100D7:d8110497
kernel-NAND_mtd=/dev/mtdblock9
kernel-NAND_ofs=0x1300000
kernel-NAND_len=0x800000
initrd-NAND_mtd=/dev/mtdblock10
initrd-NAND_ofs=0x1b00000
initrd-NAND_len=0x600000
filesystem-NAND_mtd=/dev/mtdblock11
filesystem-NAND_ofs=0x2100000
filesystem-NAND_len=0x10000000
wmt.nfc.mtd.u-boot-logo=0x12100000
wmt.nfc.mtd.kernel-logo=0x12300000
stdin=serial
stdout=serial
stderr=serial
ver=U-Boot 1.1.4 (Feb 3 2012 - 17:41:10)

Environment size: 2344/65531 bytes
</pre>
<p>So it looks like they have two boot methods, mmcboot and nandboot it tries the MMC and if it fails it boots NAND &#8211; makes sense as they have you try to recover your device using a memory card:</p>
<pre class="brush: sh">

bootcmd=run scriptcmd; run mmcboot; echo No MMC card found; run nandboot; echo No kernel found
</pre>
<p><em>[more coming soon]</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.balldawg.net/index.php/2012/08/via-apc-building-and-exploring-das-u-boot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIA APC: Building an ARM Toolchain</title>
		<link>http://www.balldawg.net/index.php/2012/08/via-apc-building-an-arm-toolchain/</link>
		<comments>http://www.balldawg.net/index.php/2012/08/via-apc-building-an-arm-toolchain/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 13:06:13 +0000</pubDate>
		<dc:creator>Andrew Rankin</dc:creator>
				<category><![CDATA[APC]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[apc.io]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[gcc]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[VIA]]></category>

		<guid isPermaLink="false">http://www.balldawg.net/?p=470</guid>
		<description><![CDATA[For someone such as myself who has never build software for a platform other than the one I was currently on, this was an interesting experience.  You&#8217;ll need to either build an ARM toolchain yourself or grab a pre-built version. I tried and was successful at building out a gcc, gdb, binutils, and newlib toolchain [...]]]></description>
				<content:encoded><![CDATA[<p>For someone such as myself who has never build software for a platform other than the one I was currently on, this was an interesting experience.  You&#8217;ll need to either build an ARM toolchain yourself or grab a pre-built version. I tried and was successful at <a href="http://www.kunen.org/uC/gnu_tool.html" target="_blank">building out a gcc, gdb, binutils, and newlib toolchain</a> for the &#8216;arm-none-eabi&#8217; architecture only to have u-boot tell me it used abi version 4 when abi version 0 was required while linking. Seems this has come up <a title="Seems this has come up before" href="http://www.denx.de/wiki/DULG/SourceObjectHasEABIVersion4ButTargetHasEABIVersion0" target="_blank">before</a>, unfortunately the &#8220;solution&#8221; on that page isn&#8217;t particularly descriptive for a cross-platform noob.  After some digging I found the option &#8220;&#8211;with-abi=apcs-gnu&#8221; to force the abi version back to &#8220;apcs-gnu&#8221;, or version 0.  You&#8217;ll also need to force gcc to use software float with the &#8220;&#8211;with-float=soft&#8221; option. I would have figured this would force software float, but apparently I had to add a &#8220;&#8211;with-arch=armv6&#8243; to really persuade it to happen.  So follow the directions at the link above and change the configure for gcc to (also note I used newlib v1.17):</p>
<pre class="brush: sh">

../../src/gcc-4.3.3/configure --target=arm-none-eabi --prefix=/home/rar/beertronics/beertronics-apcio/toolkits/bt-arm-toolkit --enable-interwork --enable-multilib --enable-languages=&quot;c,c++&quot; --with-newlib --with-headers=../../src/newlib-1.17.0/newlib/libc/include --with-abi=apcs-gnu --with-float=soft --with-arch=armv6
</pre>
<p>If you don&#8217;t want to compile your own, you&#8217;re welcome to <a href="http://www.balldawg.net/files/bt-arm-toolkit.tar.bz2">download mine</a>, it&#8217;s provided with zero warranty.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.balldawg.net/index.php/2012/08/via-apc-building-an-arm-toolchain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIA APC: UART/Serial</title>
		<link>http://www.balldawg.net/index.php/2012/08/via-apc-uartserial/</link>
		<comments>http://www.balldawg.net/index.php/2012/08/via-apc-uartserial/#comments</comments>
		<pubDate>Fri, 17 Aug 2012 13:05:41 +0000</pubDate>
		<dc:creator>Andrew Rankin</dc:creator>
				<category><![CDATA[APC]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[apc.io]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[uart]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[VIA]]></category>

		<guid isPermaLink="false">http://www.balldawg.net/?p=468</guid>
		<description><![CDATA[Before we can modify the kernel, filesystem or u-boot itself on the unit we need to get serial access to it.  There is header labeled &#8220;UART&#8221; and that is just what it is, I happened to have an Arduino USBSerial light hanging out which works great, you&#8217;ll want to set your serial console to 115200 [...]]]></description>
				<content:encoded><![CDATA[<p>Before we can modify the kernel, filesystem or u-boot itself on the unit we need to get serial access to it.  There is header label<a href="http://www.balldawg.net/files/uart.jpg"><img class="alignright" title="UART Serial header with Arduino USBSerial Light" src="http://www.balldawg.net/files/uart.jpg" alt="" width="248" height="332" /></a>ed &#8220;UART&#8221; and that is just what it is, I happened to have an <a href="http://arduino.cc/en/Main/USBSerial">Arduino USBSerial light</a> hanging out which works great, you&#8217;ll want to set your serial console to 115200 baud, 8n1.  The <a href="http://www.spinics.net/linux/fedora/fedora-arm/msg03770.html">pinout</a> appears to be:</p>
<p>1 VCC (3.3V)<br />
2 TX<br />
3 RX<br />
4 ?<br />
5 ?<br />
6 Gnd</p>
<p>The board is a bit moody on when you can hook the serial to USB convertor to it, if you have no power to the board it seems the board will be powered by the UART header which looks to confuse it since the power light comes on even thought it&#8217;s not actually on.  I ended up having to plug in the APC and power it on, then plug in the UART header &#8211; same goes if you want to hard reset it outside of a software restart.  You can stop u-boot&#8217;s autoboot by hitting a key when prompted, after which you&#8217;ll get a u-boot prompt!  Running &#8216;version&#8217; confirms u-boot v1.1.4 and also confirms that <a href="http://www.wondermedia.com.tw/en/index.jsp">WonderMedia Technologies, Inc.</a> edited this version of u-boot and have written the drivers for the board to run that WM8750 chip.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.balldawg.net/index.php/2012/08/via-apc-uartserial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VIA APC: UART, ARM Toolchain, Kernel &amp; U-Boot</title>
		<link>http://www.balldawg.net/index.php/2012/08/via-apc-arm-toolchain-kernel-u-boot/</link>
		<comments>http://www.balldawg.net/index.php/2012/08/via-apc-arm-toolchain-kernel-u-boot/#comments</comments>
		<pubDate>Wed, 15 Aug 2012 23:07:49 +0000</pubDate>
		<dc:creator>Andrew Rankin</dc:creator>
				<category><![CDATA[APC]]></category>
		<category><![CDATA[ARM]]></category>
		<category><![CDATA[Redsleeve Linux]]></category>
		<category><![CDATA[u-boot]]></category>
		<category><![CDATA[apc.io]]></category>
		<category><![CDATA[arm]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[redsleeve]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[uart]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[VIA]]></category>

		<guid isPermaLink="false">http://www.balldawg.net/?p=397</guid>
		<description><![CDATA[So you snagged one of those new apc.io boards.  Cool. If you&#8217;re like me you&#8217;re going to want to hack the heck out of it.  In my case I want to use it for a project I&#8217;m working on and don&#8217;t really want to run Android on it.   I&#8217;m going to go for redsleeve Linux [...]]]></description>
				<content:encoded><![CDATA[<p>So you snagged one of those new apc.io boards.  Cool.</p>
<p>If you&#8217;re like me you&#8217;re going to want to hack the heck out of it.  In my case I want to use it for a project I&#8217;m working on and don&#8217;t really want to run Android on it.   I&#8217;m going to go for <a href="http://www.redsleeve.org/" target="_blank">redsleeve Linux</a> since everything else in the project is build on CentOS/RHEL.  To get started with hacking the board I downloaded the pre-build software that is available at <a href="http://apc.io/library/">APC.IO&#8217;s Library Section</a> for a reference, and source files they&#8217;ve uploaded to github.  Since we&#8217;re building for an ARM platform on an Intel x86_64 (in my case) platform, we&#8217;ll also need to locate or build an ARM toolchain.</p>
<p>I&#8217;ve split up each section into their own posts since this page was getting a bit long:</p>
<ul>
<li><a href="http://www.balldawg.net/?p=468">VIA APC Serial/UART Access</a></li>
<li><a href="http://www.balldawg.net/?p=470">Building an ARM Tool chain for the VIA APC</a></li>
<li><a href="http://www.balldawg.net/?p=472">Exploring and Building the VIA APC U-Boot</a></li>
<li><a href="http://www.balldawg.net/?p=474">Building the Stock VIA APC Kernel</a></li>
<li><a href="http://www.balldawg.net/?p=482">Redsleeve Linux on the VIA APC</a></li>
<li><a href="http://www.balldawg.net/?p=513">Misc Informaton</a></li>
</ul>
<p>These posts are being actively update as I explore the board, please be aware the information is being provided without any warranty.</p>
<p>Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.balldawg.net/index.php/2012/08/via-apc-arm-toolchain-kernel-u-boot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using HAProxy and Keepalived for HA Puppet</title>
		<link>http://www.balldawg.net/index.php/2010/12/haproxy-keepalived-puppet/</link>
		<comments>http://www.balldawg.net/index.php/2010/12/haproxy-keepalived-puppet/#comments</comments>
		<pubDate>Thu, 02 Dec 2010 19:30:43 +0000</pubDate>
		<dc:creator>Andrew Rankin</dc:creator>
				<category><![CDATA[Server Management]]></category>
		<category><![CDATA[Server Monitoring]]></category>
		<category><![CDATA[HAProxy]]></category>
		<category><![CDATA[keepalived]]></category>
		<category><![CDATA[Puppet]]></category>

		<guid isPermaLink="false">http://www.balldawg.net/?p=359</guid>
		<description><![CDATA[I&#8217;ve had a &#8220;backup&#8221; puppet server for some time now, but the fail-over was completely manual. Meaning if the main puppet server failed, I&#8217;d actually need to change DNS to point to the other server. This if fine for environments where a bit of downtime does not hurt, but in a production environment it&#8217;s less [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve had a &#8220;backup&#8221; puppet server for some time now, but the fail-over was completely manual.  Meaning if the main puppet server failed, I&#8217;d actually need to change DNS to point to the other server.  This if fine for environments where a bit of downtime does not hurt, but in a production environment it&#8217;s less than ideal.   When I had a bit of spare time recently I decided to implement an automatic fail over for our environment.  To do this I decided to use HAProxy for the load balancing and keepalived to manage a virtual IP.<br />
<img alt="" src="http://www.balldawg.net/files/diagram_vip.png" title="Network Layout" class="aligncenter" width="628" height="203" /><br />
<span id="more-359"></span><br />
This setup assumes that when you setup your puppet master you didn&#8217;t use the actual machine name as the puppet server name in your puppet.conf.  For example, in my case I used puppet.domain.com, as apposed to the actual DNS name of the machine it lives on.  puppet.domain.com is just a CNAME to the machines DNS name, but since web based SSL is based off the DNS name you are connecting too I can float different machines behind puppet.domain.com and the client is none the wiser.  To do it you&#8217;ll need to sign puppet.machine.com with puppetca and mirror your CA to your backup machine.  </p>
<p>To make this setup work, first you&#8217;ll need a virtual IP to point puppet.machine.com at and setup keepalived to manage it.  The keepalived setup was fairly straight forward, both machines were on the same network so I just picked an IP and configured keepalived on each machine.  In my case the configurations were as follows:</p>
<pre class="brush: php">
vrrp_instance VI_1 {
        interface bond0
        state MASTER
        virtual_router_id 51
        priority 101
        authentication {
            auth_type PASS
            auth_pass PASSWORD
        }
        virtual_ipaddress {
                192.168.33.61/26 dev bond0
        }
        notify_master /sw/keepalived/scripts/notify_master.sh
        notify_backup /sw/keepalived/scripts/notify_backup.sh
        notify_fault /sw/keepalived/scripts/notify_backup.sh
}
</pre>
<p>Basically for bonded interface 0, add the virtual interface of 192.168.33.61/26, and this machine has a priority of 101, or master.  The three entries at the bottom are what to run if the machine should fail over or fail back.  The other machine has a similar setup, except it has the priority of 100, or backup.</p>
<p>After starting up keepalived on both machines, they negotiate and the machine with the higher priority ends up with the IP enabled on bond0 as a secondary address.</p>
<p>Next I needed something to manage fail-over of the puppet &#8220;service&#8221; should the interface/IP stay up and just the puppet service fail.  For this I decided to use HAProxy.  It&#8217;s configuration is, again, fairly straight forward.  You need to setup a front end to listen on the default puppet master port, and a back end that has both your puppet master machines in it.  The configuration is as follows:</p>
<pre class="brush: php">
global
    log         127.0.0.1 local2
    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     10000
    user        haproxy
    group       haproxy
    daemon
    stats socket /var/lib/haproxy/stats

defaults
    log                     global
    option                  redispatch
    retries                 3
    timeout http-request    10s
    timeout queue           1m
    timeout connect         10s
    timeout client          1m
    timeout server          1m
    timeout http-keep-alive 10s
    timeout check           10s
    maxconn                 8000

frontend        puppet 192.168.33.61:8140
    mode tcp
    default_backend     puppet0

backend puppet0
    mode        tcp
    option      ssl-hello-chk
    balance     roundrobin
    server      server1 192.168.33.17:8140 check
    server      server2 192.168.33.27:8140 check backup
</pre>
<p>This configuration and the installation of haproxy is mirrored on the second server.  </p>
<p>Now if you recall I had some scripts that were to run should keepalived feel the need to fail to/from the backup server.  Because haproxy binds to the address on start up, you can&#8217;t have it running on your backup server.  To work around the script is run upon keepalived starting that IP on the system, the script starts haproxy.</p>
<p>With the complicated part done, it was just a matter of mirroring my puppet manifests and files between the two machines, and making sure they stay up to date.  Ideally you&#8217;d have them on some sort of NAS which is just mounted on both machines which would make them being out of date impossible.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.balldawg.net/index.php/2010/12/haproxy-keepalived-puppet/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>NVidia, Stereo (3D) and LCDs</title>
		<link>http://www.balldawg.net/index.php/2010/09/nvidia-stereo-3d-and-lcds/</link>
		<comments>http://www.balldawg.net/index.php/2010/09/nvidia-stereo-3d-and-lcds/#comments</comments>
		<pubDate>Wed, 01 Sep 2010 13:35:22 +0000</pubDate>
		<dc:creator>Andrew Rankin</dc:creator>
				<category><![CDATA[Linux Workstations]]></category>
		<category><![CDATA[3D]]></category>
		<category><![CDATA[Alienware]]></category>
		<category><![CDATA[NVidia]]></category>
		<category><![CDATA[Stereo]]></category>

		<guid isPermaLink="false">http://www.balldawg.net/?p=300</guid>
		<description><![CDATA[Back in December 2009 NVidia finally released a graphics driver for Linux that supported Stereo/3d graphics on a few LCD monitors. Since then we have purchased a few different brands of monitors but have decided to standardize on the NVidia supported Alienware AW2310. The Monitor appears very well built and has a fantastic image. When [...]]]></description>
				<content:encoded><![CDATA[<p>Back in December 2009 NVidia finally released a graphics driver for Linux that supported Stereo/3d graphics on a few LCD monitors.  Since then we have purchased a few different brands of monitors but have decided to standardize on the NVidia supported <a href="http://accessories.us.dell.com/sna/products/Displays/productdetail.aspx?c=us&amp;l=en&amp;s=dhs&amp;cs=19&amp;sku=320-8846" target="_blank">Alienware AW2310</a>.  The Monitor appears very well built and has a fantastic image.  When the driver was initially released there was some confusion on how to get the Stereo working on Linux under CentOS or RHEL 5.  Since it&#8217;s quite simple, I thought I&#8217;d share our configuration.<span id="more-300"></span></p>
<p>First grab the newest driver from NVidia, and install in whichever kernel you intend to run on the workstation.  Next modify your xorg.conf, adding:</p>
<pre class="brush: php">
Section &quot;Extensions&quot;
   Option         &quot;Composite&quot; &quot;false&quot;
EndSection
</pre>
<p>This section is required for running any Stereo, whether it be on a CRT or an LCD on RHEL 5.  For the description of what it does, I&#8217;d suggesting heading over to <a href="http://wiki.archlinux.org/index.php/Composite" target="_blank">Archlinux&#8217;s Wiki</a>.</p>
<p>Next you&#8217;ll need to setup the Screen section to allow for Stereo (Mode of 10 with LCDs):</p>
<pre class="brush: php">
Section &quot;Screen&quot;
   Identifier     &quot;Screen0&quot;
   Device         &quot;Videocard0&quot;
   Monitor        &quot;Monitor0&quot;
   DefaultDepth    24
   Option         &quot;metamodes&quot; &quot;DFP: 1920x1080_120 +0+0&quot;
   Option         &quot;Stereo&quot; &quot;10&quot;
   SubSection     &quot;Display&quot;
      Depth       24
      Modes      &quot;nvidia-auto-select&quot;
   EndSubSection
EndSection
</pre>
<p>You&#8217;ll also need your monitor and video card setup correctly:</p>
<pre class="brush: php">
Section &quot;Monitor&quot;
   Identifier     &quot;Monitor0&quot;
   VendorName     &quot;Alienware&quot;
   ModelName      &quot;AW2310&quot;
   HorizSync       30.0 - 140.0
   VertRefresh     56.0 - 120.0
   Option         &quot;DPMS&quot;
EndSection

Section &quot;Device&quot;
   Identifier     &quot;Videocard0&quot;
   Driver         &quot;nvidia&quot;
   VendorName     &quot;Videocard vendor&quot;
   BoardName      &quot;NVIDIA Quadro FX (generic)&quot;
EndSection
</pre>
<p>At this resolution there is not enough bandwidth in a single channel DVI cable to run Stereo, so you will need a dual channel cable.  Take note that if you run the system through a KVM, it too will need to support dual channel.  I have a single setup running the <a href="http://www.iogear.com/product/GCS1782/" target="_blank">IOGear GCS1782</a> and it has functioned flawlessly so far.</p>
<p>For a list of supported hardware, hit up <a href="http://www.nvidia.com/object/3d-vision-requirements.html" target="_blank">NVidia&#8217;s site</a>.  Don&#8217;t forget to order your <a href="http://www.nvidia.com/object/product_geforce_3D_VisionKit_us.html" target="_blank">3D Vision Kit</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.balldawg.net/index.php/2010/09/nvidia-stereo-3d-and-lcds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Parallel BZIP2: pbzip2</title>
		<link>http://www.balldawg.net/index.php/2010/07/parallel-bzip2-pbzip2/</link>
		<comments>http://www.balldawg.net/index.php/2010/07/parallel-bzip2-pbzip2/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 18:53:22 +0000</pubDate>
		<dc:creator>Andrew Rankin</dc:creator>
				<category><![CDATA[Server Management]]></category>
		<category><![CDATA[bzip2]]></category>
		<category><![CDATA[compression]]></category>

		<guid isPermaLink="false">http://www.balldawg.net/?p=321</guid>
		<description><![CDATA[I find myself compressing files for archival purposes constantly &#8211; today I was sitting, waiting on one such compression on a SMP box and thought it seems silly that bzip2 does not use more than one CPU. After a quick flip through the man page for bzip2 I found no way to force it to [...]]]></description>
				<content:encoded><![CDATA[<p>I find myself compressing files for archival purposes constantly &#8211; today I was sitting, waiting on one such compression on a SMP box and thought it seems silly that bzip2 does not use more than one CPU.  After a quick flip through the man page for bzip2 I found no way to force it to use more than one core.  A quick web search yielded pbzip2 (<a href="http://compression.ca/pbzip2/">http://compression.ca/pbzip2/</a>) &#8211; another project that does indeed allow you to use more than one CPU for compress and decompression of bzip2 files.  A quick test showed a huge reduction in compression time:<span id="more-321"></span></p>
<p>Using 1 Core:</p>
<pre class="brush: sh">
[user@server source]$ pbzip2 -p1 -v -m1000 source.tar
Parallel BZIP2 v1.1.1 - by: Jeff Gilchrist [http://compression.ca]
[Apr. 17, 2010]             (uses libbzip2 by Julian Seward)

# CPUs: 1
BWT Block Size: 900 KB
File Block Size: 900 KB
Maximum Memory: 1000 MB
-------------------------------------------
File: 1 of 1
Input Name: source.tar
Output Name: source.tar.bz2

Input Size: 445163520 bytes
Compressing data (no threads)...
Output Size: 80063773 bytes
-------------------------------------------

Wall Clock: 95.100318 seconds
</pre>
<p>Using 64 Cores:</p>
<pre class="brush: sh">
[user@server source]$ pbzip2 -p64 -v -m1000 source.tar
Parallel BZIP2 v1.1.1 - by: Jeff Gilchrist [http://compression.ca]
[Apr. 17, 2010]             (uses libbzip2 by Julian Seward)

# CPUs: 64
BWT Block Size: 900 KB
File Block Size: 900 KB
Maximum Memory: 1000 MB
-------------------------------------------
File: 1 of 1
Input Name: source.tar
Output Name: source.tar.bz2

Input Size: 445163520 bytes
Compressing data...
Output Size: 80063773 bytes
-------------------------------------------

Wall Clock: 3.795763 seconds
</pre>
<p>Needless to say I&#8217;ve found a new utility for my compression needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.balldawg.net/index.php/2010/07/parallel-bzip2-pbzip2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
