Sunteți pe pagina 1din 11

1

OPERATING SYSTEMS
OPERATING SYSTEMS
Boo Krstaji, PhD, University of Montenegro Podgorica
bozok@cg.ac.yu
2
General concepts
Multitasking
Multi-tasking means that multiple processes can
run at the same time.
Even if you have launched no applications there
are a group of processes running in the
background.
Some processes might provide network services,
others sit there showing a login prompt on other
consoles, and there is even a process that
executes scheduled tasks,
These processes that are running in the
background are often called daemon
3
General concepts
Processes
Applications run as one or more processes.
Every process basically has two areas; an
area that is named text and an area that
is named data.
The text area is the actual program code; it
is used to tell the computer what to do.
The data area is used to store information
that the process has to keep.
4
General concepts
Threads
The problem with processes is that they can get
quite large, and that is not very efficient for
computers with more than one processor. This
problem is solved by duplicating the text area of
a process.
So, a threaded process is basically a program that
has multiple instances of its executing code
running, but these instances share the data area
of the process.
These threads can be divided over multiple CPUs,
making it possible to run one process on more
than one CPU at same time.
5
General concepts
File system hierarchy
Operating systems store data in filesystems.
A filesystem is basically a collection of directories
that hold files, like the operating system, user
programs and user data.
In GNU/Linux there is only one filesystem
hierarchy, this means GNU/Linux doesnt have
multiple drives (e.g. A:, C:, D:), like Windows.
The filesystem looks like a tree, with a root
directory (/) which has no parent directory.
Directories are separated using the / character
6
General concepts
File system hierarchy
The full path of the file is:
/home/jack/memo.txt.
Each directory has to special
entries:
. refers to the same
directory,
.. to the parent directory.
These entries can be used for
making relative paths.
7
General concepts
Mounting
You might have started to wonder how it is
possible to access other devices or partitions
(CD, USB, Floppy, ).
Linux allows the system administrator to
connect a device to any directory in the
filesystem structure.
This process is named mounting
For example, one could mount the
CD-ROM drive to the /cdrom directory
8
General concepts
Common directories
/bin: essential user binaries that should still be available in case
the /usr is not mounted.
/dev: device files. These are special files used to access certain
devices.
/etc: the /etc directory contains all important configuration files.
/home: contains home directories for individual users.
/lib: essential system libraries and kernel modules.
/root: home directory for the root user (Superuser).
/sbin: essential binaries that are used for system administration.
/tmp: a world-writable directory for temporary files.
/X11R6: the X Window System.
/usr/bin: stores the majority of the user binaries.
/usr/lib: libraries that are not essential for the system to boot.
/usr/sbin: non-essential system administration binaries.
/var: variable data files, like logs.
9
General concepts
Devices
In UNIX and Linux almost everything is represented as a file,
including devices.
Each GNU/Linux system has a a directory with special files,
named /dev. Each file in the /dev directory represents a
device.
For the Linux kernel there are two types of devices:
- character and
- block devices.
- Character devices can be read byte by byte.
- Block devices are read per block (for example 4 Kb at a time).
Whether a device is a character or block device is determined
by the nature of the device. For example, most storage
media are block devices, and most input devices are
character devices
10
General concepts
ATA and SCSI devices
There are two categories of devices:
ATA and SCSI hard disks and CD-ROMs.
Under Linux these devices are named in the
following way:
/dev/hda - master device on the first ATA channel
/dev/hdb - slave device on the first ATA channel
/dev/hdc - master device on the second ATA channel
/dev/hdd - slave device on the second ATA channel
11
General concepts
ATA and SCSI devices
/dev/sda - First SCSI disk
/dev/sdb - Second SCSI disk
/dev/sdc - Third SCSI disk
/dev/scd0 - First CD-ROM
/dev/scd1 - Second CD-ROM
/dev/scd2 - Third CD-ROM
Most average PCs do not have SCSI hard disks or
CD-ROM drives, but SCSI is often used for USB
drives.

S-ar putea să vă placă și