Transcript Document
Application & Systems Software
Operating
Systems –
a deeper look
1
Included in today’s work:
• Follow up Lecture
• What is an Operating System (OS)?
• A quick look at Operating Systems
• Some finer points of MS-DOS
• Files and Directories
• Extending the command set
2
What are Operating
Systems?
• They define our computing experience.
• First software we see when we turn a
computer on.
• ‘Enables’ all the programs we use.
• Organises and controls all the hardware.
• Hides the details of all the actual
processing from the user.
3
Some Examples
• Not all computers have operating systems.
• All desktop computers have an OS:
– Windows family (95, 98, 2000, NT);
– UNIX family (Linux, BSD, UNIX, etc);
– Macintosh OS;
• Hundreds of others:
– Mainframes, robotics, manufacturing,
etc.
4
So what does an OS do?
• Manages the hardware and software
resources of the computer system:
– e.g. processor, memory, disk space.
• Provides a stable, consistent way for
applications to deal with the hardware
without having to know all the details of
the hardware.
5
• Various programs and input methods
compete for the attention of the CPU and
demand memory, storage and input/output
(I/O) bandwidth for their own purposes.
• The OS acts like a “good parent”, making
sure that each application gets the
necessary resources , ensuring that the
limited capacity of the system is shared
out for the greatest good of all users and
applications.
6
• The provision of an consistent application
interface is very important when there is
more than one type of computer using the
OS.
• Windows 98, for example, runs on
hardware from thousands of vendors and
accommodates thousands of different
printers, disk drives and special
peripherals.
7
Basic Functions of OS
• Wake-Up Call
– The first program that runs is usually a set of
instructions kept in the computers ROM. This
examines the system hardware to make sure
everything is functioning properly
– This is the Power-On Self Test (POST)
– After POST, the software loaded in ROM will
begin to activate the computer’s disk drives.
– In most modern computers, the first bit of OS
loaded is the bootstrap loader.
8
Bootstrap Loader
• 1 single function
– Loads the OS into memory and allows it to begin
operation
• Sets up the small driver programs that interface
with and control the various hardware sub-systems
of the computer.
• Divides the memory into those bits that hold the
OS, user information and applications.
• Finally turns control of the computer over to the
OS
9
OS Tasks
• Falls into 6 general categories
– Processor management
– Memory management
– Device management
– Storage management
– Application interface
– User interface
10
Processor management
Managing the processor concerns two issues:
• ensuring that each process & application
receives enough CPU time
• maximising the number of CPU cycles used
for real work
The OS controls and schedules processes.
It handles interrupts, and prioritises tasks
11
Memory Management
Two tasks are performed:
• the OS works out how much memory to
allocate to a particular process
• the OS decides which type of memory in
the system can be used for which part of
each process
The crucial factor here is the different
types of memory and their speeds.
12
Device Management
Each peripheral requires a driver
• This is a special program to translate
between the hardware and high-level
programming languages.
• Part of the OS function is to communicate
with these drivers and to assign priorities
to data and commands going to and coming
from the device.
13
Storage management
Drivers are also used to manage memory storage
peripherals e.g. disks, tape etc.
• One function of the OS is to configure and manage
part of the storage device for virtual memory.
• A further function of the OS is to determine
which parts of “current processes” are consigned
to this virtual memory.
• A third function is that of file manager, to keep
track of and to recall all the files and programs
stored in the device.
14
Application interface
• An Application Program Interface (API)
allows Application programmers to use and
program various functions of the computer
and OS without needing to know all the
details of the CPU operations.
• Such an API may, for example allow a
programmer access to disk storage and to
read mouse commands, without having to
worry about the different kinds of disks
and mice which might be used.
15
User Interface
• The UI provides a consistent way for the
user to interact with the computer, which
is common to all models and manufacturers
• There are two main types of UI:
– Graphical User Interface (eg Windows)
– Command Line Interface (e.g MS-DOS)
• Other Operating Systems may deliver a
mixture of these two.
16
Finding out more about
Operating Systems
• The information presented here is an
introduction to a very extensive subject.
• You should follow up some of these ideas
by:
– Reading the IMC booklets
– Attending the lectures
– Checking out:
http://www.howstuffworks.com/operatingsystem.htm
17
A brief overview of MS-DOS
• When you activate the Command Prompt,
a new window should open (called command
prompt) and it will probably contain
something like:
– Microsoft Windows 2000 [version 5.00.2195]
(C) Copyright 1985-2000 Microsoft Corp.
C:\>
18
DOS Conventions
• All DOS commands are activated by typing
the commands and pressing the <Enter>
key.
• DOS is not case-sensitive.
• Spaces are the primary separators in DOS
commands. One or more spaces must
follow each command word, and file names
are delimited by spaces – therefore, files
names may not contain spaces.
19
The DOS Prompt
• e.g.
C:\WINDOWS\SYSTEM>
• C:
• \
• WINDOWS\
• SYSTEM\
• >
the default disk drive
the root directory
name of a subdirectory in
the root
name of a directory in the
WINDOWS subdirectory
Ready for your command
20
DOS Disk Concepts
• Each disk drive is assigned a letter
• A colon after the drive letter identifies it
as a drive name, as opposed to a file name
• The letter is associated with the drive, not
the disk.
• Certain letters
– A: = floppy disk
– C: = primary hard disk drive
21
Changing Drives
• If your screen cursor is at:
C:\>
• Type in
C:\> A:
(and press return)
• The screen cursor changes to
A:\>
• The system has changed drives. Previously
we were “looking at” the hard drive C:, now
we are looking at the floppy disk A:
22
Listing a Directory
• Command
– dir
• This command is an instruction to DOS to
list the directory for the folder which you
have selected.
• DOS remembers the “position” that you
are in the directory structure. This is
called the “default”.
23
DOS File Concepts
• Files on the disk are named things like
se3.doc , notes.ppt and go.exe etc.
• A filename potentially has two parts to it:
– the filename (up to 8 letters)
– the extension (up to three letters)
• The “.” is merely a separator, used to keep
the two elements apart, so that DOS can
find files of a particular type.
24
Directories, Subdirectories
• If you look in any folder you will see a
collection of files and folders
• Listing the Directory will tell you what is in
there.
• A subdirectory is merely a list of what is in
any of the folders within the current
directory.
25
DOS Directory Concepts
• Files are collected together in folders
– so for example a folder called semester4
might contain the documents week1.doc,
week2.doc etc.
Semester 4
week1.doc
week2.doc
week3.doc
26
DOS Directory Concepts
• groups of folders can be put into other folders,
– so for example a folder called year2 might
contain the folders semester1 and semester2
Year 2
Semester3
week1.doc
Semester4
week2.doc week3.doc
27
DOS Directory Concepts
• This process of putting files into folders and
folders into other folders continues up to the level
of the root directory, the disk drive’s main folder.
C:\
IMC
Year 2
Programs
BACE
Games
28
Example Directory Structure
29
Changing Drives/Directories
• Make C: the default
– c:
• Make the root default
– cd\
• Change to winword directory
– cd \msoffice\winword
• Change to the parent directory (one up)
– cd..
30
Creating Directories
• To create a new directory, we can type in:
MD sysenv
• This will create a new subdirectory called
sysenv within the current directory at the
present location in the directory structure.
31
Other Directory Commands
Other Commands:
• To put the listing across the screen (Wide)
– dir /w
• To order the listing by name
– dir /o
• To include subdirectories
– dir /s
32
Removing directories
• To remove a directory, we can type in:
RD sysenv
• This will remove the subdirectory called sysenv
within the current directory at the present
location in the directory structure.
• Note that this will only work if the directory is
empty.
33
Interpreting a Directory Listing
Volume in drive A is MINI_BOOT
Volume Serial Number is 4106-18E9
Directory of A:\
COMMAND COM 52925 03-10-93
DEFRAG
EXE 75033 03-10-93
DEFRAG
HLP
9227 03-10-93
3 file(s)
137185 bytes
1188352
bytes free
6:00a
6:00a
6:00a
34
Interpreting a Directory Listing
• Volume in drive A is MINI_BOOT
– Volume label can be given when
formatting a disk, or by using the label
command
• Volume Serial Number is 4106-18E9
– Serial number is assigned automatically
when formatting.
35
Interpreting a Directory Listing
• Directory of A:\
– This disk is in A: drive, and we’re looking
at the “root” directory
• COMMAND COM 52925 03-10-93 6:00a
– A file called command.com, which
occupies 52,925 bytes and was last
modified 03-10-93 at 6 am
36
Interpreting a Directory Listing
• 3 file(s) 137185 bytes
– There are three files occupying a total
of 137,185 bytes in this directory
• 1188352 bytes free
– You could store another 1,188,352 bytes
on this disk
37
Date and Time
• There is a system clock, which keeps the time
even when the power off. The commands TIME
and DATE allow you to reset the clock.
DATE
Current date is Mon 22-03-03
Enter new date (dd-mm-yy):
• This allows you to set a new date
(e.g. 31-12-99)
38
Looking at Files
• The TYPE command allows you to inspect
the contents of files.
TYPE students.txt
• Displays the contents of the text file
called students.
39
Deleting, Renaming & Copying
• Del file1
• This removes a file in the current
directory with the name specified by file1
Del oldfile.doc
40
Deleting, Renaming & Copying
• Rename file1 file2
(Note spaces)
• Changes the name of a file in the current
directory from file1 to file2
Rename oldname.ppt newname.ppt
41
Deleting, Renaming & Copying
• Copy file1 file2
(Note spaces)
• This copies the file at the name and
location location specified by file1 to a file
at the name and location specified by file2
Copy C:\sysenv\dos.txt A:\lect1.txt
42
Deleting, Renaming & Copying
• Copy from default to a:\
– Copy file.ext a:\
• Copy from a:\ to default
– Copy a:\file.ext
• Delete one file
– Del a:\file.ext
• Rename a file.abc to file.xyz
– Rename file.abc file.xyz
43
Using Wildcard Characters
• A Wildcard Character allows you to type in
a name without specifying it completely.
This means that you can work on all files of
a particular type
• For example, suppose that you wished to
find all word files. These have the
extension DOC, so you would use specify
*.DOC as the filename. The * is a wildcard.
44
Using Wildcard Characters
• Matching any group of letters
– * (star or asterisk) matches any group of
letters in the file name after the
asterisk
• Matching any single letter
– ? (question mark) matches any single
letter in the file name.
45
Listing a Directory using wildcards
• List all files
– dir *.*
• All files with same extension
– dir *.ext
• All files with a particular name, regardless of
their extension
– dir name.*
• All files within a specific directory
– dir c:\web\site\*.*
46
Creative use of Wildcards
• dir q*.*
– List all files beginning with the letter q
• copy *.bat b:
– Copy all files with the extension bat to
drive b:
• dir budget?a.dat
– List files whose name begins with
budget, has any single character, ends
with a and has the extension dat.
47
Finding out more about DOS
Links to help you with DOS Commands
MS-DOS Survival Guide
• http://courses.wccnet.edu/computer/mod/
q02cd.htm
• EasyDOS Command Index
• http://www.easydos.com/dosindex.html
DOS 7 Full Command list
• http://www3.sympatico.ca/rhwatson/dos7/
48