Monday, March 21, 2011

Introduction to PC Hardware



The hardware are the parts of the computer itself including the Central Processing Unit (CPU) and related microchips and micro-circuitry, keyboards, monitors, case and drives (hard, CD, DVD, floppy, optical, tape, etc...). Other extra parts called peripheral components or devices include mouse, printers, modems, scanners, digital cameras and cards (sound, colour, video) etc... Together they are often referred to as a personal computer.

Central Processing Unit - Though the term relates to a specific chip or the processor a CPU's performance is determined by the rest of the computer's circuitry and chips.

Currently the Pentium chip or processor, made by Intel, is the most common CPU though there are many other companies that produce processors for personal computers. Examples are the CPU made by Motorola and AMD.


With faster processors the clock speed becomes more important. Compared to some of the first computers which operated at below 30 megahertz (MHz) the Pentium chips began at 75 MHz in the late 1990's. Speeds now exceed 3000+ MHz or 3 gigahertz (GHz) and different chip manufacturers use different measuring standards (check your local computer store for the latest speed). It depends on the circuit board that the chip is housed in, or the motherboard, as to whether you are able to upgrade to a faster chip. The motherboard contains the circuitry and connections that allow the various component to communicate with each other.

Though there were many computers using many different processors previous to this I call the 80286 processor the advent of home computers as these were the processors that made computers available for the average person. Using a processor before the 286 involved learning a proprietary system and software. Most new software are being developed for the newest and fastest processors so it can be difficult to use an older computer system.

Keyboard - The keyboard is used to type information into the computer or input information. There are many different keyboard layouts and sizes with the most common for Latin based languages being the QWERTY layout (named for the first 6 keys). The standard keyboard has 101 keys. Notebooks have embedded keys accessible by special keys or by pressing key combinations (CTRL or Command and P for example). Ergonomically designed keyboards are designed to make typing easier. Hand held devices have various and different keyboard configurations and touch screens.

Some of the keys have a special use. They are referred to as command keys. The 3 most common are the Control (CTRL), Alternate (Alt) and the Shift keys though there can be more (the Windows key for example or the Command key). Each key on a standard keyboard has one or two characters. Press the key to get the lower character and hold Shift to get the upper.

Removable Storage and/or Disk Drives - All disks need a drive to get information off - or read - and put information on the disk - or write. Each drive is designed for a specific type of disk whether it is a CD, DVD, hard disk or floppy. Often the term 'disk' and 'drive' are used to describe the same thing but it helps to understand that the disk is the storage device which contains computer files - or software - and the drive is the mechanism that runs the disk.

Digital flash drives work slightly differently as they use memory cards to store information so there are no moving parts. Digital cameras also use Flash memory cards to store information, in this case photographs. Hand held devices use digital drives and many also use removable or built in memory cards.

Mouse - Most modern computers today are run using a mouse controlled pointer. Generally if the mouse has two buttons the left one is used to select objects and text and the right one is used to access menus. If the mouse has one button (Mac for instance) it controls all the activity and a mouse with a third button can be used by specific software programs.

One type of mouse has a round ball under the bottom of the mouse that rolls and turns two wheels which control the direction of the pointer on the screen. Another type of mouse uses an optical system to track the movement of the mouse. Laptop computers use touch pads, buttons and other devices to control the pointer. Hand helds use a combination of devices to control the pointer, including touch screens.
Note: It is important to clean the mouse periodically, particularly if it becomes sluggish. A ball type mouse has a small circular panel that can be opened, allowing you to remove the ball. Lint can be removed carefully with a tooth pick or tweezers and the ball can be washed with mild detergent. A build up will accumulate on the small wheels in the mouse. Use a small instrument or finger nail to scrape it off taking care not to scratch the wheels. Track balls can be cleaned much like a mouse and touch-pad can be wiped with a clean, damp cloth. An optical mouse can accumulate material from the surface that it is in contact with which can be removed with a finger nail or small instrument.

Monitors - The monitor shows information on the screen when you type. This is called outputting information. When the computer needs more information it will display a message on the screen, usually through a dialog box. Monitors come in many types and sizes. The resolution of the monitor determines the sharpness of the screen. The resolution can be adjusted to control the screen's display..

Most desktop computers use a monitor with a cathode tube or liquid crystal display. Most notebooks use a liquid crystal display monitor.
To get the full benefit of today's software with full colour graphics and animation, computers need a color monitor with a display or graphics card.

Printers - The printer takes the information on your screen and transfers it to paper or a hard copy. There are many different types of printers with various levels of quality. The three basic types of printer are; dot matrix, inkjet, and laser.

Dot matrix printers work like a typewriter transferring ink from a ribbon to paper with a series or 'matrix' of tiny pins.
Ink jet printers work like dot matrix printers but fires a stream of ink from a cartridge directly onto the paper.
Laser printers use the same technology as a photocopier using heat to transfer toner onto paper.
Modem - A modem is used to translate information transferred through telephone lines, cable, satellite or line-of-sight wireless.

The term stands for modulate and demodulate which changes the signal from digital, which computers use, to analog, which telephones use and then back again. Digital modems transfer digital information directly without changing to analog.

Modems are measured by the speed that the information is transferred. The measuring tool is called the baud rate. Originally modems worked at speeds below 2400 baud but today analog speeds of 56,000 are standard. Cable, wireless or digital subscriber lines can transfer information much faster with rates of 300,000 baud and up.

Modems also use Error Correction which corrects for transmission errors by constantly checking whether the information was received properly or not and Compression which allows for faster data transfer rates. Information is transferred in packets. Each packet is checked for errors and is re-sent if there is an error.

Anyone who has used the Internet has noticed that at times the information travels at different speeds. Depending on the amount of information that is being transferred, the information will arrive at it's destination at different times. The amount of information that can travel through a line is limited. This limit is called bandwidth.

There are many more variables involved in communication technology using computers, much of which is covered in the section on the Internet.

Scanners- Scanners allow you to transfer pictures and photographs to your computer. A scanner 'scans' the image from the top to the bottom, one line at a time and transfers it to the computer as a series of bits or a bitmap. You can then take that image and use it in a paint program, send it out as a fax or print it. With optional Optical Character Recognition (OCR) software you can convert printed documents such as newspaper articles to text that can be used in your word processor. Most scanners use TWAIN software that makes the scanner accessable by other software applications.

Digital cameras allow you to take digital photographs. The images are stored on a memory chip or disk that can be transferred to your computer. Some cameras can also capture sound and video.

Case - The case houses the microchips and circuitry that run the computer. Desktop models usually sit under the monitor and tower models beside. They come in many sizes, including desktop, mini, midi, and full tower. There is usually room inside to expand or add components at a later time. By removing the cover off the case you may find plate covered, empty slots that allow you to add cards. There are various types of slots including IDE, ASI, USB, PCI and Firewire slots.

Depending on the type notebook computers may have room to expand . Most Notebooks also have connections or ports that allows expansion or connection to exterior, peripheral devices such as monitor, portable hard-drives or other devices.

Cards - Cards are components added to computers to increase their capability. When adding a peripheral device make sure that your computer has a slot of the type needed by the device.

Sound cards allow computers to produce sound like music and voice. The older sound cards were 8 bit then 16 bit then 32 bit. Though the human ear can't distinguish the fine difference between sounds produced by the more powerful sound card they allow for more complex music and music production.

Colour cards allow computers to produce colour (with a colour monitor of course). The first colour cards were 2 bit which produced 4 colours [CGA]. It was amazing what could be done with those 4 colours. Next came 4 bit allowing for 16 [EGA and VGA ] colours. Then came 16 bit allowing for 1064 colours and then 24 bit which allows for almost 17 million colours and now 32 bit and higher allow monitors to display almost a billion separate colours.

Video cards allow computers to display video and animation. Some video cards allow computers to display television as well as capture frames from video. A video card with a digital video camera allows computers users to produce live video. A high speed connection is required for effective video transmission.

Network cards allow computers to connect together to communicate with each other. Network cards have connections for cable, thin wire or wireless networks. For more information see the section on Networks.

Cables connect internal components to the Motherboard, which is a board with series of electronic path ways and connections allowing the CPU to communicate with the other components of the computer.

Memory - Memory can be very confusing but is usually one of the easiest pieces of hardware to add to your computer. It is common to confuse chip memory with disk storage. An example of the difference between memory and storage would be the difference between a table where the actual work is done (memory) and a filing cabinet where the finished product is stored (disk). To add a bit more confusion, the computer's hard disk can be used as temporary memory when the program needs more than the chips can provide.

Random Access Memory or RAM is the memory that the computer uses to temporarily store the information as it is being processed. The more information being processed the more RAM the computer needs.

One of the first home computers used 64 kilobytes of RAM memory (Commodore 64). Today's modern computers need a minimum of 64 Mb (recommended 128 Mb or more) to run Windows or OS 10 with modern software.

RAM memory chips come in many different sizes and speeds and can usually be expanded. Older computers came with 512 Kb of memory which could be expanded to a maximum of 640 Kb. In most modern computers the memory can be expanded by adding or replacing the memory chips depending on the processor you have and the type of memory your computer uses. Memory chips range in size from 1 Mb to 4 Gb. As computer technology changes the type of memory changes as well making old memory chips obsolete. Check your computer manual to find out what kind of memory your computer uses before purchasing new memory chips.

What happens when your PC is powered on?

When your PC is powered on a sequence called the bootstrap is run. It occurs in two steps, Power-On Self Test and Operating System Load.

Power-On Self Test (POST) is a series of tests to make certain that necessary is present and properly operating.

  1. First the Central Processing Unit (CPU) is reset. 
  2. The CPU checks itself and the POST program stored in the BIOS memory. 
  3. Then the CPU begins using the code located in BIOS to check components in the PC. 
  4. The DRAM is tested by writing and reading back every byte to insure proper operation. 
  5. The Keyboard is checked for attachment and to see if any key has been pressed. 
  6. Pushing certain keys during boot up tells the CPU you want to modify the BIOS code. You would want to do this if a new piece of hardware has been added and you need to set up BIOS to talk to it. 
  7. The Floppy and Hard Drives are checked to make sure they are present. 
  8. The Mouse is also checked to make sure it is attached. 
  9. Finally, the test results are compared to the configuration data in the BIOS. 
  10. Any mismatches causes the POST to fail and an error message appears on the display.

Operating System Load - After the POST is successfully completed the CPU searches Storage devices for special files that indicate the beginning of the OS and then loads it into memory.

  1. The sequence in which the storage devices are searched is part of the configuration set-up stored in BIOS. 
  2. Once the Operating System (OS) is located, the CPU copies what’s called the 'boot record' from the OS into DRAM. 
  3. Control is then passed to the 'boot record' in DRAM, which then continues loading the rest of the OS. 
  4. This process continues until the OS load is completed.  
  5. When the OS load is completed the Desktop appears in the display and waits for you, the user, to tell it what you want it to do.

What is a computer?

It is one of the most revolutionary and powerful tools ever developed! It stands in the company of the wheel, the aircraft wing and the internal combustion engine because of the tremendous changes it has and still continues to make in our lives.

Together with the its close cousins, the Internet and the web, a global, instantaneous communications network now exists in a way no one dreamed of when the first commercial PC appeared in 1981.

This Web site was developed to help non-technical people take full advantage of this powerful technology. On the surface, its workings are not at all intuitive, and probably appear somewhat mysterious. It is just the opposite! It is a very well ordered, logical machine.

Our aim is to take a some of the mystery out of it for you!

Where do we begin?

There are different ways to study any system. One is by describing each component. In Hardware each component of the PC is described to provide a basic understanding of how each one works. This type of analysis by itself doesn't provide an understanding of the how the PC functions as a unit.

In PC Basics we talk about the different functions in a PC and what they do. At the end we show you the bigger picture where they all come together to make the PC work.

Processor - At the heart of every PC is the central processing unit, CPU for short. The CPU plugs into a motherboard which has a lot of other chips and electronics on it. The CPU and other components work together to schedule, compute and control everything that happens in the PC.

You've probably seen the 'Intel Inside' appearing in many computer sales ads. They are referring to the Intel CPU which is often a Pentium or Celeron processor.

Input - devices that allow you to direct the action of the PC. The keyboard and mouse enable you to control the computer by giving it directions (input).

Output - devices that display or produce results for you. The video display and printer are the primary ones. The speakers beep, chime etc., to let you know an action is completed and they also play your favorite MP3 files.

Memory - is temporary storage used by the CPU to store results of calculations or files brought in from the hard drive. Memory is very fast and volatile which means it loses it's information when power is removed. The memory cells are housed in Integrated Circuits (ICs), or chips as they are often called.

Storage - devices that retain information magnetically (Hard Disk Drive and Tapes) or optically (CD and DVD). They are not as fast as memory but can store much more data. They do not lose their information when power is removed.

Software - these are instructions, also known as programs or code. Software is to the CPU, what knowledge is to our human brains. The CPU and software work very closely together. Each one by itself is useless. Only when they work properly together can they direct and execute activities in the PC in a productive way.

The PC and the ATM

What do a PC and an automated teller machine have in common? They are both computer based systems. By explaining the operation of an ATM it may help you see how information flows in a PC based system.

The PC is general purpose. It can run many different types of software that do a wide range of things.

The ATM has all the functional elements of a PC: processor, memory, storage, input, output and software. Like the PC, it can connect to remote computers using communication services in order to access your bank records and determine whether or not to authorize transactions.

The ATM can be thought of as a specialized PC that is designed to do a very limited set of operations. It takes in deposits, dispenses withdrawals and prints out account information.

The ATM software resides in a local or remote storage device and runs on a central processing unit probably a microprocessor or micro controller. It is programmed to sit and wait for you, the user, to tell it what to do.

How do you tell it what to do? With input of course. The basic inputs to the ATM are a keypad, the ATM card reader and the envelope receiver bin used to make deposits.

After the ATM has read your card and you have successfully entered your PIN (Personal Identification Number), which it temporarily stores in memory, you can complete your transaction. Let's say you want to withdraw $100. Using the keypad you select the account and the amount to be debited. The codes for the keys you press go into memory until the processor uses them to determine what action to take. During all this, how do know what the ATM is doing? You know because you are reading a display output that shows you status messages.

The processor in the ATM checks with the remote computers to determine if your bank account is active and if there are sufficient funds to proceed. If so, it slides your money out through the cash dispensing machine door which is another output device. Its then asks you by way of the display if you want to make another transaction. Based on your input it takes the proper action.

If you are done it returns your ATM card, and prints another output device a transaction receipt and closes itself up and waits until someone asks it to do something.

Hopefully you've begun to see what the basic PC functions are and how they work together to perform a useful service for us.

Intel Core i5 2500K 'best CPU of 2011'

Tech Radar has published a processing buying guide called Best CPU 2011 in which the tech site evaluated a range of processors at different price segments.
Aiming to provide a guide to "which processors offer the best value for money in an even more confusing world of chipsets and sockets", Tech Radar looked at the latest offerings from Intel and AMD.
"Predictably enough the winner is Intel's second generation Core processors, those Sandy Bridge chips," Jeremy Laird.
"Not only do they blow everything vaguely close to them out of the water performance-wise, but they also represent the future of processor design."
Tech Radar nominated the mid-range Core i5 2500K processor but warned that an upgrade to the new Sandy Bridge processor would requite a "total rig upgrade".

TOP 5 COMPANIES IN THE COMPUTER HARDWARE

(DELL, NCR, SGI, HPQ, AAPL)

Mar 21, 2011 (SmarTrend(R) News Watch via COMTEX) -- Below are the top five companies in the Computer Hardware industry as measured by relative performance. This analysis was compiled based on yesterday's trading activity as we search for stocks that have the potential to outperform.
Dell (NASDAQ:DELL) ranks first with a gain of 2.83%; NCR (NYSE:NCR) ranks second with a gain of 1.27%; and Silicon Graphics International (NYSE:SGI) ranks third with a loss of 0.06%.

Hewlett-Packard (NYSE:HPQ) follows with a loss of 0.27% and Apple (NASDAQ:AAPL) rounds out the top five with a loss of 1.19%.

SmarTrend currently has shares of Silicon Graphics International in an Uptrend and issued the Uptrend alert on December 03, 2010 at $8.04. The stock has risen 115.6% since the Uptrend alert was issued.

Write to Chip Brian at cbrian@tradethetrend.com

---------------------------------------------------------------------------------------------

SmarTrend analyzes over 5,000 securities simultaneously throughout the trading day and provides its subscribers with trend change alerts in real time. To get a free trial of our trading calls and maximize your trading results, please visit http://www.mysmartrend.com

Get exclusive, actionable insight into how the market is expected to trend prior to market open with our free morning newsletter. Sign up at: http://www.mysmartrend.com/signup

Copyright, Comtex News Network, Inc. 2011

**********************************************************************

As of Thursday, 03-17-2011 23:59, the latest Comtex SmarTrendA? Alert,
an automated pattern recognition system, indicated a DOWNTREND on
03-15-2011 for NCR @ $18.09.

As of Thursday, 03-17-2011 23:59, the latest Comtex SmarTrend Alert,
an automated pattern recognition system, indicated an UPTREND on
12-03-2010 for SGI @ $8.04.

For more information on SmarTrend, contact your market data
provider or go to www.mysmartrend.com

SmarTrend is a registered trademark of Comtex News Network, Inc.
Copyright A? 2004-2011 Comtex News Network, Inc. All rights reserved.

Sunday, March 20, 2011

How to clean your PC of dust and dirt

Tips for improving computer performance usually concentrate on streamlining and maintaining operating systems, boosting speed with new RAM, upgrading video and so on. However, you can give your machine a speed and reliability upgrade easily with the help of a vacuum cleaner and a soft brush.

A build-up of dust on vents, components and fans ruins your machine's ability to keep its cool, and when a computer runs at a high temperature, it goes more slowly.

In the worst-case scenario, your cards, power supply units and motherboards can fail entirely. On a more basic level, dirt and dust can gum up moving parts and affect performance.

Here, we'll show you how to physically clean your PC, keyboard and monitor. As a bonus, we'll also tell you how to keep your computer grime-free once you've fettled it. You'll add years to the life of your hardware and improve its performance.

Before you begin, remember that PC cleaning is a serious job that - depending on how far you want to take it - will require some technical skills. As a gauge, if you're comfortable with fitting new memory or upgrading a video card in your PC, you should be able to complete all the steps.

Gear up, power down

Start by assembling your tools. You'll need a small, soft brush - the kind you might use for painting a window or door frame. Make-up brushes are also ideal. Go for the best quality you can afford, because economy ones often tend to shed hairs.

A can of compressed air, which should be available from most computer retailers and hardware shops, is also required. Make sure you have soft, general cleaning cloths for the exterior of your machine and the computer's cabling.

The final essential tool is a full-sized vacuum cleaner with a nozzle attachment, or a fully charged handheld device. Some other tools may be handy, but aren't necessities. For example, an anti-static wristband will prove useful once you've opened up the computer.

You might also want to use a switch cleaner, which is a spray solvent that eats dust and can be used on ports and contacts. These aids can be bought cheaply from Maplin or larger computer retailers.

Switch off your computer and unplug it from the mains. If you've been using it, you should leave it to stand for at least 30 minutes before you begin the cleaning routine. This will give internal components a chance to cool down, and also reduce the risk of electric shock from any stored charge that may potentially injure you or damage your computer.

Carefully unplug all your peripherals and input devices, then set the cables to one side, because you'll be giving them special attention.

Place your computer on a raised surface - an empty table or desk will do fine. Attempting to spring clean with the computer on the floor or in another awkward place will just make things more difficult. You're now ready to begin

Computer Hardware Update - Leaders: STX, NTAP - Laggards: IBM, AAPL

New York, March 16th (TradersHuddle.com) - IBM (NYSE:IBM), the IT solutions and consulting services provider is trading at 155.57, which represents -2.17% versus its previous trading session close,adding downward pressure to technology shares, with the Technology Select Sector Spider (NYSE:XLK) trading -0.96% from its previous trading session close.

Technology shares trading flat with the S&P500, which is trading lower by -0.96%.

Among the computer hardware makers, IBM was the worst performer in the Computer Hardware Index (NYSE:^HWI), which is trading lower by 0.31%. The index is having a mixed day with slight upside bias with 5 index components trading higher.

Apple (NASDAQ:AAPL), is a worst performer as well. The maker of iPhones and iPads is trading at $338.17 representing -2.1% Versus the previous trading session. Shares of Apple have defined support at $159.02 and resistance at $159.02.

Relative strength in the Computer Hardware Index is being felt in Seagate (NASDAQ:STX), which is the top performer in the session, with the stock trading at $13.27 representing 2% versus the previous trading session. Shares of Seagate, the maker of hard drives and storage solutions have defined support at $12.26 and resistance at $14.19.

The other top performer is NetApp (NASDAQ:NTAP), which is trading at $47.32 representing 1.72% from its previous close. NetApp, the storage and data management solutions provider has calculated support and resistance levels at $46.57 and $52.83 respectively.

Top 10 Computer Hardware Stocks

Xyratex Ltd. (NASDAQ:XRTX) has the 1st highest Return on Assets in this segment of the market. Its ROA was 29.82% for the last 12 months. Its Asset Turnover ratio (revenue divided by assets) was 3.43 for the same period. Apple Inc. (NASDAQ:AAPL) has the 2nd highest Return on Assets in this segment of the market. Its ROA was 23.66% for the last 12 months. Its Asset Turnover ratio (revenue divided by assets) was 1.08 for the same period. SanDisk Corporation (NASDAQ:SNDK) has the 3rd highest Return on Assets in this segment of the market. Its ROA was 17.60% for the last 12 months. Its Asset Turnover ratio (revenue divided by assets) was 0.65 for the same period. Synaptics, Incorporated (NASDAQ:SYNA) has the 4th highest Return on Assets in this segment of the market. Its ROA was 17.07% for the last 12 months. Its Asset Turnover ratio (revenue divided by assets) was 1.46 for the same period. Western Digital Corp. (NYSE:WDC) has the 5th highest Return on Assets in this segment of the market. Its ROA was 15.07% for the last 12 months. Its Asset Turnover ratio (revenue divided by assets) was 1.37 for the same period.

Seagate Technology PLC (NASDAQ:STX) has the 6th highest Return on Assets in this segment of the market. Its ROA was 14.91% for the last 12 months. Its Asset Turnover ratio (revenue divided by assets) was 1.39 for the same period. Mercury Computer Systems Inc. (NASDAQ:MRCY) has the 7th highest Return on Assets in this segment of the market. Its ROA was 13.35% for the last 12 months. Its Asset Turnover ratio (revenue divided by assets) was 0.94 for the same period. Intevac, Inc. (NASDAQ:IVAC) has the 8th highest Return on Assets in this segment of the market. Its ROA was 12.33% for the last 12 months. Its Asset Turnover ratio (revenue divided by assets) was 0.89 for the same period. 3D Systems Corporation (NASDAQ:TDSC) has the 9th highest Return on Assets in this segment of the market. Its ROA was 10.89% for the last 12 months. Its Asset Turnover ratio (revenue divided by assets) was 0.89 for the same period. Key Tronic Corporation (NASDAQ:KTCC) has the 10th highest Return on Assets in this segment of the market. Its ROA was 10.26% for the last 12 months. Its Asset Turnover ratio (revenue divided by assets) was 2.39 for the same period.

SUBSCRIBE TO OUR FREE DAILY EMAIL UPDATES

DAILY STOCK RANKINGS
•Daily Top-10 Stock Rankings (Mar 20, 2011)
•Daily U.S. Market Headlines (Mar 20, 2011)
•Top Rebounding Canadian Stocks (Mar 20, 2011)
•Top Rebounding U.K. Stocks (Mar 20, 2011)
•Daily Top-10 Stock Rankings (Mar 19, 2011)
•Top Falling Stocks with Unusual Volume (Mar 19, 2011)
•Latest 52-Week High Stocks (Mar 19, 2011)
•Latest 52-Week Low Stocks (Mar 19, 2011)
•Top Rising Stocks with Unusual Volume (Mar 19, 2011)
•Best-Performing Canadian Stocks for the Week Ended...
•Best-Performing U.K. Stocks for the Week Ended Mar...
•Daily Top-10 Stock Rankings (Mar 18, 2011)
•Top Falling Stocks with Unusual Volume (Mar 18, 2011)
•Daily U.S. Market Headlines (Mar 18, 2011)
•Latest 52-Week High Stocks (Mar 18, 2011)
•Latest 52-Week Low Stocks (Mar 18, 2011)
•Top Rising Stocks with Unusual Volume (Mar 18, 2011)
•Top Canadian Stocks with Highest Momentum (Mar 18,...
•"Strong Buy" Rated U.S. Stocks (Mar 18, 2011)
•Daily Top-10 Stock Rankings (Mar 17, 2011)
•Daily U.S. Market Headlines (Mar 17, 2011)
•Top Falling Stocks with Unusual Volume (Mar 17, 2011)
•Latest 52-Week High Stocks (Mar 17, 2011)
•Latest 52-Week Low Stocks (Mar 17, 2011)
•Top Rising Stocks with Unusual Volume (Mar 17, 2011)

How your operating system works

 The operating system also manages how much CPU time each running application has to ensure that it gets work done. Most modern PCs have multiple CPUs, but let's imagine we only have one.

Only one application or process can use that CPU at any one time. To create the illusion of many applications running simultaneously, the OS will switch rapidly back and forth between the current set of programs, giving each one a small timeslice in which to get some work done.

Once the current application has run for a certain amount of time (the time slice), or has been suspended waiting for a resource or some form of user input, the OS will save its current state (register values, memory, current execution point), load the saved state for the next application in line, and start executing it.



After it's completed its timeslice or has suspended, the next process gets a turn using the CPU to get work done. This round-robin scheduling continues as long as the OS is running.

Sometimes an interrupt will occur needing immediate attention, in which case the current process is interrupted, its state is saved and the interrupt is serviced.

Modern 32-bit and 64-bit operating system provide services that manage memory for user applications, including the virtualisation of memory. In essence, the memory layout for a user application looks exactly the same to each one.

To ensure that different programs don't interfere with each other's memory structures, the OS doesn't provide access to physical memory directly. Instead, it maps user-mode memory through mapping tables called descriptor tables to either real memory or to the swap file on disk.

This provides a great deal of flexibility for the operating system: it can move memory blocks around to accommodate other programs' memory requirements without the original program knowing; it can swap out memory blocks to disk if the program isn't being used and it can defer assigning (or committing) memory requests until the memory is written to.

This mapping of memory through descriptor tables also means the OS gives every user application the convenient fiction that it's the only application running on the system. No applications will clash by trying to use the same memory, and an application can't cause another to crash by writing to its memory space.





FIGURE 2: Mapping virtual memory to physical memory and the swap file with a descriptor table

Figure 2 shows two programs, A and B, both with the same view of their memory space. Program A has one block of memory allocated at a particular position in its memory space; in reality it's found somewhere else in physical memory via the descriptor table. Program B has two blocks allocated, one of which is found in the swap file for the system.

Files and folders

Another important virtualised service provided by the OS is the filesystem. Disk hardware works on logical block addresses (LBAs), which are essentially numbers that define the sector number from the beginning of the drive volume.

The disk controller hardware converts the LBA into physical parameters (such as head, track and platter) to find the actual sector. For SSD drives, the disk controller simply converts the LBA into a memory address (although the controllers on SSDs will move data blocks around to even out access to the flash memory unbeknownst to the OS).

The operating system hides these raw LBAs from user programs by imposing a hierarchical filesystem over the disk. The filesystem organises the physical disk sectors (each one usually being 512 bytes in size, although the market is starting to move towards 4kB sectors since most filesystems use that block size as a minimum allocation and granular size for a file) into files and directories.

The filesystem is responsible for maintaining the mapping between files and blocks, which blocks appear in which files (and in which order they appear), which directory a file is found in, and other similar services.

The filesystem virtualisation also means that user programs only need to worry about high-level operations with files and folders: creating new ones, deleting existing ones, adding data to the end of a file, reading and writing to files and enumerating the folder contents.

All the mapping between userfriendly names and LBAs is done by the operating system under the hood. To the user program, a file is just a contiguous set of bytes somewhere on the disk and it doesn't have to work out that the file consists of a block over here, followed by that one over there.

APIs

This filesystem abstraction points to another set of services provided by the operating system: the application programming interfaces (also know as APIs).

These are plug-in points that let user programs like browsers and word processors to take advantage of various services exposed by the operating system. These include APIs for memory management, file and folder management, network management, user input (keyboard and mouse), the windowing user interface, multimedia (video and audio) and so on.

In all cases, the API provides a standardised way for user applications to obtain and use resources from the PC, no matter what hardware was actually present. So, for example, a user program doesn't have to know anything about which video adaptor or screen the PC is using in order to display something on it. It merely makes calls to the standard API ('draw a window here of this size') and the adaptor and screen drivers translate those standard requests to calls to the hardware that provide the required result.

That is perhaps the last part of the operating system story. It isn't a monolithic program, written to work with every single piece of hardware out there. It is instead a framework into which hardware-specific drivers are plugged.

These drivers know how to access their particular hardware, can translate between standard function calls and the requirements of the device, and are written to use the operating system's APIs.