Sunday, March 24, 2013

iOS 1, Android 0

I have both iOS and Android devices and both have their strengths. I have a new LG Android phone that didn't come with Jelly Bean and have been waiting for it. I finally got the over-the-air update notification that Jelly Bean (4.1.2) was ready for download on 3/23/13. A long time after it's October 2012 release.

When Apple release iOS it releases directly to compatible devices. Boom -- done. When Android releases, the phone vendors have to work with it (if they even decide to), then the carriers have to approve it, then it's staged to be released to users. Apple got this one right.

Tuesday, January 22, 2013

Raspberry Pi


I was pleasantly surprised to find out that Raspberry Pi boards (http://www.raspberrypi.org/faqs) are no longer on a forever backlog. I got mine from element 14/newark.

One surprise was that the first SD card I loaded with Linux and tried to boot from failed with:


mmc0: controller never released inhibit bit(s)
mmc0: timeout waiting for hardware interrupt

Checked out an SD card compatibility page: http://elinux.org/RPi_SD_cards and bought one that worked.

Saturday, July 9, 2011

UCLA Embedded Course Overview

UCLA extension offers a 12 week evening course (Engineering x457.55) on programming embedded processors. Students use a Texas Instruments ARM evaluation kit which includes the processor mounted on an evaluation board with a Windows IDE to program the ARM chip.



The board has a 32 bit ARM chip running at up to 50 MHz. It has 64KB of flash, 8 KB of SRAM, hardware timers, digital and analog I/O. The board draws its power from the USB interface which also serves to program, debug and support a separate RS-232 style interface.

The course starts with writing a hardware abstraction layer (HAL) in C to set up hardware timers and I/O for the button and potentiometer. Since there isn't an operating system, the programmer must configure the board according to his needs including setting the clock speed of the CPU itself. The C main() method is called from a small bit of assembler that sets up the stack, heap and interrupt vectors.

Bugs frequently manifest with a hardware interrupt and no stack trace. One learns how to use the JTAG debugger to not only perform standard software debugging but to also set and query arbitrary memory addresses. This includes setting up or querying hardware.

The course then covers common design patterns for handling multiple I/O events. The common pattern we used was to code up an event loop where the hardware interrupts were mapped into events. To send a debugging printf() required that we set up the hardware for baud rate, character size and parity; load the first character into the outgoing FIFO; service the transmission complete interrupt and load the next character.

The course was wrapped up by replacing our event loop with a small, real time operating system (RTOS). We retained the assembly initialization, our HAL setup and interrupt routines but now set up semaphores, queues and tasks (threads) to partition the work. The RTOS is started as the last line of main() as opposed to having an operating system load the application.

This was an excellent introduction to the very different world of embedded systems. If you've wanted to play with hardware or embedded software, this is a great way to start.

Friday, May 20, 2011

Ubuntu server minimal gnome setup

If you set up Ubuntu server 10.04 LTS, you may be surprised to learn that it's a command-line system by default. If you'd like to set up some minimal GUI tools you'll need to add some packages.

First a command line cheat sheet:
  • apt-get update
    • Update the system's list of packages
  • apt-cache show package-name
    • Show what will be installed
  • dpkg -S pathname
    • Find out what package supplies pathname
  • apt-get install package-name
    • Install a package
Get started by installing the basics:
sudo apt-get update
sudo apt-get install gnome-core \
                     gnome-themes-selected \
                     xserver-xorg \
                     x-window-system-core

You can now flip into X with "startx" and log out to return to the command line. If you'd also like the graphical login screen, add:
sudo apt-get install gdm
sudo /etc/init.d/gdm start

Graphical packages that you may wish to add are:
  • gnome-system-tools
    • User management
  • update-manager
    • Update packages
  • synaptic
    • Find and add packages
Additional information can be found in the dated entry: How to install GNOME on Ubuntu Server

Thursday, March 4, 2010

ZFS endian neutrality

One of the draws of ZFS is that a disk can be created on one machine architecture (say Intel) and used on another like Sparc. One has to be careful for this to work however.

The disk must also have an endian neutral partitioning scheme like EFI. If you use another partitioning scheme like Solaris VTOC, ZFS will work just fine on a single architecture but fail when taken to a different endian machine.

On Solaris, the fix was to run format with the -e (expert) field. -e enables both using EFI formats as well as removeable devices like a USB flash drive. See the OpenSolaris Bible (Ch. 7 and 8) and the System Administration Guide: Devices and File Systems.

Another gotcha is that some machines can't boot from an EFI formatted drive so that can complicate moving root disks between architectures.

Friday, February 19, 2010

NFS write performance

In prior posts, I've complained about the poor NFS write performance I've seen. A bit of research later, I've discovered that it's because OpenSolaris is strict about syncing NFS writes to disk (ref: NFS and ZFS, a fine combination)

There are ways to improve the time (ref: Disabling the ZIL, Don't) but the prevailing view is to put the ZIL on a separate device from the main ZFS data. I decided to give it a try using a 16 GB Sony USB flash disk.

I couldn't get it to work because the flash drive kept getting ZFS errors (ref: Bug 14676 – ZFS pool fails on Sony USB Flash drive - device disappears during use). A different flash drive worked but was too slow to help as a separate log device. Maybe I'll have to break down and buy a SATA flash drive. In the mean time, SMB is working out.

Saturday, February 6, 2010

OpenSolaris Realtek Network Interface Redux

In my last post, I tried using the "gani" driver for my Realtek RTL8111/8168B Gigabit network interface. In OpenSolaris bug 6892693, they patched the original driver so I decided to try the update.

I switched to the development repository but I couldn't find a way to get the package system to install the rge driver by itself. I set up another boot environment for the entire dev tree and updated to rev 131. I played around a bit with the dev boot environment but it was too buggy for me. I then copied /kernel/drv/rge and /kernel/drv/amd64/rge back to my stable boot environment and replaced the original rge drivers.

The new drivers worked reliably but didn't help the NFS transfer rate. I did find that scp (secure copy over ssh) clocked in much faster at 22 MB/sec. so I decided to set up SMB file shares.

If you haven't already bought it, the OpenSolaris Bible has great history and timesaving advise for setting up SMB and other parts of OpenSolaris. Using Sun's kernel implementation of SMB, I also got 24 MB second. I have to see if I can find tuning advise for NFS.