csnb334 advanced operating systems 1. introduction to linux lecturer: abdul rahim ahmad

13
CSNB334 Advanced CSNB334 Advanced Operating Systems Operating Systems 1. 1. Introduction to Introduction to Linux Linux Lecturer: Abdul Rahim Ahmad

Upload: grace-may

Post on 20-Jan-2016

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

CSNB334 Advanced CSNB334 Advanced Operating SystemsOperating Systems1. 1. Introduction to Introduction to LinuxLinux

Lecturer: Abdul Rahim Ahmad

Page 2: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

ContentsContentsUnix vs LinuxWhat is LinuxOpen Source OSLinux HistoryLinux Kernel

Page 3: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

Unix vs LinuxUnix vs Linux Architecture of Modern OSs

◦ Kernel: OS core running in privileged mode

◦ User-space: compiler, editor, GUI, …, system and other application programs running in user mode.

A good example is Unix◦ Many flavors (most not “free”)◦ Many different versions◦ Not open – proprietary source code

Linux look and feel like UNIX◦ But with totally different code and free.

Page 4: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

What is Linux?What is Linux?Full featured, Unix-like OSOpen source: entire kernel source

available freeCommunity: created by a loose

worldwide community of programmers collaborating mainly through the internet

Portable : from mainframe to hand-helds

Estimated users: over 29 million (see counter.li.org)

Page 5: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

GNU: Open Source OS before GNU: Open Source OS before LinuxLinuxThe concept of “free” software

◦ Through 70s: Richard Stallman advocates “free” software

◦ “ free” as in “free speech” not “free beer” (not zero cost) - free to use, distribute (for a profit), and modify.

1984: Richard Stallman founded GNU◦ Goal: to produce free software

GPL: ensure software freedom by copyright terms◦ GNU software: Unix-like programs (no

kernel)

Page 6: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

Linux HistoryLinux History1991: Finnish student Linus Torvalds started

working on an update of Minix (released in 1987 by Andrew S Tanenbaum).

From the start, Linus asked volunteers on the Internet to help him develop Linux◦ People started using and publicizing Linux◦ A number of programmers joined the project

From the start, the source code has been freely available on the Internet

Linux provides a kernel for GNU software◦ GNU has lots of user-space programs (like libraries,

compilers, text editors and a Windowing System) but no kernel

◦ Linux kernel + GNU software = Linux distribution

Page 7: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

The Linux KernelThe Linux KernelLinux kernel is written in C

programming languageIt implements POSIX standards in

terms of interface, commands etc, but the source code implementation is not UNIX

Linux kernel just provides the bare necessity. GNU software provides the bell and whistles.

Page 8: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

Linux Kernel EvolutionLinux Kernel Evolution Linux kernel has undergone massive development in the last

one and a half decade :◦ 0 (Apr 1991): First e-mail from Linus about his new OS.◦ 0.01 (Sept 1991)◦ 1.0 (March 94), user: 100,000◦ 1.2 (March 95), user: 500,000◦ 2.0 (June 96), user: 1,500,000◦ 2.2 (January 99)◦ 2.4 (January 2001)◦ 2.6 (December 2003)

Odd/Even versioning system◦ 2.4.x: stable kernels◦ 2.5.x: development kernels◦ Starting with the Linux 2.6.x series,

there is no significance to even or odd numbers, with new feature development going on in the same kernel series. Linus Torvalds has stated that this will be the model for the foreseeable future.

The version number of the Linux kernel has changed from a three-number versioning scheme to a four-number one. A.B.C[.D] (e.g. 2.6.12.3).

Page 9: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

Linux Kernel History Linux Kernel History (wikipedia)(wikipedia) April 1991, First version. Started by  Linus Torvalds, just 21 years old then (only

task switcher and a terminal driver). September 1991, Linux version 0.01 was released (10,239 lines of code). October 1991, Linux version 0.02 was released. December 1991, Linux 0.11 was released. (self-hosted - could be compiled on a

computer running Linux 0.11itself) February 1992 version 0.12 (use GNU General Public License) 19 January 1992 , A newsgroup alt.os.linux was started March 1992, Linux version 0.95 was released (Able to run GUI based X Window

System ) 14 March 1994, Linux 1.0.0 was released (176,250 lines of code). March 1995, Linux 1.2.0 was released (310,950 lines of code). 9 June 1996 version 2 of Linux released. 25 January 1999 - Linux 2.2.0 was released (1,800,847 lines of code). 18 December 1999 becoming enterprise-class machines in IBM mainframe (using

modified 2.2.13 release). 4 January 2001 - Linux 2.4.0 was released (3,377,902 lines of code). 17 December 2003 - Linux 2.6.0 was released (5,929,913 lines of code). 9 June 2009 - Linux 2.6.30 was released (11,637,173 lines of code).

Page 10: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

The Kernel of Our StudyThe Kernel of Our StudyVersion 2.6.11

◦Latest Stable version 2.6.30Linux distribution used is Xandross

LinuxThe entire kernel source code is

available and downloadable from the internet (http://www.kernel.org/).

For study purpose, you can download the source code into windows directories.

Page 11: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

Using Linux on Windows◦ Most organizations use Windows. In

order to use Linux in this kind of environment, we need to install multiple OS in a single computer By using partitioning and a dual boot system By running Linux in a virtual machine on a

Windows system.For our purpose, we will use

Xandros Linux using a dual boot system.

You can also use Ubuntu Linux.

Page 12: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

Linux - Fun reading◦ If you can, Read the whole book.

Otherwise◦ Read part II (pp 39-123: “Birth of an

Operating System”) Or

◦Read part II section X (pp 98-106: “Minix vs Linux”)

Page 13: CSNB334 Advanced Operating Systems 1. Introduction to Linux Lecturer: Abdul Rahim Ahmad

Linux and Systems Linux and Systems ProgrammingProgrammingWhat is System Programming?

◦ Dealing with large complex and usually monolithic system software (e.g., OS kernel)

Why large, complex, and monolithic software?◦ Structure often limits flexibility and

performance◦ Working such system requires extraordinary

skill◦ It is often an art more than a science or an

engineering In industry

◦ System programmers usually have more “respect” than application programmers.