0% found this document useful (0 votes)
15 views55 pages

Linux Kernel Source Code Heavily Commented Kernel Version 0 12 2019th Edition Zhao Jiong Instant Download

This document is a heavily commented source code book for the early Linux kernel (version 0.12) by Zhao Jiong, aimed at helping readers understand the Linux operating system's mechanisms. It covers the development history, hardware structure, programming languages, and kernel architecture, providing a comprehensive guide for students and Linux enthusiasts. The book also includes debugging tests and is available for download from the author's website.

Uploaded by

xoehaogp878
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views55 pages

Linux Kernel Source Code Heavily Commented Kernel Version 0 12 2019th Edition Zhao Jiong Instant Download

This document is a heavily commented source code book for the early Linux kernel (version 0.12) by Zhao Jiong, aimed at helping readers understand the Linux operating system's mechanisms. It covers the development history, hardware structure, programming languages, and kernel architecture, providing a comprehensive guide for students and Linux enthusiasts. The book also includes debugging tests and is available for download from the author's website.

Uploaded by

xoehaogp878
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Linux Kernel source code Heavily Commented

Kernel Version 0 12 2019th Edition Zhao Jiong


download

https://textbookfull.com/product/linux-kernel-source-code-
heavily-commented-kernel-version-0-12-2019th-edition-zhao-jiong/

Download full version ebook from https://textbookfull.com


We believe these products will be a great fit for you. Click
the link to download now, or visit textbookfull.com
to discover even more!

Linux Kernel Programming - Second Edition: A


comprehensive and practical guide to kernel internals,
writing modules, and kernel synchronization Kaiwan N.
Billimoria
https://textbookfull.com/product/linux-kernel-programming-second-
edition-a-comprehensive-and-practical-guide-to-kernel-internals-
writing-modules-and-kernel-synchronization-kaiwan-n-billimoria/

Linux Kernel Programming - Second Edition Kaiwan N.


Billimoria

https://textbookfull.com/product/linux-kernel-programming-second-
edition-kaiwan-n-billimoria/

Multivariate Kernel Smoothing and Its Applications 1st


Edition José E. Chacón

https://textbookfull.com/product/multivariate-kernel-smoothing-
and-its-applications-1st-edition-jose-e-chacon/

Linux for Absolute Beginners 5 Books in 1 The Ultimate


Guide to Advanced Linux Programming Kernel Mastery
Robust Security Measures System Automation and In Depth
Hands on Exercises 1st Edition Denver Geiger.
https://textbookfull.com/product/linux-for-absolute-
beginners-5-books-in-1-the-ultimate-guide-to-advanced-linux-
programming-kernel-mastery-robust-security-measures-system-
An Introduction to the Theory of Reproducing Kernel
Hilbert Spaces 1st Edition Vern I. Paulsen

https://textbookfull.com/product/an-introduction-to-the-theory-
of-reproducing-kernel-hilbert-spaces-1st-edition-vern-i-paulsen/

An Introduction to the Theory of Reproducing Kernel


Hilbert Spaces 1st Edition Vern I. Paulsen

https://textbookfull.com/product/an-introduction-to-the-theory-
of-reproducing-kernel-hilbert-spaces-1st-edition-vern-i-
paulsen-2/

Neuroimaging, Software, and Communication: The Social


Code of Source Code Edison Bicudo

https://textbookfull.com/product/neuroimaging-software-and-
communication-the-social-code-of-source-code-edison-bicudo/

Android s Architecture Components Version 0 10 Mark L.


Murphy

https://textbookfull.com/product/android-s-architecture-
components-version-0-10-mark-l-murphy/

Source Code Analytics With Roslyn and JavaScript Data


Visualization Mukherjee

https://textbookfull.com/product/source-code-analytics-with-
roslyn-and-javascript-data-visualization-mukherjee/
www.oldlinux.org [email protected]
A Heavily Commented Linux Kernel
Source Code
Kernel Version 0.12

(Chinese Revision 5)

Zhao Jiong
[email protected]

WWW.OLDLINUX.ORG

2019-01-24
Abstract

This book provides detailed and comprehensive comments and explanations on all source code of the early Linux kernel
(V0.12), aiming to enable readers to gain a comprehensive and profound understanding of the working mechanism of Linux in a
shortest possible time and to lay a solid foundation for further study of modern Linux systems. Although the version of the analysis is
very low, the kernel has been able to compile and run, and it already includes the essence of the working principle of Linux.
The book first briefly introduced the development history of the Linux kernel, explained the main differences between the
various kernel versions and improvements, and gave the reasons for choosing the 0.12 kernel source code as the study object. Then it
gives the basic knowledge needed to read the source code, outlines the hardware structure of the PC running the Linux system, the
assembly language used by the kernel, the extends of C language, and focuses on the 80X86 processor in protected mode. Then we
introduced the kernel code overview, given the kernel source directory tree structure, and according to the organizational structure of
all kernel, programs and files are described in detail. In order to deepen the reader's understanding of the working principle of the
kernel, the last chapter gives a number of related operational debugging tests. All relevant information in the book can be
downloaded from the website www.oldlinux.org.
This book suits as the assistant and practical teaching material of university computer major student study operating system
course, also suitable for self-study reference book of Linux lovers as learning kernel operating principle, also can be used as the
reference book that the general technical personnel develops the embedded system.

Copyright statement
The author retains all rights to modify and formally publish this book. Feedback from readers can be sent to me via e-mail:
[email protected] or [email protected], or you can write directly to: School of Mechanical and Energy Engineering,
Institute of Mechanical and Electronic Engineering, Tongji University, Address: Room B409, Machinery Building, 4800 Cao'an Road,
Shanghai, China: 201804

© 2002 - 2019 by Zhao Jiong


Dedicated to:

Sun Hongfang - my dear mother


Zhao Bichen - my beloved father

In teaching me to grow up
You have spent your hard life

Your son
Zhao Jiong
“RTFSC – Read The F**king Source Code :)!”

–Linus Benedict Torvalds


Table of Contents

Table of Contents

5.3 LINUX KERNEL MEMORY MANAGEMENT ..... 178


PREFACE ...................................................................... 1
5.4 INTERRUPT MECHANISM .............................. 193
THE MAIN GOAL OF THIS BOOK .................................... 1 5.5 LINUX SYSTEM CALLS ................................. 199
FEATURES OF THIS BOOK ............................................. 1 5.6 SYSTEM TIME AND TIMING .......................... 201
OTHER BENEFITS OF READING EARLY KERNEL CODE.... 2 5.7 LINUX PROCESS CONTROL .......................... 203
THE IMPORTANCE AND NECESSITY OF READING THE 5.8 HOW TO USE THE STACK IN LINUX............... 215
COMPLETE CODE .......................................................... 3 5.9 FILE SYSTEM FOR LINUX 0.12 ..................... 219
HOW TO SELECT THE KERNEL CODE VERSION TO READ 3 5.10 DIRECTORIES OF KERNEL SOURCE CODE...... 220
THE BASIC KNOWLEDGE REQUIRED BY THE BOOK ....... 4 5.11 THE KERNEL CODE AND USER PROGRAMS . 229
IS READING AN EARLIER VERSION OUT OF DATE? ......... 5 5.12 LINUX/MAKEFILE ........................................ 230
EXT FILE SYSTEM AND MINIX FILE SYSTEM ............... 5 5.13 SUMMARY ................................................... 236
1 OVERVIEW ......................................................... 7 6 BOOTING SYSTEM ........................................ 237
1.1 THE BIRTH AND DEVELOPMENT OF LINUX ....... 7 6.1 MAIN FUNCTIONS ....................................... 237
1.2 CONTENT REVIEW ......................................... 15 6.2 BOOTSECT.S ................................................ 239
1.3 SUMMARY ..................................................... 20 6.3 SETUP.S ....................................................... 254
6.4 HEAD.S ........................................................ 286
2 MICROCOMPUTER STRUCTURE ............... 21 6.5 SUMMARY ................................................... 299
2.1 THE MICROCOMPUTER COMPOSITION .......... 22
7 INITIALIZATION PROGRAM (INIT) ......... 301
2.2 I/O PORT ADDRESSING & ACCESS CONTROL .. 23
2.3 MAIN MEMORY, BIOS AND CMOS MEMORY 26 7.1 MAIN.C ........................................................ 301
2.4 CONTROLLERS AND CONTROL CARDS........... 28 7.2 ENVIRONMENT INITIALIZATION ................... 316
2.5 SUMMARY ..................................................... 38 7.3 SUMMARY ................................................... 318
3 KERNEL PROGRAMMING LANGUAGE AND 8 KERNEL CODE (KERNEL) .......................... 319
ENVIRONMENT ....................................................... 39
8.1 MAIN FUNCTIONS ....................................... 319
3.1 AS86 ASSEMBLER ......................................... 39 8.2 ASM.S .......................................................... 322
3.2 GNU AS ASSEMBLER ..................................... 46 8.3 TRAPS.C....................................................... 329
3.3 C LANGUAGE PROGRAM ................................ 58 8.4 SYS_CALL.S ................................................. 335
3.4 INTERWORKING BETWEEN C AND ASSEMBLY 8.5 MKTIME.C.................................................... 349
LANGUAGE ................................................................ 67 8.6 SCHED.C ...................................................... 351
3.5 LINUX 0.12 OBJECT FILE FORMAT ................. 76 8.7 SIGNAL.C ..................................................... 373
3.6 MAKE COMMAND AND MAKEFILE ................ 87 8.8 EXIT.C ......................................................... 391
3.7 SUMMARY ..................................................... 93 8.9 FORK.C ........................................................ 404
8.10 SYS.C........................................................... 413
4 80X86 PROTECTION MODE AND ITS 8.11 VSPRINTF.C .................................................. 429
PROGRAMMING ...................................................... 94 8.12 PRINTK.C ..................................................... 438
4.1 80X86 SYSTEM REGISTERS AND SYSTEM 8.13 PANIC.C ....................................................... 439
INSTRUCTIONS ........................................................... 94 8.14 SUMMARY ................................................... 440
4.2 PROTECT MODE MEMORY MANAGEMENT .. 101
9 BLOCK DEVICE DRIVER ............................ 441
4.3 SEGMENTATION MECHANISM ...................... 106
4.4 PAGING ....................................................... 119 9.1 MAIN FUNCTIONS ....................................... 442
4.5 PROTECTION ............................................... 124 9.2 BLK.H .......................................................... 446
4.6 INTERRUPT AND EXCEPTION HANDLING ..... 136 9.3 HD.C ............................................................ 451
4.7 TASK MANAGEMENT .................................. 147 9.4 LL_RW_BLK.C ............................................. 477
4.8 THE INITIALIZATION OF PROTECTED MODE 157 9.5 RAMDISK.C .................................................. 485
4.9 A SIMPLE MULTITASK KERNEL EXAMPLE ... 161 9.6 FLOPPY.C ..................................................... 491
4.10 SUMMARY ................................................... 173 9.7 SUMMARY ................................................... 521
5 LINUX KERNEL ARCHITECTURE ............ 175 10 CHARACTER DEVICE DRIVER ................. 523
5.1 LINUX KERNEL MODE .................................. 175 10.1 MAIN FUNCTIONS ....................................... 523
5.2 LINUX KERNEL SYSTEM ARCHITECTURE ...... 176 10.2 KEYBOARD.S ............................................... 535

- I -
Table of Contents

10.3 CONSOLE.C .................................................. 555 14.11 TERMIOS.H .................................................. 947


10.4 SERIAL.C ..................................................... 594 14.12 TIME.H ........................................................ 954
10.5 RS_IO.S ....................................................... 603 14.13 UNISTD.H ..................................................... 956
10.6 TTY_IO.C ..................................................... 608 14.14 UTIME.H ...................................................... 963
10.7 TTY_IOCTL.C ............................................... 626 14.15 FILES IN THE INCLUDE/ASM/ DIRECTORY ..... 964
10.8 SUMMARY ................................................... 635 14.16 IO.H ............................................................. 964
14.17 MEMORY.H................................................... 965
11 MATH COPROCESSOR (MATH) ................. 637
14.18 SEGMENT.H ................................................. 966
11.1 FUNCTION DESCRIPTION ............................. 637 14.19 SYSTEM.H .................................................... 968
11.2 MATH-EMULATION.C ................................... 647 14.20 FILES IN THE DIRECTORY INCLUDE/LINUX/ .. 973
11.3 ERROR.C ...................................................... 660 14.21 CONFIG.H .................................................... 973
11.4 EA.C ............................................................ 661 14.22 FDREG.H ...................................................... 975
11.5 CONVERT.C .................................................. 665 14.23 FS.H ............................................................. 977
11.6 ADD.C ......................................................... 670 14.24 HDREG.H ..................................................... 982
11.7 COMPARE.C ................................................. 673 14.25 HEAD.H ....................................................... 985
11.8 GET_PUT.C .................................................. 675 14.26 KERNEL.H .................................................... 986
11.9 MUL.C ......................................................... 682 14.27 MATH_EMU.H .............................................. 987
11.10 DIV.C ........................................................... 684 14.28 MM.H........................................................... 991
11.11 SUMMARY ................................................... 686 14.29 SCHED.H ...................................................... 993
14.30 SYS.H ........................................................ 1002
12 FILE SYSTEM (FS) ......................................... 689 14.31 TTY.H ........................................................ 1004
12.1 MAIN FUNCTIONS ....................................... 689 14.32 HEADER FILES IN THE INCLUDE/SYS/
12.2 BUFFER.C .................................................... 708 DIRECTORY ............................................................ 1008
12.3 BITMAP.C ..................................................... 728 14.33 PARAM.H ................................................... 1008
12.4 TRUNCATE.C ................................................ 735 14.34 RESOURCE.H.............................................. 1009
12.5 INODE.C ...................................................... 738 14.35 STAT.H ....................................................... 1011
12.6 SUPER.C ...................................................... 752 14.36 TIME.H ...................................................... 1013
12.7 NAMEI.C ...................................................... 763 14.37 TIMES.H ..................................................... 1014
12.8 FILE_TABLE.C .............................................. 793 14.38 TYPES.H..................................................... 1015
12.9 BLOCK_DEV.C ............................................. 793 14.39 UTSNAME.H ............................................... 1016
12.10 FILE_DEV.C ................................................. 798 14.40 WAIT.H....................................................... 1017
12.11 PIPE.C .......................................................... 802 14.41 SUMMARY ................................................. 1018
12.12 CHAR_DEV.C ............................................... 807
15 LIBRARY FILES (LIB) ................................. 1019
12.13 READ_WRITE.C ............................................ 810
12.14 OPEN.C ........................................................ 817 15.1 _EXIT.C ..................................................... 1020
12.15 EXEC.C ........................................................ 826 15.2 CLOSE.C .................................................... 1021
12.16 STAT.C ......................................................... 845 15.3 CTYPE.C .................................................... 1021
12.17 FCNTL.C ...................................................... 848 15.4 DUP.C ........................................................ 1022
12.18 IOCTL.C ....................................................... 852 15.5 ERRNO.C .................................................... 1023
12.19 SELECT.C ..................................................... 854 15.6 EXECVE.C .................................................. 1023
12.20 SUMMARY ................................................... 868 15.7 MALLOC.C ................................................. 1024
15.8 OPEN.C ...................................................... 1032
13 MEMORY MANAGEMENT (MM) ............... 869 15.9 SETSID.C .................................................... 1034
13.1 MAIN FUNCTIONALITIES ............................. 869 15.10 STRING.C ................................................... 1034
13.2 MEMORY.C................................................... 879 15.11 WAIT.C ....................................................... 1035
13.3 PAGE.S ......................................................... 901 15.12 WRITE.C .................................................... 1036
13.4 SWAP.C ........................................................ 902 15.13 SUMMARY ................................................. 1037
13.5 SUMMARY ................................................... 912
16 BUILDING KERNEL (TOOLS) ................... 1039
14 HEADER FILES (INCLUDE) ........................ 913 16.1 BUILD.C ..................................................... 1039
14.1 FILES IN THE INCLUDE/ DIRECTORY ............. 914 16.2 SUMMARY ................................................. 1047
14.2 A.OUT.H....................................................... 915
17 EXPERIMENTAL ENVIRONMENT
14.3 CONST.H ...................................................... 926
SETTINGS AND USAGE ...................................... 1048
14.4 CTYPE.H ...................................................... 926
14.5 ERRNO.H ..................................................... 928 17.1 BOCHS SIMULATION SOFTWARE ................ 1049
14.6 FCNTL.H ...................................................... 930 17.2 RUNNING LINUX 0.1X SYSTEM IN BOCHS .. 1054
14.7 SIGNAL.H .................................................... 931 17.3 ACCESS INFORMATION IN A DISK IMAGE FILE
14.8 STDARG.H ................................................... 934 1059
14.9 STDDEF.H .................................................... 936 17.4 COMPILING AND RUNNING THE SIMPLE KERNEL
14.10 STRING.H ..................................................... 937 1062

- II -
Table of Contents

17.5 USING BOCHS TO DEBUG THE KERNEL ..... 1065 REFERENCES........................................................ 1101
17.6 CREATING A DISK IMAGE FILE .................. 1073
APPENDIX .............................................................. 1103
17.7 MAKING A ROOT FILE SYSTEM ................. 1076
17.8 COMPILE KERNEL ON LINUX 0.12 SYSTEM 1084 A1 ASCII CODE TABLE .................................. 1103
17.9 COMPILE KERNEL UNDER REDHAT SYSTEM 1085 A2 COMMON C0, C1 CONTROL CHARACTERS 1104
17.10 INTEGRATED BOOT DISK AND ROOT FS .... 1089 A3 ESCAPE AND CONTROL SEQUENCES .......... 1106
17.11 DEBUGGING KERNEL CODE WITH GDB AND A4 THE FIRST SET OF KEYBOARD SCAN CODE1109
BOCHS 1094
17.12 SUMMARY ................................................. 1100

- III -
Preface

Preface

Under the general trend of intelligent manufacturing and networking direct control of objects, the Linux
operating system has become the most important basic platform for operation control in today's embedded
systems. This book is a primer on the basic workings of the Linux operating system kernel.

The main goal of this book

The main goal of this book is to use a minimal amount of space or within a limited space to dissect the
complete Linux kernel source code in order to obtain a full understanding of the basic functions and actual
implementation of the operating system. To achieve a complete and profound understanding of the Linux kernel,
a true understanding and introduction of the basic operating principles of the Linux operating system.
This book's readership is positioned to know the general use of Linux systems or has a certain
programming basis, but it lacks the basic knowledge to read the current new kernel code and is eager to
understand the working principle and actual code of the UNIX operating system kernel as soon as possible.

Features of this book

At the time of writing this book, there are books on the market that describe the Linux kernel that try to use
the newer Linux kernel version (such as version 2.6.24 used by Fedora 8) to describe the kernel working
mechanism. However, since the size of kernel source code is already very large (for example, 2.2.20 version has
2.68 million lines!), these books can only selectively explain and describe the Linux kernel source code, and
many system implementation details are ignore. Therefore, it is difficult to have a clear and complete
description of the Linux kernel.
The book “Linux Kernel Source Code Analysis” written by Scott Maxwell is basically oriented to the
advanced level readers of Linux. It needs a more comprehensive basic knowledge to fully understand. And may
be due to space limitations, the book does not comment on all the Linux kernel code, omitted a lot of kernel
implementation details, such as the various header files used in the kernel (*.h), the tool to generate the kernel
code image file The role of the program, each make file, and its implementation are not covered. Therefore,
reading the book is difficult for readers who are at entry level.
The book "Leon's UNIX source code analysis" written by John Lions is a good book for learning UNIX
source code of the operating system kernel, but because it uses the UNIX version V6, some of the code in the
system call is With the assembler language of the long-deprecated PDP-11 series machine, it is difficult to
conduct experiments when reading and understanding the source code related to the hardware part.
Andrew S. Tanenbaum's book "Operating Systems: Design and Implementation" is a good primer on
operating system kernel implementation, but the MINIX system described in this book is a message-based
kernel implementation mechanism, and Linux There are differences in the implementation of the kernel.
Therefore, after learning this book, it is not very easy to start working on the newer Linux kernel source code.
When using these books for learning, there will be a feeling of "blind people feel like elephants". It is not

- 1 -
Preface

easy to understand the overall concept of the specific implementation of the Linux kernel system, especially
when the Linux system beginners use those books to learn the principle of the kernel, the overall operating
structure of the kernel. It cannot be clearly formed in the mind. This has profound experience in my many years
of experience in the Linux kernel learning. In October 1991, Linux founder Linus Torvalds mentioned the same
problem in an article written during the development of Linux version 0.03. In this article titled "LINUX--a free
unix-386 kernel", he said: "The development of Linux is for the use, learning and entertainment of those
operating system enthusiasts and computer science students." Today's popular Linux systems have become
larger and more complex, so they are no longer suitable as a starting point for beginners learning the operating
system.
In order to fill this vacancy, this book uses a minimal amount of space or within a limited space to conduct
a complete dissection of the complete Linux kernel source code in order to obtain a full understanding of the
basic functions and actual implementation of the operating system. To achieve a complete and profound
understanding of the Linux kernel, a true understanding and introduction of the basic operating principles of the
Linux operating system.

Other benefits of reading early kernel code

At present, there have been many kernel versions developed specifically for embedded systems based on
Linux's early kernels, such as DJJ's x86 operating system, Uclinux, etc. Many people in the world also realize
the benefits of learning through the early Linux kernel source code. At present, people in China are already
organizing human annotations to publish books similar to this article. Therefore, by reading the source code of
the Linux kernel version earlier, it is indeed an effective way to learn the Linux system, and it is also very
helpful for the research and application of the Linux embedded system.
In commenting on early kernel source code, the author found that early kernel source code was almost a
condensed version of the newer kernels in use today. It already includes almost all the basic functional
principles of the current version. As Leland L. Beck, author of "System Software: An Introduction to System
Programming," introduced system programs and operating system design, he introduced an extremely
simplified Simple Instruction Computer (SIC) system to illustrate the design and implementation of all system
programs. The principle, which not only avoids the complexity of the actual computer system, but also a
thorough description of the problem. Here, select the early kernel version of Linux as a learning object, and its
guiding ideology is the same as that of Leland. This is one of the best choices for beginners of Linux kernel
learning. The basic working principle of the Linux kernel can be deeply understood in the shortest possible
time.
For those who are already familiar with the working principle of the kernel, it is necessary to read the
kernel source code in order to allow the actual operation mechanism of the system in the actual work to produce
no feeling of castle in the air.
Of course, using the early kernel as a learning object also has its disadvantages. The selected Linux early
kernel version does not include support for virtual file system VFS, support for network systems, support for
only a.out executable files, and description of complex subsystems in some other existing kernels. However,
since this book is an introductory textbook that is used as a working mechanism for the Linux kernel, this is one
of the advantages of choosing an earlier kernel version. By studying this book, you can lay a solid foundation
for further studying these advanced contents.

- 2 -
Preface

The importance and necessity of reading the complete code

Just as the founder of the Linux system stated in a newsgroup submission, to understand the true operating
mechanism of a software system, be sure to read its source code (RTFSC – Read The F**king Source Code).
The system itself is a complete whole, with many seemingly unimportant details. However, ignoring these
details will make it difficult to understand the entire system and fail to truly understand the implementation
method and means of an actual system.
Although some classic books on operating system principles (such as Mr. MJBach's "UNIX Operating
System Design") can be used to theoretically guide the working principle of the UNIX-like operating system,
the actual composition of the operating system is The understanding of the realization of internal relations is
still not very clear. As Andrew S. Tanenbaum said, "many operating system textbooks are theoretical and light
practice." "Most books and courses consume a lot of time and space for scheduling algorithms and completely
ignore I/O. In fact, the former is usually less than one page of code. The latter often has to account for one-third
of the total code of the entire system.” A large number of important details in the kernel are not mentioned.
Therefore, it does not allow readers to understand the true beauty of a real operating system. Only after reading
the complete kernel source code in detail will there be a sense of openness to the system and a deep
understanding of the entire system's operational process. When you choose the newest or newer kernel source
code to learn later, you will not encounter major problems and basically will be able to understand the new code
content smoothly.

How to select the kernel code version to read

So, how can we choose to meet the above requirements without being confused by too much content and
choose a suitable version of the Linux kernel to learn and improve the efficiency of learning? After comparing
and selecting a large number of kernel versions, the author finally chose the 0.12 kernel that is similar to the
current basic functions of the Linux kernel and is very short, as the best version for getting started. The
following figure shows the statistics for some major Linux kernel version lines.

- 3 -
Preface

The current Linux kernel source code amount is in the number of millions of lines, the 2.6.0 version of the
kernel code line is about 5.92 million lines, and the 4.18.X version of the kernel code is extremely large, and it
has exceeded 25 million lines! So it is almost impossible to fully annotate and elaborate on these kernels. The
0.12 version of the kernel does not exceed 20,000 lines of code, so it can be explained and commented clearly
in a book. Small but complete. In order to have an inductive understanding of the system under study and to use
experiments to deepen the understanding of the principle, the author has also specifically rebuilt the Linux 0.12
system that is based on this kernel. Since it contains the GNU gcc compilation environment, using this system
can also do some simple development work.
In addition, the use of this version can avoid the use of existing newer kernel versions that have become
more and more complicated to study the various subsystems (such as virtual file system VFS, ext2, or ext3 file
systems, network subsystems, new complex Memory management mechanisms, etc.)

The basic knowledge required by the book

When reading this book, readers must have some basic C language knowledge and Intel CPU assembly
language knowledge. The best reference for C language is still the book "The C Programming Language"
written by Mr. Brain W. Kernighan and Mr. Dennis M. Ritchie. Assembler language data can refer to any
assembly language textbook that explains Intel CPU. Also need some embedded assembly language information.
The authoritative information about embedded assembly is contained in the GNU gcc compiler manual. We can
also search for some valuable essays about embedded assembly from the Internet. The book also contains some
basic syntax descriptions for inline assembly (Section 5.5).
In addition, I hope readers have the following basic knowledge or related reference books. One is
knowledge or information about 80x86 processor architecture and programming. For example, the 80x86
programming manual (INTEL 80386 Programmer's Reference Manual) can be downloaded from the Internet;
the second is about 80x86 hardware architecture and interface programming knowledge or information. There is
a lot of information in this regard; the third should also have the simple skills of using the Linux system at the

- 4 -
Preface

beginning.
Since Linux kernel implementation was first developed according to the basic principles of the "UNIX
operating system design" book, many variables or function names in the source code come from the book.
Therefore, if you read this book properly, it will be easier to understand the kernel source code.
When Linus first developed the Linux operating system, he referred to the MINIX operating system. For
example, the original Linux kernel version completely copied the MINIX 1.0 file system. Therefore, when
reading this book, A.S. Tanenbaum's book "Operating System: Design and Implementation" also has great
reference value.

Is reading an earlier version out of date?

On the surface, the book notes the contents of Linux's early kernel version as if the Linux operating system
has just been released. Tanenbaum thinks that it is outdated (Linux is obsolete). However, by studying the
content of this book, you will find that because of the small amount of early kernel source code and lean, using
this book to learn the Linux kernel will have a very high learning efficiency, can do more with less, and get
started quickly. And lay a solid foundation for continuing to further select the source code of the new kernel part.
After completing this book, you will have a very complete and practical concept of how the system works. This
complete concept makes it easy to further select and learn any part of the new kernel source code without
having to Read the complete source code in the new kernel with a large amount of code.

Ext file system and MINIX file system

The Ext3 file system currently used on Linux systems was developed after kernel 1.x. Its function is
detailed and its performance is also very complete and stable. It is the default standard file system on the current
Linux operating system. However, as part of the introductory learning of the full working principle of the Linux
operating system, in principle, the more streamlined the better. In order to achieve a complete understanding of
an operating system, and without being overwhelmed by the complex and excessive details of the various
subsystems, the principle of choosing the kernel version for learning is as simple as possible, as long as the
system code can explain the actual working principle. The Linux kernel version 0.12 contained only the
simplest MINIX 1.0 file system at the time, which is enough to understand the actual composition and working
principle of a file system in an operating system. This is one of the main reasons to choose the early Linux
kernel version for learning.

After reading this book in its entirety, I believe you will send this kind of sigh: "For the Linux kernel
system, I'm finally getting started!" At this point, you should have enough confidence to further study the
working principle and process of each part of the latest Linux kernel.

Dr. Zhao Jiong


Tongji University
2019.1

- 5 -
1.1 The birth and development of Linux

1 Overview

This chapter first reviews the process of the birth, development, and growth of the Linux operating system.
This can be used to understand why the book chose an earlier version of the Linux system as a learning object.
It then explains in detail the advantages and disadvantages of choosing an early version of the Linux kernel for
learning and how to begin further learning. Finally, we briefly introduced the contents of each chapter.

1.1 The birth and development of Linux

Linux is a clone system of the UNIX operating system. It was born on October 5, 1991 (this is the time for
the first official announcement). Since then, with the aid of the Internet, through the joint efforts of computer
enthusiasts all over the world, it has now become the most widely used type of UNIX operating system in the
world, and the number of users is still growing rapidly.
The birth, development, and growth of the Linux operating system depend on the following five pillars: the
UNIX operating system, the MINIX operating system, the GNU project, the POSIX standard, and the Internet
network. Based on these five basic clues, we follow the development history of Linux, its brewing process and
its initial development. First of all, I will introduce the four basic elements, and then follow Linux founder
Linus Torvalds to learn computer knowledge from her own interest in computers, start brewing her own
operating system, release to the initial release of the Linux kernel version 0.01, and how difficult it will be. Step
by step, with the help of hackers all over the world, the development of the more mature version 1.0 was finally
introduced. It also describes the history of Linux's early development in detail.
Of course, the current Linux kernel version has been developed to version 4.18.x. The kernel used in most
Linux systems is a stable 4.4.x-4.16.x kernel (where the second digit is an odd number, it means that it is being
developed and cannot guarantee system stability). For the general history of Linux development, many articles
and books have been introduced and will not be repeated here.

1.1.1 The birth of the UNIX operating system


The Linux operating system is a cloned version of the UNIX operating system. The UNIX operating
system is a time-sharing operating system developed by Bell Labs's Ken. Thompson and Dennis Ritchie on the
DEC PDP-7 minicomputer in the summer of 1969.
In order to be able to run his favorite Star Travel game on an idle PDP-7 computer, Ken Thompson
developed UNIX operations within a month in the summer of 1969 while his wife returned home to California.
The prototype of the system. At that time, the BCPL language (basic combination programming language) was
used. After being rewritten by Dennis Ritchie in 1972 with a highly portable C language, the UNIX system was
promoted in universities and colleges.

1.1.2 MINIX operating system


The MINIX system was developed by Andrew S. Tanenbaum (AST). AST is a mathematics and computer
science system at Vrije University in Amsterdam, the Netherlands. He is a senior member of ACM and IEEE
(only a few people in the world are senior members of the two associations). A total of more than 100 articles
and 5 computer books were published.

- 7 -
1.1 The birth and development of Linux

Although AST was born in New York, it was a Dutch expatriate (his grandfather came to the United States
in 1914). He studied at a high school in New York, a university at M.I.T, and a doctorate at the Berkeley campus
of the University of California. Due to his postdoctoral studies, he came to his hometown of the Netherlands.
Since then, it has been with the hometown. Later, I started teaching and graduate school at Vrije University.
Amsterdam, the capital city of the Netherlands, is a year-round rainy city, but for the AST, this is best, because
in this environment he can often stay at home to play with his computer.
MINIX was created in 1987 and is mainly used by students to learn operating system principles. By 1991
the version was 1.5. There are currently two major versions in use: Version 1.5 and Version 2.0. At that time, the
operating system was free at university, but other uses were not. Of course, the current MINIX system is free
and can be downloaded from many FTP sites.
For the Linux system, he later expressed his compliments to the developer Linus. However, he believes
that the development of Linux is largely due to the fact that in order to keep MINIX small, he will be able to
complete the learning within one semester, thus failing to accept the expansion requirements of MINIX from
many people around the world. So under this premise inspired Linus to write a Linux system. Of course, Linus
also just caught this good time.
As an operating system, MINIX is not an excellent one, but it also provides system source code written in
C and assembly language. This is the first time that aspiring programmers or hackers have been able to read the
operating system's source code. At the time, this source code was a secret that software vendors had been
carefully guarding.

1.1.3 GNU Project


The GNU Project and the Free Software Foundation were founded by Richard M. Stallman in 1984 to
develop a complete operating system similar to UNIX and free software: the GNU system (GNU is "GNU's
Not". Recursive abbreviation for Unix, which is pronounced "guh-NEW"). Various GNU operating systems
using Linux as the core are being widely used. Although these systems are often referred to as "Linux,"
Stallman believes that, strictly speaking, they should be referred to as GNU/Linux systems.
By the early 1990s, the GNU project had developed many high-quality free software, including the famous
emacs editing system, bash shell program, gcc series compiler, gdb debugger and so on. These softwares create
a suitable environment for the development of the Linux operating system. This is one of the foundations for the
birth of Linux, so that many people now refer to the Linux operating system as the "GNU/Linux" operating
system.

1.1.4 POSIX standard


POSIX (Portable Operating System Interface for Computing Systems) is a cluster of standards developed
by IEEE and ISO/IEC. The standard is based on existing UNIX practices and experiences and describes the
operating system's call service interface. The applications used to ensure the compilation can be ported and run
on multiple operating systems at the source code level. It was based on the early work of a UNIX user group
(usr/group) in the early 1980s. The UNIX user group originally attempted to re-integrate the distinction between
AT&T's System V operating system and Berkeley CSRG's BSD operating system's call interface. In 1984, the
/usr/group standard was customized.
In 1985, the IEEE Operating System Technical Committee Standards Subcommittee (TCOS-SS) began,
under the aegis of ANSI, instructing the IEEE Standards Committee to establish a formal standard for program
source code portability operating system service interfaces. In April 1986, the IEEE developed a trial standard.
The first formal standard was approved in September 1988 (IEEE 1003.1-1988), and also the POSIX.1 standard

- 8 -
1.1 The birth and development of Linux

that is often mentioned later.


By 1989, POSIX's work was transferred to the ISO/IEC community and the 15 working group continued to
develop it as an ISO standard. By 1990, POSIX.1, in conjunction with the already adopted C language standard,
was formally approved as the IEEE 1003.1-1990 (also ANSI) and ISO/IEC 9945-1:1990 standards.
POSIX.1 only specifies system service application programming interfaces (APIs) and only summarizes
basic system service standards. Therefore, the working group expects to establish standards for other functions
of the system. So the work of IEEE POSIX began. Ten approval plans were in progress at the beginning, and
nearly 300 people participated in the quarterly one-week meeting. The work that started was command and tool
standard (POSIX.2), test method standard (POSIX.3), and real-time API (POSIX.4). In the first half of 1990, 25
plans were already in progress and 16 working groups were involved. At the same time, some organizations are
also developing similar standards such as X/Open, AT&T, and OSF.

In the early 1990s, the formulation of the POSIX standard was in the final stage of voting, which was
between 1991 and 1993. At this point, when Linux was just starting out, this UNIX standard provided extremely
important information for Linux, enabling Linux to be developed under the guidance of standards and
compatible with most UNIX operating systems. In the original Linux kernel source code (versions 0.1, 0.11, and
0.12) the Linux system was ready for compatibility with the POSIX standard. Several symbolic constants for
POSXI standard requirements have been defined in the /include/unistd.h file of the Linux version 0.01 kernel,
and Linus wrote in the comment: "OK, this may be a joke, but I'm working on it. It does."
On July 3, 1991, Linus mentioned on the post posted on comp.os.minix that it is collecting POSIX data. It
revealed that he is working on the development of an operating system, and at the beginning of development, he
had thought of the problem of compatibility with POSIX.

1.1.5 The birth of the Linux operating system


In 1981, IBM introduced the world-renowned microcomputer IBM PC. Between 1981 and 1991, the
MS-DOS operating system was always the master of the microcomputer operating system. At this time,
although the price of computer hardware has decreased year by year, software prices have remained high. At
that time, Apple's MACs operating system can be said to be the best performance, but its price is so that no one
can easily get close.
Another computer technology camp at the time was the UNIX world. However, the UNIX operating
system is not only an expensive issue. In order to seek high profit margins, UNIX dealers have pushed prices
extremely high, and PC users can't get close to it. The UNIX source code that once received permission from
Bell Labs to be used for teaching in the university has also been carefully guarded against disclosure. For the
majority of PC users, large vendors in the software industry have never given effective solutions to this
problem.
At this time, the MINIX operating system appeared, and a book describing the principles of its design and
implementation was issued at the same time. Since this book written by AST was very detailed and
well-articulated, almost all computer enthusiasts around the world began to read this book in order to
understand how the operating system works. It also includes Linus Benedict Torvalds, the founder of the Linux
system. At that time (in 1991), he was a sophomore in the Department of Computer Science at the University of
Helsinki and a self-taught computer hacker. The 21-year-old Finnish young man likes to drum up his computer
and test the performance and limitations of the computer. But what he lacked at the time was a
professional-level operating system.
During the same year, the GNU program has developed a number of software tools. The most anticipated

- 9 -
1.1 The birth and development of Linux

GNU C compiler has emerged, but the free GNU operating system has not yet been developed. Even the
MINIX operating system used in teaching has begun to have copyright, and it is necessary to purchase it to get
the source code. Although the GNU operating system HURD has been under development, it did not appear to
have been completed within a few years.
To better learn computer knowledge (perhaps just for interest), Linus purchased a 386-compatible
computer using Christmas lucky money and loans, and mailed a MINIX system software from the United States.
While waiting for the MINIX software, Linus learned the hardware knowledge of Intel 80386 seriously. In order
to be able to connect to the school's mainframe through a Modem dial-up, he uses assembly language and uses
the multitasking features of the 80386 CPU to create a terminal emulation program. Later, in order to copy his
own software on an old computer to a new computer, he also compiled drivers for floppy disk drives, keyboards,
and other hardware devices.
Through programming practice and recognizing the many limitations of the MINIX system during the
learning process (MINIX is good, but it is only a simple operating system for teaching purposes, rather than a
powerful and practical operating system), Linus already has something similar. The code for the operating
system device driver, so he began to have the idea of a new operating system. At this point, the GNU Project has
developed many tools and software, among which the most anticipated GNU C compiler has appeared.
Although GNU's free operating system HURD is under development. But Linus has waited for no hurry.
From April 1991, he began to develop his own operating system by modifying the terminal emulation
program and hardware drivers. At the beginning, his purpose was simple, just to learn the programming
techniques of the Intel 386 architecture protection mode operation. However, the development of Linux has
completely changed its original intention. According to Linus's news release on the comp.os.minix newsgroup,
we can see that he has gradually evolved from learning the MINIX system stage to developing his own Linux
system.
Linus delivered the message to comp.os.minix for the first time on March 29, 1991. The title of the posted
post is "gcc on minix-386 doesn't optimize". It is about the gcc compiler running optimized on the MINIX-386
system (MINIX-386 is an improvement from Bruce Evans using Intel 386 features 32 Bit MINIX system).
From this it can be seen that Linus had already begun to study the MINIX system in depth in early 1991, and
during this time there has been an improvement of the MINIX operating system. After further learning about the
MINIX system, this idea gradually evolved into the idea of redesigning a new operating system based on the
Intel 80386 architecture.
When he answered someone's question on MINIX, the first sentence said was "Read the F**ing Source
Code :-)"). He thinks the answer lies in the source program. This also shows that for the learning system
software, we not only need to understand the basic working principles of the system, but also need to combine
the actual system to learn how to implement the actual system. After all, theory is a theory, in which many
branches are omitted. Although these branch problems do not have much theoretical content, they are a
necessary part of the system, just like a feather in a sparrow.
From April 1991, Linus spent almost all of his time researching the MINIX-386 system (Hacking the
kernel) and trying to port GNU software to the system (GNU gcc, bash, gdb, etc.). And announced on
comp.os.minix on April 13 that he had successfully ported bash to MINIX, and he could not afford to leave the
shell software.
The first Linux-related news was released on comp.os.minix on July 3, 1991. (Of course, there was no such
name as Linux at that time. Linus thought that the name might be FREAK , FREAX. The English meaning is
grotesque, monsters, whimsical, etc.). It revealed that he is developing Linux system and he has already thought
of the problem of compatibility with POSIX.

- 10 -
1.1 The birth and development of Linux

In another announcement by Linus (comp.os.minix, August 25, 1991), he asked all MINIX users "What do
you most want to see in the MINIX system?" ("What would you like to see?" In minix?”), in which he revealed
for the first time that a (free) 386(486) operating system is being developed, and that he is only interested in it.
The code will not be large and will not be as professional as GNU. I hope you will give us some feedback on
what features the MINIX system likes and dislikes, and explain that due to practical and other reasons, the
newly developed system is just like MINIX (and uses MINIX's file system). And it has successfully ported bash
(version 1.08) and gcc (version 1.40) to the new system and it will be practical in months.

Finally, Linus stated that the operating system he developed does not use a single line of MINIX source
code; because of the task switching feature of the 386, the operating system is not portable (no portability) and
only AT hard disks are used. Linus did not consider the issue of Linux portability. But at present, Linux can run
on almost any kind of hardware architecture.
On October 5th, 1991, Linus published a message on the comp.os.minix newsgroup, officially announcing
the birth of the Linux kernel system (Free minix-like kernel sources for 386-AT). This news can be called the
birth declaration of Linux, and has been widely circulated. Therefore, October 5 was a special day for the Linux
community, and many later Linux versions had chosen this date. So RedHat chose this day to release its new
system is not accidental.

1.1.6 Linux operating system version changes


Since the birth of the Linux operating system to the 1.0 release, a number of major releases have been
released as shown in Table 1–1. Linus looked at all of the previous versions of 1.0 when he started learning to
use the version management tool BitKeeper in September 2003. In fact, the Linux system does not have this
version of 0.00, but since Linus' experiment on his own 80386 compatible machine succeeded in switching
between two tasks under the control of clock interruption, he further enhanced his idea of developing his
operating system to some extent. . Therefore we are also listed as a version. The Linux version of the kernel
version was completed on September 17, 1991. However, Linus has no copyright awareness at all, so only one
copy of copyright information appears in this version of the include/string.h file. The keyboard driver for this
version of the kernel is hard-coded only into Finnish code, so only the Finnish keyboard is supported. Only
8MB physical memory is supported. Due to a mistake by Linus, the subsequent 0.02, 0.03 version of the kernel
source code was destroyed and lost.

Table 1-1 Earlier major versions of the kernel


Version No. Release date Description
The two processes display 'AAA...' and 'BBB...' on the screen, respectively. (Note:
0.00 1991.2-4
No release)
The first official release of the Linux kernel version. Multi-threaded file system,
0.01 1991.9.17 segmentation, and paging memory management. Does not include floppy disk
drivers yet.
This version and version 0.03 is an internal version that is currently unavailable.
0.02 1991.10.5
Features the same as above.
The Linux kernel version released by Ted Ts’o. Added memory allocation library
0.10 1991.10 functions. The boot directory contains a script that converts as86 assembler syntax
to gas assembler syntax.
0.11 1991.12.8 Basically functioning kernel. Supports hard disk and floppy drive devices as well as

- 11 -
1.1 The birth and development of Linux

serial communications.
The more stable version mainly increases the software simulation program of the
0.12 1992.1.15 math coprocessor. Added job control, virtual console, file symbolic links, and virtual
memory swapping capabilities.
Virtual file system support was added in this version, but it still contains only one
MINIX file system. Added login functionality. Improves the performance of floppy
0.95.x
1992.3.8 disk drivers and file systems. Changed hard disk naming and numbering. The
(ie 0.13)
original naming method is the same as that of the MINIX system. At this time, it is
the same as the current Linux system. Support CDROM.
Began to add UNIX Socket support. Added ext file system alpha tester. SCSI drivers
are officially added to the kernel. Floppy disk type is automatically recognized.
Improved serial driver, cache, memory management performance, support for
0.96.x 1992.5.12
dynamic link libraries, and the ability to run X-Windows programs. The keyboard
driver written in the original assembly language has been rewritten with C.
Compared with the 0.95 kernel code, there are great changes.
Added support for new SCSI drivers; dynamic caching; msdos and ext file system
0.97.x 1992.8.1 support; bus mouse drivers. The kernel is mapped to the beginning of the linear
address 3GB.
Improve support for TCP/IP (0.8.1) networks and correct extfs errors. Rewritten
memory management section (mm), each process has 4GB of logical address space
0.98.x 1992.9.28 (the kernel occupies 1GB). Starting from 0.98.4, each process can open 256 files at
the same time (originally 32), and the process's kernel stack uses a single memory
page independently.
Re-design the process of the use of memory allocation, each process has 4G linear
0.99.x 1992.12.13
space. Constantly improving the network code. NFS support.
1.0 1994.3.14 The first official version.

The existing 0.10 version of the kernel code is a version of Ted Ts'o that was preserved at the time, Linus's
own has also been lost. This version is a great improvement over the previous versions. On this version of the
kernel system, GNU gcc has been used to compile the kernel, and has begun to support the operation of
mounting/unmounting file systems. From this kernel version, Linus added copyright information for each file:
"(C) 1991 Linus Torvalds". Some other changes in this version include: the original boot program boot/boot.s
split into two programs boot/bootsect.s and boot/setup.s; 1 supports up to 16MB of physical memory; 2 drivers
and memory management procedures Created their own subdirectories separately; 3 Added floppy driver; 4
Supported file read-ahead operations; 5 Supported dev/port and dev/null devices; 6 Rewritten kernel/signal.c
code, added sigaction() Support etc.
Relative to the 0.10 version of the kernel, Linux 0.11 version of the changes are relatively small. However,
this version is also the first stable version, and other people are beginning to participate in kernel development.
The main additions in this version are: 1 load requirements for the execution program; 2 execute the /etc/rc
initial file at startup; 3 build the math coprocessor simulation program frame program structure; 4Ted Ts'o adds
a script program The processing code; 5 Galen Hunt added support for multiple display cards; 6John T Kohl
modified the kernel/console.c program to enable the console to support tweet and KILL characters; 7 provides
support for multilingual keyboards.
Linux 0.12 is a more satisfactory kernel version of Linus and a more stable kernel. During the Christmas

- 12 -
1.1 The birth and development of Linux

season in 1991, he compiled the virtual memory management code so that "large" software like gcc could be
used on machines with only 2MB of memory. This version makes Linus feel that releasing the 1.0 kernel
version is not something that is out of sight, so he immediately upgraded the next version (0.13 version) to
version 0.95. Another implication of Linus's ability to do this is to make everyone not feel that they are still far
from version 1.0. However, due to the hasty release of the 0.95 version, which also contains more errors, so
when the 0.95 version was just released, there were more Linux enthusiasts encountered problems in use. At
that time, Linus felt like he had encountered a catastrophe. However, he has accepted this lesson since then.
Every time a new kernel version is released later, he will undergo more careful testing and let a few good
friends try it out before officially publishing it. The main changes in the 0.12 version of the kernel are: 1Ted
Ts'o adds support for terminal signal processing; 2 can change the screen ranks used when starting up; 3 corrects
a race condition caused by a file IO; 4 adds support for shared libraries Support, saving memory usage; 5
symbolic link handling; 6 deletion of directory system calls; 7 Peter MacDonald implements virtual terminal
support, making Linux even superior to certain commercial versions of UNIX at the time; Function support,
which was modified by Peter MacDonald based on patches provided by some people for MINIX, but MINIX
did not adopt these patches; 9 re-executable system calls; 10Linus compiled math coprocessor simulation code.
Version 0.95 was the first Linux kernel version to use the GNU GPL copyright. There are actually three
sub-versions of this version. Due to some problems encountered when the first 0.95 release was released on
March 8, 1992, another 0.95a version was immediately released in less than 10 days (March 17). And in a
month later (April 9th), 0.95c+ was released again. The biggest improvement in this version is the introduction
of the virtual file system VFS structure. Although only the MINIX file system was supported at the time, the
program structure has been extensively adjusted to support multiple file systems. The code for the MINIX file
system is put into a separate MINIX subdirectory. Some of the other changes in the 0.95 kernel include: 1
Added login interface; 2 Ross Biro added debugging code (ptrace); 3 Floppy disk drive track buffering; 4
Non-blocking pipeline file operations; 5 System restart (Ctrl-Alt-Del); Swapon() system call to select swap
devices in real time; 6 support for recursive symbolic links; 7 support for 4 serial ports; 8 support for hard disk
partitions; 9 support for more types of keyboards; 10James Wiegand compiles initial parallel port drivers, etc. .
In addition, starting with the 0.95 release, many of the kernel's improvements (providing patches) were
dominated by others, and Linus's main task began to become the maintenance of the kernel and decide whether
to adopt a patch. Until now, the latest kernel version is version 4.16.16 released in June 2018. Its use of gz
compressed source code package also has about 152MB! The latest version of each major stable release is
shown in Table 1–2. Table 1-2

Table 1-2 New kernel source code size


Version number Release date Size (after gz compression)
2.0.40 2004.2.8 7.2 MB
2.2.26 2004.2.25 19 MB
2.6.25 2008.4.17 58 MB
3.0.10 2011.11.21 92MB
4.4.10 2016.5.11 127MB
4.16.16 2018.6.16 152MB

1.1.7 The reason for the Linux name


At the beginning of the Linux operating system, it was not called Linux. Linus named his operating system

- 13 -
1.1 The birth and development of Linux

FREAK. Its English meaning is grotesque, monster, whimsical. When he uploaded the new operating system to
the ftp.funet.fi server, administrator Ari Lemke disliked the name very much. He believes that since it is Linus's
operating system, take its homonym Linux as the operating system's directory, so the name of Linux began to
pass down.
In Linus's autobiography "Just for Fun," Linus explains:
“Honest: I didn't want to ever release it under the name Linux because it was too egotistical . What was the
name I reserved for any eventual release ? Freax. (Get it? Freaks with the requisite X.) In fact, some of the early
make files-the files that describe how to compile the sources-included the word "Freax" for about half a year.
But it really didn't matter. At that point I didn't need a name for it because I wasn't releasing it to anybody.”
“And Ari Lemke, who insured that it made its way to the ftp site, hated the name Freax. He preferred the
other working name I was using-Linux-and named my posting: pub/OS/Linux. I admit that I didn't put up much
of a fight. But it was his doing . So I can honestly say I wasn't egotistical, or half-honestly say I wasn't
egotistical . But I thought, okay, that's a good name, and I can always blame somebody else for it, which I'm
doing now.”

1.1.8 The main contributor to the development of early Linux systems


As can be seen from the early Linux source code, one of the most famous developers of the Linux system
in addition to Linus himself is Theodore Ts'o (Ted Ts'o). He graduated from MIT Computer Science in 1990. In
college time he actively participated in various student activities held in the school. He likes cooking, cycling,
and of course Hacking on Linux. Later he began to like the amateur radio telegram campaign. He currently
works at IBM on system programming and other important issues. He is also an IETF member of the
International Network Design, Operations, Sales and Research Open Group.
The popularity of Linux in the world also has his great credit. As early as when the Linux operating system
came out, he provided Maillist with great enthusiasm for the development of Linux. Almost since Linux was
first released, he has been contributing to Linux. He was also the first person to add programs to the Linux
kernel (the ramdisk.c virtual disk driver and the kernel memory allocation program kmalloc.c in the Linux
kernel version 0.10). Until now he is still engaged in Linux-related work. In North America, he first established
the Linux ftp site (tsx-11.mit.edu), and this site still provides services for the majority of Linux users. One of his
biggest contributions to Linux was to propose and implement the ext2 file system. The file system has now
become the de facto file system standard in the Linux world. Recently he introduced the ext3 file system. The
system greatly improves the stability and access efficiency of the file system. As his admiration, the Linux
Journal issue of the 97th issue (May 2002) used him as a cover character and interviewed him. He currently
works for the IBM Linux Technology Center and is working on the Linux Standard Base (LSB).

Another famous person in the Linux community is Alan Cox. He originally worked at Swansea University
College in Wales. At first, he particularly likes to play computer games, especially MUD (Multi-User Dungeon
or Dimension). In the posts of games.mud news group in the early 90s you can find a lot of posts he posted. He
even wrote a history of MUD development (rec.games.mud news group, March 9, 1992, A history of MUD). As
MUD games are closely related to the internet, he slowly became fascinated with computer networks. In order
to play the game and improve the speed of the computer running the game and the network transmission speed,
he needs to choose a most satisfactory operating platform. So he began to contact various types of operating
systems. Because of the lack of money, he could not afford even the MINIX system. When Linux 0.1x and
386BSD were released, he took a long time to purchase a 386SX computer. Since the 386BSD requires math

- 14 -
1.2 Content review

coprocessor support and the computer with the Intel 386SX CPU does not have a math coprocessor, he installed
the Linux system. So he started to learn Linux with free source code and started to have interest in Linux
systems, especially with regard to networking. In the discussion of Linux single-user mode of operation, he
even praised Linux for being beautifully implemented.
After the release of Linux 0.95, he began writing patches (modification programs) for the Linux system
(remembering that his two earliest patches were not adopted by Linus) and became the earliest users of TCP/IP
network code on Linux systems. one. Later, he gradually joined the Linux development team and became one of
the main responsible for maintaining the Linux kernel source code. It can also be said to be the most important
figure in the Linux community after relaying Linus. Later Microsoft invited him to join, but he simply refused.
Since 2001, he is responsible for maintaining the Linux kernel 2.4.x code. Linus is mainly responsible for the
development of the latest development version of the kernel (odd version, such as 2.5.x version).
Michael K. Johnson, author of The Linux Kernel Hackers' Guide, was also one of the first people to
contact the Linux operating system (from version 0.97). He is also one of the initiators of the well-known Linux
Document Project (LDP). He once worked for Linux Journal and now works for RedHat.
The Linux system is not the only backbone that can develop into what it is today. There are many computer
experts who have made great contributions to Linux. We will not list them here. The specific list of major
contributors can be found in the CREDITS file in the Linux kernel, which lists in alphabetical order the list of
more than 400 people who contributed significantly to Linux, including their email address and mailing address,
home page, and major contributions. Deeds and other information.

Through the above explanation, we can sum up the above five pillars of Linux as follows:
 UNIX Operating System -- UNIX was born in Bell Labs in 1969. Linux is a UNIX clone system. The
importance of UNIX goes without saying.
 The MINIX operating system -- The MINIX operating system is also a UNIX clone system. It was
developed in 1987 by the famous computer professor Andrew S. Tanenbaum. Due to the emergence of
the MINIX system and the availability of source code (which can only be used free of charge in
universities), the whirlwind of learning the UNIX system was spurred by universities around the
world. Linux first started development in 1991 with reference to the MINIX system.
 The GNU Project -- The development of the Linux operating system, and most of the software used
on Linux is basically from the GNU program. Linux is only a kernel of the operating system. Without
the GNU software environment (such as the bash shell), Linux will be difficult to move.
 POSIX Standard -- This standard has played an important role in the development of the Linux
operating system after the formal development. It is the beacon of Linux's progress.
 Internet - If you don't have an Internet network and don't have the unselfish dedication of countless
computer hackers all over the world, then Linux can only grow to a level of 0.13 (0.95).

1.2 Content review

This book will mainly describe and comment on the early Linux kernel version 0.12. The Linux-0.12
version was released on January 15, 1992. Include the following files when publishing:

bootimage-0.12.Z - a compressed boot image file with a U.S. keyboard code;


rootimage-0.12.Z - 1200kB compressed root file system image file;
linux-0.12.tar.Z - Kernel source code file. The size is 130KB, and only 463KB after expansion;

- 15 -
1.2 Content review

as86.tar.Z - Bruce Evans' binary execution file. 16-bit assembler and loader;
INSTALL-0.11 - Updated installation information file.

bootimage-0.12.Z and rootimage-0.12.Z are compressed floppy image files. Bootimage is the boot image
file, which mainly includes disk boot sector code, operating system loader, and kernel execution code. When the
PC starts, the program in the ROM BIOS reads the boot sector code and data from the default boot drive into
memory, and the boot sector code reads the operating system loader and kernel execution code into memory and
then controls It is up to the operating system loader to further prepare the kernel for initialization, and the final
loader will give control to the kernel code. Kernel code needs file system support to function properly.
Rootimage is the root file system used to provide the most basic support to the kernel, including the operating
system at least some configuration files and command execution procedures. For UNIX-based file system used
in Linux system, it mainly includes some specified directories, configuration files, device drivers, development
programs, and all other user data or text files. The combination of these two disks is equivalent to a bootable
DOS operating system disk.
as86.tar.Z is a 16-bit assembler linker package. linux-0.12.tar.Z is the compressed Linux 0.12 kernel source
code. INSTALL-0.11 is a simple installation documentation for the Linux 0.11 system. It also applies to Linux
systems that use the 0.12 kernel.
At present, in addition to the original rootimage-0.12.Z file, the other four files can be found. However, the
author has used the resources on the Internet to re-create a fully usable rootimage-0.12 root file system for
Linux 0.12. The gcc 1.40 compiler that can be used in the 0.12 environment is recompiled and the available
experimental development environment is configured. Currently, these files can be downloaded from the
oldlinux.org website. The specific download directory location is:
 http://oldlinux.org/Linux.old/images/ This directory contains the kernel image file bootimage and the
root file system image file rootimage that have been created.
 http://oldlinux.org/Linux.old/kernels/ This directory contains the kernel source code programs,
including the Linux 0.12 kernel source code program described in this book.
 http://oldlinux.org/Linux.old/bochs/ This directory contains Linux systems that have been set up to
run under the computer simulation system bochs.
 http://oldlinux.org/Linux.old/Linux-0.12/ This directory contains some of the other tools that can be
used in the Linux 0.12 system and some of the original installation instructions.

This book mainly analyzes all the source code programs in linux-0.12 kernel in detail, and makes detailed
comments on each source program file, including comments on Makefile files. The analysis process is mainly
carried out according to the computer startup process. Therefore, the consistency of the analysis until the end of
the initialization kernel starts calling the shell program. The rest of the programs are for their own analysis,
there is no coherence, so you can read according to their own needs. However, some application examples are
provided during the analysis.
In the process of analyzing all programs, if the author thinks it is difficult to understand the statement, it
will give a detailed description of the relevant knowledge. For example, when an input/output operation to the
interrupt controller is encountered, a detailed description of the Intel Interrupt Controller (8259A) chip will be
given and the used commands and methods will be listed. This will help deepen the understanding of the code,
but also better understand the use of the hardware used, the author believes that this method of interpretation
than a separate chapter to the overall introduction of hardware or other knowledge is much more efficient.

Taking the Linux 0.12 kernel to "dissect" is to increase the efficiency of our understanding of Linux's

- 16 -
1.2 Content review

operating mechanism. Linux-0.12 version of the entire kernel source code is only about 463K bytes, including
the content is basically the essence of Linux. The latest kernel version 2.6.XX is very large, 200 megabytes.
Even if you spend a lifetime learning to read it may not be able to read all. Maybe you have to ask, "Since you
want to start with Jane, why not analyze the smaller version of the Linux kernel source code for version 0.01?
It's only about 240K bytes." The main reason is because the 0.01 version of the kernel code has too many
shortcomings, not even Including drivers for floppy disks also does not relate well to the use of math
coprocessors and instructions for login procedures. And the structure of the bootstrapping boot program is not
the same as the current version, and the 0.12 boot boot program structure is basically the same as now. Another
reason is that you can find the earlier version 1.22 of the already compiled and compiled kernel image file
(bootimage-0.12), which can be used for boot demonstrations. If you add a simple root file system image
(rootimage-0.12), it will be able to run normally.
There are also deficiencies in learning with Linux 0.12. For example, the kernel version does not include
some very important code related to special process waiting queues, TCP/IP networks, etc. The allocation and
use of memory is also different from the current kernel. Fortunately, the network code in Linux is basically
self-contained, and the relationship with the kernel mechanism is not very large, so you can analyze the code
after you understand the basic principles of Linux work.
This book describes all the code in the Linux kernel. In order to maintain the integrity of the structure, the
description of the code is based on the structure of the source code in the kernel. Basically, the contents of each
source code is a chapter. The order of the source files introduced can be found in the previous file list index. The
directory structure of the entire Linux kernel source code is shown in Listing 1-1. All directory structures are
based on Linux as the current directory.

List 1-1 Linux/ directory

Name Size Last modified date (GMT) Desc.


boot/ 1992-01-16 14:37:00
fs/ 1992-01-16 14:37:00
include/ 1992-01-16 14:37:00
init/ 1992-01-16 14:37:00
kernel/ 1992-01-16 14:37:00
lib/ 1992-01-16 14:37:00
mm/ 1992-01-16 14:37:00
tools/ 1992-01-16 14:37:00
Makefile 3091 bytes 1992-01-13 03:48:56

The content of this book can be divided into five parts. Chapters 1 to 4 are basics. The operating system is
closely related to the hardware environment being run. If you want to thoroughly understand the entire
operation of the operating system, then you need to understand its hardware operating environment, especially
the processor multi-task operating mechanism. This part introduces in more detail the hardware composition of
the microcomputer, the programming language used to compile the Linux kernel program, and the programming
principle under Intel 80X86 protection mode; the second part includes chapters 5 through 7, describing the
kernel boot boot and 32-bit operation. The preparation phase of the method should be fully read as a beginner to
learn the kernel; the third part from Chapter 8 to Chapter 13 is the main part of the kernel code. The contents of
Chapter 8 can be used as the main clue to read the subsequent chapters of this section. Chapters 14 to 16 are the

- 17 -
1.2 Content review

contents of the fourth section and can serve as reference for reading the third part of the source code. The last
part includes only Chapter 17, which describes how to use the PC simulation software system Bochs to conduct
various experimental activities on the Linux 0.12 kernel.
The second chapter is based on the hardware block diagram of the traditional microcomputer system. It
mainly introduces the components of the IBM PC/AT386 microcomputer running on the Linux kernel. Describe
the functions and relationships of each major section. At the same time, it is also compared with the block
diagram of the latest microcomputer. This will provide enough relevant information for readers who have not
learned the principles of computer composition.
Chapter 3 introduces the programming language, object file format, and compilation environment used in
the Linux 0.12 kernel. The main goal is to provide the assembly language and GNU C language extension
knowledge needed to read the Linux 0.12 kernel source code. This chapter first introduced the syntax and usage
of as86 and GNU as assembler in more detail, and then explained the common C language extensions such as
inline assembly, statement expressions, register variables, and inline functions in the GNU C language. The
mutual calling mechanism between C and assembly functions is described in detail. Finally, the use of the
Makefile is briefly described.
Chapter 4 describes the architecture of the 80X86 CPU and some basic knowledge of protected mode
programming. It lays a solid foundation for preparing to read the Linux kernel source code based on the 80X86
CPU. These include: 80X86 basics, protected mode memory management, interrupt and exception handling,
task management, and a simple multitasking kernel example.
Chapter 5 outlines the Linux operating system architecture, the organization of the kernel source code files,
and the general functionality of each file. It also introduces the use of Linux for physical memory allocation,
several stacks of the kernel, and how they are used, and the use of virtual linear addresses. Finally, it begins to
comment the first file seen in the Linux/ directory in the kernel package, which is the contents of the overall
Makefile of the kernel code. This file is the compilation management configuration file for all kernel source
programs and is used by the build management tool software make.
Chapter 6 will explain in detail the three assembly language programs in the boot/ directory, including the
bootdisk.ss of the disk boot program, the setup.s assembler that takes the parameters in the BIOS, and the 32-bit
run start code program head.s. The three assembler programs complete the bootloading of the kernel from the
block device into memory and detect system configuration parameters, completing all the work before entering
the 32-bit protected mode. Prepare for the kernel system to perform further initialization work.
Chapter 7 mainly introduces the initialization program main.c of the kernel system in the init/ directory. It
is a key point for the kernel to complete all initialization work and enter normal operation. After completing all
the initialization of the system, a process for the shell is created. In the introduction of the program will need to
see the other programs it calls, so the reading of the subsequent chapters can be performed in the order called
here. Since memory management program functions are widely used in the kernel, this chapter should be read
first. When you can really understand all the programs up to the main.c program, you should already have a
certain understanding of the Linux kernel. It can be said that half of them are already started, but you also need
to file systems, system calls, each Drivers, etc. for a deeper reading.
Chapter 8 mainly introduces all programs in the kernel/ directory. The most important part of the process is
the process scheduler(), sleep_on(), and program related system calls. At this point you should already know
some of the important programs. From the beginning of this chapter, we will encounter many assembly
language statements embedded in C language programs. The basic syntax for embedded assembly statements is
described in Chapter 3.
Chapter 9 explains the block device program in the kernel/blk_drv/ directory. This chapter mainly contains

- 18 -
1.2 Content review

drivers for block devices such as hard disks and floppy disks. It is mainly used to deal with file systems and
high-speed buffers, and contains more hardware-related content. Therefore, you need to refer to some hardware
information when reading this chapter. It's best to first look at the sections of the file system.
Chapter 10 Annotates the character device drivers in the kernel/chr_drv/ directory. This chapter mainly
deals with serial line drivers, keyboard drivers, and monitor drivers. These drivers constitute the serial terminal
and console terminal devices supported by the 0.12 kernel. Therefore, this chapter also contains more
hardware-related content. Need to refer to related hardware books when reading.
Chapter 11 introduces the math coprocessor simulation program in the kernel/math/ directory. Due to the
version of the kernel annotated in this book, coprocessors have not really started to be supported yet, so the
content of this chapter is relatively small and relatively simple. Just have a general understanding.
The 12th chapter introduces the file system program in the fs/ directory of the kernel source code. When
reading this chapter, we recommend that you pause for a while to read about the MINIX file system in Andrew
S. Tanenbaum's book “Operating System Design and Implementation”. Chapters, because the original Linux
system only supports MINIX file system, Linux 0.12 version is no exception.
Chapter 13 explains the memory management program in the mm/ directory. To thoroughly understand this
aspect, we need to have a sufficient understanding of the protection mode operation mode of the Intel 80X86
microprocessor. Therefore, when reading this chapter of the program, you can refer to the overview of the
operation mode of the 80X86 protection mode included in the appropriate place in this chapter. In addition to
the description, you should also refer to Chapter 4 at the same time. Since this chapter explains the use of
examples in the source code as objects, you can better understand how memory management works.
Existing Linux kernel analysis books generally lack the description of the kernel header file, so for a
beginner, there are many obstacles to reading the kernel program. Chapter 14 of this book details all the header
files in the include/ directory. Basically, each definition, each constant, or data structure is commented in detail.
In order to facilitate reference during reading, this book also summarizes some important data structures and
variables that are frequently used in the appendix, but these contents can actually be found in the header files of
this chapter. Although the contents of this chapter are mainly used for reading the procedures in other chapters,
if you want to thoroughly understand the kernel's operating mechanism, you still need to understand many of
the details in these header files.
Chapter 15 describes all the files in the Linux 0.12 kernel source code lib/ directory. These library function
files mainly provide interface functions to the system programs such as the compilation system, which will help
the future understanding of the system software. Because of this lower version, there is not much here, so we
can read it quickly. This is one of the reasons why we chose the 0.12 version.
Chapter 16 introduces the build.c program in the tools/ directory. This program is not included in the
compiled and generated kernel image file. It is only used to connect the disk boot block in the kernel with other
major kernel modules into a complete kernel image file.
Chapter 17 introduces the experimental environment for learning the kernel source code and the methods
for hands-on experimentation. It mainly introduces the method of using and compiling Linux kernel under
Bochs simulation system and the method of making disk image files. It also explains how to modify the syntax
of the Linux 0.12 source code so that it can successfully compile the correct kernel under the RedHat 9 system.
The last is the appendix and index. The appendix gives some constant definitions and basic data structure
definitions in the Linux kernel, as well as a concise description of the protection mode operating mechanism.

For ease of reference, the information on PC hardware used in the kernel is also listed separately in the
appendix of this book. In the reference literature, we only provided books, articles, and other information that

- 19 -
1.3 Summary

we can refer to when reading the source code. We did not provide all kinds of complicated and messy literature
lists. For example, when referring to a file in the LDP (Linux Document Project) of the Linux Documentation
Project, we will explicitly list which HOWTO article we need to refer to, and not just the LDP's website
address.
When Linus first developed the Linux operating system kernel, he mainly referred to three books. One is
"UNIX Operating System Design" by M. J. Bach, which describes the working principle and data structure of
the UNIX System V kernel. Linus uses the algorithms for many of the functions in the book. The names of
many important functions in the Linux kernel source code are taken from the book. Therefore, when reading
this book, this is an essential reference book on the working principle of the kernel. The other is “Programming
the 80386” edited by John H. Crawford et al. and is a good book explaining the 80x86 protected mode
programming method. There is also a first edition of the book "MINIX Operating System Design and
Implementation" by Andrew S. Tanenbaum. Linus mainly uses the MINIX file system version 1.0 described in
this book, and also supports only this file system in the early Linux kernel, so when reading this chapter about
the file system, the working principle of the file system It is fully available from Tanenbaum's book.

In the explanation of each program, we first briefly explain the main purpose and purpose of the program,
input and output parameters and the relationship with other programs, and then list the complete code of the
program and make detailed comments on the code, the original The program code or text is not altered or
deleted in any way, because C language is a kind of English language. The original small amount of English
comments in the program also provides a lot of useful information for constant symbols, variable names, and so
on. Behind the code is a more in-depth anatomy of the program and a description of some of the language or
hardware related knowledge that appears in the code. If you look back through the program after reading this
information, you will have a deeper understanding.
The introduction of some basic concept knowledge needed to read this book is scattered in the
corresponding parts of the various chapters. This is mainly for the convenience of finding, and when you
combine the source code reading, you can have a deeper understanding of some basic concepts.
The last thing to note is that when you have fully understood everything explained in this book, it does not
mean that you have become a Linux expert. You just embarked on the journey of Linux, with some initial
knowledge of becoming a Linux kernel master. At this point you should read more source code, preferably
incrementally from version 1.0 up to the latest odd-numbered version under development. The latest Linux
kernel at the time of revision of this book is version 4.16.16. When you can quickly understand the latest
versions of these developments and even come up with their own suggestions and patches, I'm willing to take a
plunge.

1.3 Summary

This chapter first elaborated on the indispensable pillars of the birth and development of Linux: UNIX's
initial open source version provided the basic principles and algorithms for Linux implementation, and Richard
Stallman's GNU program provided a variety of free and practical utilities for Linux systems. The emergence of
tools and POSIX standards provides Linux with reference guides for implementing standards-compliant systems.
AST's MINIX operating system has served as an indispensable reference for the birth of Linux, and the Internet
is a necessary environment for Linux to grow and grow. Finally, the chapter outlines the basic content of the
book.

- 20 -
1.3 Summary

2 Microcomputer structure

Any system can be seen as a model consisting of four basic parts, as shown in Figure 2-1. The input part is
used to receive information or data entering the system; after being processed by the processing center, the output
part is sent out. The energy section provides the energy supply for the operation of the entire system, including the
input and output part of the energy required for operation.
The composition of the computer system is no exception, it is also mainly composed of these four parts.
Internally, however, the channels or interfaces between the processing center and the input/output portion of the
computer system can be used in common, and therefore (b) in Figure 2-1 should more appropriately abstractly
represent a computer system. Of course, for computers or many complex systems, each of them can be regarded
as a complete subsystem independently and can also be described using this model, and a complete computer
system is composed of these subsystems.

Energy Energy

Input Process Output Process Input/Output

(a) (b)

Figure 2-1 The basic composition of a system

Computer systems can be divided into hardware and software, but they are interdependent. The hardware part
is the visible part of the computer system and is the platform for software operation and storage. Software is a
stream of instructions that control hardware operations and actions. Just as information and thoughts stored in the
human brain control the thoughts and actions of the human body, software can be seen as information and
thinking in the "brain" of the computer. The theme described in this book is the operating mechanism of a
computer system. It mainly explains the hardware composition principle of the processing center and the
input/output part of the system and the realization of software control. On the hardware side, we outline the
hardware system of an IBM PC microcomputer based on the Intel 80X86 CPU (Central Processing Unit) and its
compatibles. The CPU chip of the computer can be regarded directly as the processing center of the system. The
bus interface is connected with other parts; for the software running on it, we specifically describe the
implementation of the Linux operating system kernel.
It can be seen that the operating system is closely related to the hardware environment being run. If you want
to thoroughly understand the entire operating system, you need to understand its operating hardware environment.
This chapter is based on the hardware block diagram of the traditional microcomputer system and introduces the
functions of each major part of the microcomputer. These contents have basically established the hardware basis
for reading the Linux 0.12 kernel. For ease of illustration, the term PC/AT will be used to refer to IBM PCs with
80386 or greater CPUs and their compatible microcomputers, while PCs are used generically to refer to all
microcomputers, including IBM PC/XTs and their compatible microcomputers.

21
Other documents randomly have
different content
the French guards, forced the prison of St. Lazare, released all the
prisoners, and took a great store of corn, which they carried to the
corn market. Here they got some arms, and the French guards
began to form and train them. The committee determined to raise
forty-eight thousand Bourgeoise, or rather to restrain their numbers
to forty-eight thousand. On the 14th, they sent one of their
members (Monsieur de Corny, whom we knew in America) to the
Hotel des Invalides, to ask arms for their Garde Bourgeoise. He was
followed by, or he found there, a great mob. The Governor of the
Invalides came out, and represented the impossibility of his
delivering arms, without the orders of those from whom he received
them. De Corny advised the people then to retire, and retired
himself; and the people took possession of the arms. It was
remarkable, that not only the Invalides themselves made no
opposition, but that a body of five thousand foreign troops,
encamped within four hundred yards, never stirred. Monsieur de
Corny and five others were then sent to ask arms of Monsieur de
Launai, Governor of the Bastile. They found a great collection of
people already before the place, and they immediately planted a flag
of truce, which was answered by a like flag hoisted on the parapet.
The deputation prevailed on the people to fall back a little, advanced
themselves to make their demand of the Governor, and in that
instant a discharge from the Bastile killed four people of those
nearest to the deputies. The deputies retired; the people rushed
against the place, and almost in an instant were in possession of a
fortification, defended by one hundred men, of infinite strength,
which in other times had stood several regular sieges, and had never
been taken. How they got in, has, as yet, been impossible to
discover. Those who pretend to have been of the party tell so many
different stories, as to destroy the credit of them all. They took all
the arms, discharged the prisoners, and such of the garrison as were
not killed in the first moment of fury, carried the Governor and
Lieutenant Governor to the Gréve, (the place of public execution,)
cut off their heads, and sent them through the city in triumph to the
Palais Royal. About the same instant, a treacherous correspondence
having been discovered in Monsieur de Flesselles, Prevost des
Marchands, they seized him in the Hotel de Ville, where he was in
the exercise of his office, and cut off his head. These events, carried
imperfectly to Versailles, were the subject of two successive
deputations from the States to the King, to both of which he gave
dry and hard answers; for it has transpired, that it had been
proposed and agitated in Council, to seize on the principal members
of the States General, to march the whole army down upon Paris,
and to suppress its tumults by the sword. But at night, the Duke de
Liancourt forced his way into the King's bed chamber, and obliged
him to hear a full and animated detail of the disasters of the day in
Paris. He went to bed deeply impressed. The decapitation of de
Launai worked powerfully through the night on the whole
aristocratical party, insomuch, that in the morning, those of the
greatest influence on the Count d'Artois, represented to him the
absolute necessity that the King should give up everything to the
States. This according well enough with the dispositions of the King,
he went about eleven o'clock, accompanied only by his brothers, to
the States General, and there read to them a speech, in which he
asked their interposition to re-establish order. Though this be
couched in terms of some caution, yet the manner in which it was
delivered, made it evident that it was meant as a surrender at
discretion. He returned to the chateau a foot, accompanied by the
States. They sent off a deputation, the Marquis de La Fayette at
their head, to quiet Paris. He had, the same morning, been named
Commandant-in-Chief of the Milice Bourgeoise, and Monsieur Bailly,
former President of the States General, was called for as Prevost des
Marchands. The demolition of the Bastile was now ordered, and
begun. A body of the Swiss guards of the regiment of Ventimille, and
the city horse guards, joined the people. The alarm at Versailles
increased instead of abating. They believed that the aristocrats of
Paris were under pillage and carnage, that one hundred and fifty
thousand men were in arms, coming to Versailles to massacre the
royal family, the court, the ministers, and all connected with them,
their practices and principles. The aristocrats of the Nobles and
Clergy in the States General, vied with each other in declaring how
sincerely they were converted to the justice of voting by persons,
and how determined to go with the nation all its lengths. The foreign
troops were ordered off instantly. Every minister resigned. The King
confirmed Bailly as Prevost des Marchands, wrote to Mr. Neckar to
recall him, sent his letter open to the States General, to be
forwarded by them, and invited them to go with him to Paris the
next day, to satisfy the city of his dispositions; and that night and
the next morning, the Count d'Artois and Monsieur de Montisson (a
deputy connected with him) Madame de Polignac, Madame de
Guiche, and the Count de Vaudreuil, favorites of the Queen, the
Abbé de Vermont, her confessor, the Prince of Condé and Duke de
Bourbon, all fled; we know not whither. The King came to Paris,
leaving the Queen in consternation for his return. Omitting the less
important figures of the procession, I will only observe, that the
King's carriage was in the centre, on each side of it the States
General, in two ranks, a foot, and at their head the Marquis de La
Fayette, as Commander-in-Chief, on horseback, and Bourgeoise
guards before and behind. About sixty thousand citizens of all forms
and colors, armed with the muskets of the Bastile and Invalides, as
far as they would go, the rest with pistols, swords, pikes, pruning
hooks, scythes, &c., lined all the streets through which the
procession passed, and, with the crowds of people in the streets,
doors and windows, saluted them everywhere with cries of "vive la
nation;" but not a single "vive le roy" was heard. The King stopped
at the Hotel de Ville. There Monsieur Bailly presented and put into
his hat the popular cockade, and addressed him. The King being
unprepared and unable to answer, Bailly went to him, gathered from
him some scraps of sentences, and made out an answer, which he
delivered to the audience as from the King. On their return, the
popular cries were "vive le roy et la nation." He was conducted by a
Garde Bourgeoise to his palace at Versailles, and thus concluded
such an amende honorable, as no sovereign ever made, and no
people ever received. Letters written with his own hand to the
Marquis de La Fayette, remove the scruples of his position.
Tranquillity is now restored to the capital: the shops are again
opened; the people resuming their labors, and if the want of bread
does not disturb our peace, we may hope a continuance of it. The
demolition of the Bastile is going on, and the Milice Bourgeoise
organizing and training. The ancient police of the city is abolished by
the authority of the people, the introduction of the King's troops will
probably be proscribed, and a watch or city guards substituted,
which shall depend on the city alone. But we cannot suppose this
paroxysm confined to Paris alone. The whole country must pass
successively through it, and happy if they get through it as soon and
as well as Paris has done.
I went yesterday to Versailles, to satisfy myself what had passed
there; for nothing can be believed but what one sees, or has from
an eye witness. They believe there still, that three thousand people
have fallen victims to the tumults of Paris. Mr. Short and myself have
been every day among them, in order to be sure what was passing.
We cannot find, with certainty, that anybody has been killed but the
three before mentioned, and those who fell in the assault or defence
of the Bastile. How many of the garrison were killed, nobody
pretends to have ever heard. Of the assailants, accounts vary from
six to six hundred. The most general belief is, that there fell about
thirty. There have been many reports of instantaneous executions by
the mob, on such of their body as they caught in acts of theft or
robbery. Some of these may perhaps be true. There was a severity
of honesty observed, of which no example has been known. Bags of
money offered on various occasions through fear or guilt, have been
uniformly refused by the mobs. The churches are now occupied in
singing "De profundis" and "Requiems" "for the repose of the souls
of the brave and valiant citizens who have sealed with their blood
the liberty of the nation." Monsieur de Montmorin is this day
replaced in the department of foreign affairs, and Monsieur de St.
Priest is named to the home department. The gazettes of France and
Leyden accompany this. I send, also, a paper (called the Point du
Jour), which will give you some idea of the proceedings of the
National Assembly. It is but an indifferent thing; however, it is the
best.
I have the honor to be, with great esteem and respect, Sir, your
most obedient, and most humble servant.

P. S. July 21. Mr. Neckar had left Brussels for Frankfort, before the
courier got there. We expect, however, to hear of him in a day or
two. Monsieur le Comte de La Luzerne has resumed the department
of the marine this day. Either this is an office of friendship effected
by Monsieur de Montmorin, (for though they had taken different
sides, their friendship continued,) or he comes in as a stop-gap, till
somebody else can be found. Though very unequal to his office, all
agree that he is an honest man. The Count d'Artois was at
Valenciennes. The Prince of Condé and Duke de Bourbon had passed
that place.
FOOTNOTE

[2] See it in the paper called Point du Jour, No. 23.

TO M. L'ABBÉ ARNOLD.

Paris, July 19, 1789.

Dear Sir,—The annexed is a catalogue of all the books I recollect on


the subject of juries. With respect to the value of this institution, I
must make a general observation. We think, in America, that it is
necessary to introduce the people into every department of
government, as far as they are capable of exercising it; and that this
is the only way to insure a long-continued and honest administration
of its powers.
1. They are not qualified to exercise themselves the executive
department, but they are qualified to name the person who shall
exercise it. With us, therefore, they choose this officer every four
years. 2. They are not qualified to legislate. With us, therefore, they
only choose the legislators. 3. They are not qualified to judge
questions of law, but they are very capable of judging questions of
fact. In the form of juries, therefore, they determine all matters of
fact, leaving to the permanent judges, to decide the law resulting
from those facts. But we all know that permanent judges acquire an
Esprit de corps; that being known, they are liable to be tempted by
bribery; that they are misled by favor, by relationship, by a spirit of
party, by a devotion to the executive or legislative power; that it is
better to leave a cause to the decision of cross and pile, than to that
of a judge biased to one side; and that the opinion of twelve honest
jurymen gives still a better hope of right, than cross and pile does. It
is in the power, therefore, of the juries, if they think permanent
judges are under any bias whatever, in any cause, to take on
themselves to judge the law as well as the fact. They never exercise
this power but when they suspect partiality in the judges; and by the
exercise of this power, they have been the firmest bulwarks of
English liberty. Were I called upon to decide, whether the people had
best be omitted in the legislative or judiciary department, I would
say it is better to leave them out of the legislative. The execution of
the laws is more important than the making them. However, it is
best to have the people in all the three departments, where that is
possible.
I write in great haste, my dear Sir, and have, therefore, only time to
add wishes for the happiness of your country, to which a new order
of things is opening; and assurances of the sincere esteem with
which I have the honor to be, dear Sir, your most obedient and
humble servant.

Books on the subject of Juries.

Complete Juryman, or a compendium of the laws relating to


jurors.
Guide to English juries.
Hawles' Englishman's right.
Juror's judges both of law and fact, by Jones.
Security of Englishmen's lives, or the duty of grand juries.
Walwin's juries justified.
TO MR. MADISON.

Paris, July 22, 1789.

Dear Sir,—My last to you was of the 18th of June. Within a day or
two after, yours of May the 9th came to hand. In the rest of Europe
nothing remarkable has happened; but in France such events as will
be forever memorable in history. To begin where my last left them,
the King took on himself to decide the great question of voting by
persons or orders, by a declaration made at a seance royale on the
23d of June. In the same declaration he inserted many other things,
some good, some bad. The Tiers, undismayed, resolved the whole
was a mere nullity, and proceeded as if nothing had happened. The
majority of the clergy joined them, and a small part of the nobles.
The uneasiness produced by the King's declaration occasioned the
people to collect about the palace in the evening of the same day.
The King and Queen were alarmed and sent for Mr. Neckar. He was
conducted to and from the palace amidst the acclamations of the
people. The French guards were observed to be mixed in great
numbers with the people and to participate of their passions. This
made so decisive an impression, that the King on the 27th wrote to
the clergy and nobles, who had not yet joined the Tiers,
recommending to them to go and join them. They did so, and it was
imagined all was now settled. It was soon observed, however, that
troops, and those the foreign troops, were marching towards Paris
from different quarters. The States addressed the King to forbid their
approach. He declared it was only to preserve the tranquillity of Paris
and Versailles, and I believe he thought so. The command of those
troops was given to the Marshal Broglio, and it was observed that
the Baron de Breteuil was going daily to Versailles. On the 11th,
there being now thirty thousand foreign troops in and between Paris
and Versailles, Mr. Neckar was dismissed and ordered to retire
privately. The next day the whole ministry was changed except
Villedeuil and Barentin. Breteuil, Broglio and Vauguyon were the
principal persons named in the new. A body of cavalry were
advanced into Paris to awe them. The people attacked and routed
them, killing one of the cavalry and losing a French guard. The corps
of French guards gathered stronger, followed the cavalry, attacked
them in the street, (the rue basse des ramparts,) and killed four. (I
did not know this fact with certainty when I wrote to Mr. Jay, it is
therefore not in my letter. I since have it from an eye-witness.) The
insurrection became now universal. The next day (the 13th) the
people forced a prison and took some arms. On the 14th a
committee was framed by the city, with powers corresponding to our
committees of safety. They resolve to raise a city militia of forty-
eight thousand men. The people attack the invalids and get a great
store of arms. They then attack and carry the Bastile, cut off the
Governor's and Lieutenant-Governor's heads, and that also of the
Prevost des Marchand's, discovered in a treacherous
correspondence. While these things were doing here, the council is
said to have been agitating at Versailles a proposition to arrest a
number of the members of the States, to march all the foreign
troops against Paris, and suppress the tumult by the sword. But the
decapitations being once known there, and that there were fifty or
sixty thousand men in arms, the King went to the States, referred
everything to them, and ordered away the troops. The City
Committee named the Marquis de La Fayette commander-in-chief.
They went on organizing their militia, the tumult continued, and a
noise spread about Versailles that they were coming to massacre the
court, the ministry, &c. Every minister hereupon resigned and fled,
the Count d'Artois, Prince of Condé, Duke de Bourbon, the family of
Polignacs, the Count de Vaudreuil, Abbé Vermont, confessor of the
Queen, and key-stone of all the intrigues, all fled out of the
kingdom. The King agreed to recall Mr. Neckar, reappointed
Montmorin and St. Priest, friends of Neckar, and came with the
States General to Paris to satisfy the city of his dispositions. All the
streets through which he passed were lined with Bourgeoise, armed
with guns, pistols, pikes, pruning-hooks, scythes, and whatever they
could lay hold of, about sixty thousand. The States General on foot
on each side of his coach, the Marquis de La Fayette at their head,
on horseback. He returned to Versailles in the same order, to the
great joy of the remaining courtiers, who feared he would have been
detained in Paris. The tumults in the city had pretty well subsided,
but to-day they have been revived by a new incident. Foulon, one of
the fugitive ministers, was taken in the country, (it is said by his own
tenants,) and brought to Paris. Every possible effort of persuasion
was exerted in vain to save him. He was forced from the hands of
the Gardes Bourgeoises by the mob, was hung, and after severing
his head, the body was dragged by the enraged populace through
the principal streets of Paris. The Intendant of Paris (de Chauvigny),
accused of having been in the plots with the late ministry, and who
had fled, was taken at Compiegne, and a party of two hundred
militia horse are now gone for him. If they bring him to Paris it will
be impossible to save him. Monsieur de La Luzerne was reappointed
minister of marine yesterday. Your last letter says nothing of my
leave of absence. The season is so far advanced towards the
Equinox, that if it comes to hand I shall not leave Europe till that be
over. Indeed this scene is too interesting to be left at present. But if
the permission does not come in time for my passage in the fall, the
necessity of my going is so imperious, that I shall be in a most
distressing dilemma.
I am, with sincere esteem and respect, dear Sir, your affectionate
friend and servant.

P. S. July 23. I just learn that Bertier de Chauvigny was brought to


town in the night and massacred immediately.

TO JOHN JAY.

Paris, July 23, 1789.

Sir,—The bearer of my letters (a servant of Mr. Morris) not going off


till to-day, I am enabled to add to their contents. The spirit of tumult
seemed to have subsided, when, yesterday, it was excited again, by
a particular incident. Monsieur Foulon, one of the obnoxious ministry,
who, as well as his brethren, had absconded, was taken in the
country, and, as is said, by his own tenants, and brought to Paris.
Great efforts were exerted by popular characters, to save him. He
was at length forced out of the hands of the Garde Bourgeoise, hung
immediately, his head cut off, and his body drawn through the
principal streets of the city. The Intendant of Paris, Monsieur de
Chauvigny, accused of having entered into the designs of the said
ministry, has been taken at Compiegne, and a body of two hundred
men on horseback have gone for him. If he be brought here, it will
be difficult to save him. Indeed, it is hard to say at what distance of
time the presence of one of those ministers, or of any of the most
obnoxious of the fugitive courtiers, will not rekindle the same blood-
thirsty spirit. I hope it is extinguished as to everybody else, and
yesterday's example will teach them to keep out of its way. I add
two other sheets of the Point du Jour, and am, with the most perfect
esteem and respect, Sir, your most obedient, and most humble
servant.

P. S. I just now learn that Bertier de Chauvigny was brought to town


last night, and massacred immediately.

TO JOHN JAY.

Paris, July 29, 1789.

Sir,—I have written you lately, on the 24th of June, with a postscript
of the 25th; on the 29th of the same month; the 19th of July, with a
postscript of the 21st; and again on the 23d. Yesterday I received
yours of the 9th of March, by the way of Holland.
Mr. Neckar has accepted his appointment, and will arrive to-day from
Switzerland, where he had taken refuge. No other ministers have
been named since my last. It is thought that Mr. Neckar will choose
his own associates. The tranquillity of Paris has not been disturbed
since the death of Foulon and Bertier mentioned in my last. Their
militia is in a course of organization. It is impossible to know the
exact state of the supplies of bread. We suppose them low and
precarious, because, some days, we are allowed to buy but half or
three-fourths of the daily allowance of our families. Yet as the wheat
harvest must begin within ten days or a fortnight, we are in hopes
there will be subsistence found till that time. This is the only source
from which I should fear a renewal of the late disorders; for I take
for granted, the fugitives from the wrath of their country are all safe
in foreign countries. Among these, are numbered seven Princes of
the house of Bourbon, and six ministers; the seventh (the Marshal
de Broglio), being shut up in the fortified town of Metz, strongly
garrisoned with foreign soldiers. I observed to you, in a preceding
letter, that the storm which had begun in Paris, on the change of the
ministry, would have to pass over the whole country, and
consequently would, for a short time, occasion us terrible details
from the different parts of it. Among these, you will find a horrid one
retailed from Vesoul, in French Compté. The atrociousness of the
fact would dispose us rather to doubt the truth of the evidence on
which it rests, however regular that appears. There is no question,
that a number of people were blown up; but there are reasons for
suspecting that it was by accident and not design. It is said the
owner of the chateau sold powder by the pound, which was kept in
the cellar of the house blown up; and it is possible, some one of the
guests may have taken this occasion to supply himself, and been too
careless in approaching the mass. Many idle stories have also been
propagated and believed here, against the English, as that they have
instigated the late tumults with money, that they had taken or were
preparing to take Cherbourg, Brest, &c.; and even reasonable men
have believed, or pretended to believe, all these. The British
ambassador has thought it necessary to disavow them in a public
letter, which you will find in one of the papers accompanying this.
I have lately had an opportunity of knowing with certainty, the
present state of the King of England. His recovery was slow; he
passed through a stage of profound melancholy; but this has at
length dissipated, and he is at present perfectly re-established. He
talks now as much as ever, on the same trifling subjects, and has
recovered even his habitual inquisitiveness into the small news of
the families about him. His health is also good, though he is not as
fleshy as he used to be. I have multiplied my letters to you lately,
because the scene has been truly interesting; so much so, that had I
received my permission to pay my projected visit to my own country,
I should have thought, and should still think it my duty to defer it
awhile. I presume it cannot now be long, before I receive your
definitive answer to my request. I send herewith the public papers,
as usual; and have the honor to be, with the most perfect esteem
and respect, Sir, your most obedient, and most humble servant.

TO MR. CARMICHAEL.

Paris, August 9, 1789.

Dear Sir,—Since your last of March the 27th, I have only written that
of May the 8th. The cause of this long silence, on both parts, has
been the expectation I communicated to you of embarking for
America. In fact, I have expected permission for this, every hour
since the month of March, and therefore always thought that by
putting off writing to you a few days, my letter, while it should
communicate the occurrences of the day, might be a letter of adieu.
Should my permission now arrive, I should put off my departure till
after the equinox. They write me that my not receiving it, has
proceeded from the ceasing of the old government in October last,
and the organization of the higher departments in the new, which
had not yet taken place when my last letters came away. Bills had
been brought in for establishing departments of Foreign Affairs,
Finance, and War. The last would certainly be given to General Knox.
Mr. Jay would probably have his choice of the first and second; and
it is supposed Hamilton would have that which Mr. Jay declined.
Some thought Mr. Jay would prefer and obtain the head of the law
department, for which Wilson would be a competitor. In such a case;
some have supposed C. Thompson would ask the Foreign Affairs.
The Senate and Representatives differed about the title of the
President. The former wanted to style him "His Highness, George
Washington, President of the United States, and Protector of their
liberties." The latter insisted and prevailed, to give no title but that
of office, to wit, "George Washington, President of the United
States." I hope the terms of Excellency, Honor, Worship, Esquire,
forever disappear from among us, from that moment: I wish that of
Mr. would follow them. In the impost bill, the Representatives had,
by almost an unanimous concurrence, made a difference between
nations in treaty with us, and those not in treaty. The Senate had
struck out this difference and lowered all the duties. Quære,
whether the Representatives would yield? Congress were to proceed
about the 1st of June to propose amendments to the new
Constitution. The principal would be, the annexing a declaration of
rights to satisfy the mind of all, on the subject of their liberties. They
waited the arrival of Brown, delegate from Kentucky, to take up the
receiving that district as a fourteenth State. The only objections
apprehended, were from the partisans of Vermont, who might insist
on both coming in together. This would produce a delay, though
probably not a long one.
To detail to you the events of this country, would require a volume.
It would be useless too; because those given in the Leyden gazette,
though not universally true, have so few and such unimportant
errors mixed with them, that you may have a general faith in them. I
will rather give you, therefore, what that paper cannot give, the
views of the prevailing power, as far as they can be collected from
conversation and writings. They will distribute the powers of
government into three parts, legislative, judiciary, and executive. The
legislative will certainly have no hereditary branch, and probably not
even a select one (like our Senate). If they divide it into two
chambers at all, it will be by breaking the representative body into
two equal halves by lot. But very many are for a single House, and
particularly the Turgotists. The imperfection of their legislative body,
I think, will be, that not a member of it will be chosen by the people
directly. Their representation will be an equal one, in which every
man will elect and be elected as a citizen, not as of a distinct order.
Quære, whether they will elect placemen and pensioners? Their
legislature will meet periodically, and set at their own will, with a
power in the executive to call them extraordinarily, in case of
emergencies. There is a considerable division of sentiment whether
the executive shall have a negative on the laws. I think they will
determine to give such a negative, either absolute or qualified. In
the judiciary, the parliaments will be suppressed, less numerous
judiciary bodies instituted, and trial by jury established in criminal, if
not in civil cases. The executive power will be left entire in the hands
of the King. They will establish the responsibility of ministers, gifts
and appropriations of money by the National Assembly alone;
consequently, a civil list, freedom of the press, freedom of religion,
freedom of commerce and industry, freedom of person against
arbitrary arrests, and modifications, if not a total prohibition of
military agency in civil cases. I do not see how they can prohibit
altogether the aid of the military in cases of riot, and yet I doubt
whether they can descend from the sublimity of ancient military
pride, to let a Marechal of France with his troops, be commanded by
a Magistrate. They cannot conceive, that General Washington, at the
head of his army, during the late war, could have been commanded
by a common Constable to go as his posse comitatus, to suppress a
mob, and that Count Rochambeau, when he was arrested at the
head of his army by a sheriff, must have gone to jail if he had not
given bail to appear in court. Though they have gone astonishing
lengths, they are not yet thus far. It is probable, therefore, that not
knowing how to use the military as a civil weapon, they will do too
much or too little with it.
I have said that things will be so and so. Understand by this, that
these are only my conjectures, the plan of the constitution not being
proposed yet, much less agreed to. Tranquillity is pretty well
established in the capital; though the appearance of any of the
refugees here would endanger it. The Baron de Besenval is kept
away; so is M. de la Vauguyon. The latter was so short a time a
member of the obnoxious administration, that probably he might not
be touched were he here. Seven Princes of the house of Bourbon,
and seven ministers, fled into foreign countries, is a wonderful event
indeed.
I have the honor to be, with great respect and attachment, dear Sir,
your most obedient, and most humble servant.

TO JOHN JAY.

Paris, August 27, 1789.

Sir,—I am honored with your favor of June the 19th, informing me


that permission is given me to make a short visit to my native
country, for which indulgence I beg leave to return my thanks to the
President, and to yourself, Sir, for the expedition with which you
were so good as to forward it, after it was obtained. Being advised
that October is the best month of the autumn for a passage to
America, I shall wish to sail about the first of that month; and as I
have a family with me, and their baggage is considerable, I must
endeavor to find a vessel bound directly for Virginia, if possible.
My last letters to you have been of the 5th and 12th instant. Since
these, I received information from our bankers in Holland, that they
had money in hand sufficient to answer the demands for the foreign
officers, and for the captives; and that moreover, the residue of the
bonds of the last loan were engaged. I hereupon wrote to Mr. Grand
for an exact estimate of the sum necessary for the officers. He had
stated it to me as being forty-five thousand six hundred and fifty-two
livres eleven sous six deniers, a year, when I was going to Holland to
propose the loan to Mr. Adams, and at that sum, you will see it was
stated in the estimate we sent you from Amsterdam. He now
informed me it was sixty thousand three hundred and ninety-three
livres seventeen sous ten deniers, a year. I called on him for an
explanation. He showed me that his first information agreed with the
only list of the officers and sums then in his possession, and his last
with a new list lately sent from the treasury board in which other
officers were set down, who had been omitted in the first. I wrote to
our bankers an account of this error, and desired to know whether,
after reserving the money necessary for the captives, they were in
condition to furnish two hundred and fifty-four thousand livres for
the officers. They answered me by sending the money, and the
additional sum of twenty-six thousand livres, to complete the
business of the medals. I delivered the bills to Messrs. Grand and
company, to negotiate and pay away; and the arrears to the officers
to the first day of the present year, are now in a course of payment.
While on this subject, I will ask that an order may be forwarded to
the bankers in Holland to furnish, and to Mr. Grand to pay, the
arrearages which may be due on the first of January next. The
money being in hand, it would be a pity that we should fail in
payment a single day, merely for want of an order. The bankers
further give it as their opinion, that our credit is so much advanced
on the exchange of Amsterdam, that we may probably execute any
money arrangements we may have occasion for, on this side the
water. I have the honor to send you a copy of their letter. They have
communicated to me apprehensions, that another house was
endeavoring to obtain the business of our government. Knowing of
no such endeavors myself, I have assured them that I am a stranger
to any applications on the subject. At the same time, I cannot but
suspect that this jealousy has been one of the spurs, at least, to the
prompt completion of our loan. The spirited proceedings of the new
Congress in the business of revenue, has doubtless been the
principal one.
An engagement has taken place between the Russian and Swedish
fleets in the Baltic, which has been not at all decisive, no ship having
been lost on either side. The Swedes claim a victory, because they
remained in the field till the Russians quitted it. The latter effected a
junction soon after with another part of their fleet, and being now
about ten ships strongest, the Swedes retired into port, and it is
imagined they will not appear again under so great disparity; so that
the campaign by sea is supposed to be finished. Their commerce will
be at the mercy of their enemies; but they have put it out of the
power of the Russians to send any fleet to the Mediterranean this
year.
A revolution has been effected very suddenly in the bishopric of
Liege. Their constitution had been changed by force, by the reigning
sovereign, about one hundred years ago. This subject had been
lately revived and discussed in print. The people were at length
excited to assemble tumultuously. They sent for their Prince, who
was at his country seat, and required him to come to the town
house to hear their grievances. Though in the night, he came
instantly and was obliged to sign a restitution of their ancient
constitution, which took place on the spot, and all became quiet
without a drop of blood spilt. This fact is worthy notice, only as it
shows the progress of the spirit of revolution.
No act of violence has taken place in Paris since my last, except on
account of the difference between the French and Swiss guards,
which gave rise to occasional single combats, in which five or six
were killed. The difference is made up. Some misunderstandings had
arisen between the committees of the different districts of Paris, as
to the form of the future municipal government. These gave
uneasiness for awhile, but have been also reconciled. Still there is
such a leaven of fermentation remaining in the body of the people,
that acts of violence are always possible, and are quite
unpunishable; there being, as yet, no judicature which can venture
to act in any case, however small or great. The country is becoming
more calm. The embarrassments of the government, for want of
money, are extreme. The loan of thirty millions proposed by Mr.
Neckar, has not succeeded at all. No taxes are paid. A total stoppage
of all payment to the creditors of the State is possible every
moment. These form a great mass in the city as well as country, and
among the lower class of people too, who have been used to carry
their little savings of their service into the public funds upon life
rents of five, ten, twenty guineas a year, and many of whom have no
other dependence for daily subsistence. A prodigious number of
servants are now also thrown out of employ by domestic reforms,
rendered necessary by the late events. Add to this, the want of
bread, which is extreme. For several days past, a considerable
proportion of the people have been without bread altogether; for
though the new harvest is begun, there is neither water nor wind to
grind the grain. For some days past the people have besieged the
doors of the bakers, scrambled with one another for bread, collected
in squads all over the city, and need only some slight incident to lead
them to excesses which may end in, nobody can tell what. The
danger from the want of bread, however, which is the most
imminent, will certainly lessen in a few days. What turn that may
take which arises from the want of money, is difficult to be foreseen.
Mr. Neckar is totally without influence in the National Assembly, and
is, I believe, not satisfied with this want of importance. That
Assembly has just finished their bill of rights. The question will then
be, whether to take up first the constitution or the business of
finance.
No plan of a constitution has been yet given in. But I can state to
you the outlines of what the leading members have in
contemplation. The executive power in a hereditary King, with power
of dissolving the legislature, and a negative on their laws; his
authority in forming treaties to be greatly restrained. The legislative
to be a single House of representatives, chosen for two or three
years. They propose a body whom they call a Senate, to be chosen
by the Provincial Assemblies, as our federal Senate is, but with no
power of negativing or amending laws; they may only remonstrate
on them to the representatives, who will decide by a simple majority
the ultimate event of the law. This body will therefore be a mere
council of revision. It is proposed that they shall be of a certain age
and property, and be for life. They may make them also their court
of impeachment. They will suppress the parliaments, and establish a
system of judicature somewhat like that of England, with trial by jury
in criminal cases, perhaps also in civil. Each province will have a
subordinate provincial government, and the great cities, a municipal
one on a free basis. These are the ideas and views of the most
distinguished members. But they may suffer great modifications
from the Assembly, and the longer the delay, the greater will be the
modifications. Considerable interval having taken place since any
popular execution, the aristocratic party is raising its head. They are
strengthened by a considerable defection from the patriots, in
consequence of the general suppression of the abuses of the 4th of
August, in which many were interested. Another faction too, of the
most desperate views, has acquired strength in the Assembly, as
well as out of it. These wish to dethrone the reigning branch, and
transfer the crown to the Duke d'Orleans. The members of this
faction are mostly persons of wicked and desperate fortunes, who
have nothing at heart but to pillage from the wreck of their country.
The Duke himself is as unprincipled as his followers; sunk in
debaucheries of the lowest kind, and incapable of quitting them for
business; not a fool, yet not head enough to conduct anything. In
fact, I suppose him used merely as a tool, because of his immense
wealth, and that he acquired a certain degree of popularity by his
first opposition to the government, then credited to him as upon
virtuous motives. He is certainly borrowing money on a large scale.
He is in understanding with the court of London, where he had been
long in habits of intimacy. The ministry here are apprehensive, that
that ministry will support his designs by war. I have no idea of this,
but no doubt, at the same time, that they will furnish him money
liberally to aliment a civil war, and prevent the regeneration of this
country.
It was suggested to me, some days ago, that the court of Versailles
were treating with that of London, for a surrender of their West
India possessions, in consideration of a great sum of money to
relieve their present distress. Every principle of common sense was
in opposition to this fact; yet it was so affirmed as to merit inquiry. I
became satisfied the government had never such an idea; but that
the story was not without foundation altogether; that something like
this was in contemplation between the faction of Orleans and the
court of London, as a means of obtaining money from that court. In
a conversation with the Count de Montmorin, two days ago, he told
me their colonies were speaking a language which gave them
uneasiness, and for which there was no foundation. I asked him if
he knew anything of what I have just mentioned. He appeared
unapprized of it, but to see at once that it would be a probable
speculation between two parties circumstanced and principled as
those two are. I apologized to him for the inquiries I had made into
this business, by observing that it would be much against our
interest, that any one power should monopolize all the West India
islands. "Parde, assurement," was his answer.
The emancipation of their islands is an idea prevailing in the minds
of several members of the National Assembly, particularly those most
enlightened and most liberal in their views. Such a step by this
country would lead to other emancipations or revolutions in the
same quarter. I enclose you some papers received from Mr.
Carmichael, relative to the capture of one of our vessels by a
Morocco cruiser, and restitution by the Emperor. I shall immediately
write to M. Chiappe, to express a proper sense of the Emperor's
friendly dispositions to us. I forward also the public papers to the
present date; and have the honor to be, with sentiments of the most
perfect esteem and respect, Sir, your most obedient, and most
humble servant.

TO JAMES MADISON.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like