Basic Operating System Concepts

Written by Wendi Jollymore, 1997-99
Last Update:
[ Previous Page | Back To Terminal Learning! ]

Summary of topics covered here:
  Operating Systems and Environments
  Files and Directories
  Parts of a Disk
  How the Computer Boots Up
       DOS Boot Process
       Windows95 Boot Process
  The CONFIG.SYS and AUTOEXEC.BAT Files

Operating Systems/Environments

What's an operating system? An operating system is a type of software that allows people like us to use a computer. Before operating systems, computer's were really hard to use. You had to know a lot about how the inside of a computer works and you had to type in ugly stuff like machine code (lots of 1's and 0's). Most people who used computers then had been using them for years and had even built their own computers. Today, anyone can use a computer!

The operating system is like a bridge over a river - it connects a user (a person who uses a computer) and a computer's hardware. Without it, most of us couldn't use a computer. The operating system is an interface between the user, the hardware, and the software.
 

Hardware refers to the parts of a computer, like the monitor, keyboard, hard drive, etc. 
Software refers to the programs that run on your computer, like word processors, games, virus scanners, etc.

Besides allowing a user to use a computer, the operating system is also responsible for managing a computer's resources. The CPU, memory, secondary storage devices, and input and output devices all have to be told what to do and when to do it. The operating system also keeps track of all your files and programs - what kind of files they are, where they are on a disk, how big they are, and when they were created or changed.

The operating systems we are working with in this course are MS-DOS (MS stands for MicroSoft and DOS stands for Disk Operating System), which is a command-line interface, and Windows95, which is a Graphical User Interface (GUI).

A command-line interface is an environment where you tell the computer what you want by typing at the command line, or prompt, then pressing the Enter key.

A Graphical User Interface is an environment with graphics and icons that a user may operate on with a mouse or other pointing device. Such operations might include clicking, double-clicking, dragging and dropping.
 

What's an operating environment? An operating environment, which is also sometimes called an operating system emulator, is software that acts like an operating system. Windows 3.x is an example of an operating environment (which is also a GUI). Windows uses icons on the screen to represent programs or groups of programs. This and older versions of Windows require DOS to run on your computer.


Unlike Windows 3.x (3.1 and 3.11), Windows95 and WindowsNT are operating systems, not operating environments. They run stand-alone on your system, without DOS in the background. If you want to use DOS, you have to run the DOS Shell, which is a separate program.

  Quick Quiz! 
What are some other examples of operating systems?
  Can you name a few?
 

Files and Directories

Files are organized on your computer in a couple of ways. Files are given meaningful names and extensions to help the user and the software to recognize them. Files are also organized into directories or folders.

For example, the name CTCH21X1Exam.Doc tells me that this file is probably a Microsoft Word Document of an exam for the class CTCH21X1. We'll talk more about file types in a moment.

In DOS and Windows 3.x, all file names must follow a certain pattern. The first part of the file name is an 8 character (or less) root name that might tell you what's in the file. If the name is more than 8 characters, you won't get an error, but DOS will cut off the extra characters for you. You can also use a dash (-) or an underscore (_) in your file name, but you are not allowed to use a space. You might sometimes see files or folders with the ~ (tilde - pronounced TILL-dee) symbol in them.  The tilde usually indicates that the file or folder name is too long for DOS and that there are more characters to the name than what you see.  This occurs when you are using an environment like Windows95 or Unix with DOS, since both those operating systems allow "long filenames" (file and folder names greater than 8 characters). In operating systems like Windows95 or Unix, a file's name and extension can be any number of characters, including spaces.

File Types

The file's extension should tell you what type of file it is.  Some common file extensions you might come across are:

EXE or COM
These are executable files. They are programs or commands that you can run. To run an EXE or COM file in DOS just type the root of the file name. For example, to run a program called win.com, you just have to type win and press the Enter key.
BAT
Batch file. A batch file is a bunch of DOS commands that run when you type in the batch file's root name.
TXT
Text file. This is a file that contains plain text. You can view it on your screen in DOS by using the type command, or in Windows 3.x by using Notepad. You can also view it in any word processor.
BMP
Bitmap. This is a graphics file. You can create your own BMP files in Window's Paint Brush or other graphics package that supports bitmaps. Other graphics files have extensions like .JPG, .GIF, .TIF, .PCX and many more.
INI
These are files used in Windows. INI files are files that contain information about programs and software. They usually tell Windows how a certain program should look and behave.
SYS
System file. These files are special files that help the hardware and devices work together and configure how the computer works.
HLP
Help file. These are used both in Windows and in DOS. They contain information for the user on how to use certain commands and programs.
HTM, HTML
Hypertext file. These are text files made up of Hypertext Markup Language and are used to display information in a web browser like Netscape Navigator.
There are lots of other file extensions and you will learn to recognize them as you use different types of programs and software.
 
 
  Quick Quiz! 
Which of the following are valid DOS file/folder names? 
1.  IMCHILLIN 
2.  MY DOCS 
3.  MYFILE.TXT 
4.  MY-FILE.DAT 
5.  MY_FILE.HTML 
6.  SYSTEM.4-1 
7.  MYBATCH.001 

Now, a computer will have hundreds and thousands of files on it, so thankfully there is an easy way to keep them all organized.

What if you ran a business and decided to just throw all your documents, letters, invoices and such into one big pile on the floor? Not only would this be really messy, but you would also have a hard time trying to find what you wanted. To avoid this problem, we use folders and filing cabinets. Similarly, we keep all our computer files in directories and folders on disk as a way of keeping them organized.

The main directory on your computer is called the root directory. At the command prompt, it's shown as a \ after the drive specification (ie. G:\> or C:\> ). Off of your root directory, you have subdirectories. Think of it like a tree. The root directory is the trunk of the tree, from which all the branches (subdirectories) grow. Subdirectories can contain more subdirectories, just like tree branches can have more branches growing off them. We use a similar system in an office - a filing cabinet (the root directory) might have a number of drawers (sub-directories) and each drawer is divided into folders. A folder might also contain more folders to further categorize information.

A way of looking at a directory structure would be with a hierarchy chart like the one below:

When you want to locate a file or run a program, you need to know the file's path. The path is the location of a file in the directory or folder structure. For example, using the diagram, lets say that you wanted to use a file called SYSA1.VSD located in the Visio subfolder of the Program Files folder. The full path and file name would be C:\Program Files\Visio\SYSA1.VSD.  In this example, "C:\Program Files\Visio" is the path and "SYSA1.VSD" is the file name.
 
 

  Quick Quiz! 
What would be the paths or locations of files in the following folders?  
1.  ISU  
2.  WINDOWS  
3.  EXAMS  
4.  CTCH21X1  
5.  WEEK3 
 

Parts of a Disk

When you want to write a letter to a friend, you have to have their address. Cities and towns are divided up into streets and buildings on the streets are all given numbers. This information indicates where you can find your friend. Disks need to work the same way so that the operating system can find your files. You'll have many files on a disk, so there needs to be some way of addressing the parts of your disk in order to determine where your files are.

Notice that the disk in the diagram is broken up into tracks and sectors. This is how we begin to address the data on the disk.

Tracks are concentric circles (circles that have the same center) on the disk. The number of tracks on a hard disk platter depends on the type and manufacturer of the hard drive. On a 3.5 HD (high density) disk there are 80 tracks on each side of the disk. They are numbered from 0 on the outside to 79 on the inside. Each of these disks has 2 identical sides, with 0 being the top and 1 being the bottom. So far, we can now identify a track on certain side of a disk, for example, Track 40 on Side 1. Let's narrow it down some more.

Sectors are pie-shaped wedges on a disk. The number of sectors on a hard disk platter depends on the type and manufacturer of the hard drive. Each track on a 3.5" HD disk is broken up into 18 sectors. A sector is always 512 bytes in size and it is the smallest unit that you can write to on a disk. So now we can identify a part of the disk by it's side number, track number and sector number.

  Quick Quiz!
You can calculate the capacity (number of bytes) on a disk when you know something about the tracks and sectors of the disk:
Disk Capacity = (# of Tracks per Side) X (# of Sides) X (# of Sectors per Track) X (# of Bytes per Sector)

So, with this formula, what is the storage capacity of a 3.5" HD Disk?

Data on disks is also organized into clusters. A cluster is a group of one or more sectors, and the number of sectors is determined by the type and size of disk. On a 3.5" HD disk, there is 1 sector in a cluster however, on hard disks, the number of sectors per cluster goes up as the capacity of the disk gets larger. A cluster is the smallest unit where you can store a file. In other words, if your disk has a cluster size of 8 sectors, and you store a file that is about 3 sectors, the whole cluster is used up by the file, even though there are 5 sectors of space left! You can't allocate more than one file in a cluster (although you can store a file in more than one cluster). This is why we sometimes call a cluster an allocation unit.

How big are the clusters on your computer?
You can check the cluster size of your hard drive by running a program called CHKDSK (Check Disk). At the DOS prompt, type CHKDSK and press Enter. You will see lots of information on your screen when the command executes. Look for a line like this:
32,768 bytes in each allocation unit
This says that there are 32,768 bytes in a cluster (your number may be different). Since we know that there are 512 bytes in a sector, how many sectors are in one cluster on this hard drive? What does this mean in terms of space on the drive, for example, what if I stored a lot of small files on this drive?

The first few sectors on track 0 of a disk contain vital information that is needed to find the addresses of files and sometimes to boot up the computer.


In the above diagram, the first four blocks represent these sectors, called the System Area. The rest of the tracks and sectors on the disk, where all your files are stored, is called the File Area

You can see that the System Area is made up of four main parts:

  • Boot Sector, Master Boot Record (MBR), or Boot Block
    This sector contains the boot program. When you turn on your computer, it looks for this area on your hard disk (or, if you are booting from Drive A:, on the diskette) for a program that prepares the computer and the operating system to be used.

  • FAT1
    FAT stands for File Allocation Table. This table keeps track of every cluster on your disk - it's basically a list of clusters and their contents. An entry in the table might indicate that a cluster is used up. Sometimes a file is too big to fit in one cluster, so it takes up a few clusters. In this case, the first cluster's entry in the FAT will "point to", or give the address for, the next cluster that contains more of the file. This next cluster may point to the next cluster with the file, or it may indicate that the file is finished. When files are broken up over many clusters like this, it is called fragmentation. This can sometimes slow down your computer, especially when the clusters are not "contiguous" (next to each other). A cluster's entry in the FAT might also indicate that the cluster is free, or empty, and it might also indicate that it is damaged and can't be used.

  • FAT2
    The FAT on a disk is very important. If it ever gets damaged, you can no longer use your disk and you lose all the files and data stored on it. For this reason, a disk stores a second copy of the FAT, called the FAT Backup. This way, if the first FAT gets damaged, the disk can use the second FAT instead.

  • Root Directory
    This section is where all the information in the Root Directory is stored. The Root Directory stores information such as:
    file and directory names
    file size
    date and time the file or directory was created
    file attributes
    pointer to FAT
    When you want to get a file on your disk, DOS first looks up the file in the Root Directory. The Root Directory points to the first cluster in which the file is located. If it's a big file, that cluster's FAT entry shows where the next cluster is, and so on until the end of the file is found.

    When you format a disk, the tracks and sectors are created, along with the information stored in these sections of the disk. We'll discuss formatting disks in a later section.

    How the Computer Boots Up

    When you turn on, or "boot up" your computer, a number of things occur in order to make it ready to receive commands and run programs. Even though you are probably using Windows95 for most of this course, we are going to cover the boot process for both Windows95 and a DOS-based system.

    Booting Up in DOS

    1. Power comes on.
    This is pretty easy, just flip the switch!

    2. POST Program Runs.
    POST stands for Power On Self Test. It is located in the ROM-BIOS (Read Only Memory - Basic Input-Output System) chip and performs a series of checks on the system:
    a) Checks itself
    The POST Program checks itself to make sure that it is functioning properly.
    b) Checks bus lines and video ROM
    Bus lines are the pathways that carry data from one componnent of the computer to another. The POST Program sends signals along the bus lines to various hardware componnents to make sure they're working. Some of these componnents, like a video card, also have they're own ROM-BIOS, which is loaded into memory with the original ROM-BIOS.
    c) Primary Memory is tested
    Primary memory, also called main memory or RAM (Random Access Memory), is checked and a running total is displayed on the monitor.
    d) Keyboard connection is tested
    The POST Program checks to see if the keyboard is properly connected. If it isn't, a message asking you to check the connection and press the F1 key is displayed on the screen.
    e) Diskette Drives and Hard Drives Tested
    Any diskette drives and hard drives connected to your computer are tested to ensure that they are connected and working properly.
    f) Results of POST compared to CMOS
    The results of the POST are compared with the permanent record in the CMOS.

    CMOS stands for Complementary Metal-Oxide Semi-Conductor and refers to an area of the system that stores information about how the hardware on your computer works.

    3. Operating System is Loaded.
    This is when the actual operating system is loaded onto the system. In order for this to happen, 3 files are needed. They are IO.SYS, MSDOS.SYS and COMMAND.COM. IO.SYS and MSDOS.SYS are hidden system files so they don't show up in a directory listing. They are like a contractor and a foreman on a construction site - they determine what tasks need to be done on the system and then get those tasks done using the system's resources. COMMAND.COM is where the internal DOS commands are located.
  • Another piece of code in the ROM BIOS looks for the boot sector where the boot program is located, and for the 2 system files. First, it will look on Drive A: If they aren't found there, it will look on Drive C: If you have accidentally placed a disk in Drive A: that isn't a boot disk, you will get a "Non-System Disk" Error and must remove the disk from the drive, or replace it with a bootable disk.
  • When the boot program and files have been found, the boot program loads IO.SYS into memory. This file contains a subroutine called SYSINIT that takes care of the rest of the process.
  • SYSINIT loads MSDOS.SYS into memory.
  • The commands in CONFIG.SYS, if it exists, are executed.
  • COMMAND.COM is found and loaded into memory.
  • AUTOEXEC.BAT is found and, if it exists, it's commands are executed.

  • 4. DOS Prompt Appears.
    The boot process is complete and the DOS prompt appears, ready to accept your commands. Alternatively, if you are running an older version of Windows (like 3.1), you will probably have a command at the end of AUTOEXEC.BAT that will run Windows for you. If this is the case, you will then see your Windows desktop on the screen.

    Booting Up in Windows95

    The boot process for Windows95 is slightly different than for DOS:

    1. Power On and POST.
    When you first boot the machine, the POST occurs just as it does in a DOS-based environment.

    2. BIOS Allocates Resources to Devices
    Windows95 uses a different BIOS, called a Plug-N-Play BIOS. This BIOS will automatically allocate the necessary resources to devices (like the CD-ROM drive, keyboard and sound card) so that they will work properly with the rest of the system.

    3. Operating System is Loaded.
  • The BIOS searches for the boot sector, just as it does in DOS. When it is found, IO.SYS is loaded. SYSINIT locates and executes the commands in CONFIG.SYS, which performs the same function as with DOS even though with Plug-N-Play in use it is not really necessary. CONFIG.SYS is optional with Windows95.
  • Next, MSDOS.SYS is located. In Windows95, MSDOS.SYS is simply a plain text file that a few instructions that configures Windows95 (such as locations of the Windows95 directory, the Windows95 startup files, and the type of startup desired).
  • Just as with DOS, COMMAND.COM is loaded and AUTOEXEC.BAT is executed, if it exists.

    4. Windows95 Desktop Appears.
    With the boot process complete, the Windows95 desktop appears on the screen, ready to be used.

  • The Autoexec.Bat and Config.Sys Files

    The Autoexec.Bat and Config.Sys files are files that are used to configure your system's resources and operating system. Having these 2 files saves time because you don't have to keep typing in certain commands every time you boot up your computer.

    Config.Sys The Config.Sys file is a configuration file located in the root directory. It contains special commands to customize how DOS works with certain parts of your computer, such as:

    FILES   This determines the number of files your system can have open at any one time.
    Example:  FILES=25
    BUFFERS   This determines the number of buffers to create. Buffers are temporary storage areas in memory that hold data while it waits to go to a device like a hard drive or a printer.
    Example:  BUFFERS=40
    DEVICE   Loads a specific device driver into memory. A device driver is a special software program that allows the operating system to work with a device attached to your system, such as a mouse or CD-ROM drive. Some device drivers also help to manage your computer's memory.
    Example:  DEVICE=C:\WINDOWS\HIMEM.SYS

    Autoexec.Bat The Autoexec.Bat file is a batch file located in the root directory that is executed during system boot-up. Most commands make certain changes to your DOS environment but you can also use your autoexec.bat to run programs automatically when you boot up (most systems with Windows 3.x do this). If you have a DOS-based system and don't have an autoexec.bat file, your computer will simply run the TIME and DATE commands when it boots up.

    Well, that should get you started with basic operating systems. If you are worried about understanding all this information, don't worry! Many of these concepts will be touched upon again in future sections.

    Answers to Quiz Questions

    There are many operating systems out there. Here are a few, but maybe you can name others!
    Unix, Novell Netware, OS/2, VMS, Mac OS, Linux

    1. Valid, but the letter N will be cut off since you are only allowed 8 characters.
    2. Invalid, no spaces allowed.
    3. Valid
    4. Valid
    5. Valid, but the last letter of the file extension will be cut off since you are only allowed 3 characters in the extension.
    6. Valid
    7. Valid

    1. C:\PROGRAM FILES\NETSCAPE\COMMUNICATOR\ISU
    2. C:\WINDOWS
    3. C:\MY DOCUMENTS\CPG3201\EXAMS
    4. C:\MY DOCUMENTS\CTCH21X1
    5. C:\MY DOCUMENTS\CPG3201\NOTES\WEEK3

    The capacity of a 3.5" HD disk would be:
    # Tracks per side: 80
    # Sides: 2
    # Sectors per track: 18
    # Bytes per sector: 512
    Using Formula - 80 * 2 * 18 * 512 = 1,474,560 bytes or 1.44 Megabytes.

    Written by Wendi Jollymore, 1997-99

    Last Update:


    [ Previous Page | Back To Terminal Learning! ]