InfoZ, a self-contained hardware detection system

Marcos Zapata

Introduction

Now that GNU/Linux systems are becoming more user friendly by the addition of packages such as Gnome and KDE, it's possible to use them at schools, at home and even at private companies; not only in servers at universities and ISP's. The appearance of office related programs helps even more with this migration.

Schools nowadays are starting to realize the advantages of having a GNU/Linux system installed, mainly because of the cost reduction in their budget but also because of the great amount of educational programs for kids, office related packages, and many more. Universities and small companies are starting to realize this fact also.

One of the major problem a user or company has, it's that it doesn't know whether its computers will be able to function properly with this operating system. And won't take a leap of faith to prove themselves wrong.

Another thing, it's that schools and universities doesn't have an unlimited budget to buy new computers with GNU/Linux already installed. They have the need to use what they already have. And to be able to know up to what extent their computers will be able to function with it.

Objectives

My objective is to develop a system, based on GNU/Linux, capable of booting from a floppy disk that will report all the hardware in a computer. It will also have the ability to distinguish the hardware supported by GNU/Linux. That way, an university, school or company, will only have to boot their machines (any operating system already installed in it) and be able to see how difficult it would be for them to migrate to a GNU/Linux system. The system will also have to generate reports to inventory the all computers in the school, university, etc. They might be saved in another floppy, send to an ftp server or to a serial terminal.

Methodology

In order to build this system I had to choices: the first was to use a glibc 5 based system to reduce the space of the system libraries. Remember I only have 1440Kb. The other one, the one I preferred, was to use a new uclibc based system. I try to use new tools to avoid old problems so I picked busybox to give me an standard set of tools for my system, since I decided to program the hardware detection scripts, whenever possible, with ash and gnu tools. The kernel I've used was 2.4.x, the newer the better, to avoid trouble with usb. It had to have devfs set and mounted at boot time. The sorted hierarchy helped make my scripts more simple. The scripts detect: Various scripts were easily made because they only have to parse the information in /proc: cpu, memory, ide drives.

To detect partitions I had to enable them in my kernel build, I couldn't enable all there is because the kernel might grow bigger than a floppy disk. I chose to detect ext2/ext3, reiser, vfat and ntfs. This detection with it's filesystem drivers provided me with the possibility to later save the report in one of the partitions of the host computer.

In order to detect the video card in the computer I had to modify an old source I programmed several years ago. The problem with it, is that it's Intel or compatible dependant. After a couple of days searching the Internet I found the interrupts that gave me information from the monitor. The computer will have to have a VESA2 compatible card and a DDC monitor.

The mouse detection was done by ripping some pieces of code from kudzu. It will detect serial port and ps2 mice.

I used chat from the ppp package to efficiently detect the hardware modem, whether in an ISA card or an external one connected to a serial port.

All the devices ISAPnP give an ID string that could be easily taken by pnpdump. I had to set ISAPnp support in the kernel to use it.

Now comes the difficult part: I couldn't have all the drivers installed in the floppy and probe them to see what hardware there was, so I used lists.

Most of the PCI cards "register" themselves in /lib/modules/kernel-i-build so all I needed was to take their IDs from modules.pcimap and make me some lists: one to detect network cards, one for sound cards, etc.

The lists to detect pci video cards were taken from the XFree86 project. There are many sites in the Internet from where I took IDs to build a winmodem compatible list for this system.

That way when I look for all PCI cards in the computer all I have to do is compare them with the ones in the lists and that way I know if they are supported by GNU/Linux without having to have all the drivers need it. This saves me tons of space, because I have all I need to detect the PCI cards without having the drivers compiled in. And I don't need them.

The same thing can be done with ISAPnp sound cards. I worked with the alsa project drivers.

Working with the USB bus would have been the same as working with the PCI bus, but not so automated. I would have needed to build a list of compatible devices manually to do this at linux-usb.org. This feature is not available as today. The system reports all the devices there is in the USB bus but can't tell which ones are supported, except for printers.

I enabled support for IEEE1284 in the kernel and if the computer has an ECP/EPP parallel port, it's able to detect what printer is connected to the parallel port. The list (similar to the ones above) were made from the linuxprinting.org project. It can be also use to detect printers in the USB bus.

Now that I had all the scripts I needed, I programmed a frontend to combine all of them and generate the report.

The ability to write the report to a floppy disk or to a partition in the host computer is possible for the filesystem drivers installed in the kernel.

I had enough space so I decided to include some drivers for network cards to be able to send the report to an ftp server, of couse, if the network card might have been detect it.

Note: All the programs needed, not included in busybox, were also compiled against uclibc libraries.

Results

I have successfully build it: infoz. I did so and I didn't have any kind of trouble with it. The only essencial thing that is lacking is the detection of scsi cards and drives. Mainly because of the shortage of space in the floppy disk.

The only drawback of this project doesn't actually comes from it. The floppies dies after being used in a number of computers, especially if their floppy drives doesn't work properly.

Conclusion

I think this system can be helpfull to many people and organizations. I designed it mainly to be used at schools and universities to help to the migration from operating systems other than GNU/Linux to it.

One of the advantages is that an organization (private or not) could easily inventory all the computers it has, pretty fast, thus reducing the budget needed, and use the extra money for others thing that really matters.

References


VALID HTML 2.0!