Tải bản đầy đủ (.pdf) (191 trang)

bài giảng lập trình mã nguồn mở - ts. lê nhật duy

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (2.09 MB, 191 trang )


LẬP TRÌNH MÃ NGUỒN MỞ
TS. Lê Nhật Duy
Blog:
Email:
Nội dung chương trình
 Mục tiêu môn học
Giúp sinh viên hiểu về lập trình Shell cho Linux,
lập trình C/C++ với giao diện trên Linux
 Thời lượng
 Lý thuyết : 30 tiết
 Thực hành: 30 tiết
 Mục tiêu môn học
Giúp sinh viên hiểu về lập trình Shell cho Linux,
lập trình C/C++ với giao diện trên Linux
 Thời lượng
 Lý thuyết : 30 tiết
 Thực hành: 30 tiết
2
Nội dung chương trình
1. Essential Linux
2. Introduction to Linux Programming
3. Shell Programming
4. Graphics Intergace Programming
5. Qt and Databases
6. Development Tools
1. Essential Linux
2. Introduction to Linux Programming
3. Shell Programming
4. Graphics Intergace Programming
5. Qt and Databases


6. Development Tools
3
Kiểm tra đánh giá
 Kiểm tra giữa kỳ
 Tiểu luận theo nhóm
 Thi kết thúc môn
 Kiểm tra giữa kỳ
 Tiểu luận theo nhóm
 Thi kết thúc môn
4
Giáo trình và TLTK
 Giáo trình
Neil Matthew, Richard Stones, “Beginning Linux
Programming”, 4th Edition, Wiley Publishing,
Inc, 2008.
 Tài liệu tham khảo
Slides bài giảng của giảng viên
 Giáo trình
Neil Matthew, Richard Stones, “Beginning Linux
Programming”, 4th Edition, Wiley Publishing,
Inc, 2008.
 Tài liệu tham khảo
Slides bài giảng của giảng viên
5
Rules
 …
6
Essential Linux
Contents
1. Introduction Linux and Linux Distributions

2. Installing Linux
3. Getting Help (using man pages, info and other
documentation resources)
4. Using Linux Text Editor
5. Managing the Linux File System
6. Installing and Managing Software on Linux
1. Introduction Linux and Linux Distributions
2. Installing Linux
3. Getting Help (using man pages, info and other
documentation resources)
4. Using Linux Text Editor
5. Managing the Linux File System
6. Installing and Managing Software on Linux
2
What is Linux ?
 Linux is an Unix-like operating system
 Linux is an free and open source software
 Linux is a leading server operating system
 Multi-user, security, stability, …
3
 Linux is an Unix-like operating system
 Linux is an free and open source software
 Linux is a leading server operating system
 Multi-user, security, stability, …
What is Linux ?
 Linux is an operating system,
provides key functions in a computer system:
 Application Platform
 Hardware Moderator
 Data Storage

 Security
 Connectivity
4
 Linux is an operating system,
provides key functions in a computer system:
 Application Platform
 Hardware Moderator
 Data Storage
 Security
 Connectivity
The History of Linux
 GNU/Linux
5
The History of Linux
 Richard Matthew Stallman (born March 16, 1953), is an
American software freedom activist and computer program
 Is a student at Harvard University
 a programmer at the MIT Artificial Intelligence Laboratory
 In September 1983, he launched the GNU Project to create a
free Unix-like operating system
 With the launch of the GNU Project, he initiated the free
software movement. In October 1985, he founded the Free
Software Foundation, and in 1989 he wrote the GNU General
Public License (GNU GPL)
6
 Richard Matthew Stallman (born March 16, 1953), is an
American software freedom activist and computer program
 Is a student at Harvard University
 a programmer at the MIT Artificial Intelligence Laboratory
 In September 1983, he launched the GNU Project to create a

free Unix-like operating system
 With the launch of the GNU Project, he initiated the free
software movement. In October 1985, he founded the Free
Software Foundation, and in 1989 he wrote the GNU General
Public License (GNU GPL)
The History of Linux
 By the early 1990s, many of the programs required in the
GNU project’s operating system (such as libraries,
compilers, text editors, a Unix shell, and a windowing
system) were completed, although low-level elements
such as device drivers, daemons, and the kernel were
stalled and incomplete.
 In 1991, in Helsinki, Linus Torvalds began a project that
later became the Linux kernel
 Development was done on MINIX using the GNU C compiler
7
 By the early 1990s, many of the programs required in the
GNU project’s operating system (such as libraries,
compilers, text editors, a Unix shell, and a windowing
system) were completed, although low-level elements
such as device drivers, daemons, and the kernel were
stalled and incomplete.
 In 1991, in Helsinki, Linus Torvalds began a project that
later became the Linux kernel
 Development was done on MINIX using the GNU C compiler
The History of Linux
 The first release of the Linux kernel, Linux 0.01, included
a binary of GNU's Bash shell
 In 1992, he suggested releasing the kernel under the GNU
General Public License.

 He first announced this decision in the release notes of version
0.12.
 In the middle of December 1992 he published version 0.99 using
the GNU GPL
 Linux and GNU developers worked to integrate GNU
components with Linux to make a fully-functional and
free operating system.
8
 The first release of the Linux kernel, Linux 0.01, included
a binary of GNU's Bash shell
 In 1992, he suggested releasing the kernel under the GNU
General Public License.
 He first announced this decision in the release notes of version
0.12.
 In the middle of December 1992 he published version 0.99 using
the GNU GPL
 Linux and GNU developers worked to integrate GNU
components with Linux to make a fully-functional and
free operating system.
Linux Distributions
 A Linux distribution (also called GNU/Linux
distribution or distro for short ) is a member of the
family of Unix-like operating systems
 built on top of the Linux kernel
 consist a set of libraries and utilities from the GNU
project
9
 A Linux distribution (also called GNU/Linux
distribution or distro for short ) is a member of the
family of Unix-like operating systems

 built on top of the Linux kernel
 consist a set of libraries and utilities from the GNU
project
Linux Distributions
 Linux distributions have taken a wide variety of forms
 Commercial or non-commercial;
 Designed for enterprise users, power users, or for home
users;
 Supported on multiple types of hardware, or platform-
specific, even to the extent of certification by the platform
vendor;
 Designed for servers, desktops, or embedded devices;
 General purpose or highly specialized toward specific
machine functionalities (e.g. firewalls, network routers, and
computer clusters);
 Built primarily for security, usability, portability, or
comprehensiveness.
10
 Linux distributions have taken a wide variety of forms
 Commercial or non-commercial;
 Designed for enterprise users, power users, or for home
users;
 Supported on multiple types of hardware, or platform-
specific, even to the extent of certification by the platform
vendor;
 Designed for servers, desktops, or embedded devices;
 General purpose or highly specialized toward specific
machine functionalities (e.g. firewalls, network routers, and
computer clusters);
 Built primarily for security, usability, portability, or

comprehensiveness.
Linux Distributions …
 Today there are hundreds of different
distributions available popular
■ SUSE Linux ■ TurboLinux
■ Fedora Linux ■ Mandrake Linux
■ Red Hat Enterprise Linux ■ Lycoris Linux
■ Debian Linux
■ CentOS ■ Linspire
■ ALT Linux
■ Gentoo Linux ■ Ubuntu
■Slackware Linux
11
 Today there are hundreds of different
distributions available popular
■ SUSE Linux ■ TurboLinux
■ Fedora Linux ■ Mandrake Linux
■ Red Hat Enterprise Linux ■ Lycoris Linux
■ Debian Linux
■ CentOS ■ Linspire
■ ALT Linux
■ Gentoo Linux ■ Ubuntu
■Slackware Linux
Linux Distributions …
12
Roles of Linux
 Desktop operating system
 Server operating system
 Firewall
13

 Desktop operating system
 Server operating system
 Firewall
Components of Linux
 The Linux Kernel
 Libraries
 Utilities
 User Interface
User
14
 The Linux Kernel
 Libraries
 Utilities
 User Interface
User Interface
Linux Graphical User Interface
 The Linux GUI is composed of the following components:
 X Window System
 The X Window System provides the base system for the graphical interface on
Linux. It allows programmers to run applications in windows. It also allows
users to move windows around on the screen as well as click on items with the
mouse.
 Window manager
 The role of the window manager is to control the appearance of the windows
on the screen. It also determines how they are arranged on the screen.
 GUI toolkit
 GUI toolkits are libraries used by programmers to create X Window
applications. On Linux, the GTK+, Motif, and Qt toolkits are commonly used.
 Desktop environment
 The desktop environment is used to actually present the GUI desktop to the

end user. It allows you to place icons on the desktop, customize the appearance
of your windows, add wallpaper to the desktop background, and so on. Two
very popular Linux desktop environments include the K Desktop Environment
(KDE) and GNOME.
15
 The Linux GUI is composed of the following components:
 X Window System
 The X Window System provides the base system for the graphical interface on
Linux. It allows programmers to run applications in windows. It also allows
users to move windows around on the screen as well as click on items with the
mouse.
 Window manager
 The role of the window manager is to control the appearance of the windows
on the screen. It also determines how they are arranged on the screen.
 GUI toolkit
 GUI toolkits are libraries used by programmers to create X Window
applications. On Linux, the GTK+, Motif, and Qt toolkits are commonly used.
 Desktop environment
 The desktop environment is used to actually present the GUI desktop to the
end user. It allows you to place icons on the desktop, customize the appearance
of your windows, add wallpaper to the desktop background, and so on. Two
very popular Linux desktop environments include the K Desktop Environment
(KDE) and GNOME.
User Interface
Linux Command-Line Interface (CLI)
 The Linux command line interface is created by shells
 sh (Bourne Shell)
 bash (Bourne-Again Shell)
 csh (C Shell)
 tsch

 zsh (Z Shell)
The bash shell is the default shell for most distributions
 A shell is a command interpreter that allows you to type
commands from the keyboard to interact with the operating
system kernel.
16
 The Linux command line interface is created by shells
 sh (Bourne Shell)
 bash (Bourne-Again Shell)
 csh (C Shell)
 tsch
 zsh (Z Shell)
The bash shell is the default shell for most distributions
 A shell is a command interpreter that allows you to type
commands from the keyboard to interact with the operating
system kernel.
Getting Help
Overview
 Using the various sources of information to learn
about Linux system.
 Include :
 man utility
 info utility
 README files
 Web-based resources
18
 Using the various sources of information to learn
about Linux system.
 Include :
 man utility

 info utility
 README files
 Web-based resources
Using Linux Text Editors

×