GPS for NTP Time Sync - Success with Voyage and ALIX

| |

Following up my last blog post, I have finally got a Garmin GPS18/USB unit from my friend working in Asia Link to test for time sync for NTP. Right now, I have an ALIX board running Voyage Linux 0.4. It is an ideal platform to test the kernel support in Voyage with the USB-based GPS device.

Voyage kernel immediately recognizes GPS18/USB device at boot, it connects to /dev/ttyUSB0 according to dmesg:

garmin_gps 1-3:1.0: Garmin GPS usb/tty converter detected
usb 1-3: Garmin GPS usb/tty converter now attached to ttyUSB0
usbcore: registered new interface driver garmin_gps
drivers/usb/serial/garmin_gps.c: garmin gps driver v0.28

First, install the required Debian package for gps and ntp:

apt-get install gpsd gpsd-clients ntp ntp-simple
gpsd-clients package provides client utility programs to interact with gpsd for getting GPS data from the device. Since the client program includes xgps that requires X libraries, around 30MB will be consumed after you install them.

Virtualization in Debian Etch (Part 4 - Linux-VServer)


In the past virtualization article series (Part 1 - UML, 2 - KVM, and 3 - Xen), we have examined how different virtualization technology available in Debian Etch. In part 4, we will explore Linux-VServer. According to its website, Linux-VServer provides virtualization by accomplishing kernel level isolation. Simply speaking, Linux-VServer virtualizes the Linux kernel so that Virtual Private Servers (VPS) run independently with no knowledge of one another. Linux-VServer achieves user-space isolation through a set of modifications to the Linux kernel.

Follow this step-by-step instructions, you will be able to:

  1. install Linux-Vserver kernel and utility tools from the Etch repository, without building from source files or compilation of kernel
  2. create virtual server and install Debian Etch on it, using the newvserver tool
  3. start, run and manage virtual server
  4. know the tuning and operation tips for running virtual server
  5. compare the performance of difference virtualization technologies - UML, KVM, Xen and Linux-VServer

Virtualization in Debian Etch (Part 3 - Xen)


In Part 1 and Part 2, we have explored running virtual machines using UML and KVM and benchmarked their performance comparing to the real machine. In Part 3, we will investigate Xen. If you are not familiar with Xen, here is the description from KernelNewbies

Xen is a hypervisor based virtualization technology originating at the University of Cambridge 
nowadays developed largely by the company XenSource. Xen introduced the concept of
paravirtualization, which allows for extremely high performance virtualization provided that the 
guest virtual machine runs a modified operating system kernel.

Follow this step-by-step instructions, you will be able to:

  1. install Xen hypervisor and related tools from the Etch repository, without building from source files or compilation of kernel
  2. create virtual guest image and install Debian Etch on it
  3. start, run and manage Xen virtual guest systems
  4. compare the performance of difference virtualization technologies - UML, KVM and Xen

Virtualization in Debian Etch (Part 2 - KVM)


In Part 1, we have learned to setup virtual server running under UML on Debian Etch. In this Part 2 of virtualization articles, we will explore KVM. KVM stands for kernel-based virtual machine, which is now available in 2.6.20 mainline kernel. But KVM is known to be backward compatible to 2.6.18 of Debian Etch. So, it is still possible to run kvm on Debian Etch without upgrading the kernel to 2.6.20.

Follow the steps in this article, you will know:

  1. the hardware requirement for KVM
  2. how to build KVM kernel module and install userspace component on Debian Etch host OS.
  3. how to install Debian Etch on OS image
  4. how to start and run guest OS under the KVM
  5. the tips for running KVM guest OS on a host with single NIC interface and bridge network
  6. the performance of KVM - we compare the build time of Voyage Linux kernel image on native machine, UML and KVM

NTP Time Sync with GPS


Few days ago, a user in Voyage mailing list raised a interesting discussion[1]: How to synchronize the system time if the embedded device goes out for a few weeks without internet connection?

The first thing flashed in my mind is GPS. I used ntp time sync in my server (the server that powers and voyage mailing list) and configure it to point to GPS time sync source ( - stratum 1). So I know that GPS can be used for the time sync. After a short while, I got this link[2] from google.

The discussion[3] ended up suggesting that it is able to use Voyage Linux with gpsd. The gps/ntp solution is documented on their site[4], by using gpsd 2.32+ and SiRf3 GPS devices. Some suggested GPS devices are:

Once I acquired a GPS device, I am sure to give it a try!


Virtualization in Debian Etch (Part 1 - User Mode Linux)


This is part 1 of my virtualization articles. This article is about using User Mode Linux (UML) to build virtual server on Debian Etch.

I have been using UML for more than two years. The major reason is that I needed isolated virtual servers for Voyage Linux development. At that time, there are not many options available. VMWare Workstation is still too heavy to run on my Athlon XP 2500 server and it also requires running on GNOME/X-Window. VServer was coming to the game, but it was not available for 2.4.26 kernel that my host server was running. UML just fits my need. It runs the whole Linux system as a userspace process. That means, the crash of the guest OS in UML does not affect the host OS. So, system isolation is guaranteed.

Right now, I have two virtual servers running under UML. They are used for building Voyage Linux kernel and Voyage Linux rootfs base, which is the initial stage of Voyage Linux building process.

Follow this step-by-step guide, we will show you:

  1. how to prepare the Debian Etch as a host OS for running UML
  2. how to create a Debian Etch guest OS image
  3. how to run guest OS under the UML
  4. the tips for running UML guest OS on a host with bridge network
  5. the performance of UML - we will use the build time of Voyage Linux kernel image as the performance measures

Building kernel module with module assistant (madwifi, zaptel, openswan and kvm)


In the previous post I showed how to build an external kernel modules. In this post, I explored another way to build kernel module using module assistant. For modules that could be built by module assistant, the module source must be available as deb package in the form of -source. In below, I demonstrate how to build madwifi-source.

Since madwifi-source is under non-free, I will need to modify /etc/apt/source.list to include non-free and contrib.

deb etch main contrib non-free
deb-src etch main contrib non-free

Next, install the source deb package as always:

# apt-get install madwifi-source
This will download the source the module source to /usr/src/madwifi.tar.bz2

If you have not installed module-assistant (or even build-essential) before, because of package dependency it will install along with the module source together.

To build and install, you just need to run one command:

# m-a a-i madwifi-source
where m-a stands for module-assistant and a-i stands for auto-install. So, this command will build the kernel module from source, and automatically install it.

Compiling k8temp module on Etch

| |

Next thing I would like to monitor the temperature reading on my new barebone server. So the easiest way to do is to install lm-sensors:

apt-get install lm-sensors
and run sensors-detect. After all, it is prompted to install the following modules in /etc/modules and I did:
# Generated by sensors-detect on Wed May  2 12:27:18 2007
# I2C adapter drivers
# Chip drivers
# Warning: the required module k8temp is not currently installed
# on your system. For status of 2.6 kernel ports check
# If driver is built
# into the kernel, or unavailable, comment out the following line.
However, if I follow the wiki link to k8temp is only supported for 2.6.19 or later kernel, but not 2.6.18 shipped with etch. Searching from google I found the link[1] that I will need to compile and install the module manually.

Remote desktop with nx


Recently I access all my linux machines using ssh from cygwin on the Windows XP desktop. This is inconvenience as I will need to open 5-6 terminal/bash windows for my development work on these machines. I have been investigating the VNC solution that is available for both Windows and Linux.

Using VNC, I run vncserver on my Linux server, and run VNC client on Windows. That sound logical to solve my problem... but not really. I will need to login to Gnome desktop or to enable automatic login in Gnome before I can get the VNC client on Windows able to connect to it. Later on, I found a new solution : NX

New AMD64 barebone server for virtualization


I just build a new barebone machine for playing with a lot of virtualization technologies on Linux, preferablely on a fresh install Debian r4.0 Etch. In the coming weeks and months, I will document my experience on the following virtualization technologies that I am going to playing around:

  • UML - User-mode-Linux
  • KVM - Kernel-based Virtual Machine for Linux
  • Xen
  • VServer
  • qemu for ARM

I have been using UML for years. It has been providing complete isolated environments for building Voyage Linux and kernel on daily basis. However, UML is rather slow. These years, we have been seeing VServer, Xen as well as virtual machine support in kernel (KVM). In addition, I would like to explore the ARM emulation under QEMU. My final goal is to setup a guest ARM emulation system for porting Voyage Linux on ARM platforms.