Linux and DOS comparisonDynamic Link Library DLL: Data Link Library - Hệ điều hành DOS, các chương trình được biên dịch và liên kết với tất các hàm bên trong thành một tập tin thi hàn
Trang 11 st Chapter
INTRODUCTION ABOUT LINUX
Trang 2• Linux and DOS comparison
• Start, Login & Logout Linux
Trang 3Concepts of Linux OS
• Operating system is a program running on
computer, it is use for operating and managing the hardware appliances and software resources
on your computer
• Operating system serves as intermediary in
communication between user and computer
hardware, providing an environment that allows users to develop and implement their applications easily.
Trang 4Linux OS History
• Linux is derived from the Unix operating system - a tasking operating system for mini-computer and mainframe computers in the 70s of the 20th century
multi-• The first version of Linux OS was written by Linus Torvald in
• Many companies offer Linux as a software package that
helps to install easily , or provide computers with
preinstalled Linux
Trang 5Linux OS History
• Linux is a compete and independent operating system
It can run X Window, TCP / IP, Emacs, Web, email and other software Most free and commercial software are run
on Linux
• Linux is a multi-user operating system, it means that many people can log in and use the same system With these advantages, we can reduce the investment costs of
machinery and equipment
Trang 6Linux OS History
• For Linux, Berkley Unix operating system (BSD) also plays an important role in making itself
becomes more and more common Most utilities
go along with Linux are moved from BSD,
especially network tools and utilities.
Trang 7Linux OS features
Linux a multitasking and multi-user operating system
Linux is compatible with the Unix standards as IEEE, POSIX.1, System V and BSD
Linux can be installed with other operating systems such as
Linux download system program including GRUB and LILO
Linux supports many different file systems such as ext2fs, ext3fs, ntfs, fat,
Linux provides all of services and network protocols TCP / IP
• Driver for card Ethernet, PPP, SLIP, PLIP, NFS
• Supporting services such as FTP, Telnet, NNTP and SMTP,
Firewall.
Trang 8Linux Structures
Trang 9Linux Structures
Kernel
• Used to manage hardware and implement applications
• Linux considers each hardware equivalent to a file
• When you start your computer, the kernel is loaded into main
memory, and it works until shutdown Performing low and system level functions.
• Kernel is responsible for translating and sending instructions to the computer processor.
• Kernel is also responsible for the processes and provides input and output for the processes
Kernel is the heart of the Linux operating system.
Trang 10Linux Structures
Operation of Kernel
• When users log into the system and make requests, Kernel will call two special programs to run are Getty and login
• Getty shows prompt and requires user to login
• Upon receiving input, Getty will call login program to set the name for user and determine the rights of user login Login program checks the password in the password file If the password is not correct, the entrance will not
be set and returned control to Getty If the user enter the correct password, login program sends control to the program that is named in the password file Normally this program is Shell
Trang 12 Nowadays, the Linux operating system are used primarily in three types
of shell: Bourne shell, Korn shell, C shell The following table compares three types of shell (According to documents Linux Unleashed - Sams Development Team - Sams Publishibng).
Trang 13Linux Structures
Trang 14Linux Structures
User
• This class includes the facilities, applications interact with users.
Trang 15Linux OS Versions
Debian
• This version was set by Debian project, it is the free software distribution developed from the
collaboration of volunteers around the world.
• Officially issued as the Debian GNU / Linux, is
based on Linux kernel with many basic tools of the operating system from the GNU project.
system (Advanced Packaging Tool).
Trang 16Linux OS Versions
Redhat
• Red Hat Enterprise Linux is a Linux distribution with the
commerce of Red Hat Each version of Red Hat Enterprise Linux Red Hat is supported by Red Hat in seven years from the first date issued
• Versions of Red Hat Enterprise Linux:
• Red Hat Enterprise Linux Advance Server (RHEL AS): For large systems.
• Red Hat Enterprise Linux Edge Server hoặc Entry-Level Server (RHEL ES): For average systems.
• Red Hat Enterprise Linux Workstation (RHEL WS): For individual user with high income.
• Red Hat Desktop: For individual user with low income.
Trang 17• Fedora is designed friendly with graphical interface
Additional software packages can be downloaded and
installed with yum tool
• Fedora name aims to distinguish the main software
package of Fedora with additional software packages, to support Fedora
Trang 18Linux OS Versions
Ubuntu
• Ubuntu is a distributing version of Linux that is mainly used for desktop PCs based on Debian GNU / Linux It is issued every six months
• "Ubuntu" means "man toward man."
in South African.
• Easier to use than Debian
• Using free software, running stably and can be updated by the average user
• Versions: Ubuntu 6.06 (Dapper Drake), 7.10 (Gutsy Gibbon), 8.04 (Hardy),
• Kubuntu and Xubuntu versions are the smaller projects of the
Ubuntu project: combining KDE and Xfce interfaces with the core
of Ubuntu.
Trang 19Linux OS Versions
Hacao
• Hacao is a distributing version of Linux that is able
to start to run Linux directly from CD-ROM drive without the hard drive This is the customize Linux version can change to suit everyone at work, at school or at home.
• Hacao Linux version is based on Puppy Linux Therefore it has most of the special features of Puppy
Trang 20Linux OS Versions
Suse
• Suse is a great distribution version of Linux It was developed by the Novell, Inc company in Germany Suse is open source distributing
version with graphical interfaces KDE and
GNOME.
• The newer versions of Suse can be issued every six or
eight months One of the newest versions of Suse is Suse 10.1 It was appeared on May 11th,2006
• In addition, there are other versions like Mandriva, CentOS, gentoo, slackware…
Trang 21Linux and DOS comparison
Managing processes
• DOS: Management process
• stacking programs in memory
• For example, if you loaded A, B, C programs into DOS, DOS arranges these programs in order C, B and A is put at the bottom To remove A program, we must remove C and B programs
• Linux has overcome this disadvantage, means it can remove A program but does not affect B and C
programs
Trang 22Linux and DOS comparison
Managing processes (con’t)
• Linux also has the ability to make the swap (swap space) also called virtual memory
• The processes don’t work can be exchanged in a short time by dividing paging (paging) This
process will be removed from RAM and stored in virtual memory to free/give space for a different process.
• When this process want to reuse CPU, it will be swapped RAM again
Trang 23Linux and DOS comparison
Managing processes (con’t)
• However, if there are too many pages at the same time -> CPU has to spend much time swapping memory to the hard drive, so it is not enough time for the processes.
• When you install the Linux operating system:
declare swap memory is double RAM on your
computer
Trang 24Linux and DOS comparison
Input – output channels STDIN, STDOUT and
STDERR
Unlike DOS, Linux introduces the concept of
Input – output channels as input, stdout, stderr.
• Stdout is the standard productive channel of a program.
• Stderr is the standard error channel : make the program not stuck in an pipe (pipe) or redirection (redirection) In this way, if the computer gets any abruptly error, it will not damage the data that the next program is receiving.
Trang 25Linux and DOS comparison
Pipes or redirections
• Tuyến dẫn cho phép trực tiếp gửi kết quả của một chương trình thành đầu vào của một chương trình khác
• Tuyến điều hướng cho phép sử dụng một tập tin thay cho STDIN, STDOUT hoặc STDERR Ví dụ:
Trang 26Linux and DOS comparison
Dynamic Link Library (DLL: Data Link Library)
- Hệ điều hành DOS, các chương trình được
biên dịch và liên kết với tất các hàm bên trong
thành một tập tin thi hành duy nhất gọi là tập tin
kết nối tĩnh Các thư viện của tập tin kết nối tĩnh sẽ không thay đổi trừ khi ta biên dịch lại chương
trình
- Hệ điều hành MS Windows/Linux: sử dụng thư
viện liên kết động (DLL) Có nghĩa là ta có thể tạo một tập tin thi hành nhỏ hơn bằng cách lưu trữ các
Trang 27Linux and DOS comparison
Dynamic Link Library (con’t)
• Các thư viện của chương trình có thể thay đổi dễ dàng mà không cần biên dịch lại toàn bộ phần mềm Chỉ việc cài đặt các hàm thư viện mới và tiếp tục chạy các chương trình này
• Dung lượng các tập tin thi hành sẽ ít hơn
Trang 28Linux and DOS comparison
Dynamic Link Library (con’t)
quan trọng vào trong /sbin hoặc /usr/sbin để ta có
thể phục hồi các thư viện này lại cho các chương trình
Trang 29Linux and DOS comparison
Drive Structure
• Trong Linux, người dùng
chỉ làm việc với một ổ đĩa
và mọi thư mục, tập tin
được ráp nối vào ổ đĩa
này gọi là thư mục gốc
hay root (ký hiệu: / )
• Khi Linux khởi động, thư
mục gốc (/) được nối vào
Trang 30Linux and DOS comparison
Drive Structure
• Linux hiểu các ổ đĩa vật lý như ổ đĩa mềm 3.5”, ổ đĩa cứng,
ổ đĩa CD-ROM, là những tập tin đặc biệt nằm trong thư mục /dev
• Ví dụ
• Ổ đĩa mềm (ổ A: trong DOS): /dev/fd0
• Các ổ đĩa cứng:
• hd: ổ đĩa cứng chuẩn IDE
• sd: ổ đĩa cứng chuẩn SATA
• Dùng ký tự a và b sau 2 ký tự trên (ví dụ: hda, sda, hdb, sdb) để đặt tên cho ổ đĩa cứng vật lý thứ nhất và thứ 2
• Dùng ký số 1, 2, 3, sau 3 ký tự trên (ví dụ: hda1, hda2, sda1, sda2, ) để đặt tên cho ổ đĩa cứng logic thứ
Trang 31Linux and DOS comparison
Directory structure
• /etc: Cấu hình hệ thống Tương ứng với thư mục Config trong Windows.
• /usr/bin: Chứa các lệnh của người dùng
• /usr/local: Chứa các thư mục của các chương trình khi được cài đặt lên hệ
thống Tương tự như thư mục Program Files trong Windows.
• /usr/lib: Chứa các thư viện của các chương trình người dùng.
• /usr/include: Các tập tin include chuẩn của C.
• /usr/man: Chứa các tài liệu trực tuyến.
• /usr/src: Chứa các vị trí mã nguồn, kể cả mã nguồn Linux.
• /usr/log: Chứa các tập tin nhật ký người sử dụng quản lí đăng nhập hệ
thống.
• /dev: Chứa các tập tin thiết bị Tương tự thư mục drivers trong Windows
• /home: Chứa các thư mục người sử dụng Tương tự thư mục My
Documents trong Windows.
• /root: Thư mục của tài khoản root Tương tự thư mục My Documents của
tài khoản Administrator trong Windows.
• /boot: Chứa các Tập tin khi khởi động.
Trang 32Linux and DOS comparison
Name files and folders
• Độ dài tối đa 255 ký tự, không chứa ký tự đặc biệt / vì
ký hiệu này trùng với ký hiệu đường dẫn trong Linux
• Phân biệt chữ hoa, chữ thường và tuân thủ quy ước dành cho phần mở rộng trong tên của tập tin và thư mục Cụ thể:
• c: Tập tin chương trình C.
• f: Tập tin chương trình Fortran.
• pl: Tập tin chương trình Perl.
Trang 33Linux and DOS comparison
Path
• Khác với Dos hoặc Windows, để biểu diễn đường dẫn trong Linux ta dùng ký hiệu / thay vì \ như trong DOS hoặc Windows
Trang 34Linux and DOS comparison
Types of files in Linux:
Trang 35Linux and DOS comparison
Shell
• Chương trình Shell của Linux cung cấp các chức năng giao tiếp giữa người sử dụng và hệ thống Nó có nhiều điểm
giống với COMMAND.COM trên DOS
• Các biến môi trường: Là các biến tham số hệ thống
Các biến này có thể thay đổi theo từng người sử dụng hoặc theo từng phiên làm việc của người sử dụng
• Các chương trình chạy khi khởi động
• Dấu nhắc hệ thống
• Shell trong Linux mạnh hơn COMMAND.COM rất nhiều, nó cung cấp rất nhiều khả năng khác mà DOS không có
Trang 36Linux and DOS comparison
TCP/IP and network
• Linux là một hệ điều hành mạng, do đó nó tương thích với giao thức TCP/IP và các giao thức trên mạng khác Hệ
thống NFS và NIS cho phép người sử dụng có thể đăng nhập và làm việc từ bất kỳ máy nào trên mạng như là trên một máy duy nhất
Trang 37Start and login Linux
Start/login
• Bật công tắc nguồn.
• Chương trình sẽ khởi động hệ điều hành và hiện các thông tin về hệ điều hành Cuối cùng, chương trình sẽ hiển thị dấu nhắc đăng nhập hệ thống:
• Linux login:
• Password:
• user profile và được Linux tạo ra dưới dạng tên của người sử dùng đó trong thư mục /home/<Tên user>
Trang 38Start and login Linux
Working with Virtual Console
• Linux là hệ điều hành đa nhiệm, đa người dùng Linux cho phép nhiều người dùng cùng truy nhập
và làm nhiều việc khác nhau trên hệ thống cùng thời điểm Để thực hiện điều đó, Linux sử dụng nhiều Console ảo.
• Linux cho phép sử dụng tối đa 7 console ảo Để làm việc với các console ảo, ta nhấn giữ tổ hợp phím Ctrl + Alt đồng thời nhấn 1 trong 7 phím F1 đến F7
Trang 39Logout Linux
Logout Linux (1 st method )
• Để khởi động lại máy (restart) hoặc tắt máy (shutdown), ta phải đăng nhập hệ thống với quyền root và dùng lệnh sau:
• shutdown -[Option][Time][Message]
• [Option]: các tùy chọn, –h (halt) shutdown; –r restart
• [Time]: quy định thời gian (phút) trước khi shutdown
Nếu tham số là now thì hệ thống shutdown ngay lập tức
• [Message]: Thông báo được gửi cho mọi người đang
truy nhập hệ thống Thông báo được đặt trong dấu “ ”
Ngoài ra, có thể dùng các lệnh sau để thay thế cho lệnh shutdown:
• Init 6 or Reboot: khởi động lại máy ngay lập tức
• Init 0 or halt: Tắt hệ thống ngay lập tức
Trang 40Logout Linux
Logout Linux (2nd method )
• Hoặc ta vào menu System/Shut down
Trang 41 Linux OS History
• Linux bắt nguồn từ hệ điều hành Unix
• Phiên bản Linux 1.0 ra đời vào năm 1994
• Linux là một hệ điều hành đầy đủ và độc lập
• Linux được phát triển và bảo trì bởi một cộng đồng người
sử dụng
Features
• Linux là hệ điều hành đa nhiệm và đa người dùng
• Linux tương thích với các bản Unix chuẩn
• Linux có thể được cài đặt cùng với các hệ điều hành khác
• Linux hỗ trợ nhiều hệ thống tập tin khác nhau
• Linux cung cấp đầy đủ các dịch vụ và giao thức mạng TCP/IP
Trang 43 Linux và DOS comparison
• Quản lý tiến trình
• Kênh vào ra chuẩn
• Tuyến dẫn/tuyến điều hướng
• Thư viện liên kết động DLL
Trang 44Theory Questions
Question 1 Present OS concept?
• Hệ điều hành là một chương trình chạy trên máy
tính, dùng để điều hành, quản lý các thiết bị phần cứng và các tài nguyên phần mềm trên máy tính
• Hệ điều hành đóng vai trò trung gian trong việc giao tiếp giữa người sử dụng và phần cứng máy tính, cung cấp một môi trường cho phép người
sử dụng phát triển và thực hiện các ứng dụng của
họ một cách dễ dàng
Trang 45Theory Questions
Question 2 Present Linux operating system?
Trang 46Theory Questions
Question 3 Show Linux operating system's
features?
• Linux là hệ điều hành đa nhiệm và đa người dùng
• Linux tương thích với các bản Unix chuẩn như
IEEE, POSIX.1, System V và BSD
• Linux có thể được cài đặt cùng với các hệ điều hành khác như Windows hoặc các phiên bản
Trang 49Theory Questions
Question 6 Linux and DOS comparison?
• Quản lý tiến trình
• Các kênh vào ra chuẩn (STDIN, OUT, ERR)
• Tuyến dẫn, tuyến điều hướng
• Thư viện liên kết động
Trang 51Theory Questions
Questions 8: What kind of file systems does Linux support ?
Trang 53Theory Questions
Question 10 What is open source software?
và miễn phí.