Raspberry Pi System Software Re - Warren W. Gay.pdf

(1823 KB) Pobierz
TECHNOLOGY IN ACTION™
Raspberry Pi
System Software
Reference
AN INDISPENSABLE GUIDE TO LINUX ON THE
RPI, FROM MASTERING THE RASPBERRY PI
Warren Gay
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
About the Author �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
xiii
About the Technical Reviewer �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
xv
Acknowledgments �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
xvii
Introduction �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
xix
■
Chapter 1: Preparation �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
1
■
Chapter 2: Boot �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
9
■
Chapter 3: Initialization �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
45
■
Chapter 4: vcgencmd�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
55
■
Chapter 5: Linux Console �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
61
■
Chapter 6: Cross-Compiling�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
63
■
Chapter 7: Cross-Compiling the Kernel �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
79
■
Appendix A: Glossary�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
91
■
Appendix B: Power Standards �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
97
■
Appendix C: Raspbian apt Commands �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
99
■
Appendix D: ARM Compile Options �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
103
■
Appendix E: Mac OS X Tips �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
105
Index �½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½�½
107
v
Introduction
The Raspberry Pi, implemented as a System on a Chip (SoC), really does embody the
very idea of a “system” There are several large hardware components that make up this
.
complex whole, that we call a system. When we then examine the software side that
drives this hardware, we see another body of components that make up the operating
system software.
As different as hardware is from software, they form a symbiotic relationship. The
hardware provides for external interactions with the world while the software internalizes
its inputs and determines the external actions that should result.
Content of this Book
This particular book is focused on system software aspects of the Raspberry Pi. The
content was extracted from the complete volume “Mastering the Raspberry Pi” for those
that want to focus on this area alone.
While the Pi is not restricted to running one operating system, this title assumes that
the student will be working with Raspbian Linux. This is the platform supported by the
Raspberry Pi Foundation and as a result, will represent the easiest path for learning.
Chapter 1 covers some very basic things that the beginning student may want to
hit the ground running with. Things like setting up a static IP address, using ssh and
VNC. Chapter two then jumps right into what happens when your Raspberry Pi boots.
Files connected with booting and boot configuration is covered as a reference. But what
happens after booting? Chapter 3 looks at how Raspbian Linux pulls itself up from its
bootstraps. It examines how services get started and terminated.
Chapter 4 documents the vcgencmd command, which is unique to the Raspberry
Pi. It reports and configures special aspects of the hardware. The Linux Console chapter
covers the configuration of Linux consoles, including serial port consoles.
Chapters 6 and 7 are important to software developers of the Pi. The first is dedicated
to the building and installing a cross-compiler environment for faster, more convenient
development on fast hardware like your desktop system. For those that want to modify
their Linux kernel, the last chapter is for you. This chapter will guide you through the
steps needed to customize and build the Raspbian Linux kernel.
Assumptions about the Reader
Linux tends to be used as a catchall name to include more than just the kernel. In fact
some people suggest that it should be referred to as GNU/Linux instead. This is because
so much of the involved software is actually provided by the Free Software Foundation
xix
■
IntroduCtIon
(FSF), aside from the Linux kernel. However you wish to frame it, the reader is assumed to
either have some experience with Linux, or is developing some along the way.
For the section about Raspbian Linux initialization, knowledge of shell programming
is an asset when creating or modifying the system startup procedures. Otherwise, a basic
concept of Linux processes is sufficient for understanding.
Users of cross-compilers for application software development are expected to
have some familiarity with the Linux developer tools. This includes the make command
and the compiler/linker. Building the kernel can be done by the less experienced, but
developer experience is an asset.
Working with the Raspberry Pi often results in bumping into a number of terms
and acronyms like GPU or TCP. This book has assumed an intermediate to advanced
level audience and consequently these terms are generally not explained. For readers
encountering these terms for the first time, the Glossary in Appendix A is there to help.
Finally, as the end user installs or configures his Raspberry Pi, some of the example
administration commands found in Appendix C may be useful as a cheat sheet. In most
cases, the commands necessary will have already been presented in the text where
needed. Mac OS X users will also find Mac specific tips in Appendix E.
xx
Zgłoś jeśli naruszono regulamin