Introduction to Linux Programming

Source: Internet
Author: User
Development and Learning steps in Linux

1. Familiarize yourself with Common commands in Linux.

2. Learn more about Emacs or vim. It takes you six months to study the system! In the future, we will use this editor to writeProgramAfter configuration, Emacs is completely an IDE, likeCodeJump, auto-completion (smart sensing), and other useful functions.

3. Learn how to compile makefile. Because we use makefile to organize our program, just like the DSP/DSW file in vc6 (of course, VC's own makefile ). Some good tools can help us compile makefiles that can be transplanted, such as Autoconf.

4. Learn to use the development tool chain of gun, such as GCC, GDB, LDD, LD ,......

5. Learn about Linux system calls and some open source libraries. Look at the highly handwritten code for a long time. Learning CVs, because most openSource codeThey are all managed by CVS. Use CVS to get the code down.

6. Write your own code to complete the work


The most common problem we encounter is how to build an IDE that is similar to VC. It will benefit a lot if you spend more time learning Emacs. In addition, it does not feel very good during GDB debugging.
Convenience. In fact, GDB and Emacs are better than vc6! Of course, writing makefile will also make many people afraid. Just stick to it, especially the tools such as atuoconf,
It is very easy to write a makefile.

Recommended books:
Linux: laruence's Linux Private food: Basic Learning
Emacs learning: Learning GNU Emacs (version 2)
Linux development tools: Basic tutorial on Linux and UNIX program development
Linux system call learning: Unix/Linux Programming Practice tutorial, Unix environment advanced programming (version 2nd)

For more information about makefile, please search for it on the Internet. For more information, please refer to other people's books. If you really want to buy it, GNU make project management (full revision of the third edition) (Chinese Version) "is also good! CVS is searched on the Internet. There are many tutorials.

 

Original address: http://www.linuxdiyf.com/viewarticle.php? Id = 53499

 

 

 

 

Advantages and disadvantages of C/C ++ programming and Linux platform

 

Disadvantages:

1. There are not many people familiar with Linux. It takes a long time to get familiar with Linux.
2. There are not many Chinese resources, which are often incomplete or not new enough.
3. Many windows things I learned in the past won't work in Linux.
4. It is difficult to get started with vim/Emacs full of Linux flavor, and requires a lot of use to be proficient.
5. The threshold is high, and the learning difficulty curve is steep at the beginning.

Advantages:

1. It is rare and rare. There are fewer Linux users than Windows users, and the Linux platform has a large demand, which adds a lot to your resume.
2. force you to learn more words, improve your English skills, and increase your ability to read the original books.
3. accept different design philosophies and master new development methods and implementation methods.
4. Once you master Vim/Emacs, the power is infinite. One is the god of the editor, and the other is the editor of God.
5. Almost all software is open source. If you want to know how to implement it, you can refer to the source code.
6. The original GCC has excellent support for the standard. automake cmake and other automation tools make you feel better.
7. If you have doubts about the source code, even if you go deep into the kernel and driver, you can also see the source code. Any details and the underlying layers can be traced one by one.
8. Knowledge is more preserved, relying on the day of the dragon, apue and UNP popular N years, the knowledge contained, so far useful, not so quickly eliminated.
9. A large number of excellent open-source software, giving you a pleasant journey to the sea of source code and learning various design implementation skills.
10. Although the threshold is high, it is difficult to learn and refine, and the learning difficulty curve is getting flat, different from that of windows.

Recommended books:

0. Second Edition of advanced programming in UNIX environment (basic)
1. Volume 1 (Network basics), third edition of UNIX Network Programming)
2. Unix shell programming (script basics)
3. Begin Linux programming version 4 (add some unexplained items in version 0)
4. a deep understanding of the third edition of Linux kernel (system operating principles)
5. Building embedded Linux systems (kernel customization and compilation)
6. Linux kernel primer (kernel development)
7. Linux kernel development (kernel development)
8. Linux Device Drivers (driver development)
9. Essential Linux Device Drivers (driver development)

I have read from 0 to 5. It is a very good book, especially 0, 1, 4.
I haven't seen it from 6 to 10. According to the suggestions of taoyou, these books are also very good.

Note:
To read the kernel source code, it is best to use vim or Emacs because the makefile provided by the kernel contains the function of Automatically Generating the cscope and tags indexes.
Cssag is seamlessly integrated with vim/Emacs and can be used to read Code. It is more powerful than source insight in combination with other plugins.

If you have physical strength, time, and good machines, you will also experience a lot through LFS.

Original address: http://topic.csdn.net/u/20091023/09/6faa79ed-d07f-42a0-b83a-b1b2e13ab7d2.html? 13274

 

 

 

 

How to Learn Linux Programming

If you want to learn Unix/Linux programming, apue is a classic teaching material. Learn more about unp. In this way, you can master the system.
However
Then look at douglus.
E. comer's "using TCP/IP for Internet interconnection" Volume 1, learn about the network, and then look at the first volume of "UNP", not only learning network programming, but also some common techniques of System Programming
I am very familiar with it. If you continue network programming, we suggest you read the third volume of "TCP/IP for Internet interconnection", which contains a lot of programming on the application protocol telnet, FTP and other protocols.
Recommended learning path:
First, learn the editor, Vim, emacs, and anything.

 

Then, learn to make file. You only need to know a bit, so that you can prepare the program.

Then let's take a look at "C programming language" K & R. In this way, we can basically perform general programming. By the way, let's look at this data structure book.

If you want to learn Unix/Linux programming, apue is a classic teaching material. Learn more about unp. In this way, you can master the system.
However
Then look at douglus.
E. comer's "using TCP/IP for Internet interconnection" Volume 1, learn about the network, and then look at the first volume of "UNP", not only learning network programming, but also some common techniques of System Programming
I am very familiar with it. If you continue network programming, we suggest you read the third volume of "TCP/IP for Internet interconnection", which contains a lot of programming on the application protocol telnet, FTP and other protocols.
If you want to write a device driver, first you must be familiar with the system programming interfaces such as files and IPC, and then learn "LDD" 2.

Comments on several classic textbooks:
The
C programing language K & R
The author of the classical C language programming material is the inventor of C language. Although it is a bit old, I often flip through a necessary manual. The length is relatively small,
Once, you will get it again. It can also be replaced by Tan haoqiang's C language programming.

Advanced
Programing in UNIX envirement
W. Richard Steven S: it's also a very classic book (nonsense, but it's not a classic one in the text of Steven s !), Although it can be viewed by beginners, but in fact it is
A secondary document in networkprograming. The Chinese Translation of "Advanced Programming in UNIX environment" is not very good. Now there is a photoplate that allows you to read English more directly than Chinese.
Easy.

 

UNIX Network
programing W. richard Steven s: the first volume is about BSD
Socket network programming interface and another network programming interface, but currently BSD is generally used
socket, so this book only needs to read about half of it. The second volume is not designed for the network, mainly for inter-process communication and POSIX Threads. So after reading apue, You can
Read it. Basically, what the system is like

apue and UNP vol2 are summarized. After reading UNP, you will know the vast majority of programming skills in system programming, even if the first volume is about network programming. In China, Tsinghua translated "UNIX network programming", with a high level of skills and good translation skills. We recommend that you read the Chinese version.
"TCP/IP xiangjie" consists of three volumes: the first lecture protocol, the second lecture implementation, and the third lecture Programming Application. I have not read it ., But it is also said that it is classic, because I do not have time to read the second, so it is inconvenient to comment.
using
TCP/IP for Internet connection douglus. e. A total of three volumes of comer are provided. Here are the principles, implementation, and advanced protocols. It seems that this set is better than the set of Steven S
, and even Steven s has to admit that its first volume is very classic. In fact, even if you do not have any knowledge about the network, you will be familiar with the network in the future. In the first volume,
there are also a lot of exercises designed to be classic and practical, because the author is a teacher and the first volume is a foreign graduate student teaching material. There is no answer to the exercises, which is left for readers to think about, because the answers to these questions can make you a
medium-level hacker. The answers to these questions can be obtained by douglus, however, I don't know how to read this document only for the instructor. I can use this document as a reference manual. The examples are also classic. If you
Read the source code of qterm, you will know that the Telnet Implementation of qterm is mostly from the source code of this book. I recommend the book on Network principles, instead of
Steven S's explanation of TCP/IP.
operating
system-Design and
implement is an example of operating system. The author's mother tongue is not English, so the English looks rather obscure. I have translated the "Operating System
Design and Implementation" in China. I have never read the Chinese version. Because the translator is Yu jinyuan, his translation of "apue" has left me disappointed. After reading this book, you will have a clear
understanding of how the underlying operating system works.
Linux Device

Driver, 2e, one of the few good books about Linux device drivers. However, the content is a bit messy. If you do not have some writing-driven experience, you will not be able to touch the north and south for the first time. Domestic Translation
I have a lot of contact with the translators of the First and Second editions of "Linux device drivers", but in general, although the translation of the second edition is somewhat unsatisfactory, however, compared with the first version
This is a big part. To read this book, you should at least find some books about computer principles and computer architecture. At least you should have some knowledge about the hardware and computer processes.

Address: http://www.ithao123.com/networkprog/0003.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.