August 2005 - Posts

We have a couple of legacy applications here, written in C++, that have always run on windows and *nix. In order to support the *nix versions, we always have to have a Linux install hanging around (we also have a solaris, but that's already set up).

So we got a Dell Precision 380 workstation with a SATA drive that had Windows XP installed on it. Since the Dell didn't come with a floppy drive, I couldn't very well just create a boot diskette. That would be useless. So based on the fact that there is a spec called "El Torito", I looked up an article online about Linux Bootdisks. It looked pretty good, but there was one glaring omission: the author mentions that you need to load any initial ramdisk via LILO, but doesn't explain how to setup LILO correctly for a floppy image. I decided to go back to it if necessary and went to to see if there was any insight there.

I ended up finding a section of documentation that outlines how to create an Installation Boot CD-ROM, but I had already installed it! I later found that if at the bootloader screen of the install CD I typed the command:

vmlinuz root=/dev/hdb2

It would in fact load the installation off of the second (IDE) harddrive (thanks, btw, linux for making me use a modified kernel to support SATA drives. That's top-notch, guys.)

So I figured that the secret to the sauce was probably in the isolinux.cfg file that configures all the commands visible at the boot loader screen. First I tried something like this: 

default linux
label linux
	kernel vmlinuz
	append root=/dev/hdb2 initrd=initrd.img

but that didn't work, it still brings up the install screen. So I figured why not try the simplest possible solution using the config file, and this is what I came up with:

default vmlinuz root=/dev/hdb2

Guess what? I now have a Redhat Linux 9 install that will boot from a CD and I didn't have to mess with a bootmanager or touch the MBR in any way. I don't have to wait those pesky 10 seconds for either grub or the windows NT bootloader to select which install to start - I just pop in a CD if I want linux, and open it if I want WinXP.

This has probably been done a hundred times already, but I couldn't find one in the first few pages of google results, so I wrote my own in ~40 lines of C#:

using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;

namespace PostXING.Controls
	/// <summary>
	/// GradientPanel is just like a regular panel except it optionally  
	/// shows a gradient.
	/// </summary>
	public class GradientPanel : Panel
		/// <summary>
		/// Property GradientColor (Color)
		/// </summary>
		private Color _gradientColor;
		public Color GradientColor {
			get { return this._gradientColor;}
			set { this._gradientColor = value;}

		/// <summary>
		/// Property Rotation (float)
		/// </summary>
		private float _rotation;
		public float Rotation {
			get { return this._rotation;}
			set { this._rotation = value;}

		protected override void OnPaint(PaintEventArgs e) {
if(e.ClipRectangle.IsEmpty) return; //why draw if non-visible? using(LinearGradientBrush lgb = new
this.Rotation)){ e.Graphics.FillRectangle(lgb, this.ClientRectangle); }

.OnPaint (e); //right, want anything handled to be drawn too. } } }

There it is. Enjoy!

[ Currently Playing :  New Way Home - Foo Fighters - The Colour And The Shape (5:42) ]

Well, it's been a week now since I handed over my pip-squeak back to his mom.

I gotta say, I miss him a lot. Having him around every day and then all of a sudden not having him any more is a real shock to the system. I've also gotta say that I feel really blessed to have been able to spend that time with Ethan, and do fun Father/Son stuff. By far the most fun that I had was when I took him to the beach for the first time ever.

I tought Ethan the basics of doing a jig after you throw down a football. Ethan taught me that you need a bucket of water to wash each hand when they get sandy at the beach: Ethan072405.MPG

More Posts