0% found this document useful (0 votes)
23 views40 pages

Operating Systems and Middleware Supporting Controlled Interaction Max Hailperin All Chapters Instant Download

The document promotes the ebook 'Operating Systems and Middleware: Supporting Controlled Interaction' by Max Hailperin, available for download on ebookmeta.com. It includes links to other recommended ebooks on operating systems and related topics. The content covers various aspects of operating systems, middleware, and their interactions, emphasizing security and controlled interfaces.

Uploaded by

teigezadeh29
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)
23 views40 pages

Operating Systems and Middleware Supporting Controlled Interaction Max Hailperin All Chapters Instant Download

The document promotes the ebook 'Operating Systems and Middleware: Supporting Controlled Interaction' by Max Hailperin, available for download on ebookmeta.com. It includes links to other recommended ebooks on operating systems and related topics. The content covers various aspects of operating systems, middleware, and their interactions, emphasizing security and controlled interfaces.

Uploaded by

teigezadeh29
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/ 40

Get the full ebook with Bonus Features for a Better Reading Experience on ebookmeta.

com

Operating Systems and Middleware Supporting


Controlled Interaction Max Hailperin

https://ebookmeta.com/product/operating-systems-and-
middleware-supporting-controlled-interaction-max-hailperin/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Survey of Operating Systems, 7th Edition Jane Holcombe

https://ebookmeta.com/product/survey-of-operating-systems-7th-edition-
jane-holcombe/

ebookmeta.com

Modern Operating Systems 5th Edition Andrew S. Tanenbaum

https://ebookmeta.com/product/modern-operating-systems-5th-edition-
andrew-s-tanenbaum/

ebookmeta.com

Understanding Operating Systems, 8th ed. 8th Edition Ann


Mchoes

https://ebookmeta.com/product/understanding-operating-systems-8th-
ed-8th-edition-ann-mchoes/

ebookmeta.com

MECHANICAL DESIGN AND MANUFACTURING OF ELECTRIC MOTORS


2nd Edition Wei Tong

https://ebookmeta.com/product/mechanical-design-and-manufacturing-of-
electric-motors-2nd-edition-wei-tong/

ebookmeta.com
Contracting and Contract Law in the Age of Artificial
Intelligence 1st Edition Martin Ebers

https://ebookmeta.com/product/contracting-and-contract-law-in-the-age-
of-artificial-intelligence-1st-edition-martin-ebers/

ebookmeta.com

Reference Frame Theory : Development and Applications 1st


Edition Paul C. Krause

https://ebookmeta.com/product/reference-frame-theory-development-and-
applications-1st-edition-paul-c-krause/

ebookmeta.com

Handbook of Single-Cell Technologies Tuhin Subhra Santra


(Editor)

https://ebookmeta.com/product/handbook-of-single-cell-technologies-
tuhin-subhra-santra-editor/

ebookmeta.com

Physique Secrets The Underground Playbook For Building A


Muscular And Aesthetic Male Body Nick Schlager

https://ebookmeta.com/product/physique-secrets-the-underground-
playbook-for-building-a-muscular-and-aesthetic-male-body-nick-
schlager/
ebookmeta.com

What Would You Do If You Weren t Afraid Discover a Life


Filled with Purpose and Joy Through the Secrets of Jewish
Wisdom 1st Edition Michal Oshman
https://ebookmeta.com/product/what-would-you-do-if-you-weren-t-afraid-
discover-a-life-filled-with-purpose-and-joy-through-the-secrets-of-
jewish-wisdom-1st-edition-michal-oshman/
ebookmeta.com
Return of Pal ul don 1st Edition Will Murray

https://ebookmeta.com/product/return-of-pal-ul-don-1st-edition-will-
murray/

ebookmeta.com
Operating Systems and Middleware:
Supporting Controlled Interaction

Max Hailperin
Gustavus Adolphus College

Revised Edition 1.3.1


June 4, 2019
Copyright c 2011–2019 by Max Hailperin.

This work is licensed under the Creative Commons Attribution-ShareAlike


3.0 Unported License. To view a copy of this license, visit

http:// creativecommons.org/ licenses/ by-sa/ 3.0/

or send a letter to Creative Commons, 171 Second Street, Suite 300, San
Francisco, California, 94105, USA.

About the Cover


The cover photo shows the treasury coming into view at the end of the siq, or
defile, leading to the ancient Nabatean city of Petra in present-day Jordan.
The siq is a narrow, winding passage cut deep into the sandstone primarily
by natural geological forces, though it was improved by the Nabateans.
Petra was a thriving spice trading city. Its prosperity can be linked to
several factors, including its location on important trade routes, its access to
water through sophisticated hydraulic engineering, and its easily defensible
character. The siq played an important role in the latter two aspects. Water
conduits were built into the walls of the siq. Meanwhile, the floor of the siq
was just wide enough for a single-file merchant caravan of camels, while
remaining too narrow to serve as a route for attack.
Operating systems and middleware provide a conducive environment for
application programs to interact in a controlled manner, much as Petra must
have served for spice merchants 2000 years ago. Access to communication
and resources remain as important as then, but so does the provision of
tightly controlled interfaces that ensure security.
The photo is by Rhys Davenport, who released it under a Creative Com-
mons Attribution 2.0 Generic license. The photo is available on the web at
http:// www.flickr.com/ photos/ 33122834@N06/ 3437495101/ .
To my family
iv
Contents

Preface xi

1 Introduction 1
1.1 Chapter Overview . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 What Is an Operating System? . . . . . . . . . . . . . . . . . 2
1.3 What Is Middleware? . . . . . . . . . . . . . . . . . . . . . . 6
1.4 Objectives for the Book . . . . . . . . . . . . . . . . . . . . . 8
1.5 Multiple Computations on One Computer . . . . . . . . . . . 9
1.6 Interactions Between Computations . . . . . . . . . . . . . . 11
1.7 Supporting Interaction Across Time . . . . . . . . . . . . . . 13
1.8 Supporting Interaction Across Space . . . . . . . . . . . . . . 15
1.9 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

2 Threads 21
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
2.2 Example of Multithreaded Programs . . . . . . . . . . . . . . 23
2.3 Reasons for Using Concurrent Threads . . . . . . . . . . . . . 27
2.4 Switching Between Threads . . . . . . . . . . . . . . . . . . . 30
2.5 Preemptive Multitasking . . . . . . . . . . . . . . . . . . . . . 37
2.6 Security and Threads . . . . . . . . . . . . . . . . . . . . . . . 39

3 Scheduling 45
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
3.2 Thread States . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
3.3 Scheduling Goals . . . . . . . . . . . . . . . . . . . . . . . . . 49
3.3.1 Throughput . . . . . . . . . . . . . . . . . . . . . . . . 51
3.3.2 Response Time . . . . . . . . . . . . . . . . . . . . . . 54
3.3.3 Urgency, Importance, and Resource Allocation . . . . 55
3.4 Fixed-Priority Scheduling . . . . . . . . . . . . . . . . . . . . 61

v
vi CONTENTS

3.5 Dynamic-Priority Scheduling . . . . . . . . . . . . . . . . . . 65


3.5.1 Earliest Deadline First Scheduling . . . . . . . . . . . 65
3.5.2 Decay Usage Scheduling . . . . . . . . . . . . . . . . . 66
3.6 Proportional-Share Scheduling . . . . . . . . . . . . . . . . . 71
3.7 Security and Scheduling . . . . . . . . . . . . . . . . . . . . . 79

4 Synchronization and Deadlocks 93


4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
4.2 Races and the Need for Mutual Exclusion . . . . . . . . . . . 95
4.3 Mutexes and Monitors . . . . . . . . . . . . . . . . . . . . . . 98
4.3.1 The Mutex Application Programming Interface . . . . 99
4.3.2 Monitors: A More Structured Interface to Mutexes . . 103
4.3.3 Underlying Mechanisms for Mutexes . . . . . . . . . . 106
4.4 Other Synchronization Patterns . . . . . . . . . . . . . . . . . 110
4.4.1 Bounded Buffers . . . . . . . . . . . . . . . . . . . . . 113
4.4.2 Readers/Writers Locks . . . . . . . . . . . . . . . . . . 115
4.4.3 Barriers . . . . . . . . . . . . . . . . . . . . . . . . . . 116
4.5 Condition Variables . . . . . . . . . . . . . . . . . . . . . . . 117
4.6 Semaphores . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
4.7 Deadlock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
4.7.1 The Deadlock Problem . . . . . . . . . . . . . . . . . . 126
4.7.2 Deadlock Prevention Through Resource Ordering . . . 128
4.7.3 Ex Post Facto Deadlock Detection . . . . . . . . . . . 130
4.7.4 Immediate Deadlock Detection . . . . . . . . . . . . . 132
4.8 Synchronization/Scheduling Interactions . . . . . . . . . . . . 135
4.8.1 Priority Inversion . . . . . . . . . . . . . . . . . . . . . 135
4.8.2 The Convoy Phenomenon . . . . . . . . . . . . . . . . 137
4.9 Nonblocking Synchronization . . . . . . . . . . . . . . . . . . 141
4.10 Security and Synchronization . . . . . . . . . . . . . . . . . . 145

5 Atomic Transactions 161


5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
5.2 Example Applications of Transactions . . . . . . . . . . . . . 164
5.2.1 Database Systems . . . . . . . . . . . . . . . . . . . . 165
5.2.2 Message-Queuing Systems . . . . . . . . . . . . . . . . 169
5.2.3 Journaled File Systems . . . . . . . . . . . . . . . . . 174
5.3 Mechanisms to Ensure Atomicity . . . . . . . . . . . . . . . . 176
5.3.1 Serializability: Two-Phase Locking . . . . . . . . . . . 176
5.3.2 Failure Atomicity: Undo Logging . . . . . . . . . . . . 185
5.4 Transaction Durability: Write-Ahead Logging . . . . . . . . . 188
CONTENTS vii

5.5 Additional Transaction Mechanisms . . . . . . . . . . . . . . 192


5.5.1 Increased Transaction Concurrency: Reduced Isolation 193
5.5.2 Coordinated Transaction Participants: Two-Phase Com-
mit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
5.6 Security and Transactions . . . . . . . . . . . . . . . . . . . . 198

6 Virtual Memory 209


6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
6.2 Uses for Virtual Memory . . . . . . . . . . . . . . . . . . . . . 214
6.2.1 Private Storage . . . . . . . . . . . . . . . . . . . . . . 214
6.2.2 Controlled Sharing . . . . . . . . . . . . . . . . . . . . 215
6.2.3 Flexible Memory Allocation . . . . . . . . . . . . . . . 218
6.2.4 Sparse Address Spaces . . . . . . . . . . . . . . . . . . 220
6.2.5 Persistence . . . . . . . . . . . . . . . . . . . . . . . . 222
6.2.6 Demand-Driven Program Loading . . . . . . . . . . . 223
6.2.7 Efficient Zero Filling . . . . . . . . . . . . . . . . . . . 224
6.2.8 Substituting Disk Storage for RAM . . . . . . . . . . 225
6.3 Mechanisms for Virtual Memory . . . . . . . . . . . . . . . . 226
6.3.1 Software/Hardware Interface . . . . . . . . . . . . . . 228
6.3.2 Linear Page Tables . . . . . . . . . . . . . . . . . . . . 232
6.3.3 Multilevel Page Tables . . . . . . . . . . . . . . . . . . 237
6.3.4 Hashed Page Tables . . . . . . . . . . . . . . . . . . . 242
6.3.5 Segmentation . . . . . . . . . . . . . . . . . . . . . . . 245
6.4 Policies for Virtual Memory . . . . . . . . . . . . . . . . . . . 250
6.4.1 Fetch Policy . . . . . . . . . . . . . . . . . . . . . . . . 251
6.4.2 Placement Policy . . . . . . . . . . . . . . . . . . . . . 253
6.4.3 Replacement Policy . . . . . . . . . . . . . . . . . . . 254
6.5 Security and Virtual Memory . . . . . . . . . . . . . . . . . . 262

7 Processes and Protection 273


7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
7.2 POSIX Process Management API . . . . . . . . . . . . . . . . 275
7.3 Protecting Memory . . . . . . . . . . . . . . . . . . . . . . . . 285
7.3.1 The Foundation of Protection: Two Processor Modes 286
7.3.2 The Mainstream: Multiple Address Space Systems . . 289
7.3.3 An Alternative: Single Address Space Systems . . . . 291
7.4 Representing Access Rights . . . . . . . . . . . . . . . . . . . 293
7.4.1 Fundamentals of Access Rights . . . . . . . . . . . . . 293
7.4.2 Capabilities . . . . . . . . . . . . . . . . . . . . . . . . 299
7.4.3 Access Control Lists and Credentials . . . . . . . . . . 303
viii CONTENTS

7.5 Alternative Granularities of Protection . . . . . . . . . . . . . 311


7.5.1 Protection Within a Process . . . . . . . . . . . . . . . 312
7.5.2 Protection of Entire Simulated Machines . . . . . . . . 313
7.6 Security and Protection . . . . . . . . . . . . . . . . . . . . . 317

8 Files and Other Persistent Storage 333


8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
8.2 Disk Storage Technology . . . . . . . . . . . . . . . . . . . . . 336
8.3 POSIX File API . . . . . . . . . . . . . . . . . . . . . . . . . 340
8.3.1 File Descriptors . . . . . . . . . . . . . . . . . . . . . . 340
8.3.2 Mapping Files into Virtual Memory . . . . . . . . . . 345
8.3.3 Reading and Writing Files at Specified Positions . . . 348
8.3.4 Sequential Reading and Writing . . . . . . . . . . . . 348
8.4 Disk Space Allocation . . . . . . . . . . . . . . . . . . . . . . 350
8.4.1 Fragmentation . . . . . . . . . . . . . . . . . . . . . . 351
8.4.2 Locality . . . . . . . . . . . . . . . . . . . . . . . . . . 354
8.4.3 Allocation Policies and Mechanisms . . . . . . . . . . 356
8.5 Metadata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
8.5.1 Data Location Metadata . . . . . . . . . . . . . . . . . 359
8.5.2 Access Control Metadata . . . . . . . . . . . . . . . . 368
8.5.3 Other Metadata . . . . . . . . . . . . . . . . . . . . . 371
8.6 Directories and Indexing . . . . . . . . . . . . . . . . . . . . . 371
8.6.1 File Directories Versus Database Indexes . . . . . . . . 371
8.6.2 Using Indexes to Locate Files . . . . . . . . . . . . . . 373
8.6.3 File Linking . . . . . . . . . . . . . . . . . . . . . . . . 374
8.6.4 Directory and Index Data Structures . . . . . . . . . . 378
8.7 Metadata Integrity . . . . . . . . . . . . . . . . . . . . . . . . 379
8.8 Polymorphism in File System Implementations . . . . . . . . 383
8.9 Security and Persistent Storage . . . . . . . . . . . . . . . . . 384

9 Networking 395
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
9.1.1 Networks and Internets . . . . . . . . . . . . . . . . . 396
9.1.2 Protocol Layers . . . . . . . . . . . . . . . . . . . . . . 398
9.1.3 The End-to-End Principle . . . . . . . . . . . . . . . . 401
9.1.4 The Networking Roles of Operating Systems, Middle-
ware, and Application Software . . . . . . . . . . . . . 402
9.2 The Application Layer . . . . . . . . . . . . . . . . . . . . . . 403
9.2.1 The Web as a Typical Example . . . . . . . . . . . . . 403
CONTENTS ix

9.2.2 The Domain Name System: Application Layer as In-


frastructure . . . . . . . . . . . . . . . . . . . . . . . . 406
9.2.3 Distributed File Systems: An Application Viewed Through
Operating Systems . . . . . . . . . . . . . . . . . . . . 409
9.3 The Transport Layer . . . . . . . . . . . . . . . . . . . . . . . 411
9.3.1 Socket APIs . . . . . . . . . . . . . . . . . . . . . . . . 412
9.3.2 TCP, the Dominant Transport Protocol . . . . . . . . 418
9.3.3 Evolution Within and Beyond TCP . . . . . . . . . . 421
9.4 The Network Layer . . . . . . . . . . . . . . . . . . . . . . . . 422
9.4.1 IP, Versions 4 and 6 . . . . . . . . . . . . . . . . . . . 422
9.4.2 Routing and Label Switching . . . . . . . . . . . . . . 425
9.4.3 Network Address Translation: An End to End-to-End? 426
9.5 The Link and Physical Layers . . . . . . . . . . . . . . . . . . 429
9.6 Network Security . . . . . . . . . . . . . . . . . . . . . . . . . 431
9.6.1 Security and the Protocol Layers . . . . . . . . . . . . 432
9.6.2 Firewalls and Intrusion Detection Systems . . . . . . . 434
9.6.3 Cryptography . . . . . . . . . . . . . . . . . . . . . . . 435

10 Messaging, RPC, and Web Services 447


10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
10.2 Messaging Systems . . . . . . . . . . . . . . . . . . . . . . . . 448
10.3 Remote Procedure Call . . . . . . . . . . . . . . . . . . . . . 451
10.3.1 Principles of Operation for RPC . . . . . . . . . . . . 452
10.3.2 An Example Using Java RMI . . . . . . . . . . . . . . 455
10.4 Web Services . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
10.5 Security and Communication Middleware . . . . . . . . . . . 461

11 Security 467
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
11.2 Security Objectives and Principles . . . . . . . . . . . . . . . 468
11.3 User Authentication . . . . . . . . . . . . . . . . . . . . . . . 474
11.3.1 Password Capture Using Spoofing and Phishing . . . . 475
11.3.2 Checking Passwords Without Storing Them . . . . . . 477
11.3.3 Passwords for Multiple, Independent Systems . . . . . 477
11.3.4 Two-Factor Authentication . . . . . . . . . . . . . . . 477
11.4 Access and Information-Flow Controls . . . . . . . . . . . . . 480
11.5 Viruses and Worms . . . . . . . . . . . . . . . . . . . . . . . . 485
11.6 Security Assurance . . . . . . . . . . . . . . . . . . . . . . . . 489
11.7 Security Monitoring . . . . . . . . . . . . . . . . . . . . . . . 491
11.8 Key Security Best Practices . . . . . . . . . . . . . . . . . . . 494
x CONTENTS

A Stacks 505
A.1 Stack-Allocated Storage: The Concept . . . . . . . . . . . . . 506
A.2 Representing a Stack in Memory . . . . . . . . . . . . . . . . 507
A.3 Using a Stack for Procedure Activations . . . . . . . . . . . . 508

Bibliography 511

Index 527
Preface

Suppose you sit down at your computer to check your email. One of the
messages includes an attached document, which you are to edit. You click
the attachment, and it opens up in another window. After you start edit-
ing the document, you realize you need to leave for a trip. You save the
document in its partially edited state and shut down the computer to save
energy while you are gone. Upon returning, you boot the computer back
up, open the document, and continue editing.
This scenario illustrates that computations interact. In fact, it demon-
strates at least three kinds of interactions between computations. In each
case, one computation provides data to another. First, your email program
retrieves new mail from the server, using the Internet to bridge space. Sec-
ond, your email program provides the attachment to the word processor,
using the operating system’s services to couple the two application pro-
grams. Third, the invocation of the word processor that is running before
your trip provides the partially edited document to the invocation running
after your return, using disk storage to bridge time.
In this book, you will learn about all three kinds of interaction. In all
three cases, interesting software techniques are needed in order to bring the
computations into contact, yet keep them sufficiently at arm’s length that
they don’t compromise each other’s reliability. The exciting challenge, then,
is supporting controlled interaction. This includes support for computations
that share a single computer and interact with one another, as your email
and word processing programs do. It also includes support for data storage
and network communication. This book describes how all these kinds of
support are provided both by operating systems and by additional software
layered on top of operating systems, which is known as middleware.

xi
xii PREFACE

Audience
If you are an upper-level computer science student who wants to under-
stand how contemporary operating systems and middleware products work
and why they work that way, this book is for you. In this book, you will
find many forms of balance. The high-level application programmer’s view,
focused on the services that system software provides, is balanced with a
lower-level perspective, focused on the mechanisms used to provide those
services. Timeless concepts are balanced with concrete examples of how
those concepts are embodied in a range of currently popular systems. Pro-
gramming is balanced with other intellectual activities, such as the scientific
measurement of system performance and the strategic consideration of sys-
tem security in its human and business context. Even the programming
languages used for examples are balanced, with some examples in Java and
others in C or C++. (Only limited portions of these languages are used,
however, so that the examples can serve as learning opportunities, not stum-
bling blocks.)

Systems Used as Examples


Most of the examples throughout the book are drawn from the two dominant
families of operating systems: Microsoft Windows and the UNIX family,
including especially Linux and Mac OS X. Using this range of systems pro-
motes the students’ flexibility. It also allows a more comprehensive array of
concepts to be concretely illustrated, as the systems embody fundamentally
different approaches to some problems, such as the scheduling of processors’
time and the tracking of files’ disk space.
Most of the examples are drawn from the stable core portions of the
operating systems and, as such, are equally applicable to a range of spe-
cific versions. Whenever Microsoft Windows is mentioned without further
specification, the material should apply to Windows NT, Windows 2000,
Windows XP, Windows Server 2003, Windows Vista, Windows 2008, Win-
dows 7, Windows 8, Windows 2012, and Windows 10. All Linux examples
are from version 2.6, though much of the material applies to other versions
as well. Wherever actual Linux source code is shown (or whenever fine de-
tails matter for other reasons), the specific subversion of 2.6 is mentioned
in the end-of-chapter notes. Most of the Mac OS X examples originated
with version 10.4, also known as Tiger, but should be applicable to other
versions.
PREFACE xiii

Where the book discusses the protection of each process’s memory, one
additional operating system is brought into the mix of examples, in order
to illustrate a more comprehensive range of alternative designs. The IBM
iSeries, formerly known as the AS/400, embodies an interesting approach
to protection that might see wider application within current students’ life-
times. Rather than giving each process its own address space (as Linux,
Windows, and Mac OS X do), the iSeries allows all processes to share a
single address space and to hold varying access permissions to individual
objects within that space.
Several middleware systems are used for examples as well. The Ora-
cle database system is used to illustrate deadlock detection and recovery
as well as the use of atomic transactions. Messaging systems appear both
as another application of atomic transactions and as an important form of
communication middleware, supporting distributed applications. The spe-
cific messaging examples are drawn from the IBM WebSphere MQ system
(formerly MQSeries) and the Java Message Service (JMS) interface, which
is part of Java 2 Enterprise Edition (J2EE). The other communication mid-
dleware example is Java RMI (Remote Method Invocation).

Organization of the Text


Chapter 1 provides an overview of the text as a whole, explaining what an
operating system is, what middleware is, and what sorts of support these
systems provide for controlled interaction.
The next nine chapters work through the varieties of controlled interac-
tion that are exemplified by the scenario at the beginning of the preface: in-
teraction between concurrent computations on the same system (as between
your email program and your word processor), interaction across time (as
between your word processor before your trip and your word processor after
your trip), and interaction across space (as between your email program and
your service provider’s email server).
The first of these three topics is controlled interaction between computa-
tions operating at one time on a particular computer. Before such interaction
can make sense, you need to understand how it is that a single computer
can be running more than one program, such as an email program in one
window and a word processing program in another. Therefore, Chapter 2
explains the fundamental mechanism for dividing a computer’s attention
between concurrent computations, known as threads. Chapter 3 continues
with the related topic of scheduling. That is, if the computer is dividing its
xiv PREFACE

time between computations, it needs to decide which ones to work on at any


moment.
With concurrent computations explained, Chapter 4 introduces con-
trolled interactions between them by explaining synchronization, which is
control over the threads’ relative timing. For example, this chapter explains
how, when your email program sends a document to your word processor,
the word processor can be constrained to read the document only after the
email program writes it. One particularly important form of synchroniza-
tion, atomic transactions, is the topic of Chapter 5. Atomic transactions
are groups of operations that take place as an indivisible unit; they are
most commonly supported by middleware, though they are also playing an
increasing role in operating systems.
Other than synchronization, the main way that operating systems con-
trol the interaction between computations is by controlling their access to
memory. Chapter 6 explains how this is achieved using the technique known
as virtual memory. That chapter also explains the many other objectives
this same technique can serve. Virtual memory serves as the foundation for
Chapter 7’s topic, which is processes. A process is the fundamental unit of
computation for protected access, just as a thread is the fundamental unit
of computation for concurrency. A process is a group of threads that share a
protection environment; in particular, they share the same access to virtual
memory.
The next three chapters move outside the limitations of a single com-
puter operating in a single session. First, consider the document stored
before a trip and available again after it. Chapter 8 explains persistent
storage mechanisms, focusing particularly on the file storage that operat-
ing systems provide. Second, consider the interaction between your email
program and your service provider’s email server. Chapter 9 provides an
overview of networking, including the services that operating systems make
available to programs such as the email client and server. Chapter 10 ex-
tends this discussion into the more sophisticated forms of support provided
by communication middleware, such as messaging systems, RMI, and web
services.
Finally, Chapter 11 focuses on security. Because security is a pervasive
issue, the preceding ten chapters all provide some information on it as well.
Specifically, the final section of each chapter points out ways in which se-
curity relates to that chapter’s particular topic. However, even with that
coverage distributed throughout the book, a chapter specifically on security
is needed, primarily to elevate it out of technical particulars and talk about
general principles and the human and organizational context surrounding
PREFACE xv

the computer technology.


The best way to use these chapters is in consecutive order. However,
Chapter 5 can be omitted with only minor harm to Chapters 8 and 10, and
Chapter 9 can be omitted if students are already sufficiently familiar with
networking.

Relationship to Computer Science Curriculum 2008


Operating systems are traditionally the subject of a course required for all
computer science majors. In recent years, however, there has been increasing
interest in the idea that upper-level courses should be centered less around
particular artifacts, such as operating systems, and more around cross-
cutting concepts. In particular, the Computing Curricula 2001 (CC2001)
and its interim revision, Computer Science Curriculum 2008 (CS2008), pro-
vide encouragement for this approach, at least as one option. Most colleges
and universities still retain a relatively traditional operating systems course,
however. Therefore, this book steers a middle course, moving in the direc-
tion of the cross-cutting concerns while retaining enough familiarity to be
broadly adoptable.
The following table indicates the placement within this text of knowledge
units from CS2008’s computer science body of knowledge. Those knowledge
units designated as core units within CS2008 are listed in italics. The book
covers all core operating systems (OS) units, as well as one elective OS unit.
The overall amount of coverage for each unit is always at least that rec-
ommended by CS2008, though sometimes the specific subtopics don’t quite
correspond exactly. Outside the OS area, this book’s most substantial cov-
erage is of Net-Centric Computing (NC); another major topic, transaction
processing, comes from Information Management (IM). In each row, the
listed chapters contain the bulk of the knowledge unit’s coverage, though
Another Random Document on
Scribd Without Any Related Topics
like a natural impulse, so that he actually did not know, good simple
man, that his natural will was always towards the charity, and that
this restraint was something artificial which interposed between him
and his natural will.
“Perfectly unbusiness-like, Cuthbert,” said the merchant. “I wonder
greatly why you should speak of such a thing to me. A man
accustomed to regular business transactions has no tolerance for
such affairs as this—they are out of his way. Your landed gentry or
rich people, who don’t know anything about where their money
comes from, or how it is made—they are the people to carry such a
story to.”
Very true in the abstract, good Mr. Buchanan—nevertheless, your
nephew Cuthbert knows, as well as if you had told him, that your
purse begins to burn your breast-pocket, and leaps and struggles
there, desiring to get the worst over, and be peacefully at rest again.
Cuthbert knows it; and Cuthbert takes advantage of his knowledge.
“Martha is trustee, and has charge of all,” said Cuthbert; “and there
is little Mrs. Allenders herself, and her two babies. Little Harry, the
heir, is a fine, bold, intelligent boy, young as he is, and will want no
care they can give him—that is very sure. Then there are two other
children quite dependant on Martha—her own little sister, and
another, a distant relation, poor and fatherless whom they have kept
with them ever since they went to Allenders. Now there can be no
doubt it would be easier for them to go away to some little, quiet,
country house, and live on what they can earn themselves, and on
the residue of what the land will bring; but Martha would break her
heart. It is a generous devotion, uncle. She proposes to take the
management of the farm herself, and has actually begun to make
herself mistress of this knowledge, so strange for a woman; while the
exertions of the others, and of her own spare hours, are to provide
the household expenses, she calculates. All this is for Harry, and
Harry’s heir; and it is no burst of enthusiasm, but a steady, quiet,
undemonstrative determination. Come, uncle, you will help Martha?”
“Is that the old sister—the passionate one?” asked Mr. Buchanan.
“The passionate one—yes.”
“And there was surely one more that you have not mentioned; by
the bye, Cuthbert,” said Mr. Buchanan, hastily, “the boys used to say
you went there often. There’s nothing between you and any of them,
I hope?”
“No, uncle!”—the humility of the answer struck Mr. Buchanan
strangely. He almost thought for a moment that he had the little boy
beside him, who used to spend holiday weeks in Glasgow, when
Dick was a baby with streaming skirts, and “there was no word” of
any of the others. It made the merchant’s heart tender, even when
he turned to look upon the strong man by his side.
But Cuthbert, for his part, thought himself guilty of
disingenuousness, and by and bye, he added, “Don’t let me deceive
you, uncle. When I say no, I don’t mean to imply that there will never
be, nor that even if there never is anything between us, it will be any
fault of mine.”
But Mr. Buchanan only shook his head—how it came about, he
could not tell, but the good man’s eyelids were moistened, and there
came back to him momentary glimpses of many an early scene; he
was pleased, too, however imprudent Cuthbert’s intentions might be,
with the confidence he gave him—for that his nephew was more
than his equal, the good merchant very well knew.
So Mr. Buchanan shook his head, and satisfied his conscience with
the mute protest; “he could not find it in his heart,” as he said to
himself afterwards in self-justification, to condemn his nephew’s true
love.
“But this is not to the purpose,” continued Cuthbert. “A thousand
pounds, uncle, with the estate of Allenders, and myself for your
securities. I am getting on myself—I shall soon have a tolerable
business, I assure you, though this absence may put some of it in
jeopardy. Give me my boon now, and let me hurry back to my office
—a thousand pounds—and of course you will not accept any interest
for a few years.”
Mr. Buchanan sighed. “It is a very unbusiness-like transaction,
Cuthbert,” said the merchant.
“But not the first unbusiness-like transaction you have carried to a
good end,” said Cuthbert, warmly. “Take comfort, uncle; the Christian
charity and the natural love, will hold out longer than business. And
now you have given me your promise, I must say three words to my
aunt and Clemie, and ask you to let Robert drive me back again. I
must be home to-morrow morning at my work.”
And travelling by night, in the disconsolate stage-coach was nothing
like so satisfactory as an express-train—yet Cuthbert went home,
very comfortably; and very comfortably did the slumber of an
unencumbered mind, and a charitable heart, fall over Mr. Buchanan,
though still he shook his head at his own weakness, and was slightly
ashamed to make a memorandum of so unbusiness-like a concern.
CHAPTER XVII.
“A bankrupt, a prodigal who dare scarce show his head
on the Rialto; a beggar, that was used to come so smug
on the mart. Let him look to his bond. He was wont to call
me usurer: let him look to his bond. He was wont to lend
money for a Christian charity; let him look to his bond.”—
merchant of venice.
A few days after this, Martha came to Edinburgh according to her
appointment, to meet Harry’s principal creditor, accompanied by
Uncle Sandy who, “with all the bairns,” as he said, was to return
home to Ayr whenever he was freed from his attendance on Martha.
The meeting was arranged to take place in Lindsay’s office, and
Martha carried with her the half-year’s interest payable to this
creditor. It was the last of his own four thousand pounds.
The man was a retired shop-keeper, eloquent on “the value of
money,” and thinking the five or six thousands which were the much-
boasted result of his life, a great fortune, justly entitling its possessor
to “a proper pride.” Like most people, whose increase has been an
accumulation of morsels, Mr. Macalister was terribly afraid of risk,
and shrank from speculation with the most orthodox horror.
Persuaded at first to invest his money in Harry’s mortgage, because
land was the most secure of banks, his ears had been keenly alive,
ever since, to every morsel of news he could glean about Harry; and
when Mr. Macalister heard he was wild, he trembled for his four
thousand pounds. Then came Harry’s death, and hearing that the
property was left only in the hands of women, Mr. Macalister had a
vague notion that he had power to sell the lands of Allenders, and
pay himself, very probably making a profit of the transaction; or that
he might, if he would, take possession, and become Laird of
Allenders in his own person; but he had never mentioned this grand
imagination to any one, though it invested him with a visionary
importance, which surprised his very wife. Yet Macalister was by no
means a dishonest man, nor one who would deliberately set about
benefiting himself by cheating his neighbours—by no means; but his
exaggerated idea of the money which he had laboriously earned,
made him believe that all this was in his power.
So he came to Lindsay’s office very spruce and shining, with an
elaborate shirt-frill, and a new cane, determined to demand instant
re-payment of the money, or failing that, to intimate his intention of
entering upon possession of Allenders.
Lindsay, somewhat puzzled, was endeavouring to understand the
solemn hints, and important allusions of Macalister, when Martha
and her uncle entered his office. The creditor was somewhat taken
by surprise; and when he saw the deference with which the lawyer
received this grave-looking woman in her deep mourning, Macalister
faltered; for he had never thought of “the other party—” never, except
as natural opponents and adversaries of whom he, in this connexion
of debtor and creditor, had greatly the advantage.
“I have been thinking—I’ll likely want my money, Miss Allenders,”
said Macalister after a few general words had passed, followed by
an embarrassed silence.
“Mr. Lindsay will pay you the interest which is due,” said Martha;
“and it would be a convenience to us if you did not—at least,
immediately—claim your money. The works for which it was
borrowed have not had time yet to be profitable; but a few years
more, I trust—”
“Ay, Miss Allenders; but it’s not so easy for me to wait a few years
more,” said Macalister, briskly, restored to his natural self-importance
by Martha’s request; “for ye see, I can show you plainly—”
But what Mr. Macalister could have shown plainly, remained for
ever unknown to Martha; for at that moment, a great commotion
arose in the outer office, and the door of this room thrown violently
open, disclosed the ghost-like face, inflamed with fury, of Miss Jean
Calder, who, holding Lindsay’s clerk at arm’s length, with her long
fingers clutched upon his shoulder, had thrown the door open with
her disengaged hand, and was about to enter the room.
Involuntarily, Alexander Muir drew back his chair, and Martha
started. Like a visitant from the dead, the old woman, with a great
stride, entered among them. Her tall, angular frame tottered, and her
head shook, half with rage and excitement, half with the natural
palsied motion of her extreme age. She was dressed in a large
woollen shawl, once bright tartan, now as dim in its complexion as it
was thin in its texture, and a large bonnet, standing out stiffly like a
fan round her ghost face, which was encircled under it by a stiff ruff
of yellow lace. Miss Jean made one great step forward, and seizing
upon Alexander Muir, shook him till herself was so thoroughly
shaken that she scarcely could stand.
“Did I no tell ye—did I no warn ye, Sandy Muir, that I would pit my fit
yet on his turf, that thought I was auld, and wished me dead, and
had his covetous e’e on my siller? I’m saying did I no tell ye? And I’ll
tell ye what, strange folk,” said Miss Jean, turning round with a
glittering smile of malice, “I’m glad the reprobate’s dead—that am I!
—for now he’ll keep nae honest body out of their ain.”
Martha started from her seat with a violent passion—mingled of
burning grief and fury—in her face. Her hand clenched, her form
dilated—you would have thought her about to strike down at her feet
the incarnate demon, whose laugh of shrill malicious triumph rang
over Harry’s grave; and, for an instant, a perfect tempest—an
overwhelming storm, to whose rage everything would have been
possible—possessed Martha, like another kindred demon. Then she
suddenly sat down, and clasping her hands together, leaned them on
her knee, drawing up her person, and stretching out her arms to their
full length as if the pain were some relief to her; for years of
endurance had not quenched the passionate, fiery nature out of
Martha’s soul.
“He’s in the hands of God—he’s entered the life where no man
makes shipwreck!” said Uncle Sandy, rising up. “Bairns, have pity
upon this miserable woman, who kens not the day that her soul may
be required of her. Curse her not, Martha; curse her not. And
woman, I say, blessed are the dead—blessed are the young graves
—blessed is the very pestilence and sword, that preserves innocent
bairns from living to be evened with the like of you!”
And, with a visible tremble of indignation shaking his whole frame,
the old man sat down, unwitting that the curse he had forbidden
Martha to speak, was implied in his own denunciation.
“Let them laugh that win,” said Miss Jean; “and the play’s no played
out yet, Sandy Muir. Where’s my guid siller?—and where’s a’ the
books and papers I furnished to yon lawyer chield, to make out your
prodigal’s claim? Weel, he’s dead—he has nae claim noo—and I
crave to ken wha’s the heir?”
“His son,” said Martha, distinctly.
“His son!—wha’s his son? He was naething but a bit callant himsel.
Ay, Sandy, my man, ye thought little of my skill in folk’s lives; ye
thocht Jean Calder would have thrissels growing ower her ain head,
or ever there came a grey hair in Harry Muir’s! What are ye saying
till’t noo, Sandy? No uncle to a laird noo—uncle to naething, but six
feet of grass and a headstane! I saw him ance wi’ his hair fleeing in
the wind, and his laugh that ye could have heard it half a mile off,
and me hirpling on my staff, wi’ never ane looking ower their
shouther at me. I kent then in my heart, that auld as I was I would
see him dead!—and it’s true this day. Lad, may I sit down? I’ve come
for my siller.”
Lindsay put a chair towards her silently, and she half fell into it, half
voluntarily seated herself. Poor respectable Macalister stood aghast,
afraid of her wrinkled face, and the wild gleam in her frosty eyes.
Martha, pressing her foot upon the ground, as if she crushed
something under it, and clenching her hands together, till the pain of
them mingled with the burning pain in her heart, bent down her head
and kept silence; while Uncle Sandy, elevating himself with a simple
indignant dignity, seemed about to speak several times, but for a sob
which choked him, and which he would not have Miss Jean hear.
“I’ve come for my siller!” repeated Miss Jean, stamping her foot
upon the ground, to give her words emphasis. “What do ye ca’ this
woman? It’s Martha, is’t? Weel, there’s little about her for onybody to
envie, if it binna her bombazine. Ye would gie a hantle for the yard o’
that now? I wonder ye had the heart—a’ off the prodigal callant’s
estate, and cheating folk that he’s awn lawful siller to. And it’s no as
if ye were a young lassie either, or ane to be set off wi’ the like o’
thae vanities. I wonder a woman come to your years doesna think
shame!”
“Listen, Auntie Jean,” said Martha, suddenly raising herself and
speaking quick, as if to keep the resolution which she had brought to
this pitch: “There is nothing to be envied in me. I have neither youth,
nor good looks, nor happiness—and never had! You may deal with
me on equal terms: I am able to give you as much as you have
hitherto got for this money of yours. I want it, and you want the
income from it—give it to me if you choose: if you do not choose,
withdraw it at once, without another word. This is all I have to say to
you. I will be glad if you take it away and make me free of the
connexion of your name; but I will change no arrangement willingly.
Now, take your choice; and you, Sir, do the same. This is all I have to
say.”
And Martha turning her eyes from them, looked to Uncle Sandy,
who kept his fixed upon Miss Jean, and was still painfully composing
himself to answer her.
“No,” said the old woman with a malignant, feeble laugh, “there’s
naething to envie in you. I was a different looking woman to you in
my young days, Martha Muir; but there was never a well-far’d bit
about you a’ your life, and a temper like the auld enemy. I wish you
nae ill. I wadna gang out of my gate to do either gude or ill to the like
of you, for I dinna think ye’re worth my pains; but mony’s the bonnie
lad, and mony’s the bonnie lass I’ve seen hame to the mools, that
took their divert off me—and mony a ane I’ll see yet, for a’ that
sneck-drawing hypocrite says.”
“Ay,” said Martha, “the comely, and the blythe, and the hopeful die
away. The like of us that it would be a charity to take out of this
world, live all our days, and come to grey hairs. Ay, auntie, the bairns
are dying night and morning—the like of us lives on!”
“But bless the bairns, Martha—bless them whom the Master was at
pains to bless,” cried Uncle Sandy, his eyes shining through tears. “I
am old, too, and have seen sorrow; but God preserve and bless the
gladness of the bairns!”
“Ye’re but a bairn yourself, Sandy Muir,” said Miss Jean, casting
upon him a half-angry, half-imbecile glance out of her wandering
eyes; “and I’ve gien Mr. Macer a missive about your twa hunder
pounds. What does the like o’ you want wi’ siller? and your grand
house and garden, my bonnie man, and a’ the young, light-headed
gilpies ye train up to vanity? We’ll just see how muckle the wives and
the weans will mind about you in Ayr, when ye’re gaun frae door to
door wi’ a mealpock and a staff; but ye need never seek frae me.”
The old man rose with some dignity: “Martha, my woman, this does
not become you and me,” said Uncle Sandy, “we that have grief and
the hand of God upon us, are no more to suffer railing than to return
it. These folk have heard what ye had to say, and you’re no a person
of two minds, or many words. Let us go back to our sorrowful house,
and our bereaved bairns, with neither malice nor curse in our hearts,
leaving the ill-will with them that it comes from. Ye can hear their
answer, Martha, from the gentleman. Ye have said what ye had to
say.”
Almost mechanically Martha rose to obey him, and took the old
man’s arm. But after she had left her seat and taken a few steps
towards the door, whither Uncle Sandy hastened her with tremulous
speed, she turned round—perhaps only to speak to Lindsay who
followed them, perhaps to look again at the old miserable woman,
who still was of her own blood, and had scarcely a nearer relative
than herself in the whole world.
“I’ve come from Ayr on the tap o’ the coach, my lane,” said Miss
Jean, suddenly relapsing, as she did sometimes, into the natural
passive state of age, which forgot in an instant the emotions which
had animated the poor exhausted skeleton frame. “If it hadna been a
decent lad that paid the odds of the charge, and put me in the inside
atween this and Falkirk, I’m sure I wad have been perished wi’ the
cauld, and never ane of you offering a puir auld woman a morsel to
keep her heart. I heard from Mr. Macer, in Stirling, there was to be a
meeting here the day, and I thought my canniest plan was to take my
fit in hand, and trust nane of thae sliddry writers. But, man, micht ye
no be mending the fire the time ye’re glowering at me? the tane’s as
easy as the tither, and there’s as mony coals yonder standing in the
scoop as would fill my bunker, and hand me gaun half the year.
Coals maun be cheap here away, and I wadna scruple to make a
bleeze, if you’re sure the lum’s clean; but I aye keep a frugal fire at
hame: I’m a very careful woman. Sandy, do ye ken ony place
hereawa where an auld body could get a sma’ cheap meal? I’m very
moderate in my eating mysel, but travel appetizes even a frail person
like me; and what was yon ye was saying about the siller?”
Lindsay repeated what Martha had said in a few words. Mr. Lindsay
did not by any means admire this occupation of his office. But Miss
Jean’s eyes wandered to Martha, who still stood silently looking on,
and holding her uncle’s arm.
“She’s no muckle to look at,” said the old woman, bending her
shrivelled face forward, “but I’ve heard the voice she speaks wi’
afore, and it’s no like a fremd voice. Canna ye tell me what ye said
about the siller yoursel, instead of standing there like a stane figure?
and sit down and be quiet, honest man, now ye have gotten on the
coals.”
This was addressed to Macalister, who very humbly, and with a look
of fright at Lindsay, had replenished the fire at Miss Jean’s
command. He now obeyed her again, with instant submission,
feeling himself a very small person, and altogether forgetful of his
imaginary grandeur.
Martha repeated her former words, where she stood, holding the
arm of Uncle Sandy—and Uncle Sandy, still perceptibly trembling,
averted his head with a simple pride and dignity, and held Martha’s
arm closely in his own, as if with an impulse of protection.
“As lang as ye gie me fifty pounds by the year, ye can keep the
siller till I hear of mair for it,” said Miss Jean, at last; “but where are
favours ye, and does ye charity, ye might show a decent respect.
Woman, there’s the like o’ you that never was weel-favoured nor yet
young, nor had as guid a wit in your haill buik as I hae in my little
finger; but ane bows to ye, and anither gies ye a haud o’ their arm,
and a’ body civil, as if ye were something—when ye’re naething but
a single woman, without a penny in your purse, and needing to work
for your bread day by day. But never ane, if it binna whiles a
stranger, like him that put me in the inside of the coach, says a guid-
e’en or a guid-day to me; and when I’m useless wi’ my journey, it’s
no apples and flagons to keep my heart, but fechting and
contentions that I never could bide—for a’ body turns on me.”
And the poor old woman mumbled and sobbed, and put up a great
dingy handkerchief to her eyes.
Uncle Sandy’s offence was gone—he could not see a semblance of
distress without an effort to relieve it.
“I’ll take ye in a coach to a decent place, Miss Jean,” said
Alexander Muir, “and bid them take care of ye, and see ye safe
hame, and be at all the charges, if you’ll just think upon your evil
ways, and take tent to your ain life, and harm the young and the
heedless nae mair.”
“He thinks I’m a witch, the auld haverel,” said Miss Jean, looking up
with a harsh laugh; “but never you heed, Sandy, we’ll gree; and ye
can tell the folk to take me an inside place in the coach, and I’ll take
care mysel to see they settle for a’ thing, and I’ll gang away the
morn; so ye can gie them the siller—or I’ll take charge of it and pay
them mysel—its a’ the same to me.”
CHAPTER XVIII.

All men make faults, and even I in this;


Authorizing thy trespass with compare,
Myself corrupting, salving thy amiss,
Excusing thy sins more than thy sins are.

shakspere.
And Martha had to meet lesser creditors to whom Harry owed
smaller amounts for trifles of his own wardrobe, of furniture, and
other inconsiderable things. But the sum they came to altogether
was far from inconsiderable. Uncle Sandy, who steadily attended
and supported her, was grieved sometimes by the bitter and harsh
passion with which she received the faintest word which implied
blame of Harry. In every other particular Martha appeared a
chastened and sober woman; in this the fire and pride of her nature
blazed with an unchecked fierceness which grieved the gentler spirit.
Within himself there was something also which sprang up with
instinctive haste to defend the memory of Harry; but Martha’s
nervous impatience of the most remote implied blame, and the
headlong fiery passion with which she threw herself upon any one
who attempted this, made the old man uneasy. And people who
encountered Martha’s anger did not know its strange inconsistency,
nor could have believed how well she was aware of Harry’s faults, or
how in her heart she condemned them; but Martha had devoted her
life to restore to Harry’s memory the honour he had lost in his
person, and whoso struck at him, struck at her very life.
They were walking home on their return—for the carriage was
already sold—and John, who had not yet got another place, carried
their little travelling-bags behind them. It was a bright November day,
not very cold, but clear and beautiful, and the sunshine lay calmly
like a glory on the head of Demeyet, crowning him against his will,
though even he bore the honour more meekly than in the dazzling
days of summer. The air was so clear, that you could see the white
houses clustering at his feet, and hear the voices of distant farm-
yards on every side, miles away, making a continual sound over the
country, which seemed to lie in a silent trance of listening; and from
this little height which the road descends, you can see the blue
smoke of Allenders curling over the bare trees, and make out that
the sunshine glances upon some bright childish heads under the
stripped walnut on the lawn. Uncle Sandy, looking towards it, prays
gentle prayers in his heart—prays to the God of the fatherless, the
widow, the distressed—to Him who blessed the children in His arms,
and wept with the sisters of the dead; and has his good heart
lightened and comforted, knowing who it is to whom he has in faith
committed the charge of these helpless ones; and the old man has a
smile upon his face, and many a word of tender kindness in his
heart, to comfort the “bairns” at home—for they are all bairns to him.
But other thoughts burn at the heart of Martha, as she walks
onward by his side. Unawares and unconsciously her soul shudders
at the sunshine—hates with fierce impatience the voices and
cheerful hum of ordinary life, which grow audible as they approach
Maidlin, and shrinks from returning home—home, where that one
vacant place and absent voice, makes her heart desolate for ever.
Through her bitter repinings, Miss Jean’s exultation passes with a
ghastly terror, and Martha shivers to think that this unholy age may
come upon her, and has her heart full of questionings almost
impious. That this old woman, envious, degraded and miserable,
should be spared in the earth to see many a hopeful head laid low;
that poor old Dragon, basking in the sunshine, should live on from
day to day, and see the children die; that she herself should remain,
and Harry be taken away. Martha said, “Why? why?” and groaned
within herself, and was burdened, hating the very light, and shrinking
with burning impatience from the respectful looks and half-spoken
sympathies of these cottar women at Maidlin Cross. She could not
accept sympathy; she turned away with loathing from all except
those who immediately shared her sorrow; and even them she bore
with sometimes painfully—for who could understand her grief?
A blasting fiery unblessed grief burning her heart like a tempest—
and a sullen gloom came over Martha’s face as she averted her
head, and walked on steadily, closing her ears to the pleasant
natural sounds which seemed to crowd upon her with so much
greater distinctness than usual, that they chafed her disturbed mind
into very fury. “The spirit of the Lord left Saul, and an evil spirit from
the Lord troubled him.” It was so with Martha now.
Little Mary Paxton has been learning to-day to make a curtsey—for
she is to go to school for the first time to-morrow; and her big sister,
Mysie, says the young ladies curtsey when they enter the school-
room at Blaelodge. Mary has blue eyes, little ruddy lips, always
parted by two small white teeth, which appear between them; and
cheeks, which the sun has ripened, according to his pleasure, all the
summer through. In her little woollen frock and clean blue pinafore,
Mary has been practising her new acquirement at the Cross. She is
only four years old, and has a licence which the elder children have
not; so little Mary rises up from the step of the Cross on which she
has just seated herself for a rest, and coming forward with her small
steps, pauses suddenly on the road before Martha, folds her little
bare hands on her breast, and looking up with the sweet frank
childish face, and the two small teeth fully revealed by her smile of
innocent satisfaction, makes her little curtsey to the lady, and stands
still to be approved with the confidence of her guileless years.
Upon Martha’s oppressed heart this falls like a blow under which
she staggers, scarcely knowing for the moment from whence the
shock comes. Suddenly standing still, and grasping at the old man’s
arm to support herself, she looks at the child—the child who lifts up
her sweet little simple face, with its smiling parted lips and sunny
eyes, and look of perfect trust and innocence. Little Mary wits not
that there are in the world such despairs and bitternesses as blind
the very heart in Martha’s breast; and Martha’s breast heaves with a
great sob as this sudden stroke falls upon her. The old woman’s
haggard face, with its ghostly triumph, disappears from her mind—
herself, heavy with the grief, which is greater than every other,
passes away from her relieved sight. Standing still in perfect silence,
a sudden burst of natural emotion which sweeps away all evil things
before it, falls upon her as from the skies—a strong revulsion, like
the witched mariner:

“O happy living things! no tongue


Their beauty might declare.
A spring of love gushed from my heart,
And I blessed them unaware:
Sure my kind saint took pity on me,
And I blessed them unaware.”

The tears came in floods irrestrainable to Martha’s eyes, and with


another long sob, she snatched up the child in her arms, kissed its
little innocent, surprised face, and covering her own with her veil,
hurried away. But she had blessed them unaware—blessed all God’s
creatures out of a full heart, acquiescing in that mysterious love
which apportions all things; and the natural sounds and sights were
gall to her no longer, and the burden fell from her neck. All the way
home she hid her tears, and restrained the sound of her weeping so
far as possible; but Uncle Sandy saw and wondered, that Martha
was indeed weeping like a child.
Two days after, Uncle Sandy with his family went to Ayr. They were
to stay a month, Martha said, and Agnes and Rose acquiesced very
quietly. What did it matter where these pensive, sorrowful days were
spent? But Agnes went away, occupied with many little necessary
cares for her own delicate health, and for the children, who now had
no maid to attend them; and Rose, charged with the care of all the
little party, had countless small solicitudes and responsibilities to
interest her, and could even sometimes escape with a sigh into her
own dream-country, and be charmed into a grateful repose; while
Lettie and Katie Calder, could scarcely repress a certain childish
excitement in prospect of the journey, and were in their full
enthusiasm about new stitches, and the work they were to do in Ayr
to help Martha. All had some such new-awakened interest to relieve
the strain of constant grief, as human creatures mercifully find when
God lays upon them the heaviest of His chastisements. But they
went away, and left Martha with her one maid Mysie, and the poor
old Dragon, in a house peopled with continual reminders of Harry—
alone.
And as she lay upon her bed awake, through these gloomy, solitary
nights, and dreamed of footsteps on the stair, and mysterious
sighings through her silent room, the strong heart of Martha
trembled. What if the spirit hovering by her, struggled in those
inarticulate breathings to communicate something to the dull human
sense, which cannot hear the delicate voices out of the unseen
country? What if Harry—the true Harry—not him they laid under the
sod in the churchyard of Maidlin—was straining his grander spiritual
faculties by her side, to attain to the old mortal voice which only she
could hear, and tell her what mercy God had communicated to his
soul, and where its dwelling was? And Martha held her breath and
listened, and with a throb of deeper grief was sensible of this thrill of
fear which reminded her how great a gulf and separation lay now
between her and the dead—a gulf before which the human spirit
fainted, refusing to front the forbidden mystery which yet its restless,
curious thoughts assail on every side. But in the broad daylight many
a time there seemed to Martha an eye upon her which benumbed
her like a spell—a conscious presence going with her as she went
and came, sitting silent by her side, fixing upon her constantly this
fascinating eye.
Meanwhile everything extraneous was cleared away from their now
simple and plain establishment. John was gone—and Mr.
Buchanan’s money lodged in the Stirling Bank restored credit and
respectability to the steady and continuous care which began to rule
over Harry’s fields. At Martha’s years there is difficulty in learning an
altogether new occupation, and this was of itself distasteful and outré
to a woman; but sometimes, though every one respected her
presence, it happened that she heard indifferent people speak of
“poor Allenders,” of the “warning” of his death as Gilbert called it, or
of the shipwreck of his life. And this, which brought the burning blood
to Martha’s face, inspired her with power to overcome every
obstacle. Harry—who in her heart needed no name—he had been
too long the acknowledged centre there—it was to Martha the
bitterest pain to speak of him to the uninterested and careless who,
presuming on her mention of him, plied her with allusions to her
brother, till her impatient sorrow could have turned upon them, and
struck them down even with a blow. But even this Martha schooled
herself to bear—schooled herself to tell the men with whom her
necessary business brought her into contact, that this was Harry’s
will and that his intention; that he had proposed this work, and that
charity, which she was bound to carry out, and would. Gradually
these people came to look upon him with a visionary reverence—this
spirit of the dead whose intentions lived in a will so strong and
unvarying; and his own weakness passed away, and was forgotten,
in the strength which placed itself, like a monument, upon his grave.
CHAPTER XIX.

Here is no change but such as comes in me.

old play.
Maggie McGillivray clips no longer in the wintry sunshine at her
mother’s door. Poor little foolish girl, she has married a cotton-
spinner, and at eighteen has a baby, and many cares upon the head
which used to stoop under the light as she sang the “Lea Rig,” and
clipped at her web. And Bessie McGillivray, who has succeeded
Maggie, has no such heart for either the work or the song, but drawls
out the one dismally, and idles about the other, and thinks it would be
a great relief to marry a cotton-spinner too, and have no more webs
to clip—a fate which she will accomplish one of these days. And
Bessie is “cauldrife,” as her mother says, and prefers sitting at the
fireside to-day, though the sunshine comes down mellow and warm
through the November fog; so that the scene from Mrs. Rodger’s
parlour window loses one of its most pleasant features, when there
is nothing to look to opposite, but the idle light lying on the stones at
Peter McGillivray’s door.
Mrs. McGarvie’s Tiger, still tawny and truculent, winks in the sun, as
he sits upon the pavement, confronting it with his fierce red eyes. But
Mrs. McGarvie’s red-haired Rob has gone to Port Philip to make his
fortune in the bush, and pretty little Helen has undergone the
universal destiny, and is married. There is change everywhere
without—new names on the Port Dundas Road—new houses
springing up about its adjacent streets; but Mrs. Rodger’s parlour,
where Agnes and Rose, and Uncle Sandy, with the children, are now
assembled, though a long succession of tenants have passed
through it since they left it, remains still the same.
And still the same is gaunt Mrs. Rodger in her widow’s cap—
genteel and grim, terrible to taxgatherers, and innocent men of gas
and water; and Miss Rodger, care-worn, faded and proud; and the
prim Miss Jeanie. But “Johnnie,” in his chimney corner, has begun to
be moved to better things than this perpetual idleness; and though
he has not reached so far as to overcome himself, and his false and
unwholesome shame, he is approaching to this better state; and a
great clumsy good-natured lodger pays persevering court to Miss
Aggie. The hoyden is decidedly reluctant, and resists and rejects him
stoutly—but it is no use, for this is her fate.
And Agnes with the bright hair all hidden under her widow’s cap,
sits down by the window with her baby in her lap, and bending over
it, attending to its wants, lets her tears fall silently upon its frock, and
on the little round arms which stretch up to her, till a violent
paroxysm comes upon her, and she has to leave the infant to Rose,
and steal away into the inner room “to compose herself,” as she says
—in reality to sob and weep her strength away, and be exhausted
into composure. Poor little unconscious child, upon whom this heavy
baptism falls! for now, one by one, over the little hands with which he
strokes her cheek, steal the tears of Rose. It was unwise of them to
come here; the place is too full of memories.
By a way which Violet has often clambered up in the summer nights
long ago, it is possible to reach the high field which, closely
bordering upon Mrs. Rodger’s house, is level with the bed-room
windows. Here in the dusk, when the night cold has scarcely set in,
and one star trembles in the misty sky, strays Lettie’s friend, Mr.
John, pondering over many things; and here comes little thoughtful
Lettie, to search the old corners, where she used to find them, for
one remaining gowan, and keep it as a memorial of this place which
is like home. From the edge of the field you can look sheer down
upon the road with its din and constant population, and upon the
lights gleaming scantily in those little nooks of streets about the
Cowcaddens, where Violet knows every shop. From the other end of
the field, close upon the dangerous brink where it makes abrupt and
precipitous descent into a great quarry, comes the sound of those
distinct measured strokes, broken by continual exclamations and
laughter, with which two stout servants beat a carpet. The dust is out
of it long ago, but still their rods resound in quick time on either side,
and their voices chime in unison; and now they trail it over the dark
fragrant grass, and stealing to the edge call to the passengers below,
who start and look around in amazement, and would not discover
whence the voice comes, but for the following laugh, which reveals
the secret. And by and bye a “lad” or two, and some passing mill
girls, scramble up the broken ascent which communicates with the
road; and often will the mistress look from her door in dismay, and
the master call from the window, before Janet and Betsy lift their
carpet from the grass, and recollect that it is “a’ the hours of the
nicht,” and that there are a hundred things to do when they return.
But Lettie puts her hand softly into Mr. John’s hand, and begins to
answer, with many tears, his questions about Harry; and tells him
how Martha is to do everything that Harry wanted to be done, and
that they are all to work at the “opening,” and Katie Calder is to stay
at Allenders; but neither of them are to go to school at Blaelodge any
more. Violet does not quite know what makes her so confidential,
and has a compunction even while she speaks, and thinks Martha
would not be pleased—but yet she speaks on.
“And we’re all to be busy and work at the opening; for Martha says
we need not think shame,” said Lettie; “and Katie and me will be able
to help to keep the house, Mr. John; and Rose says it’s better to
work than be idle, and it keeps away ill thoughts; but I like best to
think it’s lane, without working, or to read books—only I’ve read all
the books in Allenders, and I’m no to be idle any more.”
“You see I’m aye idle yet, Lettie,” said John.
“Oh yes; but then you never need—and you’ve aye been,” said
Lettie, hastily; for to Lettie Mr. John was an institution, and his
idleness was part of himself—a thing quite beyond discussion, and
unchangeable.
But a burning blush came over John Rodger’s face, in the
darkness, and Lettie saw instinctively that his feelings were
wounded. This brought upon her a strange embarrassment; and
while anxiously casting about for something to say, which should

You might also like