Sunday, September 23, 2007

CPUs and Virtualization

Red Hat is in the process of incorporating virtualization in its operating systems. Both Fedora Core 6 and RHEL 5 include Xen, which is a "free virtual machine monitor," which includes QEMU-based emulation to support virtualization similar to VMware.


On the Job

QEMU is one more alternative for virtualization, licensed under the GPL and the closely related Lesser GPL. Kernel-based Virtual Machine (KVM) technologies require Linux kernel version 2.6.19; RHEL 5 uses 2.6.18. Paravirtualization for VMWare isn't expected until 2.6.21.

There are two kinds of virtualization associated with Xen. Paravirtualization provides a software interface that allows you to install specially ported operating systems (with a Xen-enabled kernel) within software-based virtual machines. Full, or hardware-assisted, virtualization supports direct hardware access; it is limited to certain Intel Dual Core and AMD X2 CPUs.


On the Job

Not all Intel Dual Core or AMD X2 CPUs support hardware-assisted virtualization. AMD X2 CPUs need to be TL-50 and above; Intel Dual Core CPUs need to be T2300 (or T5600) and above. Furthermore, Intel-based systems are often disabled in the BIOS and may not support hardware-assisted virtualization unless specifically activated through the BIOS menu. If you see the vmx (Intel) or svm (AMD) flags in /proc/cpuinfo, your system supports hardware virtualization.

Plug and Play and the Hardware Abstraction Layer

Plug and play (PnP) refers to the ability of an operating system to allocate hardware ports or addresses automatically to specific devices such as hard drives, sound cards, or modems. Linux's ability to work with PnP devices is finally up to speed, courtesy of the Linux implementation of the Hardware Abstraction Layer (HAL). Conceptually different from the Microsoft version, HAL provides a constant list of detected components. Some distributions can now automatically detect and mount the smart cards associated with digital cameras and fingerprint readers.

If you want to see the full list of detected hardware, run the lshal command. It's a long list; you may need to pipe the output to a pager with a command like:

# lshal | less

which allows you to scroll through the output.

Channel Conflicts

In rare cases, the Linux HAL subsystem may have problems with the newest computer devices or some very old ones. If you're having problems with the newest computer equipment, various Web sites are dedicated to offering help. For example, www.linmodems.org can help you configure many so-called "winmodems," and www.linux-usb.org can help you configure the latest USB equipment on Linux.

Many hardware conflicts with relatively old equipment are fairly simple to eliminate. There are three possible areas of conflict:

  • A physical hardware jumper is conflicting with another card.

  • Your ISA cards are not properly configured.

  • You are out of IRQs or other resources to add to your new device.

You can use the /proc files to check the currently used IRQ ports, I/O addresses, and DMA channels. For example, to check the occupied IRQs, the following command lists the devices that are loaded by the kernel:

# cat /proc/interrupts

If there is a conflict, the device is not loaded. You can quickly scan over the left side to see what interrupts are available. To get a list of used I/O addresses and DMA channels, issue the following commands:

# cat /proc/ioports
# cat /proc/dma

The kernel included with RHEL 5 and above should keep HAL configuration problems to a minimum. When problems arise, two or more devices are probably trying to use the same IRQ, I/O, and/or DMA. In that case, one or both devices may not be loaded. It may take a little detective work to identify the troubled hardware; conflicts may prevent it from being listed in one of the associated /proc directory files. Then select one of the devices, and change its IRQ, I/O, and/or DMA to a free location.

This is usually a two-step process: first, change the settings on the card itself through physical jumpers or a diagnostic disk, as described in the next section. If Linux doesn't detect your changes, use the appropriate configuration tool, such as system-config-keyboard, ifconfig, modprobe, or system-config-network, to change the settings on your device.

Generally, Linux should not have problems with PCI cards, USB devices, or even many IEEE 1394 (also known as FireWire or iLink) systems. Linux should recognize them and set them up with appropriate IRQ ports, I/O addresses, and DMA channels. If you cannot see what your PCI cards are set to, type cat /proc/pci. If a PCI card that you're concerned about does not show up here, you may be out of IRQs. If you run out of IRQs, you may want to look into alternatives such as IEEE 1394 or USB devices.

Some Linux distributions may not detect multiple CPUs, or the different CPUs associated with dual-core systems (unless you've installed the right kernel). To know what CPUs are detected, check /proc/cpuinfo.

Friday, September 21, 2007

system program control

There are four essential programs associated with the control of your computer and the way it interacts with: 1) programs: 2) your keyboard and siplay screen; and 3) attached devices like disk, drives, printers, and modems. These are:Boot RecordBIO.COMDOS.COMCOMMAND.COMOnly the COmmand.com program is displayed when you view a directory of filenames located on a disk. You can see the bio.com and dos.com programs if you have dos version 2.0 or later and enter the chkdsk command followed by a/V. The /V option is not available on earlier versions of DOS. each program is described in the following paragraphs.The boot record. The term boot and bootstrap, when used with computers, means start or start-up. when you boot your computer, you are turning it on and loading the opearting system into your computer's memory. This includes reading the boot record into memory, which passes control to DOS. Next, DOS checks for the presence of BIO.COM and DOS.COM. If these files are found, the DOS prompt is displayed on your screen. This prompt, normally an A>, B>, C> depending on which disk driver is active, invites you to type a command. If BIO.COM and DOS.COM are not found, an error message id displayed.Your computer will not boot without a boot record. Instead, an error message is displayed telling you to insert a system disk. The boot record is located on track0, sector 1, side 0 of your formatted DOS disk. If you have hard disk, the boot record is located on the first sector of the first cylinder of the DOS partition.

Backup with DOS

Both MSBACKUP and Backup for Windows are used to copy your files to one or more backup diskettes for safekeeping. In this way, if you experience a disk driver failure or data error, you can restore your files from the bakcup media.

Using Backup, this first time you use backup, you are prompted to perform a compatibility test. This ensures that backup is steup properly for your computer
when running the compatiibility test, you should be familiar with following options that are selected during the compatibility test.
Verify backup data compare the copies backup data to the source for accurate reproduciton. This option greatly slows down the backup process.

Use error Correction, Creates error correction coding information to the backup media to improve the chances of restoring data if the target media becomes damaged. This is helpful if the target media becomes damaged by a scratch or abrasion.

Compare, Compares teh information in your backup set to the data on your hard disk to ensure that the data can be restored. Compare provides the maximum security bye comparing the data in the backupset against the original data on the harddisk.