Tuesday, July 15, 2014

Converting VirtualBox VMs to Parallels

I sometimes get VM "appliances" in VirtualBox format. I prefer Parallels and thankfully the conversion isn't difficult.

To convert the VirtualBox .vdi file to an .hdd file:
  • Start Parallels as it's services will be needed
  • From the command line run: 
    • /Applications/Parallels\ Desktop.app/Contents/MacOS/prl_convert .vdi --allow-no-os
This created a "naked" disk that doesn't have the wrapper virtual machine definition that Parallels needs. To make the wrapper, in Parallels:
  • Add a new virtual machine
  • Install from a DVD/image file
  • Continue without a source (iso)
  • Select the OS for the wrapper (Ubuntu)
  • Name it and select customize settings before installation
Even though you're only part way through the definition of the VM, the disk files are already there. Find the Parallels .pvm file in the Finder and show contents. 
  • Move the .hdd you created from the convert step into it
  • Choose hardware—>Hard Disk 1
  • Change the source to the converted .hdd
  • Set other options to suit
Boot your new VM and install Parallels tools.

Monday, March 25, 2013

Chrome browser crash w/Jelly Bean

I updated to Jelly Bean (4.1.2) the other day and it appeared to go well until I tried to use the Chrome browser. It would flash a blank screen and silently crash. I had installed it under ICS but now it is a system app and can't be uninstalled.

The solution, thanks to Ting support, was to go to app settings --> Chrome and uninstall updates. Chrome then worked. It continued working after I went to the Play Store and reinstalled the updates.

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.