2. OS NOTES 682.23 new LAST 2024[1]
2. OS NOTES 682.23 new LAST 2024[1]
2. OS NOTES 682.23 new LAST 2024[1]
t
050616 "Information technologies" speciality
Lecture Notes
Operating systems subject
V.H. Salimov
[email protected]
http://vagif4.tripod.com
1. Introduction to OS
"The operating systems" subject plays an important role for students are
studying on the speciality "Computer Engineering" . The deep knowledge in this
area allows user work on the computer more freely and programmers design
programs for effectively .
User
OS HARDWARE
Programmers
Various sources give the different definition OS: operating system is computer
manager, operating system is virtual machine, operating system is mediator
among user and computer and others.
According to Wikipedia, the operating system -is a collection of programs that
provide management of technical devices.
All operating systems provide following functions :
1.Support for computer hardware (driver system)
2. User interface
3. File management system
4.Increase effectiveness of usage computer resources (CPU time, RAM,
external memory, external devices) .
Computer include many resources like CPU time, RAM, external memory and
devices. We can consider OS as resources management system
3
2. Architecture of processor
Control
Unit
Arithmetic
I / O Devices
Logic Unit
Main
Registers Disk Printer
Memory
Bus
4
2. Segment registers
Major flags
Original processor X86 is 16 bits one. Today most used more advanced 32 and 64
bits multicore processors.
They also have same registers but twice large ( except segment registers they keep
16 bits) 32 bits registers have prefix E so not AX EAX not BX EBX.
64 bits registers have prefix R so not AX RAX and so on.
IP — 16bits
EIP — 32 bits
RIP — 64 bits
Segment register have same size for all models 16 bits
Data registers in 32 CPU. 32 bits
EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI,
Data register in 64 CPU. 64 bits
3. Interrupt system
As has been shown above as well as under unforced management processor
time, there is a need in the temporary program switch that requires preservation of
all program options and first registers. All the information on the process required
to restore it again referred to the context. The context of the process is stored in a
special structure called a process control block. PCB(Process Control
Block). Together with the handle to form a complete description of the
- Timer interrupt;
- user interrupt
Internal interrupts
- Incorrect addressing
- Division by zero
- The output value of a variable outside
- programmed interruptions
OS work closely related system interruptions and first timer interrupt. On the basis
of the timer interrupt process is implemented switching mechanism.
Any process and thread has 2 group characterictics –descriptor and context
.Descriptor include general information about process .
1. Prosses identificator;
4. Prosses state
6. Required memory
8. Owner of process
1. Process state
4. priorities
All these information are stored in special memory space PCB (proses control
block )
PCB
Deskriptor Context
9
4 If one process is blocked, then While one thread is blocked and waiting, a
no other process can execute second thread in the same task can run.
until the first process is
unblocked.
Advantages of Thread
Threads minimize the context switching time.
Efficient communication.
6. OS history
compiler (at the time it is Assembler and Fortran) and the loader program. Initially
loaded and then performed compiler program and performance load.
Programs were entered from the panel or from a perfocards. When an error is
detected the perfo card preparing again and the process repeated.
The second period covers 1956-1966 years. During this period, there was the
first real OS and the first -Batch processing system
With this technology, the end user does not have direct contact with the
operating system, all applications is processed by the operator (specialist having
authorized access to the computer). Each packet is processed automatically, the
program selected from the packet and run. After processing the results are
delivered to the user. If error are happened process is repeated. The basic idea of
14
this technology –increase system capacity, due to the exclusion from the process
end user to work directly on the computer and achieve some savings time.
To further improve system performance by increasing the load by processor
was designed multiprogramming technology(multiprogramming). The basic idea
of this technology the fact that if in the performance of any program needs to
input / output and is released , the processor in this period can be used to load
another programs. After the completion of the I / O operation is interrupted, the
program returns to the queue of ready programs. This provides an increase CPU
utilization. This technology is called non preemptive , i.e. the second process
starts if this allows the first process.
15
The third period is 1965-1975 years, during this period there were first terminals
(monitor and keyboard) and there was an interactive mode of operation, of course
the user for the first time to get direct access to computer.
During this period, a new technology is the use of time-sharing computers -
mode (time sharing), providing a pseudo simultaneous access to your computer
many users (multiusering). The essence of the time-sharing mode is that each user
is given a certain small CPU (quantum or slice ).Quantum size is chosen so that the
user has created a sense of exclusive possession of all the
computer (virtual machines) . After completion of the quantum control is passed
to another user. The main purpose of operating time-sharing to ensure the
maximum comfort for users.
The fourth period began in 1975 and continues to the present. This
is due primarily to the advent of the personal computer (1981) and the
first multitasking system Ms Windows 3.1. At the heart of multi-tasking
technology, is at the same time (pseudo simultaneously, i.e the apparent
simultaneous) execution of several programs. Here, as well as time-
sharing but each program is given a small CPU time (slice) and a user
creates the illusion that all programs are working in parallel such as (Ms Word,
Media Player, Internet Explorer, MS Outlook, Kaspersky AntiVirus). If
multiprogramming mode is aimed at improving the efficient use of the processor,
the multitasking mode is aimed at creating a useful illusion running in parallel
operation of several programs .
planning .The structure of modern operating systems tasks also include security
issues and support networks.
7. Classification of OS
The are many classifiction of OS : by number of users OS may be single user
and multi user. By number of parallel running programs OS is diveded into multi
programming and single programming. In multiprogramming OS may be used 2
technologies non preemtive (multiprogramming) and (preemtive))
(multitasking) . By number of processors OS may be one processor and multi
processing. By number of cores one and multicore. And according to use threads :
one thred and multithreding.
8. Architecture of OS
-main module
- CPU time manager
- RAM memory manager
- disk memory manager
-user manager
OS has ierachical architecture main module kernel and functional modules..
21
The kernel (also called nucleus) is a computer program that constitutes the
central core of a computer's operating system. It has complete control over
everything that occurs in the system. As such, it is the first program loaded on
startup, and then manages the remainder of the startup, as well
as input/output requests from software, translating them into data
processing instructions for the central processing unit. It is also responsible for
managing memory, and for managing and communicating with
computing peripherals, like printers, speakers, etc. The kernel is a fundamental part
of a modern computer's operating system.
The critical code of the kernel is usually loaded into a protected area of memory,
which prevents it from being overwritten by other, less frequently used parts of the
operating system or by applications. The kernel performs its tasks, such as
executing processes and handling interrupts, in kernel space, whereas everything a
user normally does, such as writing text in a text editor or running programs in a
GUI (graphical user interface), is done in user space. This separation prevents user
data and kernel data from interfering with each other and thereby diminishing
performance or causing the system to become unstable (and possibly crashing).
When a process makes requests of the kernel, the request is called a system call.
Various kernel designs differ in how they manage system calls and resources.
-utilities
Kernel
hardware
22
9. Structure of processes in OS
1. FCFS (First come First served). First process is loaded to CPU and
start execution up to first I/O operation. When this process meets with
I/O it removed to waiting state and second process is loaded to CPU.
When I/O operation is finished first process return in front of ready
queue and second process is removed into waiting queue.
Example
FCFS disadvantage is not diffrences between short and long processes and in
this case short processes may be very long time waits long processes
(supermarket)
Short processes problem is solved in SJF (shortest job first) algorithm .Here is
used technology when shortest process get max priority and is loaded in cpu first
EXAMPLE
2. Shortest Job First (Non preemptive)
Process A 3 seconds. completed.
Process B 2 sec. completed
Process C 1 sec. completed.
In the following sequence of processes are executed SJF:
C-B-A
Processes Required time Completion Waiting time
time
A 3 sec 6 3 sec
B 2 sec 3 1 sec
C 1 sec 1 0 sec
The average completion time is calculated by the following formula:
(P 1 + P 2 + P 3 ... P n) / n
(6 + 3 + 1) / 3 = (10/3), or 3.33 sec
The average waiting time
(Q 1 + Q 2 + Q 3 ... Q n) / n
(3 + 1 + 0) / 3 = (4/3), or 1.33 sec
Process size –
Let say we have Process Pold having size 200 KB which is already executed and
its Burst-time is 20 Units of time, now lets say we have a New Process
Pnew having size 201 KB which is yet to be executed.
We take Burst-Time of already executed process Pold which is almost of same size
as that of New process as Burst-Time of New Process Pnew.
Process type –
We can predict Burst-Time depending on the Type of Process. Operating
System process(like scheduler, dispatcher, segmentation, fragmentation)
are faster than User process( Gaming, application softwares ). Burst-Time
for any New O.S process can be predicted from any old O.S process of
similar type and same for User process.
Note – Static method for burst time prediction is not reliable as it is always not
predicted correctly.
2. Dynamic method – Let ti be the actual Burst-Time of ith process and
Τn+1 be the predicted Burst-time for n+1th process.
Simple average – Given n processes ( P1, P2… Pn)
Τn+1 = 1/n(Σi=1 to n
ti)
Exponential average (Aging) –
Can be done by using the length of previous CPU bursts,
using exponential averaging
28
Max
HASAY
HA
Example
3. Round Robin
Process A 3 seconds. completed.
Process B 2 sec. completed
Process C 1 sec. complited
Each quantum process is set to 500 msec.
In RR algorithm processes carried out in the following sequence
A-B-C-A-B-C-A-B-A-B-A (for 2 quantum)
30
4. RR with priorities
Process A 3 seconds. completed. (priority 1)
Process B 2 sec. completed (priority 2)
Process C 1 sec. completed. (priority 2)
Each quantum process is set to 500 msec.
The following sequence of processes executed
A (6 quantum) -B-C-B-C-B (2 quantum)
Processes Required time Completion Waiting time
time
A 3 sec 3 sec 0 sec
B 2 sec 6 sec 4 sec
C 1 sec 5 sec 4 sec
The average completion time
(P 1 + P 2 + P 3 ... P n) / n
(3+ 6 + 5) / 3 = (14/3) = 4.66 sec
The average waiting time
(Q 1 + Q 2 + Q 3 ... Q n) / n
(4 + 4 + 0) / 3 = (8/3), or 2.66 sec
In some systems are used multi queues system, it means is organized multi level
queueies. Firstly are processing tasks from queue 1 , when are completed, system
switchs to Level 2 and so on,
31
In Figure , initially all three processes are ready to run. The highest priority
one, A, is chosen, and allowed to run until it completes at 15 msec, as shown in
the RMS line. After it finishes, B and C are run in that order. Together, these
processes take 30 msec to run, so when C finishes, it is time for A to run again.
This rotation goes on until the system goes idle at t=70. At t=80, B becomes
ready and runs. However, at t=90, a higher process, A, becomes ready, so it
preempts B and runs until it is finished, at t=100. At that point the system can
choose between finishing B or starting C, so it chooses the highest priority
process, B
An example of EDF is given in Figure 3-2. Initially all three processes are
ready. They are run in the order of their deadlines. A must finish by t=30, B must
finish by t=40, and C must finish by t=50, so A has the earliest deadline and thus
goes first. Up until t=90 the choices are the same as RMS. At t=90, A becomes
ready again, and its deadline is t=120, the same as B's deadline. The scheduler
could legitimately choose either one to run, but since in practice, preempting B
has some nonzero cost associated with it, it is better to let B continue to run
Example
Process А must start any 30мs r, processing time ı 15мs
Process В must start any 40мs, processing time ı 15мs
Process С must start any 50 ms, processing time ı 5мs
.
Checking condition ., it possible
15/30+15/40+5/50=0.975<1
CPU load 97.5%
With RMS, the priorities of the three processes are still 33, 25 and 20 as only
the period matters, not the run time. This time, B1 does not finish until t=30, at
which time A is ready to roll again. By the time A is finished, at t=45, B is ready
again, so having a higher priority than C, it runs and C misses its deadline. RMS
fails.
EDF algorithm (Earliest Deadline First)
17.Synchronization of processes.
37
Other problem when several programs try to get access to same device, for
example printer.
To solve these problem system must use special rule: if some process try to get
access to some resourse , process must recognize this resourse is free or busy. If
resourc e free then process take it and protect to acces from other programs
There are several methods.
Global variables . Programmer for any resourse create special logical
variable ( 0 or 1). This variable is called FLAG . How is seen in
flowchart program enter into critical section the flag is checked . If
resours is free then F(D)=1 and program begin work with resourse and
set to F(D)=0, 0-busy 1- free
This method has one big disadvantage – when some process is running others
without success check value of global variable. To solve this problem was
proposed metod of critical section. According to this method program send to
operating system ( Ms Windows) special mesage EnterCriticalSection(). Here
also used global variable , but but when resours is busy other program switched
39
to waiting queue . When process complets work with this resours send mesage to
Ms Windows LeaveCriticalSection() and processes from waiting queue try to
get access to resoures. .
Next method is named semaphor method. Semafor like global variable but
here are used integer variable , if resource is busy V(S)=KMAX, where KMAX is
number of resourses , if V(S)>0 it means some resourese is free and procees can
use it. When process occupate some resource it add 1 to V(S)+1, when process
disoccupate this resource P(S)-1 is exucuted
We now want to abstract the concept of deadlock, and apply it to all resources that a
computer system may have. We will see that in some cases the resources can be
shared without any chance of deadlock. However, in other cases it is possible for
several processes to be waiting for resources that they will never be able to allocate.
Resources
For the purposes of our discussion a resource is an object that a process makes use
of. A resource can be a piece of hardware such as
tape drive
disk drive
printer
etc.
or a piece of information such as
a file
a record within a file
a shared variable
a critical section
etc.
A computer typically has many different resources. In some cases there may be
many instances of a resource of a given type (e.g. buffers), all of which are
equivalent. A process needing one of these resources can use any one of them. In
other cases there may be only one instance of a resource (e.g. CD-ROM drive with
a particular CD).
Resources come in two flavors: preemptable and nonpreemptable. A preemptable
resource is one which can be allocated to a given process for a period of time, then
be allocated to another process and then be reallocated to the first process without
any ill effects. Examples of preemptable resources include
memory
buffers
41
CPU
array processor
etc.
A nonpreemptable resource cannot be taken from one process and given to
another without side effects. One obvious example is a printer: certainly we would
not want to take the printer away from one process and give it to another in the
middle of a print job. (Actually, the THE operating system treated printers as
preemptable resources -- the operators would have to sort the printed output to
reassemble print jobs.)
As we shall see, deadlocks usually involve nonpreemptable resources. The usual
sequence of events that occur as a resource is used is
1. Request the resource. One of two things can happen when a
resource is requested: the request can be granted immediately
(if the resource is available) or it can be postponed (or blocked)
until a later time.
2. Use the resource. Once the resource has been acquired, it
can be used.
3. Release the resource. When the process no longer needs the
resource it releases it. Usually it is released as soon as possible
but in most systems there is nothing to enforce this policy.
Definition
Tanenbaum and Woodhull define deadlock as:
A set of processes is deadlocked if each process in the set is waiting for an event that only
another process in the set can cause.
42
Deadlock Prevention
Deadlock prevention algorithms ensure that at least one of the
necessary conditions (Mutual exclusion, hold and wait, no
preemption and circular wait) does not hold true. However most
prevention algorithms have poor resource utilization, and hence
result in reduced throughputs.
Deadlock avoidance
Types of memory
45
It is clear that to running some process it needs to CPU time and some
RAM space. In multitacking system we meet to problem with memory
planning .
In single program system situation like to presented on the picture.
OS
User program
Free space
46
2. Segment method ,Same as page method but segment does not have fixed
size . Segment size is determined according to submodules of program.
3 Segment-page method It is combination of two previos methods, use segment
method and for any segment is used page method.
ALGORITHMS OF REPLACEMET
LRU (Least Recently Used): In this algorithm, the page that has not been used for longest
period of time is selected for replacement.
It is known that one of the basic functions of the operating system is the creation
and support of file systems. Effective management of the file system is : the most
compact, high-speed access, search, storage security. We know that the file is
located on a computer external memory. Each file has a name, extension, creation
date, security attributes, and more. The file system is built on the principle of
traditional libraries, i.e., there are directories and files.
According to the file allocation method in memory distinguish continuous
and distributed representations. By reading technology files are sequential and
direct access. Information is written to the disk by clusters. Each cluster consists
of an some number of sectors. Each sector has a standard capacity of 512
bytes. In Ms Windows, used mainly two file systems: Fat32 and NTFS.
1. FAT (file allocation table)
The file system is created in the process of formatting a disk. During this process,
a special service information such as boot record, the main directory, Fat table
and its copy are created. Files are stored separately from the directory. That is, the
directories indicate the file location address. There are two versions of FAT FAT16
and FAT32 (since 1997).
Architecture of FAT system
The boot sector. BIOS FAT FAT (copy) Root Area files
parameter block directory
FAT ( file allocation table) like one dimension array, size of this array equal to
number of clusters on the disc. Any element of FAT is 2 bayt ( 16 bits) space in
FAT16, and 4 bayt(32 bits) in FAT32.
For empty cluster on the disc FAT stores 2 zeros (00), End of file is indicate as
FF. Other elements of FAT store address of next cluster of file. FAT16 means that
used 16-bit pointers, that total space 2 16 = 65536 cluster storage and support up to
4GB disks . FAT32 uses 2 32 clusters=4 294 967 296 clusters and can
addressed 2TB disks. Numbers of directories in FAT 16 is
limited=512, FAT32 unlimited.
For each file in the directory created his own record. Structure:
53
8 3 1 10 2 2 2 4
File Extension Attributes Backup Time date Number The size
name copy of first
block
on a disc is established special area called SPOOL on which the output files to be
printed. This process is called SPOLLing.
need for new programming tools. This is explained by the fact that the
batch files do not work with accommodation facilities such as shortcuts,
registry, etc..
Example 1
@echo off
Set /p a=Enter a
set /p b= Enter b
set /a y=%a%+%b%
echo %y%
pause
59
EXAMPLE 3
@echo off
echo welcome to my calc
echo what is the num u wnt to insert to do
sum
set /p no1=
echo wt is the sec num
set /p no2=
set /a sum=%no1% + %no2%
echo %sum%
EXAMPLE 4
@echo off
Echo Type the first number you wish to add
set /p no1 add=
cls
Echo Type the second number you want to add to
the first number
set /p no2 add=
61
cls
echo Press any key to add the numbers
pause
set /a ans=%no1add%+%no2add%
echo %ans%
echo Press any key to return to the menu
pause
The variables and constants in the if statement should consist in double quotes
IF [/I] string1 comparizon operator string2 instruction
If % t% equ 2 goto m8
There is a special version of the operator if.
Multiple commands in IF
Echo ok
: m2
Pause
Example 5
@echo off
REM math
Set /p a=enter a
Set /p b=enter b
Set /a y=%a%*2 + %b%*2
Echo %y%
if %y% GTR %a% goto m1
set /a z=%a%*%b%
echo %z%
goto m2
:m1
Set /a z=%a%+%b%
Echo %z%
:m2
@echo off
REM math
Set /p a=enter a
Set /p b=enter b
Set /a y=%a%*2 + %b%*2
Echo %y%
if %y% GTR %a% goto m1
set /a z=%a%*%b%
echo %z%
goto m2
:m1
Set /a z=%a%+%b%
Echo %z%
:m2
pause
if not exist MyFolderName (
64
Example 1
@echo off
for /L %% i in (1,1,10 ) do echo %% i
Example 2
65
@echo off
for %%A in (1 2 3 6 78 43) do echo %%A
pause
FOR %%A IN (1 2 3) DO (
echo %%A
)
FOR %%A IN (1 2 3) DO (
echo %%A
)
Example 2
for /L %%i in (1,1,10 ) do (
echo %%i
set /a j=6
echo %j
)
Example 3
for /L %%g in (1,1,10) do (
66
md folder%%g
md folder%%g\filesin
md folder%%g\filesout
)
(Note that max -open in a maximized window; min - open in the minimized window)
32.WSH VBscript
We first look at the basics of programming in VBScript. The
program is typed in Notepad, and the extension vbs. The script runs on
the standard operation OPEN.
In this language, all data refer to the same type VARİANT.
Language is not case sensitive !!!!. Operators can be written on one
line, the separator is a symbol:.
Dim a, x, y
Are declared 3 variables.
To enter data is a special function InputBox ( "Comment"), this function
introduces only one variable
Array declaration and initialization
Dim a
a=array(5,7,8,12)
For i = a to b step h
expressions
next
68
While operator
While condition
expressions
wend
Example 1
Dim a, b, y
a=3
b=7
y = a^2 * b+2*sin(a-b)
Wscript.Echo (y)
Example 2
dim i,j
dim s
i=2
j=inputbox( "Enter j")
if 2*i+5<=3*j*j+6*j then
s=3*i*i+6*j
else
s=7*j+i
end if
WScript.Echo s
Example 3
dim a(5)
dim i, s
for i=1 to 5
a(i)=2*i^2-4
next
s=0
for i=1 to 5
if a(i)>7 then
s=s+a(i)
end if
next
Wscript.echo s
Example 4
69
dim a(5)
dim i, s
for i=1 to 5
a(i)=2*i-5
next
s=0
for i=1 to 5
if a(i)>2 then
s=s+a(i)
end if
next
Wscript.echo s
Example 5
dim a(5),b(5)
dim i, s
for i=1 to 5
a(i)=2
next
for i=1 to 5
b(i)=a(i)+1
next
s=0
for i=1 to 5
if i>2 then
s=s+a(i)+b(i)
end if
next
Wscript.echo s
Example 6
dim A
A=array(6,6,7,3)
dim s,i
s=0
for i=0 to 3
s=s+A(i)
next
MsgBox s
Example 7
dim a,b
a=array(3,5,6,7,2)
b=array (2,5,2,8,5)
70
dim i, s
s=0
for i=0 to 4
if i>2 then
s=s+a(i)+b(i)
end if
next
Wscript.echo s
Example 8
dim a
a=array(3,8,2,9,3)
dim i, s
s=0
for i=0 to 4
if a(i)>7 then
s=s+a(i)
end if
next
Wscript.echo s
Example 9
Dim a(3,3)
Dim i,j
a(0,0)=2
a(0,1)=3
a(0,2)=7
a(1,0)=2
a(1,1)=4
a(1,2)=7
a(2,0)=6
a(2,1)=4
a(2,2)=7
s=0
for i=0 to 2
for j=0 to 2
s=s+a(i,j)
next
next
MsgBox s
2 dimensional array
Static
var d=[ [1,2], [3,4], [5,6]];
Dynamic
var a=new Array (5,6,3);
var b= new Array (6,6,7);
var c=[a,b];
var a=new Array(2,3,4);
var b=new Array (15,4,8);
var c=new Array(a,b);
var d =new Array ([4,7,6], [6,-4,2], [3,-9,10]); //matrix
Relations Equal to == ( double equ)) != (Not equal) > < >= <=
String “ my group”
If (condition)
{
Expressions 1;
}
else
{
Expressions 2;
}
for (i=0;i<=10;i++)
{
Expressions
}
while (condition)
{
Expressions
}
do
Expressions
while (condition)
73
.
Example 1
// first script
var a;
var b,y;
a=2; b=3;
y=a*b+12;
WScript.Echo (y);
Example 2
var i;
var s;
i=5;
if( 2*i*i-7*i+5>5)
s=i*i+5;
else
s=2*i-9*Math.sin(i);
WScript.Echo (s);
Example 3
var a=new Array (5);
var b=new Array (3,6,12,67);
var i;
74
a[0]=2; a[1]=7;a[2]=12;
for (i=0;i<=2;i++)
{WScript.Echo (a[i],b[i]);}
Example 4
var a= new Array (5);
var i;
var s;
for (i=0;i<=4;i++)
{a[i]=i;}
s=0;
for (i=0;i<=4;i++)
{
if (i>2)
s=s+3*Math.cos(a[i]);
}
WScript.Echo (s);
Example 5
var a= new Array (5);
var i;
var s;
for (i=0;i<=4;i++)
{a[i]=2*i;}
s=0;
for (i=0;i<=4;i++)
{
if (i>3)
s=s+3*a[i];
else
s=s+2*a[i];
}
WScript.Echo (s);
s=s+b[i][j];
WScript.Echo(s);
Example 7.
var a=[2,5,1,6,9];
var i;
var s;
s=0;
for (i=0;i<=4;i++)
{
if (i>2)
s=s+3*Math.cos(a[i]);
}
WScript.Echo (s);
'VBScript Example
'create file system object
Set fs = CreateObject ( "Scripting.FileSystemObject" )
'create a new text file
Set TestFile = fs.CreateTextFile ( "c: \ jaf.txt", True)
'write a line into the test file
TestFile.WriteLine ( "Jafar is good student. ")
76
next
35.Mobile devices OS
iOS is best known for serving as the underlying software that allows iPhone
users to interact with their phones using gestures such as swiping, tapping
and pinching. These finger actions are typically performed on multitouch
capacitive touch screen displays, which provide fast response and accept
inputs from multiple fingers. Although it is not the No. 1 mobile OS globally,
iOS dominates the North American market by a large margin, with a 60
percent market share as of May 2010.
iOS is derived from Mac OS X and is a Unix-like OS. There are four
abstraction layers within iOS:
Core OS Layer: Provides low-level features as well as
frameworks for security and interaction with external
hardware
Core Services Layer: Provides services required by upper
layers
Media Layer: Provides the necessary technologies for
graphics, audio and video.
Coca Touch Layer: Where frameworks are located, which
are often used when creating an application
iOS comes with a lot of default apps, including an email client, a Safari
Web browser, a portable media player (iPod) and the phone app.
79
Developers can use the iOS software development kit (SDK) to create
applications for Apple mobile devices. The SDK includes tools and
interfaces for developing, installing, running and testing apps. Native apps
can be written using the iOS system frameworks and the Objective-C
programming language. Included in the iOS SDK are Xcode Tools, which
include an integrated development environment (IDE) for managing
application projects, a graphical tool for creating the user interface and a
debugging tool for analyzing runtime performance. It also includes an iOS
simulator, which allows developers to test apps on a Mac, and an iOS
developer library, which provides all the necessary documentation and
reference material.
36.UNIX
The history of UNIX began in the 60s. twentieth
century, when an employee of the Bell Labs
laboratory - the largest telecommunications
company in the world AT & T - Ken Thompson
wrote in the assembler language operating
system, which was jokingly named UNICS
(UNIPLEXED INFORMATION AND COMPUTING
SERVICE). Subsequently, the writing of this word
became shorter, turning into UNIX.
It's difficult to rewrite the entire assembly system for each new
machine, so Thompson decided to rewrite UNIX in a high-level
language, which he specifically designed and called B. But the
language B turned out to be inefficient, primarily because of the
lack of structures in it data. Then colleague Thompson Ritchie
developed the following language, which was the successor of the B
language, which, of course, was called C. Together, Thompson and
Ritchie rewrote UNIX in C. The language was just the language that
was needed at that time, and it retains the leading position in the
field of system programming so far. For the work on the creation of
UNIX Ritchie and Thompson by the association for computer
technology, ACM was awarded the prestigious Turing Award.
The UNIX operating system was supplied with a full set of source
code, so the owners of the system could improve it. New ideas and
system improvements were spreading quickly. By the mid-80's. The
80
fact, it has almost no relation to the system itself and can easily be
replaced, for example, with a graphical interface, without requiring
any changes in the system itself. It was this flexibility that made the
UNIX system so popular and allowed it to survive numerous
changes in the technology underlying it. Many versions of the UNIX
system have a graphical user interface, similar to the popular
interfaces used on Macintosh computers and on the Windows
system.
The UNIX user interface consists not only of the shell, but also of a
large number of standard maintenance programs called utilities, as
well as a mass of application programs such as web browsers, image
viewers, etc.
UNIX processes are very similar to the consistent classical processes.
Each process runs one program and initially receives one control
thread.
UNIX is a multi-tasking system, so several independent processes
can work simultaneously. Each user can have several active
processes simultaneously, so that hundreds or even thousands of
processes can work simultaneously in a large system.
The UNIX file system is hierarchical, with files and directories. All
disks are mounted in a single directory tree, starting in one root.
Individual files can be associated with any tree directory.
Advantages
Full multitasking with protected memory. Multiple users can
run multiple programs each at the same time without
interfering with each other or crashing the system.
Very efficient virtual memory, so many programs can run with
a modest amount of physical memory.
Access controls and security. All users must be authenticated
by a valid account and password to use the system at all. All
files are owned by particular accounts. The owner can decide
whether others have read or write access to his files.
A rich set of small commands and utilities that do specific
tasks well -- not cluttered up with lots of special options. Unix
is a well-stocked toolbox, not a giant do-it-all Swiss Army
Knife.
82
GOOD LUCK !!