Saturday, July 3, 2010

Minix 3 and bochs (or Virtual Machines Make My Head Hurt) -- Part 1


The subtitle Virtual Machines Make My Head Hurt is a reference to the difficulty I have in determining which layer is doing what at any given time when I'm operating in a virtual machine environment.  If there is a failure somewhere I have to ask myself the questions:   is the failure on the guest operating system?  The host operating system?  Some incomplete interoperability between the two?  The hardware?  The application I'm running?

Well, failure isn't really the theme of this post, since I'm at the beginning of this particular phase of my Minix 3 installation, although thinking through how the different layers in virtual environments are working together still makes my head hurt.  So I'll slowly explain what I'm trying to do, and why.  Then I'll followup at the end of this post with exactly where I am and what I intend to do to move this aspect of the project along.

As I stated in an earlier post my long term goal is to get Minix 3 working on my Dell Inspiron 1545 laptop in every reasonable respect (including the network, the wireless, and the USB ports).  This is both a narrow and broad project.  Narrow in the sense that I'm focused on one particular system.  Broad in the sense that in order to do this I may have to learn about writing drivers for everything on the system.

How does this relate to virtual machinery?  After a couple of weeks of burning anything I needed from the outside world to a CD on my Ubuntu Linux system and moving it to the laptop, I discovered that it might be nice to ftp things I need onto a networked Minix 3 work area, evaluate and configure it in that environment, then when I deem it ready make a CD and move it onto the laptop.

This is where bochs comes in.  bochs is a free and open source x86 emulator.  With it I should be able to run Minix 3 in a virtual environment, including access to the network of the host environment, do any configuration or development needed on the virtual Minix 3, then move it to my Dell laptop for further testing.  If I'm reading the bochs documentation correctly I should also be able to do some of the necessary reverse engineering I'll need to do for my device drivers with the debug mode in bochs.

So a couple of days ago I installed bochs onto my Ubuntu Linux workstation, and attempted to use the  document Running Minix 3 on Bochs from the Minix 3 website to configure and run Minix 3 on bochs. I followed the instructions, and the attempt to run my Minix 3 boot image failed on the following error:

========================================================================
                       Bochs x86 Emulator 2.4.2
             Build from CVS snapshot on November 12, 2009
==============================
==========================================
00000000000i[     ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/lib/bochs/plugins'
00000000000i[     ] BXSHARE not set. using compile time default '/usr/share/bochs'
00000000000i[     ] reading configuration from bochsrc.txt
00000000000p[     ] >>PANIC<< bochsrc.txt:9: directive 'ips' not understood
00000000000e[CTRL ] notify called, but no bxevent_callback function is registered
00000000000i[CTRL ] quit_sim called with exit code 1

I re-read the installation instructions, then went to the bochs home website on sourceforge and browsed the documentation there.  As far as I could tell at that time 'ips' was a legitimate directive in bochs, so I posted descriptions of the problem to both the Minix 3 google group, and to the bochs help forum.
Stanislav Shwartsman, one of the bochs developers, answered on the bochs help forum that the 'ips' directive was deprecated and could no longer be used, and suggested that I use the sample  bochsrc configuration file which comes with bochs as a basis to configure bochs for Minix 3 and that I then get the documentation updated.

So at this point my plan for the week is:

1) finish reading  the bochs documentation so that I can devise an appropriate bochsrc file.
2) get Minix running on bochs
3) Make  the configuration steps available so that the Minix 3 documentation can be updated (or just doing it myself if I have wiki editing privileges on the document).  
4)  If I've  understood the bochs documentation correctly I can  create a Minix 3 bochs image and make it available to other people via the bochs website.  I'd like to do that if possible.

I'll write a  followup post to describe how the plan went.

Wednesday, June 30, 2010

Minix 3 Installation Diary -- Part 3

As I stated in the previous article in this diary, I had a strange problem occur on my attempts to reboot after initially installing Minix 3 to my hard drive.  The problem was that the system would always reboot into a grub (Grand Unified Boot Loader) prompt, and I couldn't continue beyond that prompt.  Now this seemed to me at the time to be a strange problem indeed.  I had accepted all the setup defaults and done a full install, dedicating the entire disk to Minix 3.  I couldn't really find anything in the documentation about this problem, so I went to the minix3 google group to post a description of the problem.  The minix3 group is a good second line resource for troubleshooting if one can't find a solution to a problem in the documentation on the Minix 3 web site.  The best way to use this resource is to first attempt to figure out the problem by reading the online documentation, then to search the minix3 archive, and then, if the problem still isn't solved,  posting an enquiry on the group mailing list.

I couldn't find anything, so I posted a description of the problem.  Initially it was mysterious to the respondents, but it soon dawned on both me and a couple of the regulars on the list that grub was already installed in the Master Boot Record (MBR) from the previous host on that particular laptop, which happened to be Fedora Linux.

A member of the list suggested that I use installboot to overwrite the grub entry in the MBR.  It took me a few tries, but the command

installboot -m /dev/c0d4 /usr/mdec/masterboot  did the trick.

I rebooted, and this time came back up to the Minix 3 login prompt.

For more information on the Minix 3 boot process the article from the Minix 3 Wiki From power-on the the login prompt is very useful.

The manual page for installboot is also helpful.

Tuesday, June 29, 2010

Minix 3 Installation Diary -- Part 2

To begin the installation process I downloaded the iso image for the latest stable version, which is 3.1.7, from the minix 3 download page.
After burning it to a CD (from my ubuntu Linux workstation) I inserted the CD in the laptop and rebooted.  I had one of the installation docs open in front of me, along with tabs for any other pages on the minix site which seemed relevant to troubleshooting.

I powered on  ... and nothing useful happened.  Luckily this one was easy enough to figure out with a quick browse through the docs.  The error message (which I failed to write down) indicated that the CD was not found.   Under my BIOS system configuration I needed to change a parameter from AHCI (Advanced Host Controller Interface -- Intel's API for addressing Serial ATA) which isn't yet supported by Minix, to ATA (the Minix doc called it "legacy", but it was easy enough to tell what was going on).

So now I had a bootable live CD.  I booted up, ran the setup command, and began working through the steps.  I'd already saved everything I needed off the Fedora Linux installation which was the previous host on the laptop, so I chose  to delete the existing partitions and make the whole disk Minix 3.  I accepted the default filesystem sizes (/, /home, and /usr had separate slices).

When the copying of files finished, I was instructed to shutdown and reboot.  Then I was prompted to  run packman, which is Minix's package manager system, in order to get X windows and a number of other programs, libraries, and utilities.

Using the command xdm  I was treated to a window manager which resembled almost exactly the first X windows interface I was ever exposed to 16 years ago on a Sun workstation.  As it happens, twm ("Tom's Window Manager") is the window manager ported to Minix.  It's one of the original window managers, and is very minimalistic.  I have to say that I don't object to that.  Graphical eye candy can be soothing, mostly because I'm accustomed to it, but most of the time I'm working with text in terminal windows, which twm handles well.

I then attempted a reboot, and Oooops!!!  I was faced with a very strange problem which I'll describe in a separate blog posting (so that this article doesn't run on forever).


Monday, June 28, 2010

My Minix 3 diary -- Introduction and initial installation

In 1995 I downloaded fifty 3.5 inch diskettes of the Slackware distribution of Linux, installed it on my home computer, and after several hundred hours of configuration got it more or less working for the state-of-the art in Linux at that time. A friend at work used my diskettes to install on his computer, and both of us have been avid Linux users since.

But part of me has missed the early days of broken and missing pieces, where I had to do detective work to get my setup behaving correctly.

More seriously, although I love Linux, I've always recognized that it is not the be-all and end-all of operating system technology.  It's good, it's free (both in the "free beer" and "free as in freedom" sense, and the support community is wonderful.

But there are a number of other OSes out there, and one which in particular has beckoned me is Minix 3. 

Those of you who know the history of Linux might remember that Linus Torvalds, the creator of Linux, was originally working in the first version of Minix when he began coding Linux.  At that time Minix was an educational tool targeted at the 8088/8086 processors, and as such could not support modern production use (multiprogramming was not possible).

You may also remember the debates between Linus Torvalds and Andrew Tanenbaum regarding the merits of monolithic kernels versus microkernel architecture (I'm not going to bother to go into that now.  Follow the preceding link if you are interested in exploring it).

Fast forwarding to the present, Minix has come a very long way.  Minix 3 has been released, and an active community is working on transforming it into a serious production system.

The goals of Minix 3 are summarized as follows on the official Minix web page:

MINIX 3 is initially targeted at the following areas:
  • Applications where very high reliability is required
  • Single-chip, small-RAM, low-power, $100 laptops for Third-World children
  • Embedded systems (e.g., cameras, DVD recorders, cell phones)
  • Applications where the GPL is too restrictive (MINIX 3 uses a BSD-type license)
  • Education (e.g., operating systems courses at universities)

 I've been looking for a fun, interesting, and challenging project to keep myself young at heart  in the UNIX/POSIX world.  So I've  taken  a Dell Inspiron 1545 laptop and installed Minix 3.1.7 on it.  My intent is to get every reasonable function of this laptop working with Minix in the modern sense of the word.  Where possible I'll build on other people's work (and hope upon hope that someone writes a driver for the NIC before I'm forced to do it myself).  But if no one else is working on a particular project relevant to my laptop list, I'll hunker down and do it myself.  I have no time line, since this is a labor of love.

The top priority missing component as far as I'm concerned is a driver for the NIC.  The ethernet card on this  laptop is probably a Marvell 88E80XX 10/100 Ethernet Controller (based on looking over Dell's spec sheets).

But before I tackle device drivers I have to get the standalone Minix running and configured to my satisfaction first.  My next post is going to be a description of the specific problems I ran into on the installation, and how I dealt with them.

Tuesday, June 1, 2010

87 year old former oil man explains the BP oil catastrophe in detail

This is one of the better attempts to explain the BP Gulf of Mexico oil catastrophe I've seen. It is an interview with Peter Davidson, 87 years old and "a veteran of many oil fields" explaining the drilling operation and leak to his daughter, who prompts him to keep it to a basic level that an interested layperson can understand.


Gulf Oil Spill: what happened? from Mary Mele on Vimeo.

Monday, May 31, 2010

Google sued over pedestrian accident

It isn't often that I have a hard time coming up with a headline for a blog post, but this particular news story which I read via mashable.com is a bit too easy to meet with a knee-jerk attitude.

First, I support the right of individuals to sue corporations (or individuals) for irresponsible activity which leads to injury.  This is where I diverge from much of the pop culture/AM Radio shock jock ridicule of lawsuits directed at corporations.  There are times when a company releases dangerous goods which should have been tested better or publishes instructions which don't adequately disclose the risks of a product.

So the question is whether posting pedestian directions  which include the stretch pictured the image above was irresponsible on Google's part.

My own opinion is that Google should win this lawsuit, and that if the woman who brought the suit wanted to really target those responsible she should really sue whatever governmental body is responsible for this roadway.

IANAL (I am not a lawyer) so I can't comment on an informed manner about the legal responsibility beyond stating that Google includes a disclaimer on their pedestrian routes

But my fear is that lawsuits like this help unleash the attitude that we as a people shouldn't walk anywhere, shouldn't encourage others to walk anywhere, and that our state and local governments shouldn't be held responsible for the lack of safe pedestrian accomodation on roadways.

The problem here isn't that Google provided the woman with a route from point A to point B.  The problem is that those responsible for designing the highway didn't take into account the fact that walking is a reasonable use of a route funded, designed, and maintained by the government.

Friday, May 28, 2010

podcast interview with Donald Knuth


Listen to internet radio with larryfeltonj on Blog Talk Radio

On Wednesday I recorded a podcast interview with Dr. Donald Knuth, a major figure in the history of computer science. He's the author of The Art of Computer Science, developer of the TeX typesetting language, and the creator of the system known as Literate Programming.

I interviewed him by phone. We focused on Literate Programming, but he also touched on TeX, Metafont, Linux, and the upcoming fourth volume of the Art of Computer Programming.

You can listen by using the control above, or visit my show page at BlogtalkRadio.