University of helsinki



Yüklə 459,83 Kb.
Pdf görüntüsü
səhifə1/17
tarix08.08.2018
ölçüsü459,83 Kb.
#61585
  1   2   3   4   5   6   7   8   9   ...   17


Linux: a Portable Operating System

Linus Torvalds

Helsinki January 31, 1997

Master of Science Thesis

UNIVERSITY OF HELSINKI

Department of Computer Science




Tiedekunta/Osasto — Fakultet/Sektion — Faculty

Laitos — Institution — Department

Tekijä — Författare — Author

Työn nimi — Arbetets titel — Title

Oppiaine — Läroämne — Subject

Työn laji — Arbetets art — Level

Aika — Datum — Month and year

Sivumäärä — Sidoantal — Number of pages

Tiivistelmä — Referat — Abstract

Avainsanat — Nyckelord — Keywords

Säilytyspaikka — Förvaringsställe — Where deposited

Muita tietoja — Övriga uppgifter — Additional information

HELSINGIN YLIOPISTO — HELSINGFORS UNIVERSITET — UNIVERSITY OF HELSINKI

Faculty of Science

Department of Computer Science

Linus Torvalds

Linux: a Portable Operating System

Computer Science

Master of Science thesis

January 1997

52 p.

Linux, Operating System, Portability, Alpha, Sparc



Department of Computer Science Library,

serial number C–1997–12

We explore the hardware portability issues in Linux that were uncovered when porting the operating

system to multiple CPU and bus architectures. We also discuss software interface portability issues,

especially with regard to binary compatibility with other operating systems that can share the same

hardware platform. The approach taken in Linux is described, with a few example architectures

covered in some more detail.

Computing Reviews Classification:

D.4 (Operating Systems), C.1 (Processor Architectures), D.2.7 (Software Engineering — Portabil-

ity), D.4.7 (Operating Systems — Organization and Design)




Acknowledgements

While the Linux project has been closely associated with me personally, partly due

to the name, I would like to make it very clear that the Linux operating system is

a huge project done co-operatively by lots of people all over the world.

Even if you discount all the user-level programs that are an integral part of any

running Linux system, just the kernel contains code from hundreds of people from

all around the world.

Thanks to all of you.




Contents

1 Introduction

1

2 Linux — the Design and Implementation



7

2.1


The design — compatibility . . . . . . . . . . . . . . . . . . . . . .

8

2.2



Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

9

2.3



Kernel organization . . . . . . . . . . . . . . . . . . . . . . . . . . .

10

2.4



The virtual machine implementation . . . . . . . . . . . . . . . . .

11

3 Software Interface Portability Issues



14

3.1


The implementation of the software interface . . . . . . . . . . . . .

15

3.2



Personalities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

17

4 Hardware Portability Issues



19

4.1


Data representation portability issues . . . . . . . . . . . . . . . . .

19

4.1.1



Different data sizes . . . . . . . . . . . . . . . . . . . . . . .

20

4.1.2



The impact of alignment restrictions and byte order . . . . .

22

4.2



Kernel memory management . . . . . . . . . . . . . . . . . . . . . .

24

4.2.1



Memory management through virtual page tables . . . . . .

26

4.2.2



Page table mapping coherence . . . . . . . . . . . . . . . . .

29

4.3



Ensuring cache coherency and atomic operations . . . . . . . . . . .

30

4.3.1



Instruction cache coherency . . . . . . . . . . . . . . . . . .

30

4.3.2



Data cache coherency . . . . . . . . . . . . . . . . . . . . . .

33

4.3.3



The case against virtual data caches . . . . . . . . . . . . .

34

4.4



Multiprocessor issues . . . . . . . . . . . . . . . . . . . . . . . . . .

38

4.4.1



Symmetric multi-processing . . . . . . . . . . . . . . . . . .

39

4.4.2



Massively parallel systems . . . . . . . . . . . . . . . . . . .

42

4.5



Device drivers: accessing the I/O bus . . . . . . . . . . . . . . . . .

43

4.5.1



Proprietary buses . . . . . . . . . . . . . . . . . . . . . . . .

44

4.5.2



PCI — the emerging standard . . . . . . . . . . . . . . . . .

45

5 Example Architectures



46

5.1


The Alpha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

46

5.2



The Sparc line of computers . . . . . . . . . . . . . . . . . . . . . .

48

6 Future Work



51

References

53



1

Introduction

This thesis is an introduction to the portability issues of the Linux kernel. It is

not only meant to be my Masters thesis, I hope it will actually be useful for people

who want to port Linux to other architectures, or for people who just want to know

the design issues and goals of Linux on different platforms (as opposed to the more

general goals of Linux in general).

In an attempt to make this practical, I try to explain the general issues, usually

followed by a comment on one or more specific ports with some pointers on how

something is implemented in practice

1

.

Note that while the term “Linux” is often used to denote the whole system that



is built up from the basic kernel and all the system and user applications that are

usually running on top of the kernel, in the context of this thesis only the kernel itself

is considered. The portability of system and user applications is here considered a

totally different issue, even though there are obviously some common concerns.

Also, you should not expect this to be a line-by-line (or even very low-level)

explanation of the kernel — rather the opposite. Instead of trying to explain what

all the specific functions do, this paper tries to explain the basic ideas, and the

specific examples should be seen as just clarifying how Linux works on some specific

hardware in some specific case.

The thesis generally follows a common format: each section first explains the

generic problems and potential solutions, to then be followed by an “Implementa-

tion” section that gives Linux-specific implementation details. The reader should

be able to follow the text even with little or no knowledge of Linux itself, although

a general knowledge of the issues is obviously expected.

History of Linux portability

People who have followed Linux from the very beginning may find the title of this

paper, “Linux: a Portable Operating System”, a rather ironic statement. Being

portable was not what Linux was about initially; the early versions of Linux were

extremely unportable.

1

For the same reason this paper will also be available in an electronic version which I will try



to keep up-to-date as people send me comments or as changes to the system occur. Linux is by

no means a static system, and some of the issues, especially when it comes to multiple CPU’s, are

so young that major changes can still happen.

1



Yüklə 459,83 Kb.

Dostları ilə paylaş:
  1   2   3   4   5   6   7   8   9   ...   17




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©www.genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə