Operating Systems - Introduction
Introduction
An operating system (OS) is a software that manages hardware and software resources and provide common services for computer programs. Operating systems performs all the basic tasks of the computer like process management, memory management, file management, handling input and output and controlling peripheral devices such as disk drives and printers. Before go into further details, let's look into history of operating systems.
History
- The First Generation (1945–55) Vacuum Tubes and Plugboards
- The Second Generation (1955–65) Transistors and Batch Systems
- The Third Generation (1965–1980) ICs and Multiprogramming
- The kernel - Allocates time and memory to programs. Handles file store and communication in response to system calls.
- Shell - Executes commands typed by the user. Act as interface between user and the kernel. Commands are themselves small programs.
- Programs
- Directory - Directories hold files and other directories
- Subdirectory - Directory inside other directory
- Root directory - Top of the directory hierarchy on any Unix system
- Current or Present working directory - Default directory for unix commands
-
Home directory - Directory for all user stuff
/home/course/csXXX/username -
Path or Pathname - Gives address of location of file or directory
homeworks/hw1/prog1.cpp -
Full or Absolute path - A path name starts at root directory. Begins with slash (/) character
/usr/bin/man -
Relative path name - Path that starts form current directory
homeworks/test1 -
Command argument - Things that type at the prompt after the command name
ls -l homework -
Command flag - Things that typed at the prompt as part of a command
ls -l - Text file / Binary file - A file that mainly contains letters, digits and punctuation symbols
- Source code - A file that contains program code in C++ or some other programming language
- Executable - A program that is ready to run
- Compiling and Linking - Turning source code into an executable that can be run on the computer
- Debugger - A program that allows to examine what an executable is doing while it's running
- Background programs - Programs that do more stuff in background
-
Redirecting input into a program - Redirects input from a file into a program
command < File -
Redirecting output from a program - You can capture output from a program and send it into a file
command > file
command >> file -
Piping output from one program into another - You can capture output of a program and send it directly
as input to another program
command1 | command2 - Command history - When you execute a command, it is kept in history of login session. Use up and down arrows to access history
- The Fourth Generation (1980–Present) Personal Computers
The electronic computers first introduced in 1940s were run without any operating systems. They were designed, built, programmed, operated and maintained by a single group of people. They were programmed in absolute machine language, the basic functions of the machine were controlled using mechanical switches or jumper wires on plug boards. The programs on them were debugged using toggle switches and panel lights. ENIAC, in full Electronic Numerical Integrator and Computer, the first programmable general-purpose electronic digital computer was programmed using 1200 ten way switches.
Programmers Betty Jean Jennings (left) and Fran Bilas (right) operate ENIAC's main control panel at the Moore School of Electrical Engineering.
During this era instead of using plugboards, punched cards were used to program the computers. To run a program, a programmer would first write the program on paper, then punch it on cards. He would then insert those cards into the computer and wait until output was ready. When the output was ready, the operator would get output from the printer and carry it over to the output room, so the programmer can collect it later. Much computer time was wasted while operators were walking around the machine room. The solution for this was batch system. In the input room, full set of jobs were recorded onto a magnetic tape using an inexpensive computer. A much expensive machine was used for the real computing which was good at numerical calculations. Output was recorded in the second magnetic tape. When the output was ready, it was brought to the printing room for printing offline.
Developing and maintaining two completely different product lines was an expensive task. IBM attempted to solve this problem by introducing System/360. The 360 was a series of software compatible machines differed only in price and performance. Since all the machines had the same architecture and instruction set, programs written for one machine could run on all the others. The 360 was designed to handle both scientific (i.e., numerical) and commercial computing. For 360 systems, IBM wrote extraordinary complex operating system called OS/360. It consisted of millions of lines of assembly language written by thousands of programmers and contained thousands of bugs. Every release fixed some bugs introducing new ones.
OS/360 and similar third-generation operating systems introduced a new way of performing multiple jobs at the same time called multiprogramming. Before this, it is needed CPU to sit idle and wait for I/O to finish. The solution that evolved was to partition memory into several pieces, with a different job in each partition. While one job was waiting for I/O to complete, another job could be using the CPU. If enough jobs could be held in main memory at once, the CPU could be kept busy nearly 100 percent of the time. Whenever a running job finished, the operating system could load a new job from the disk into the now-empty partition and run it. This technique is called spooling (from Simultaneous Peripheral Operation On Line) and was also used for output.
The 360 was the first major computer line to use Integrated Circuits (IC). The quick response time of these machines paved way for timesharing, a variant of multiprogramming. Timesharing allows a large number of users to interact concurrently with a single computer, lowering cost of providing computing power. The first serious timesharing system, CTSS (Compatible Time-Sharing System), was developed at M.I.T. on a specially modified 7094. The concept was to switch between each user quickly by keeping the state of the user and their programs in the machine. Switch between users would take up computer cycles, but the improvement in speed and increase in the size of core memory decreased the overhead of timesharing.
After the success of CTSS, MIT, Bell Labs, and General Electric decided to develop a machine that would support hundreds of simultaneous timesharing users. It was called MUL-TICS (MULTiplexed Information and Computing Service), influential early time-sharing operating system, based around the concept of a single-level memory. According to single-level storage, pages of memory may be in primary storage (RAM) or in secondary storage (disk); however, the current actual physical location of a page is unimportant to a process. It is usually called virtual memory. All the modern operating systems were heavily influenced by Multics. Multics featured several innovations but also presented severe problems. Because of this, Ken Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna, who were the researchers at Bell Labs decided to reimplement Multics in a smaller scale. Later it was named as Unix.
Unix
Unix is a portable, multitasking, multi-user operating system first developed in the 1960s, and has been under constant development ever since. Unix is a suite of programs that make the computer work. There are many different versions of Unix, the most popular varieties are, Sun Solaris, GNU/Linux, and MacOS X. Unix has Command line interface (CLI) as well as a Graphical user interface (GUI). Basically, Unix operating system is made up of three part.
Unix systems are characterized by various concepts.
Everything in Unix is either a file or a process. Process is an executable program identified by a unique PID (Process identifier). A file is a collection of data, created by a user or a program. The terminal is a program that we can use to execute commands. Commands in Unix themselves are small programs. Following is a summary of the list of commands available in Unix. These commands also work in different varieties of Unix.
Command | Meaning | Examples |
---|---|---|
ls | list files and directories | ls
ls ~/.. ls ~ |
ls -a | list all files and directories | ls -a |
mkdir | make directory | mkdir mystuff |
cd directory | change to named directory | cd mystuff |
cd | change to home directory | cd |
cd ~ | change to home directory | cd ~ |
cd .. | change to parent directory | cd .. |
pwd | display the path of current
directrory |
pwd |
cp file1 file2 | copy file1 and call it file2 | cp myfile.txt myfilecopy.txt
cp myfile.txt ../ |
mv file1 file2 | move or rename file1 to file2 | mv myfile.txt renamed.txt
mv myfile.txt ../ |
rm file | remove a file | rm myfile.txt |
rmdir directory | remove a directory | rmdir mystuff |
cat file | display a file | cat myfile.txt |
less file | display a file a page at a
time |
less myfile.txt |
head file | display the first few lines
of a file |
head myfile.txt |
tail file | display the last few lines
of a file |
tail myfile.txt |
grep 'keyword' file | search a file for keywords | grep 'hello' myfile.txt |
wc file | count number of lines/words/
characters in file |
wc myfile.txt |
command > file | redirect standard output
to a file |
cat > newfile.txt
echo 'hello world' > myfile.txt |
command >> file | append standard output
to a file |
cat >> newfile.txt
echo 'hello world' >> myfile.txt |
command < file | redirect standard input
from a file |
sort < myfile.txt |
command1 | command2 | pipe the output of command1
to the input of command2 |
who | sort |
cat file1 file2 > file0 | concatenate file1 and
file2 to file0 |
cat file1 file2 > file3 |
sort | sort data | sort
sort < myfile.txt sort > sorted.txt sort $lt; myfile.txt > sorted.txt |
who | list users currently logged in | who |
* | match any number of characters | ls *txt
ls myfile* |
? | match one character | ls ??file.txt |
man command | read the online manual
page for a command |
man wc |
whatis command | brief description of
a command |
whatis wc |
apropos keyword | match commands with keyword
in their man pages |
apropos copy |
ls -l | list access rights for
all files |
ls -l |
chmod [options] file | change access rights
for named file |
chmod a+rw myfile.txt |
command & | run command in background | sleep 10 & |
^C | kill the job running in
the foreground |
^C |
^Z | suspend the job running
in the foreground |
^Z |
bg | background the suspended job | bg |
jobs | list current jobs | jobs |
fg %1 | foreground job number 1 | fg %1 |
kill %1 | kill job number 1 | kill %1 |
ps | list current processes | ps |
kill 26152 | kill process number 26152 | kill 89 |
Reference: http://www.ee.surrey.ac.uk/Teaching/Unix/index.html
You can download MINIX, a clone of Unix for VirtualBox and try above commands.
Because of Unix's source code was widely available, various organizations developed their own versions of it. To make it possible to write programs that could run on any UNIX system, IEEE developed a standard for UNIX, called POSIX (Portable Operating System Interface). POSIX define a minimal system call interface that all Unix systems must support.
Minix
Minix is a small clone of Unix created by Andrew S. Tanenbaum in 1987. Minix was developed for educational purposes and included POSIX support. In 1991, a finnish student named Linus Torvalds started to develop his own operating system kernel on Minix which eventually became the Linux kernel.
Linux
Linux is a Unix-like, open source and community-developed operating system for computers, servers, mainframes, mobile devices and embedded devices. It is supported on almost every major computer platform including x86, ARM and SPARC, making it one of the most widely supported operating systems.
With the development of LSI (Large Scale Integration) circuits and introduction of microprocessor chips, the age of personal computers dawned. In 1974, Intel came out with the 8080, the first general purpose 8 bit CPU. Intel's one of the consultant Gary Kildall wrote a disk operating system called CP/M (Control Program for Microcomputers) for it. The OS was installed on an 8-inch floppy disk, making it the first microcomputer with a disk. Gary Kildall started Digital Research Inc. company and started to market CP/M OS to individual users.
In 1980s, IBM designed the IBM PC. After negotiations with Digital Research failed, IBM asked Bill Gates to provide an operating system for the IBM PC. Gates bought DOS (Disk Operating System), a clone of CP/M OS from Seattle Computer Products and hired the person who wrote DOS, Tim Paterson to make modifications for the DOS to meet IBM specifications. The modified system was named as MS-DOS (Microsoft Disk Operating System), Gates decided to sell MS-DOS to computer companies for bundling with their hardware. It is mainly developed targetting IBM x86 based personal computers.
Microsoft licensed MS-DOS to over 70 other companies. It could run on any 8086-family computers. MS-DOS was designed with a modular structure with internal device drivers, minimally for primary disk drives and the console, integrated with the kernel and loaded by the boot loader, and installable device drivers for other devices loaded and integrated at boot time. Command line interface was its default user interface. Following table shows mostly used DOS commands. Some of them still works in newer versions of Windows operating system.
Command | Meaning | Example |
---|---|---|
cd | change directory | cd Windows
cd \Windows cd .. |
dir | display available files and
folder in current directory |
dir
dir *.exe dir file* dir fil? |
copy | copy one or more files | copy *.txt c:\
copy *.* a: copy autoexec.bat c:\windows |
del | delete one or more files | del test.tmp
del c:\windows\test.tmp del c:\windows\temp\*.* del c:\windows\temp\?est.tmp |
edit | a command line text editor | edit myfile.txt |
move | move files or directories | move c:\windows\temp\*.* c:\temp |
rename | renames files or folders | rename c:\computer hope |
deltree | delete files and directories
permanently from the computer |
deltree c:\fake010 |
cls | clear screen | cls |
format | erase information on a disk | format a: |
Reference: https://www.computerhope.com/overview.htm
You can try above commands by downloading MS-DOS floppy disk images for VirtualBox.
In 1973, Engelbart who worked as a researcher at Xerox PARC developed the Alto personal computer, the first computer with a graphical user interface. It contained windows, icons, and menus (including drop-down menu) to support commands such as opening files, deleting files, moving files, etc. In 1981, Xerox introduced its pioneering product Star workstation. It was not commercially successful but influenced future developments of Apple, Microsoft and Sun Microsystems. Steve Jobs visited PARC realized the potential value of GUI. Apple released its first computer with GUI in 1983 called Lisa but it was too expensive. In 1984, Macintosh was released, with low-cost simplified design, it became commercially successful. Microsoft developed their GUI-based system in 1985 called Windows. Till 1995, Windows was just a graphical environment on top of MS-DOS. In 1995, a freestanding version of Windows, Windows 95 was released.
Comments
Post a Comment