Installed Lubuntu 13.10 on Mini 9

January 11th, 2014
Posted in Linux / Unix | 1 Comment

I recently installed Lubuntu 13.10 to continue running updated versions of Ubuntu on my Dell Inspiron Mini 9. My Mini 9 was delivered with Hardy Heron (Ubuntu 8.04 LTS), and it will bother me to have installed a different flavor of Linux.

The procedure that I describe requires an existing Ubuntu installation and wired ethernet connection for the Mini 9.

I was unable to install current versions of Ubuntu, because of my netbook’s restricted amount of disk space. With the “Lubuntu Minimal Installation” option, I have no swap partition, a 128MB boot partition and an encrypted root partition with 1.8GB used space and 1.6GB free space after installation.

To ease updating, I downloaded the linux and initrd.gz netboot installer binaries and copied them to /boot/13_10. After rebooting, I entered the following into the Grub command line:

grub> root=(hd0,msdos1)
grub> linux /13_10/linux
grub> initrd /13_10/initrd.gz
grub> boot

There were complications with configuring the wireless adapter. The wireless adapter drivers are not installed automatically, and my wireless access point has a hidden SSID.

The wireless adapter drivers were installed with:

sudo apt-get install \
  b43-fwcutter \
  firmware-b43-installer \
  wpagui

The /etc/network/interfaces file was updated to:

auto lo
iface lo inet loopback

#auto eth0
iface eth0 inet dhcp

iface wlan0 inet manual
  wpa-roam /etc/wpa_supplicant.conf

A /etc/wpa_supplicant.conf file was created with:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=0
filter_ssids=0

network={
  ssid="MyHiddenSSID"
  scan_ssid=1
  psk="MyPassphrase"
  key_mgmt=WPA-PSK
}

network={
  key_mgmt=NONE
  disabled=0
}

After the above is performed, the computer is rebooted and the wired ethernet cable is removed. The wireless connection is enabled with the following:

ifup wlan0
dhclient wlan0

wpa_gui can be used for a graphical interface to the wpa_supplicant. Changes to wpa_supplicant.conf by wpa_gui is prevented by the update_config flag being set to 0. This is preferred to prevent losing my network’s configuration and polluting the network configuration file with several networks.

I installed Firefox. Now, the Mini 9 is running great!

Taking a Byte of Raspberry Pi

July 21st, 2012

Raspberry Pi LogoGaining access to new embedded processors is exciting. I recently ordered a Raspberry Pi Model B for 49.49USD, which includes the cost of the board, a case, and shipping. With an expected ship date that is 11 weeks away, its delivery is something I can be excited about for awhile.

The Raspberry Pi Model B features a Broadcom BCM2835 system on chip, which uses a 700 MHz ARM11 (ARM1176JZF-S) processor. The board contains two standard USB Type A ports and one HDMI receptacle. It uses a Micro-USB Type B connection for its power source. With all that it has on board, the Model B is ready to be connected.

I plan on connecting the Raspberry Pi Model B’s HDMI port to an HDMI television. One USB port will be connected to a Bluetooth USB adapter, which supports Bluetooth keyboard and mouse input devices. The other USB port will be attached to a WiFi USB adapter, which provides network connectivity. I plan on reusing my e-reader’s charger to power the Model B. My environment is ready after little preparation for operating the Raspberry Pi Model B.

As for software, the Raspberry Pi uses GNU/Linux as its default operating system. A web browser and office productivity software are included. Out of the box and connected to a display device, keyboard, and mouse, the Raspberry Pi can be used as a personal computer.

Education through their device is the Raspberry Pi Foundation’s primary motivation. The Linux kernel can be recompiled to experiment with the processor’s features. Python, which is bundled with the operating system, can be used for learning software development. The GPIO pins on the Raspberry Pi allows experiments with integrating external devices. The Raspberry Pi has great potential as a tool for education.

Advanced subjects such as cross-development and operating system specifics can be explored with the Raspberry Pi. The Linux operating system can be abandoned, and bootloaders, memory managers, process managers, and I/O managers can be implemented for the Raspberry Pi. Much education can be gained from the implementation of a specialized operating system. The benefits of implementing a specialized operating are beyond understanding an operating system’s function. Experience in complex software implementation and systems engineering also can be gained.

The Raspberry Pi, starting at 25USD, is an exciting tool for education about and exposure to embedded computing.

Linux Kernel Development

July 16th, 2012

Picture of book cover for Linux Kernel Development by Robert LoveFor nearly a decade, I have had a latent interest in developing the Linux kernel. I administered Linux servers for years, but I never had as much motivation as I have now to explore the kernel’s mechanisms. I remember leafing through books, at Borders, that made kernel development seem inaccessible. Robert Love’s book, Linux Kernel Development (third edition), stands out as an invitation to exploring and improving the open source operating system. Love’s book is a great introduction to Linux and its subsystems, and it has encouraged me to study the operating system’s implementation.

Love’s writing style makes the topic of Linux kernel development accessible to intermediate software developers. His style is clear, concise, and effective. It differs from the style used in voluminous books, which materialize publishers’ apparent hope to attract shoppers by taking up more shelf space at bookstores. The style of his writing allows Love to convey information in less words thereby saving the reader’s time. Love’s style focuses the reader’s attention on the Linux operating system, and his style allows the reader to pick up knowledge quickly.

Linux Kernel Development introduces process management, interrupt handling, memory management, and i/o handling as implemented in recent versions of Linux. To support examination of these primary operating system functions, the book also reviews data structures and thread synchronization mechanisms that are used by the kernel. The book delegates to others focused on algorithms the task of deeply examining data structures, but it provides thorough coverage of synchronization mechanisms used by Linux and highlights the strengths and limitations of each mechanism. The book maintains its focus on Linux by expanding study of topics that are specific to Linux and avoiding distractions of general topics such as data structure implementation.

Its organization, structure, and style makes Robert Love’s book a potent introduction to linux kernel development.

New eReader Acquired!

May 15th, 2012

NOOK Simple TouchWhenever I run errands, such as having my car serviced or getting a haircut, I usually bring a book with me for the wait. I already had a desktop, laptop, netbook, and smartphone, which are used daily. I figured that I can use my netbook or smartphone to read ebooks. The need for an ereader was not apparent.

A presenter of an education series presentation at my company exposed me to observed computing trends. In a world of smartphones and tablets, ereaders can fulfill a need between those device classes or be considered complementary to tablets. Tablets and ereaders have similar form factors, and using one as the other is tempting, but each should be used for their specific functions. Tablets are good for light computing, such as browsing the Internet or checking email. Ereaders are excellent for lengthy reading sessions.

I was presented an opportunity to purchase an ereader on my most recent of countless trips to Barnes & Noble. The NOOK Simple Touch and NOOK Color were on sale for Mother’s Day. The NOOK Simple Touch, at 20% off, was the only device that I considered. With the store closing and sale ending, knowing that I could return it within 14 days, I extended the time for adopting the device by making the purchase.

Compatibility with my Dell Mini9, running Ubuntu 12,04, was the first thing I checked as I charged the NOOK. After I registered my NOOK, I was able to load The PostScript® Language Tutorial and Cookbook in PDF from Adobe.com. The NOOK behaved like a USB drive when it was connected to my netbook, and I was able to copy the PDF onto the ereader with ease.

The NOOK is expected not to require being charged for two months when reading daily for 30 minutes. This is certainly better than charging a netbook or tablet daily when using it as an ereader. The NOOK is light. It is compact. It feels sturdy. The NOOK is a keeper.

Optimization

December 16th, 2011

Lately, I have been involved with optimizing code to improve execution time. I am still becoming familiar with a large and complex software system that is used by a multitude of end-users. Because my knowledge of the system is limited and people are dependent on the system, the scope of my modifications is focused on functions rather than components, modules, or subsystems. Profiler results present candidate functions that may benefit from optimization. The profiler results that I have encountered in my optimization efforts are consistent with the 80-20 rule, where 20 percent of the code is responsible for 80 percent of the execution time. These are the functions that I focused on, since they had the greatest chance of improvement.

I have had to optimize code toward desired characteristics in other projects. In other projects, I have had to optimize for space as was done in the implementation of memory built-in self tests for custom peripherals on an Infineon chip. Space was scarce in this situation, and it was fortunate to have control words, which manipulate the custom peripherals, that allowed the use of simple compression methods. Though the decompression of the custom peripheral instructions added to the execution time, the added execution time was acceptable as it allowed the built-in self test code and data to fit in the limited memory space.

In another situation that called for optimization, a tradeoff between data NVM and instruction NVM was present. In a Harvard architecture, data and instruction memory are separate. This is different from architectures that allow execution of code in memory that is also used for data. When the data NVM neared exhaustion in a previous experience, minimization or optimization of data NVM use became required. In this situation, data NVM usage was minimized by initializing variables with variable assignments. The variable assignments were implemented by the processor with “load immediate value” operations that placed the desired values into variables represented as registers. The variable assignment code resided in instruction NVM as opposed to copy sections that reside in data NVM.

At times, there is a need to sacrifice space for reduced execution times. Sometimes, space is scarce and an increase in execution time is acceptable. Other times, there is an exchange between the memory types. There is also a possibility that optimizations result in reduced space and execution time. In my view, optimization can be seen as the management of tradeoffs.

With the gains achieved in my current optimization efforts, I am wary of the possibility that premature optimization may be considered implicitly encouraged. As Knuth is credited in saying, “premature optimization is the root of all evil (or at least most of it) in programming.” A lot of time may be wasted by optimizing a solution that is later replaced. A great amount of time may also be wasted in optimizing code that consumes a very small percentage of the system’s resources. Premature optimization may also introduce complication or complexity to the implementation that adds difficulty to completion of the system and decreases the feasibility of meeting schedule constraints.

Although I disfavor premature optimization, the adoption of RandomSort() or approaches of similar quality with respect to their situations should be avoided. The optimization of an inefficient approach to a problem is a totally inappropriate allocation of valuable resources. A balance between premature optimization and efficient algorithm selection must be maintained. When it comes to a decision between a prematurely optimized solution and one that is good enough, I encourage the adoption of a good enough solution that is implemented in such a way that an optimized solution can be easily substituted if a need arises. This allows timely implementation of the system as well as a starting point for profiling and incremental refinement.

RandomSort() is a function that shuffles the elements of a collection randomly, and checks if the elements are ordered. The process is repeated until the elements are ordered.