SP-ch1 - Chapter 1 A Tour of Computer Systems A computer...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 1 A Tour of Computer Systems A computer system consists of hardware and systems software that work together to run application pro- grams. Specific implementations of systems change over time, but the underlying concepts do not. All computer systems have similar hardware and software components that perform similar functions. This book is written for programmers who want to get better at their craft by understanding how these compo- nents work and how they affect the correctness and performance of their programs. You are poised for an exciting journey. If you dedicate yourself to learning the concepts in this book, then you will be on your way to becoming a rare power programmer, enlightened by an understanding of the underlying computer system and its impact on your application programs. You are going to learn practical skills such as how to avoid strange numerical errors caused by the way that computers represent numbers. You will learn how to optimize your C code by using clever tricks that exploit the designs of modern processors and memory systems. You will learn how the compiler implements procedure calls and how to use this knowledge to avoid the security holes from buffer overflow bugs that plague network and Internet software. You will learn how to recognize and avoid the nasty errors during linking that confound the average programmer. You will learn how to write your own Unix shell, your own dynamic storage allocation package, and even your own Web server! In their classic text on the C programming language [40], Kernighan and Ritchie introduce readers to C using the hello program shown in Figure 1.1. Although hello is a very simple program, every major code/intro/hello.c 1 #include <stdio.h> 2 3 int main() 4 { 5 printf("hello, world\n"); 6 } code/intro/hello.c Figure 1.1: The hello program. 1 2 CHAPTER 1. A TOUR OF COMPUTER SYSTEMS part of the system must work in concert in order for it to run to completion. In a sense, the goal of this book is to help you understand what happens and why, when you run hello on your system. We begin our study of systems by tracing the lifetime of the hello program, from the time it is created by a programmer, until it runs on a system, prints its simple message, and terminates. As we follow the lifetime of the program, we will briefly introduce the key concepts, terminology, and components that come into play. Later chapters will expand on these ideas. 1.1 Information is Bits + Context Our hello program begins life as a source program (or source file ) that the programmer creates with an editor and saves in a text file called hello.c . The source program is a sequence of bits, each with a value of 0 or 1, organized in 8-bit chunks called bytes . Each byte represents some text character in the program....
View Full Document

Page1 / 19

SP-ch1 - Chapter 1 A Tour of Computer Systems A computer...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online