Saturday, February 5, 2011

The BIOS

As we mentioned earlier, the computer knows what to do by taking instructions from programs stored in RAM. The main instructions come from a program called the operating system, and those instructions direct traffic for other programs called applications.

When the computer is turned off, all the instructions copied into the RAM are gone. When the system is turned on again, it needs to go out to the disk, get the operating system and load it into RAM, but there are no instructions in the RAM to tell it how to do this. The solution to this problem is a set of instructions that stay in memory and don’t get lost when the computer is turned off.

This set of instructions is called the BIOS, for Basic Input Output System. Since the instructions don’t need to change, they can be stored in a different kind of chip than we use for RAM. It’s called ROM, for Read Only Memory. We say that the instructions in the BIOS are hard-wired, and instead of software they are calledfirmware.

The computer goes through a process called booting up when it is first turned on. This involves executing the BIOS instructions, loading the operating system from disk into RAM, and then turning control of the computer over to the operating system after everything checks out OK. The term refers to somebody pulling themselves up by their own bootstraps (without outside help, in other words). Any computer term that includes ‘boot’ will have something to do with this start-up process.

CMOS and RTC

There is other start-up information that normally stays the same but that we might want to change once in a while. This includes info about the various pieces of hardware connected to the system, which disk drive to check first for the operating system and that sort of thing. This data can’t be stored on the hard drive because we need it to boot up. It can’t be stored in RAM because it will be lost at power-off, and it can’t be stored in the BIOS because we might need to change it.

The problem is solved by a type of RAM chip that uses very low power, and it is connected to a battery. This type of low-power memory chip is called CMOS. It stands for the type of technology used in the chip, which is Complementary MetalOxideSubstrate. This is probably more than you need to know, but I’m a fanatic about defining things. By the way, since batteries don’t last forever, if you leave your computer unplugged for about 5 years you’ll find it needs a bit of trickery to get it to boot again, because the CMOS information will be gone.

There is another feature in the computer that has the same requirements as CMOS, and that is the date and time function. This obviously needs to change very minute, but we don’t want to lose track when the computer is turned off. The circuitry for this is called the RTC or Real Time Clock, and for convenience it is usually included in the same chip with the CMOS. A little trickle of juice from the CMOS battery keeps the clock running, and when you turn the computer on again it knows exactly what time and day it is. Convenient, isn’t it?

More About Video

The monitor is a passive device that just displays the video output from the system. However, so much data is needed for the constantly changing screen display that special provisions are made for it.

The video card (or video circuitry on the motherboard) has its own RAM memory just to hold the display information, and its own ROM BIOS to control the output. Some motherboards even have a special high-speed connection between the CPU and the video. It’s called the AGP, or Accelerated Graphics Port.

The important numbers in evaluating a video display are how many distinct colors can be displayed and also the resolution, which is how many pixels the image contains across and from top to bottom. Each dot of color making up the image is one pixel. As video technology evolved there have been a number of standards, and each one has its own set of initials like EGA, CGA or VGA. A common one isSVGA, which stands for SuperVideo Graphics Array and has a resolution of 800x600 (that’s 800 pixels across and 600 down). Some high-performance monitors use SXGA (1280x1024) or even UXGA with a resolution of 1600x1200.

More About Disk Drives

Floppies – Although floppy drives are being phased out in some new computers, there are still millions of them out there and you should know something about them. The floppy drive has a little slot on the face of the computer cabinet, and into this slot you can slide a floppy diskette like the one shown here. One of the reasons floppy drives are still around is that it is very easy to take a floppy diskette from one system to another.

Inside the floppy diskette is a round flat disk coated with iron oxide on each side so that data can be stored on it magnetically. This disk is called a platter, and it spins underneath an electro-magnet called the write head that puts data onto the platter surface. There is another head called the read head that copies data from the platter.

Once the disk has made one complete revolution, data is written all the way around. That is called a track. The head then moves a bit and writes another circle of data to create a second track. Altogether, there are 80 tracks on each side, for a total of 160. Altogether, the floppy can hold 1.44 MB (megabytes) of data.

If we are looking for just a few bytes out of 1.44 million, it’s not enough to know which track it is in. To help narrow the search, the track is divided into 18 pieces, calledsectors, which look much like a slice of pie. Each sector holds 512 bytes of data, so if we know the track and sector number of the data we want it won’t be hard to find.

Hard Drives – On a hard drive, data is also organized into tracks and sectors. While each sector still holds 512 bytes, there can be many more tracks and sectors on a platter. There are also multiple platters, one on top of the other like a stack of pancakes. Hard drives can hold much more data than floppies, sometimes into the billions of bytes, calledgigabytes(GB).

Multiple platters require multiple read and write heads, all attached to the same arm so they move together. It’s called an actuator arm. When we are reading track number 10 on the top platter, the other heads are also positioned over track 10 of the other platters, and together all of these track 10s make up a cylinder. To specify the location of data on a hard drive it is necessary to say what cylinder, then the track and sector. Moving the heads from one cylinder to another is called a seek, and the amount of time this takes is the average seek time.

Although hard drives can hold much more data than floppies, the platters are sealed into a metal case that is fastened inside the computer cabinet, so it’s not an easy matter to move from one system to another like you can with floppies. A hard drive is sometimes called a fixed diskfor this reason.

Operating systems use a couple of different methods to keep track of what data is stored where on a drive. One common method uses a table called a File Allocation Tableor FAT, which is a section of the disk with pointers to data locations. There are two versions, calledFAT16 and FAT32. Windows NT, XP and 2000 use a similar method called NTFS.

There are two different interfaces commonly by hard drives to talk to the rest of the system. These are called IDE for Integrated Drive Electronics, and SCSI forSmallComputer System Interconnect. The technical differences are not important at this point, but you should know about the two types because they are not interchangeable.

Figuring out where the heads should go next and then moving them there is the job of some electronic circuitry called the disk controller. Every disk drive has its own controller, which may be on the motherboard or inside the drive itself, depending on the type of drive.

There are a few more things you should know about disk drives before we leave the subject. The first sector of Cylinder 0, Track 0 is called the boot sector, and it contains aMaster Boot Record (MBR) that shows whether the disk contains an operating system and the location of the code. If there is more than one operating system, the drive must be divided into multiple partitions. If not, then the whole drive will be a single partition. All of the disk space assigned to a partition is called a volume.

Another term you will encounter is a disk format. There is a high-level format, which creates a new file allocation table and is done with a FORMAT command. There is also alow-level format that creates a new pattern of sectors. A low-level format must be followed by an FDISK command to create a new Master Boot Record and partitions.

Last, we have the word media. This refers to the actual surface holding the data, which is the platter in the case of a disk drive. Because the floppy platter can be taken out of the drive, it is called removable media, while a hard drive is calledfixed media.

Other Drives – Most systems today, especially home systems, have additional storage drives that use CD or DVD discs. The technology for both is similar but DVDs hold much more data. These drives do not store data magnetically but use optical markings that are read with a laser. They are mostly used just to read data and not to write it. The full name for CD in fact is CD-ROM, which stands forCompact Disc - Read Only Memory. However, there are versions that can be used to write also, and these are called CD-RW and DVD-RW. Even so they are mostly used to write just once for permanent storage, and are not practical for constantly changing data.

Like hard drives, CD-ROM drives can use either an IDE or SCSI interface. The version of IDE for CD-ROM drives is called ATAPI, and for SCSI the CD-ROM version is ASPI.

Because the discs can be removed, CD-ROM and DVD are considered removable media. There are other types of removable media also that are not as common, such as tape drives and Zip disks, which are similar to floppies but with a storage capacity of 100 or 250 MB. Zip disks and tape drives also use the ATAPI interface.

More About Memory

lled modules that plug into the motherboard. This makes it very convenient to add more memory by plugging in another module. Older computers used a SIMM, which stands for Single Inline MemoryModule, and later ones use a DIMM or Dual InlineMemory Module. The difference is that DIMMs have different signals on each side of the module connector, and the additional signals allow more memory addresses and more data lines going in and out.

The amount of memory is always is some multiple of two bytes. The most common values are 32, 64, 128, 256 or 512 megabytes.

As it is used by the system, RAM is divided into base memory and extended memory.Base memory is the first megabyte, andextended memory is everything over that. The very first PCs had only base memory, and then a scheme was developed calledexpanded memory that tricked the computer into allowing more than 1 MB of memory. Once extended memory was developed though, expanded memory quickly became obsolete and will only be found in older computers.

Another memory term you will encounter iscachememory. This refers to memory that is not on DIMMs but is either built into the CPU or connected directly to the motherboard near the CPU. It provides even faster access than RAM for the data that the CPU expects to need next. The contents of the cache will change constantly depending on what the CPU is doing.

Computer program

A computer program (also a software program, or just a program) is a sequence of instructions written to perform a specified task for a computer. A computer requires programs to function, typically executing the program's instructions in a central processor.The program has an executable form that the computer can use directly to execute the instructions. The same program in its human-readable source code form, from which executable programs are derived (e.g., compiled), enables a programmer to study and develop its algorithms.
Computer source code is often written by professional computer programmers. Source code is written in a programming language that usually follows one of two main paradigms: imperative or declarative programming. Source code may be converted into an executable file (sometimes called an executable program or a binary) by a compiler and later executed by a central processing unit. Alternatively, computer programs may be executed with the aid of an interpreter, or may be embedded directly into hardware.
Computer programs may be categorized along functional lines: system software and application software. Many computer programs may run simultaneously on a single computer, a process known as multitasking

Programming

Computer programming is the iterative process of writing or editing source code. Editing source code involves testing, analyzing, and refining, and sometimes coordinating with other programmers on a jointly developed program. A person who practices this skill is referred to as a computer programmer, software developer or coder. The sometimes lengthy process of computer programming is usually referred to as software development. The term software engineering is becoming popular as the process is seen as an engineering discipline.

Self-modifying programs

A computer program in execution is normally treated as being different from the data the program operates on. However, in some cases this distinction is blurred when a computer program modifies itself. The modified computer program is subsequently executed as part of the same program. Self-modifying code is possible for programs written in Machine code, assembly language, Lisp, COBOL, PL/1, Prolog and javascript (the eval feature) among others.

History after 1950

A number of efforts have been directed toward further refinement of the definition of "algorithm", and activity is on-going because of issues surrounding, in particular, foundations of mathematics (especially the Church–Turing Thesis) and philosophy of mind (especially arguments around artificial intelligence). For more, see Algorithm characterizations.