0% found this document useful (0 votes)
28 views

Embedded Systems VOL. 3: Real-Time Operating Systems for ARM Cortex-M Microcontrollers Jonathan Valvano download

The document is a comprehensive textbook titled 'Embedded Systems: Real-Time Operating Systems for ARM Cortex-M Microcontrollers' by Jonathan Valvano, focusing on the architecture and programming of ARM Cortex-M microcontrollers. It covers topics such as computer architecture, microcontroller I/O, thread management, real-time systems, digital signal processing, and communication systems. The fourth edition was published in January 2017 and is available for download along with other related resources.

Uploaded by

thangsaniavg
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)
28 views

Embedded Systems VOL. 3: Real-Time Operating Systems for ARM Cortex-M Microcontrollers Jonathan Valvano download

The document is a comprehensive textbook titled 'Embedded Systems: Real-Time Operating Systems for ARM Cortex-M Microcontrollers' by Jonathan Valvano, focusing on the architecture and programming of ARM Cortex-M microcontrollers. It covers topics such as computer architecture, microcontroller I/O, thread management, real-time systems, digital signal processing, and communication systems. The fourth edition was published in January 2017 and is available for download along with other related resources.

Uploaded by

thangsaniavg
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/ 62

Embedded Systems VOL.

3: Real-Time Operating
Systems for ARM Cortex-M Microcontrollers
Jonathan Valvano pdf download

https://textbookfull.com/product/embedded-systems-vol-3-real-
time-operating-systems-for-arm-cortex-m-microcontrollers-
jonathan-valvano/

Download more 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!

Stm32 Arm Programming for Embedded Systems 1st Edition


Muhammad Ali Mazidi

https://textbookfull.com/product/stm32-arm-programming-for-
embedded-systems-1st-edition-muhammad-ali-mazidi/

Distributed Embedded and Real time Java Systems 2012th


Edition M Teresa Higuera Toledano Andy J Wellings

https://textbookfull.com/product/distributed-embedded-and-real-
time-java-systems-2012th-edition-m-teresa-higuera-toledano-andy-
j-wellings/

Designing Embedded Systems and the Internet of Things


IoT with the ARM Mbed 1st Edition Perry Xiao

https://textbookfull.com/product/designing-embedded-systems-and-
the-internet-of-things-iot-with-the-arm-mbed-1st-edition-perry-
xiao/

Software Engineering for Embedded Systems Robert Oshana

https://textbookfull.com/product/software-engineering-for-
embedded-systems-robert-oshana/
Linear Discrete-Time Systems Zoran M. Buchevats

https://textbookfull.com/product/linear-discrete-time-systems-
zoran-m-buchevats/

Distributed Real Time Architecture for Mixed


Criticality Systems 1st Edition Hamidreza Ahmadian
(Editor)

https://textbookfull.com/product/distributed-real-time-
architecture-for-mixed-criticality-systems-1st-edition-hamidreza-
ahmadian-editor/

Advanced Intelligent Systems for Sustainable


Development AI2SD 2018 Vol 3 Advanced Intelligent
Systems Applied to Environment Mostafa Ezziyyani

https://textbookfull.com/product/advanced-intelligent-systems-
for-sustainable-development-ai2sd-2018-vol-3-advanced-
intelligent-systems-applied-to-environment-mostafa-ezziyyani/

Dependable Embedded Systems Jörg Henkel

https://textbookfull.com/product/dependable-embedded-systems-
jorg-henkel/

Survey of Operating Systems Jane Holcombe

https://textbookfull.com/product/survey-of-operating-systems-
jane-holcombe/
EM BED D ED SY STEM S:
REAL-TIME OPERATING SYSTEMS FOR
ARM CORTEX-M MICROCONTROLLERS

Volume 3
Fourth Edition,
January 2017

Jonathan W. Valvano
Fourth edition
January 2017
ARM and uVision are registered trademarks of ARM Limited.
Cortex and Keil are trademarks of ARM Limited.
Stellaris and Tiva are registered trademarks Texas Instruments.
Code Composer Studio is a trademark of Texas Instruments.
All other product or service names mentioned herein are the trademarks of their respective
owners.

In order to reduce costs, this college textbook has been self-published. For more
information about my classes, my research, and my books, see
http://users.ece.utexas.edu/~valvano/

For corrections and comments, please contact me at: [email protected].


Please cite this book as: J. W. Valvano, Embedded Systems: Real-Time Operating
Systems for ARM ® Cortex  -M Microcontrollers, Volume 3,
http://users.ece.utexas.edu/~valvano/, ISBN: 978-1466468863.

Copyright © 2017 Jonathan W. Valvano


All rights reserved. No part of this work covered by the copyright herein may be
reproduced, transmitted, stored, or used in any form or by any means graphic,
electronic, or mechanical, including but not limited to photocopying, recording,
scanning, digitizing, taping, web distribution, information networks, or
information storage and retrieval, except as permitted under Section 107 or 108 of
the 1976 United States Copyright Act, without the prior written permission of the
publisher.
ISBN-13: 978-1466468863
ISBN-10: 1466468866
Table of Contents

Preface to The Fourth Edition


Preface to Volume 3
Acknowledgements
1. Computer Architecture
1.1. Introduction to Real-Time Operating Systems
1.1.1. Real-time operating systems
1.1.2. Embedded Systems
1.2. Computer Architecture
1.2.1. Computers, processors, and microcontrollers
1.2.2. Memory
1.3. Cortex-M Processor Architecture
1.3.1. Registers
1.3.2. Stack
1.3.3. Operating modes
1.3.4. Reset
1.3.5. Clock system
1.4. Texas Instruments Cortex-M Microcontrollers
1.4.1. Introduction to I/O
1.4.2. Texas Instruments TM4C123 LaunchPad I/O pins
1.4.3. Texas Instruments TM4C1294 Connected LaunchPad I/O pins
1.4.4. Texas Instruments MSP432 LaunchPad I/O pins
1.4.5. Interfacing to a LaunchPad
1.5. ARM Cortex-M Assembly Language
1.5.1. Syntax
1.5.2. Addressing modes and operands
1.5.3. List of twelve instructions
1.5.4. Accessing memory
1.5.5. Functions
1.5.6. ARM Cortex Microcontroller Software Interface Standard
1.5.7. Conditional execution
1.5.8. Stack usage
1.5.9. Floating-point math
1.5.10. Keil assembler directives
1.6. Pointers in C
1.6.1. Pointers
1.6.2. Arrays
1.6.3. Linked lists
1.7. Memory Management
1.7.1. Use of the heap
1.7.2. Simple fixed-size heap
1.7.3. Memory manager: malloc and free
1.8. Introduction to debugging
1.9. Exercises
2. Microcontroller Input/Output
2.1. Parallel I/O
2.1.1. TM4C I/O programming
2.1.2. MSP432 I/O programming
2.2. Interrupts
2.2.1. NVIC
2.2.2. SysTick periodic interrupts
2.2.3. Periodic timer interrupts
2.2.4. Critical sections
2.2.5. Executing periodic tasks
2.2.6. Software interrupts
2.3. First in First Out (FIFO) Queues
2.4. Edge-triggered Interrupts
2.4.1. Edge-triggered interrupts on the TM4C123
2.4.2. Edge-triggered Interrupts on the MSP432
2.5. UART Interface
2.5.1. Transmitting in asynchronous mode
2.5.2. Receiving in asynchronous mode
2.5.3. Interrupt-driven UART on the TM4C123
2.5.4. Interrupt-driven UART on the MSP432
2.6. Synchronous Transmission and Receiving using the SSI
2.7. Input Capture or Input Edge Time Mode
2.7.1. Basic principles
2.7.2. Period measurement on the TM4C123
2.7.3. Period measurement on the MSP432
2.7.4. Pulse width measurement
2.7.5. Ultrasonic distance measurement
2.8. Pulse Width Modulation
2.8.1. Pulse width modulation on the TM4C123
2.8.2. Pulse width modulation on the MSP432
2.9. Analog Output
2.10. Analog Input
2.10.1. ADC Parameters
2.10.2. Internal ADC on TM4C
2.10.3. Internal ADC on MSP432
2.10.4. IR distance measurement
2.11. OS Considerations for I/O Devices
2.11.1 Board Support Package
2.11.2 Path Expression
2.12. Debugging
2.12.1. Functional Debugging
2.12.2. Performance Debugging (FFT analysis)
2.12.3. Debugging heartbeat
2.12.4. Profiling
2.13. Exercises
3. Thread Management
3.1. Introduction to RTOS
3.1.1. Motivation
3.1.2. Parallel, distributed and concurrent programming
3.1.3. Introduction to threads
3.1.4. States of a main thread
3.1.5. Real-time systems
3.1.6. Producer/Consumer problem using a mailbox
3.1.7. Scheduler
3.2. Function pointers
3.3. Thread Management
3.3.1. Two types of threads
3.3.2. Thread Control Block (TCB)
3.3.3. Creation of threads
3.3.4. Launching the OS
3.3.5. Switching threads
3.3.6. Profiling the OS
3.3.7. Linking assembly to C
3.3.8. Periodic tasks
3.4. Semaphores
3.5. Thread Synchronization
3.5.1. Resource sharing, nonreentrant code or mutual exclusion
3.5.2. Condition variable
3.5.3. Thread communication between two threads using a mailbox
3.6. Process Management
3.7. Dynamic loading and linking
3.8. Exercises
4. Time Management
4.1. Cooperation
4.1.1. Spin-lock semaphore implementation with cooperation
4.1.2. Cooperative Scheduler
4.2. Blocking semaphores
4.2.1. The need for blocking
4.2.2. The blocked state
4.2.3. Implementation
4.2.4. Thread rendezvous
4.3. First In First Out Queue
4.3.1. Producer/Consumer problem using a FIFO
4.3.2. Little’s Theorem
4.3.3. FIFO implementation
4.3.4. Three-semaphore FIFO implementation
4.3.5. Two-semaphore FIFO implementation
4.3.6. One-semaphore FIFO implementation
4.3.7. Kahn Process Networks
4.4. Thread sleeping
4.5. Deadlocks
4.6. Monitors
4.7. Fixed Scheduling
4.8. Exercises
5. Real-time Systems
5.1. Data Acquisition Systems
5.1.1. Approach
5.1.2. Performance Metrics
5.1.3. Audio Input/Output
5.2. Priority scheduler
5.2.1. Implementation
5.2.2. Multi-level Feedback Queue
5.2.3. Starvation and aging
5.2.4. Priority inversion and inheritance on Mars Pathfinder
5.3. Debouncing a switch
5.3.1. Approach to debouncing
5.3.2. Debouncing a switch on TM4C123
5.3.3. Debouncing a switch on MSP432
5.4. Running event threads as high priority main threads
5.5. Available RTOS
5.5.1. Micrium uC/OS-II
5.5.2. Texas Instruments RTOS
5.5.3. ARM RTX Real-Time Operating System
5.5.4. FreeRTOS
5.5.5. Other Real Time Operating Systems
5.6. Exercises
6. Digital Signal Processing
6.1. Basic Principles
6.2. Multiple Access Circular Queue
6.3. Using the Z-Transform to Derive Filter Response
6.4. IIR Filter Design Using the Pole-Zero Plot
6.5. Discrete Fourier Transform
6.6. FIR Filter Design
6.7. Direct-Form Implementations.
6.8. Exercises
7. High-Speed Interfacing
7.1. The Need for Speed
7.2. High-Speed I/O Applications
7.3. General Approaches to High-Speed Interfaces
7.3.1. Hardware FIFO
7.3.2. Dual Port Memory
7.3.3. Bank-Switched Memory
7.4. Fundamental Approach to DMA
7.4.1. DMA Cycles
7.4.2. DMA Initiation
7.4.3. Burst versus Single Cycle DMA
7.4.4. Single Address versus Dual Address DMA
7.4.5. DMA programming on the TM4C123
7.6. Exercises
8. File system management
8.1. Performance Metrics
8.1.1. Usage
8.1.2. Specifications
8.1.3. Fragmentation
8.2. File System Allocation
8.2.1. Contiguous allocation
8.2.2. Linked allocation
8.2.3. Indexed allocation
8.2.4. File allocation table (FAT)
8.3. Solid State Disk
8.3.1. Flash memory
8.3.2. Flash device driver
8.3.3. eDisk device driver
8.3.4. Secure digital card interface
8.4. Simple File System
8.4.1. Directory
8.4.2. Allocation
8.4.3. Free space management
8.5. Write-once File System
8.5.1. Usage
8.5.2. Allocation
8.5.3. Directory
8.5.4. Append
8.5.5. Free space management
8.6. Readers-Writers Problem
8.7. Exercises
9. Communication Systems
9.1. Fundamentals
9.1.1. The network
9.1.2. Physical Channel
9.1.3. Wireless Communication
9.1.4. Radio
9.2. Controller Area Network (CAN)
9.2.1. The Fundamentals of CAN
9.2.2. Texas Instruments TM4C CAN
9.3. Embedded Internet
9.3.1. Abstraction
9.3.2. Message Protocols
9.3.3. Ethernet Physical Layer
9.3.4. Ethernet on the TM4C1294
9.4. Internet of Things
9.4.1. Basic Concepts
9.4.2. UDP and TCP Packets
9.4.3. Web server
9.4.4. UDP communication over WiFi
9.4.5. Other CC3100 Applications
9.4. Bluetooth Fundamentals
9.4.1. Bluetooth Protocol Stack
9.4.2. Client-server Paradigm
9.5. CC2650 Solutions
9.5.1. CC2650 Microcontroller
9.5.2. Single Chip Solution, CC2650 LaunchPad
9.6. Network Processor Interface (NPI)
9.6.1. Overview
9.6.2. Services and Characteristics
9.6.3. Advertising
9.6.4. Read and Write Indications
9.7. Application Layer Protocols for Embedded Systems
9.7.1. CoAP
9.7.2 MQTT
9.8. Exercises
10. Robotic Systems
10.1. Introduction to Digital Control Systems
10.2. Binary Actuators
10.2.1. Electrical Interface
10.2.2. DC Motor Interface with PWM
10.3. Sensors
10.4. Odometry
10.5. Simple Closed-Loop Control Systems.
10.6. PID Controllers
10.6.1. General Approach to a PID Controller
10.6.2. Design Process for a PID Controller
10.7. Fuzzy Logic Control
10.8. Exercises
Appendix 1. Glossary
Appendix 2. Solutions to Checkpoints
Reference Material
Preface to The Fourth Edition
There are two major additions to this fourth edition. First, this version supports both
the TM4C and the MSP432 architectures. The material for the LM3S series has been
removed. Volumes 1 and 2 focused on the hardware and software aspects I/O
interfacing. In this volume we provide a set of low level device drivers allowing this
volume to focus on real-time operating systems, digital signal processing, control
systems, and the internet of things. The second addition is Bluetooth Low Energy
(BLE), which will be implemented by interfacing a CC2650, in a similar manner
with which IEEE802.11b wifi is implemented in this book using the CC3100.
Running on the CC2650 will be an application programmer interface called Simple
Network Processor (SNP). SNP allows the TM4C123/MSP432 microcontroller to
implement BLE using a simple set of UART messaging. Off-loading the BLE
functions to the CC2650 allows the target microcontroller to implement system level
functions without the burden of satisfying the real-time communication required by
Bluetooth.
Preface to Volume 3
Embedded systems are a ubiquitous component of our everyday lives. We interact
with hundreds of tiny computers every day that are embedded into our houses, our
cars, our toys, and our work. As our world has become more complex, so have the
capabilities of the microcontrollers embedded into our devices. The ARM Cortex-M
family represents the new class of microcontrollers much more powerful than the
devices available ten years ago. The purpose of this book is to present the design
methodology to train young engineers to understand the basic building blocks that
comprise devices like a cell phone, an MP3 player, a pacemaker, antilock brakes,
and an engine controller.
This book is the third in a series of three books that teach the fundamentals of
embedded systems as applied to the ARM Cortex-M family of microcontrollers. This
third volume is primarily written for senior undergraduate or first-year graduate
electrical and computer engineering students. It could also be used for professionals
wishing to design or deploy a real-time operating system onto an ARM platform. The
first book Embedded Systems: Introduction to ARM Cortex-M Microcontrollers is an
introduction to computers and interfacing focusing on assembly language and C
programming. The second book Embedded Systems: Real-Time Interfacing to ARM
Cortex-M Microcontrollers focuses on interfacing and the design of embedded
systems. This third book is an advanced book focusing on operating systems, high-
speed interfacing, control systems, and robotics.
An embedded system is a system that performs a specific task and has a computer
embedded inside. A system is comprised of components and interfaces connected
together for a common purpose. This book presents components, interfaces and
methodologies for building systems. Specific topics include microcontrollers, design,
verification, hardware/software synchronization, interfacing devices to the computer,
timing diagrams, real-time operating systems, data collection and processing, motor
control, analog filters, digital filters, and real-time signal processing.
In general, the area of embedded systems is an important and growing discipline
within electrical and computer engineering. In the past, the educational market of
embedded systems has been dominated by simple microcontrollers like the PIC, the
9S12, and the 8051. This is because of their market share, low cost, and historical
dominance. However, as problems become more complex, so must the systems that
solve them. A number of embedded system paradigms must shift in order to
accommodate this growth in complexity. First, the number of calculations per second
will increase from millions/sec to billions/sec. Similarly, the number of lines of
software code will also increase from thousands to millions. Thirdly, systems will
involve multiple microcontrollers supporting many simultaneous operations. Lastly,
the need for system verification will continue to grow as these systems are deployed
into safety critical applications. These changes are more than a simple growth in size
and bandwidth. These systems must employ parallel programming, high-speed
synchronization, real-time operating systems, fault tolerant design, priority interrupt
handling, and networking. Consequently, it will be important to provide our students
with these types of design experiences. The ARM platform is both low cost and
provides the high performance features required in future embedded systems.
Although the ARM market share is large and will continue to grow. Furthermore,
students trained on the ARM will be equipped to design systems across the complete
spectrum from simple to complex. The purpose of writing these three books at this
time is to bring engineering education into the 21st century.
This book employs many approaches to learning. It will not include an exhaustive
recapitulation of the information in data sheets. First, it begins with basic
fundamentals, which allows the reader to solve new problems with new technology.
Second, the book presents many detailed design examples. These examples illustrate
the process of design. There are multiple structural components that assist learning.
Checkpoints, with answers in the back, are short easy to answer questions providing
immediate feedback while reading. Homework problems, which typically are
simpler than labs, provide more learning opportunities. The book includes an index
and a glossary so that information can be searched. The most important learning
experiences in a class like this are of course the laboratories. More detailed lab
descriptions are available on the web. Specifically for Volume 1, look at the lab
assignments for EE319K. For Volume 2 refer to the EE445L labs, and for this
volume, look at the lab assignments for EE445M/EE380L.6.
There is a web site accompanying this book
http://users.ece.utexas.edu/~valvano/arm. Posted here are ARM Keil™ uVision®
and Texas Instruments Code Composer Studio™ projects for each of the example
programs in the book. You will also find data sheets and Excel spreadsheets relevant
to the material in this book.
The book will cover embedded systems for ARM ® Cortex™-M microcontrollers
with specific details on the TM4C123, TM4C1294, and MSP432. Most of the topics
can be run on any Texas Instruments Cortex M microcontroller. In these books the
terms MSP432 and TM4C will refer to any of the Texas Instruments ARM Cortex-M
based microcontrollers. Although the solutions are specific for the MSP432 and
TM4C families, it will be possible to use these books for other ARM derivatives.
Acknowledgements
I owe a wonderful debt of gratitude to Daniel Valvano. He wrote and tested most of
the software examples found in these books. Secondly, he maintains the example web
site, http://users.ece.utexas.edu/~valvano/arm. Lastly, he meticulously proofread
this manuscript.
Many shared experiences contributed to the development of this book. First I would
like to acknowledge the many excellent teaching assistants I have had the pleasure of
working with. Some of these hard-working, underpaid warriors include Pankaj
Bishnoi, Rajeev Sethia, Adson da Rocha, Bao Hua, Raj Randeri, Santosh Jodh,
Naresh Bhavaraju, Ashutosh Kulkarni, Bryan Stiles, V. Krishnamurthy, Paul Johnson,
Craig Kochis, Sean Askew, George Panayi, Jeehyun Kim, Vikram Godbole, Andres
Zambrano, Ann Meyer, Hyunjin Shin, Anand Rajan, Anil Kottam, Chia-ling Wei,
Jignesh Shah, Icaro Santos, David Altman, Nachiket Kharalkar, Robin Tsang, Byung
Geun Jun, John Porterfield, Daniel Fernandez, Deepak Panwar, Jacob Egner, Sandy
Hermawan, Usman Tariq, Sterling Wei, Seil Oh, Antonius Keddis, Lev Shuhatovich,
Glen Rhodes, Geoffrey Luke, Karthik Sankar, Tim Van Ruitenbeek, Raffaele Cetrulo,
Harshad Desai, Justin Capogna, Arindam Goswami, Jungho Jo, Mehmet Basoglu,
Kathryn Loeffler, Evgeni Krimer, Nachiappan Valliappan, Razik Ahmed, Sundeep
Korrapati, Song Zhang, Zahidul Haq, Matthew Halpern, Cruz Monrreal II, Pohan
Wu, Saugata Bhattacharyya, Dayo Lawal, Abhishek Agarwal, Sparsh Singhai,
Nagaraja Revanna, Mahesh Srinivasan, Victoria Bill, Alex Hsu, Dylan Zika, Chun-
Kai Chang, Zhao Zheng, Ce Wei, Kelsey Taylor Ball, Brandon Nguyen, Turan Vural,
Schuyler Christensen, Danny Vo, Justin Nguyen, Danial Rizvi, Armand Behroozi,
Vivian Tan, Anthony Bauer, Jun Qi Lau, Corey Cormier, Cody Horton, Youngchun
Kim, Ryan Chow, Cody Horton, Corey Cormier, and Dylan Zika. These teaching
assistants have contributed greatly to the contents of this book and particularly to its
laboratory assignments. Since 1981, I estimate I have taught embedded systems to
over 5000 students. My students have recharged my energy each semester with their
enthusiasm, dedication, and quest for knowledge. I have decided not to acknowledge
them all individually. However, they know I feel privileged to have had this
opportunity.
Next, I appreciate the patience and expertise of my fellow faculty members here at
the University of Texas at Austin. From a personal perspective Dr. John Pearce
provided much needed encouragement and support throughout my career. Over the
last few years, I have enjoyed teaching embedded systems with Drs. Ramesh
Yerraballi, Mattan Erez, Andreas Gerstlauer, and William Bard. Bill has contributed
to both the excitement and substance of our laboratory based on this book. Many of
the suggestions and corrections from Chris Shore and Drew Barbier of ARM about
Volume 1 applied equally to this volume. Austin Blackstone created and debugged the
Code Composer StudioTM versions of the example programs posted on the web.
Austin also taught me how to run the CC3000 and CC3100 Wifi examples on the
LaunchPad.
Ramesh Yerraballi and I have created two MOOCs, which have had over 110,000
students, and delivered to 110 countries. The new material in this book was
developed under the watchful eye of Professor Yerraballi. It has been an honor and
privilege to work with such a skilled and dedicated educator.
Andreas Gerstlauer has taught a course based on this book multiple times, and I have
incorporated many of his ideas into this edition of the book. Furthermore, you will
find a rich set of material if you search with these keywords Gerstlauer RTOS
utexas.
Sincerely, I appreciate the valuable lessons of character and commitment taught to me
by my parents and grandparents. I recall how hard my parents and grandparents
worked to make the world a better place for the next generation. Most significantly, I
acknowledge the love, patience and support of my wife, Barbara, and my children,
Ben Dan and Liz. In particular, Dan designed and tested most of the MSP432 and
TM4C software presented in this book.
By the grace of God, I am truly the happiest man on the planet, because I am
surrounded by these fine people.
Jonathan W. Valvano
Good luck
1. Computer Architecture

Chapter 1 objectives are to:


• Present a brief review of computer architecture
• Overview the ARM ® Cortex ™ -M processor including assembly
language
• Introduce the Texas Instruments MSP432/TM4C family of
microcontrollers

The overall objective of this book is to teach the design of real-time operating
systems for embedded systems. We define a system as real time if there is a
small and bounded delay between the time when a task should be completed
and when it is actually completed. We will present both fundamental principles
and practical solutions. Interfacing to the microcontroller was presented in
detail in Volume 2 and reviewed in the first two chapters of this book. The
overlap allows this book to stand alone as a text to teach embedded real time
operating systems. This first chapter will review the architecture of the Texas
Instruments MSP432/TM4C family of microcontrollers. When designing
operating systems, we need to understand the details of the architecture. In
particular, we must perform many functions in assembly language. Furthermore,
managing memory will require an intimate understanding of how the processor
accesses memory at the most basic level.
1.1. Introduction to Real-Time Operating Systems

1.1.1. Real-time operating systems


A computer system has many types of resources such as memory, I/O, data, and
processors. A real-time operating system (RTOS) is software that manages these
resources, guaranteeing all timing constraints are satisfied. Figure 1.1 illustrates the
relationship between hardware and software. On the left is a basic system without an
operating system. Software is written by a single vendor for a specific
microcontroller. As the system becomes more complex (middle figure), an operating
system facilitates the integration of software from multiple vendors. By providing a
hardware abstraction layer (HAL) an operating system simplifies porting
application code from one microcontroller to another. In order to provide additional
processing power, embedded systems of the future will require multiple
microcontrollers, processors with specialized coprocessors and/or a microcontroller
with multiple cores (right figure). Synchronization and assigning tasks across
distributed processors are important factors. As these systems become more
complex, the role of the operating system will be increasingly important.

Figure 1.1. An operating system is a software layer between the application


software and the hardware.

The RTOS must manage resources like memory, processor and I/O. The RTOS will
guarantee strict timing constraints and provide reliable operation. The RTOS will
support synchronization and communication between tasks. As complex systems are
built the RTOS manages the integration of components. Evolution is the notion of a
system changing to improve performance, features and reliability. The RTOS must
manage change. When designing a new system, it is good design practice to build a
new system by changing an existing system. The notion of portability is the ease at
which one system can be changed or adapted to create another system.
The response time or latency is the delay from a request to the beginning of the
service of that request. There are many definitions of bandwidth. In this book we
define bandwidth as the number of information bytes/sec that can be transferred or
processed. We can compare and contrast regular operating systems with real-time
operating systems.
Regular OS Real-time OS
Complex Simple
Best effort Guaranteed response
Fairness Strict timing constraints
Average bandwidth Minimum and maximum
limits
Unknown components Known components
Unpredictable behavior Predictable behavior
Plug and play Upgradable
Table 1.1. Comparison of regular and real-time operating systems.
From Table 1.1 we see that real-time operating systems have to be simple so they may be
predictable. While traditional operating systems gauge their performance in terms of
response time and fairness, real-time operating systems target strict timing constraints and
upper, lower bounds on bandwidth. One can expect to know all the components of the
system at design time and component changes happen much more infrequently.
Checkpoint 1.1: What does real time mean?

1.1.2. Embedded Systems


An embedded system is a smart device with a processor that has a special and
dedicated purpose. The user usually does not or cannot upgrade the
hardware/software or change what the system does. Real time means that the
embedded system must respond to critical events within a strictly defined time,
called the deadline. A guarantee to meet all deadlines can only be made if the
behavior of the operating system can be predicted. In other words the timing must be
deterministic. There are five types of software functions the processor can perform in
an embedded system. Similar to a general-purpose computer, it can perform
mathematical and/or data processing operations. It can analyze data and make
decisions based on the data. A second type involves handling and managing time: as
an input (e.g., measure period), an output (e.g., output waveforms), and a means to
synchronize tasks (e.g., run 1000 times a second). A third type involves real-time
input/output for the purpose of measurement or control. The fourth type involves
digital signal processing (DSP), which are mathematical calculations on data
streams. Examples include audio, video, radar, and sonar. The last type is
communication and networking. As embedded systems become more complex, how
the components are linked together will become increasingly important.
There are two classifications of embedded systems as shown in Figure 1.2. A
transformative system collects data from inputs, makes decisions, and affects its
environment by driving actuators. The robot systems presented in Chapter 10 are
examples of transformative systems. A reactive system collects data in a continuous
fashion and produce outputs also in a continuous fashion. Digital signal processing
algorithms presented in Chapter 6 are examples of reactive systems.

Figure 1.2. Embedded systems can transform or react to the environment.


Six constraints typify an embedded system. First, they are small size. For example,
many systems must be handheld. Second, they must have low weight. If the device is
deployed in a system that moves, e.g., attached to a human, aircraft or vehicle, then
weight incurs an energy cost. Third, they often must be low power. For example, they
might need to operate for a long time on battery power. Low power also impacts the
amount of heat they are allowed to generate. Fourth, embedded systems often must
operate in harsh environments, such as heat, pressure, vibrations, and shock. They
may be subject to noisy power, RF interference, water, and chemicals. Fifth,
embedded systems are often used in safety critical systems. Real-time behavior is
essential. For these systems they must function properly at extremely high levels of
reliability. Lastly, embedded systems are extremely sensitive to cost. Most
applications are profit-driven. For high-volume systems a difference in pennies can
significantly affect profit.
Checkpoint 1.2: What is an embedded system?
Checkpoint 1.3: List the six constraints typically found in an embedded system?
1.2. Computer Architecture

1.2.1. Computers, processors, and microcontrollers


Given that an operating system is a manager of resources provided by the underlying
architecture, it would serve the reader well to get acquainted with the architecture the
OS must manage. In this section we will delve into these details of the building
blocks of computer architecture, followed by the specifics of the ARM Cortex M4
processor architecture, in particular TI’s implementation of the ARM ISA found on
the TM4C and MSP432.
A computer combines a central processing unit (CPU), random access memory
(RAM), read only memory (ROM), and input/output (I/O) ports. The common bus in
Figure 1.3 defines the von Neumann architecture. Software is an ordered sequence
of very specific instructions that are stored in memory, defining exactly what and
when certain tasks are to be performed.

Figure 1.3. The basic components of a computer system include processor,


memory and I/O.
The CPU or processor executes the software by retrieving (from memory) and
interpreting these instructions one at a time. An ARM Cortex-M microcontroller
includes a processor, memory and input/output. The processor, memory and
peripherals are connected via multiple buses. Because instructions are fetched via
the ICode bus and data are fetched via the System bus, the Cortex M is classified as a
Harvard architecture. Having multiple busses allows the system to do several things
simultaneously. For example, the processor could be reading an instruction from
ROM using the ICode bus and writing data to RAM using the System bus.
The ARM Cortex-M processor has four major components, as illustrated in Figure
1.4. There are bus interface units (BIU) that read data from the bus during a read
cycle and write data onto the bus during a write cycle. The BIU always drives the
address bus and the control signals of the bus. The effective address register (EAR)
contains the memory address used to fetch the data needed for the current instruction.
Cortex-M microcontrollers execute Thumb instructions extended with Thumb-2
technology. An overview of these instructions will be presented in Section 1.5. Many
functions in an operating system will require detailed understanding of the
architecture and assembly language.
The control unit (CU) orchestrates the sequence of operations in the processor. The
CU issues commands to the other three components. The instruction register (IR)
contains the operation code (or op code) for the current instruction. When extended
with Thumb-2 technology, op codes are either 16 or 32 bits wide.
The arithmetic logic unit (ALU) performs arithmetic and logic operations. Addition,
subtraction, multiplication and division are examples of arithmetic operations.
Examples of logic operations are, and, or, exclusive-or, and shift. Many processors
used in embedded applications support specialized operations such as table lookup,
multiply and accumulate, and overflow detection.

Figure 1.4. The four basic components of a processor.


A very small microcomputer, called a microcontroller, contains all the components
of a computer (processor, memory, I/O) on a single chip. The Atmel ATtiny and the
TI TM4C123 are examples of microcontrollers. Because a microcomputer is a small
computer, this term can be confusing because it is used to describe a wide range of
systems from a 6-pin ATtiny4 running at 1 MHz with 512 bytes of program memory to
a personal computer with state-of-the-art 64-bit multi-core processor running at
multi-GHz speeds having terabytes of storage.
An application-specific integrated circuit (ASIC) is digital logic that solves a very
specific problem. See Figure 1.5. A field-programmable gate array (FPGA) is one
approach to ASIC prototyping, allowing you to program and reprogram the digital
logic. Verilog and VHDL are example FPGA programming environments. ASIC
design is appropriate for problems defined with logic and/or numerical equations.
On the other hand, microcontrollers are appropriate for problems solved with
algorithms or sequential processes. Mature problems with high volume can create
ASIC solutions directly as digital logic integrated circuits. On the other hand,
microcontrollers can be used for low-volume problems and have the advantage of
having a shorter time to market. Microcontrollers, because they are programmed with
software, allow a flexibility to upgrade features, provide user-tailored performance,
and solve problems with uncertain or changing requirements. Some systems have
both microcontrollers and ASICs.

Figure 1.5. A system implemented with an ASIC and I/O.


In an embedded system the software is converted to machine code, which is a list of
instructions, and stored in nonvolatile flash ROM. As instructions are fetched, they
are placed in a pipeline. This allows instruction fetching to run ahead of execution.
Instructions on the Cortex-M processor are fetched in order and executed in order.
However, it can execute one instruction while fetching the next. Many high-speed
processors allow out of order execution, support parallel execution on multiple
cores, and employ branch prediction.
On the ARM Cortex-M processor, an instruction may read memory or write memory,
but does not read and write memory in the same instruction. Each of the phases may
require one or more bus cycles to complete. Each bus cycle reads or writes one
piece of data. Because of the multiple bus architecture, most instructions execute in
one or two cycles. For more information on the time to execute instructions, see
Table 3.1 in the Cortex-M Technical Reference Manual.
Figure 1.6 shows a simplified block diagram of a microcontroller based on the ARM
Cortex-M processor. It is a Harvard architecture because it has separate data and
instruction buses.

Figure 1.6. Harvard architecture of an ARM Cortex-M-based


microcontroller.
The instruction set combines the high performance typical of a 32-bit processor with
high code density typical of 8-bit and 16-bit microcontrollers. Instructions are
fetched from flash ROM using the ICode bus. Data are exchanged with memory and
I/O via the system bus interface. There are many sophisticated debugging features
utilizing the DCode bus. An interrupt is a hardware-triggered software function,
which is extremely important for real-time embedded systems. The latency of an
interrupt service is the time between hardware trigger and software response. Some
internal peripherals, like the nested vectored interrupt controller (NVIC),
communicate directly with the processor via the private peripheral bus (PPB). The
tight integration of the processor and interrupt controller provides fast execution of
interrupt service routines (ISRs), dramatically reducing the interrupt latency.
Checkpoint 1.4: Why do you suppose the Cortex M has so many busses?
Checkpoint 1.5: Notice the debugger exists on the DCode bus. Why is this a good
idea?

1.2.2. Memory
One kibibyte (KiB) equals 1024 bytes of memory. The TM4C123 has 256 kibibytes
(218 bytes) of flash ROM and 32 kibibytes (215 bytes) of RAM. The MSP432 also has
256 kibibytes (218 bytes) of flash ROM but has 64 kibibytes (216 bytes) of RAM. We
view the memory as continuous virtual address space with the RAM beginning at
0x2000.0000, and the flash ROM beginning at 0x0000.0000.
The microcontrollers in the Cortex-M family differ by the amount of memory and by
the types of I/O modules. There are hundreds of members in this family; some of them
are listed in Table 1.2. The memory maps of TM4C123 and MSP432 are shown in
Figure 1.7. Although this course focuses on two microcontrollers from Texas
Instruments, all ARM Cortex-M microcontrollers have similar memory maps. In
general, Flash ROM begins at address 0x0000.0000, RAM begins at 0x2000.0000,
the peripheral I/O space is from 0x4000.0000 to 0x5FFF.FFFF, and I/O modules on
the private peripheral bus exist from 0xE000.0000 to 0xE00F.FFFF. In particular, the
only differences in the memory map for the various members of the Cortex-M family
are the ending addresses of the flash and RAM.
Part number RAM Flash I/O I/O modules
MSP432P401RIPZ 64 256 84 floating point, DMA
TM4C123GH6PM 32 256 43 floating point, CAN, DMA,
USB, PWM
TM4C1294NCPDT 256 1024 90 floating point, CAN, DMA,
USB, PWM, Ethernet
STM32F051R8T6 8 64 55 DAC, Touch sensor, DMA,
I2S, HDMI, PWM
MKE02Z64VQH2 4 64 53 PWM
KiB KiB pins
Table 1.2. Memory and I/O modules (all have SysTick, RTC, timers, UART, I2C, SSI, and
ADC).
Having multiple buses means the processor can perform multiple tasks in parallel.
On the TM4C123, general purpose input/output (GPIO) ports can be accessed using
either the PPB or AHPB. The following is some of the tasks that can occur in parallel
ICode bus Fetch opcode from ROM
DCode bus Read constant data from ROM
System bus Read/write data from RAM or I/O, fetch opcode from RAM
PPB Read/write data from internal peripherals like the NVIC
AHPB Read/write data from internal peripherals like the USB
Instructions and data are accessed using a common bus on a von Neumann machine.
The Cortex-M processor is a Harvard architecture because instructions are fetched
on the ICode bus and data accessed on the system bus. The address signals on the
ARM Cortex-M processor include 32 lines, which together specify the memory
address (0x0000.0000 to 0xFFFF.FFFF) that is currently being accessed. The
address specifies both which module (input, output, RAM, or ROM) as well as
which cell within the module will communicate with the processor. The data signals
contain the information that is being transferred and also include 32 bits. However,
on the system bus it can also transfer 8-bit or 16-bit data. The control signals specify
the timing, the size, and the direction of the transfer.

Figure 1.7. Memory map of the TM4C123 with 256k ROM and 32k RAM and
the MSP432 with 256k ROM and 64k RAM.
Checkpoint 1.6: What do we put in RAM and what do we put in ROM?
Checkpoint 1.7: Can software write into the ROM of our microcontroller?
The ARM Cortex-M processor uses bit-banding to allow read/write access to
individual bits in RAM and some bits in the I/O space. There are two parameters that
define bit-banding: the address and the bit you wish to access. Assume you wish to
access bit b of RAM address 0x2000.0000+n, where b is a number 0 to 7. The
aliased address for this bit will be
0x2200.0000 + 32*n + 4*b
Reading this address will return a 0 or a 1. Writing a 0 or 1 to this address will
perform an atomic read-modify-write modification to the bit.
If we consider 32-bit word-aligned data in RAM, the same bit-banding formula still
applies. Let the word address be 0x2000.0000+n. n starts at 0 and increments by 4.
In this case, we define b as the bit from 0 to 31. In little-endian format, bit 1 of the
byte at 0x2000.0001 is the same as bit 9 of the word at 0x2000.0000.The aliased
address for this bit will still be
0x2200.0000 + 32*n + 4*b
Examples of bit-banded addressing are listed in Table 1.3. Writing a 1 to location
0x2200.0018 will set bit 6 of RAM location 0x2000.0000. Reading location
0x2200.0024 will return a 0 or 1 depending on the value of bit 1 of RAM location
0x2000.0001.
RAM Offset Bit b Bit-banded
address n alias
0x2000.0000 0 0 0x2200.0000
0x2000.0000 0 1 0x2200.0004
0x2000.0000 0 2 0x2200.0008
0x2000.0000 0 3 0x2200.000C
0x2000.0000 0 4 0x2200.0010
0x2000.0000 0 5 0x2200.0014
0x2000.0000 0 6 0x2200.0018
0x2000.0000 0 7 0x2200.001C
0x2000.0001 1 0 0x2200.0020
0x2000.0001 1 1 0x2200.0024
Table 1.3. Examples of bit-banded addressing.
Checkpoint 1.8: What address do you use to access bit 3 of the byte at
0x2000.1010?
Checkpoint 1.9: What address do you use to access bit 22 of the word at
0x2001.0000?
The other bit-banding region is the I/O space from 0x4000.0000 through
0x400F.FFFF. In this region, let the I/O address be 0x4000.0000+n, and let b
represent the bit 0 to 7. The aliased address for this bit will be 0x4200.0000 + 32*n
+ 4*b
Checkpoint 1.10: What address do you use to access bit 7 of the byte at
0x4000.0030?
1.3. Cortex-M Processor Architecture

1.3.1. Registers
The registers on an ARM Cortex-M processor are depicted in Figure 1.8. R0 to R12
are general purpose registers and contain either data or addresses. Register R13
(also called the stack pointer, SP) points to the top element of the stack. Actually,
there are two stack pointers: the main stack pointer (MSP) and the process stack
pointer (PSP). Only one stack pointer is active at a time. In a high-reliability
operating system, we could activate the PSP for user software and the MSP for
operating system software. This way the user program could crash without disturbing
the operating system. Most of the commercially available real-time operating systems
available on the Cortex M will use the PSP for user code and MSP for OS code.
Register R14 (also called the link register, LR) is used to store the return location for
functions. The LR is also used in a special way during exceptions, such as interrupts.
Register R15 (also called the program counter, PC) points to the next instruction to
be fetched from memory. The processor fetches an instruction using the PC and then
increments the PC by the length (in bytes) of the instruction fetched.
Checkpoint 1.11: How are registers R13 R14 and R15 special?

Figure 1.8. The registers on the ARM Cortex-M processor.


The ARM Architecture Procedure Call Standard, AAPCS, part of the ARM
Application Binary Interface (ABI), uses registers R0, R1, R2, and R3 to pass input
parameters into a C function or an assembly subroutine. Also according to AAPCS
we place the return parameter in Register R0. The standard requires functions to
preserve the contents of R4-R11. In other words, functions save R4-R11, use R4-
R11, and then restore R4-R11 before returning. Another restriction is to keep the
stack aligned to 64 bits, by pushing and popping an even number of registers.
There are three status registers named Application Program Status Register (APSR),
the Interrupt Program Status Register (IPSR), and the Execution Program Status
Register (EPSR) as shown in Figure 1.9. These registers can be accessed
individually or in combination as the Program Status Register (PSR).

Figure 1.9. The program status register of the ARM Cortex-M processor.
The N, Z, V, C, and Q bits signify the status of the previous ALU operation. Many
instructions set these bits to signify the result of the operation. In general, the N bit is
set after an arithmetical or logical operation signifying whether or not the result is
negative. Similarly, the Z bit is set if the result is zero. The C bit means carry and is
set on an unsigned overflow, and the V bit signifies signed overflow. The Q bit is the
sticky saturation flag, indicating that “saturation” has occurred, and is set by
the SSAT and USAT instructions.
The T bit will always be 1, indicating the ARM Cortex-M processor is executing
Thumb instructions. The ICI/IT bits are used by interrupts and by IF-THEN
instructions. The ISR_NUMBER indicates which interrupt if any the processor is
handling. Bit 0 of the special register PRIMASK is the interrupt mask bit, or I bit. If
this bit is 1 most interrupts and exceptions are not allowed. If the bit is 0, then
interrupts are allowed. Bit 0 of the special register FAULTMASK is the fault mask
bit. If this bit is 1 all interrupts and faults are disallowed. If the bit is 0, then
interrupts and faults are allowed. The nonmaskable interrupt (NMI) is not affected by
these mask bits. The BASEPRI register defines the priority of the executing
software. It prevents interrupts with lower or equal priority from interrupting the
current execution but allows higher priority interrupts. For example if BASEPRI
equals 3, then requests with level 0, 1, and 2 can interrupt, while requests at levels 3
and higher will be postponed. The details of interrupt processing will be presented in
detail, later in the book.
Checkpoint 1.12: Where is the I bit and what does it mean?

1.3.2. Stack
Random documents with unrelated
content Scribd suggests to you:
with a sheen like the glancing of bright amber. My memory gave me
a thought full of beauty—a wild caprice of sentiment at such a time:

'The freshness of new hay is on thy hair,


And the withdrawing innocence of home
Within thine eye.'

'What has he been saying to you, Helga?'


'That he loves me,' she answered, now fixing her artless, tender
gaze upon me, though her blush lingered.
'A fine time to tell you such a thing! Does that sort of sea-captain
wait for a gale of wind to propose to a girl?' I exclaimed, with a
sudden irritation of jealousy tingling through me, and I looked at her
closely and suspiciously.
'I wanted to be angry, but could not,' said she. 'I hate the man, yet I
could not be angry with him. He spoke of his daughter—he did not
talk through his nose—he did not cant at all. Is "cant" the right
word? I felt sorry; I had not the heart to answer him in rudeness,
and to have risen and left him whilst he was speaking would have
been rudeness.'
I made a slight effort to disengage my arm from her clasp.
'He told me—no doubt you heard him,' said I—'he told me he
believed there would be no necessity to keep me long. He is a clever
man—a shrewd man. Well, after this I shall believe in all the
proverbs about women.'
'What do you mean?' she exclaimed in a startled voice, letting fall
her hands and staring at me.
'What do you mean?'
'Why, that I am sorry for the man, and hate him.'
'Oh! if you keep sorry long you will soon cease to hate him.'
'No, no!' she cried with a little passion, making as if to clasp my arm
afresh, and then shrinking. 'I could not help his coming here and
speaking to me.'
'That is true.'
'Why are you angry?'
Her gaze pleaded, her lips twitched, even as she looked at me her
blue eyes filled. Her grieved, pretty face, her wistful, tender, tearful
face, must have transformed my temper into impassioned pity, into
self-reproach, into keen self-resentment, even had there been solid
ground for vexation. I took her hand and lifted it to my lips.
'Forgive me; we have been much together. Our association and your
father's dying words make me think of you as mine until—until—the
long and short of it is, Helga, I am jealous!'
An expression of delight entered and vanished from her face. She
stood thoughtfully looking down on the deck. Just then
Punmeamootty entered to prepare the table for supper, and Helga
again went to the cabin window and stood looking out, lightly, with
unconscious ease and grace, swaying to the stormy heave of the
deck, with her hands clasped behind her in a posture of meditation.
CHAPTER IV.
A NIGHT OF HORROR.
The gale broke on the morning of Thursday, November 2. The
compacted heaven of cloud scattered in swelling cream-coloured
masses; the sun shone out of the wide lakes of moist blue, and the
sea turned from the cold and sickly gray of the stormy hours into a
rich sapphire, with a high swell and a plentiful chasing of foaming
billows. By four o'clock in the afternoon the ocean had smoothed
down into a tropical expanse of quietly rising and falling waters, with
the hot sun sliding westwards and the barque stemming the sea
afresh under all cloths which could be piled upon her, the wind a
small breeze, about west, and the sea-line a flawless girdle.
The evening that followed was one of quiet beauty. There was a
young moon overhead, with power enough to drop a little trickling of
silver into the dark sea under her; the clouds had vanished, and the
stars shone brightly with a very abundant showering of meteoric
lights above the trucks of the silent swaying masts.
As we paced the deck the Captain joined us. Short of going to our
respective cabins, there was no means of getting rid of him; so we
continued to patrol the planks, with him at Helga's side, talking,
talking—oh, Heaven! how he talked! His manner was distressingly
caressing. Helga kept hold of my arm, and meanwhile I, true to that
posture I had maintained for the past three days, listened or sent
my thoughts elsewhere, rarely speaking. In the course of his
ceaseless chatter he struck upon the subject of his crew and their
victuals, and told us he was sorry that we were not present when
Nakier and two other coloured men came aft into the cuddy after he
had taken sights and gone below.
'I am certain,' he exclaimed, smiting his leg, 'that I have made them
reflective! I believe I could not mistake. Nakier in particular listened
with attention, and looked at his mates with an expression as though
conviction were being slowly borne in upon him.'
I pricked up my ears at this, for here was a matter that had been
causing me some anxious thought, and I broke away from my
sullen, resentful behaviour to question him.
'What brought the men aft?'
'The same tiresome story,' he answered, speaking loudly, and
seemingly forgetful of or indifferent to the pair of yellow ears which,
I might warrant him, were thirstily listening at the helm. 'They ask
for beef, for beef, for nothing but beef, and I say yes—beef one day,
pork another; beef for your bodies and pork for your souls. I shall
conquer them; and what a triumph it will be! Though I should make
no further progress with them, yet I could never feel too grateful for
a decisive victory over a gross imbecile superstition that, like a
shutter, though it be one of many, helps to keep out the light.'
He then went on to tell us what he had said, how he had reasoned,
and I shall not soon forget the unctuous, self-satisfied chuckle which
broke from the folds of his throat as he paused before asking Helga
what she thought of that as an example of pure logic. I listened,
wondering that a man who could talk as he did could be crazy
enough to attempt so perilous an experiment as the attempting to
win his crew over to his own views of religion by as dangerous an
insult as his fanatical mind could have lighted upon. It was the more
incomprehensible to me in that the fellow had started upon his crude
missionary scheme when there were but two whites in the ship to
eleven believers in the Prophet.
I waited until his having to fetch breath enabled me to put in a
word. I then briefly and quietly related what had passed in the
forecastle as described to me by Jacob Minnikin.
'And what then, Mr. Tregarthen?' said he, and I seemed to catch a
sneer threading, so to speak, his bland utterance: the moon gave
but little light, as I have said, and I could not see his face. 'When a
man starts on the work of converting, he must not be afraid.'
'Your men have knives—they are devils, so I have heard, when
aroused—you may not be afraid, but you have no right to provoke
peril for us,' I said.
'The coxswain of a lifeboat should have a stout heart,' he exclaimed.
'Miss Nielsen, do not be alarmed by your courageous friend's
apprehension. My duty is exceedingly simple. I must do what is
right. Right is divinely protected;' and I saw by the pose of his head
that he cast his eyes up at the sky.
I nudged Helga as a hint not to speak, just breathlessly whispering,
'He is not to be reasoned with.'
It was a little before ten o'clock that night when the girl retired to
her cabin. The Captain, addressing her in a simpering, loverlike
voice, had importuned her to change her cabin. She needed to grow
fretful before her determined refusals silenced him. He entered his
berth when she had gone, and I took my pipe to enjoy a quiet
smoke on deck. After the uproar of the past three days, the serenity
of the night was exquisitely soothing. The moon shone in a curl of
silver; the canvas soared in pallid visible spaces starwards; there was
a pleasant rippling sound of gently stirred waters alongside, and the
soft westerly night-wind fanned the cheek with the warmth of an
infant's breath. The decks ran darkling forwards; the shadow of the
courses flung a dye that was deeper than the gloom of the hour
betwixt the rails, and nothing stirred save the low-lying stars which
slipped up and down past the forecastle rail under the crescent of
the foresail as the barque curtseyed.
Nevertheless, though I could not see the men, I heard a delicate
sound of voices proceeding from the block of darkness where the
forecastle front lay. Mr. Jones had charge of the watch, and, on my
stepping aft to the wheel, I found Jacob grasping the spokes, having
relieved the helm at four bells—ten o'clock. He was not to be
accosted while on that duty; and my dislike of the mate had not
been lessened by the few words which had passed between us since
the day when the Cape steamer had gone by, and by my observation
of his fawning behaviour to the Captain. I briefly exclaimed that it
was a fine night, received some careless, drowsy answer from him,
and, with pipe betwixt my lips, lounged lonely on the lee side of the
deck, often overhanging the rail, and viewing the sea-glow as it
crept by, with my mind full of Helga, of my home, of our experiences
so far, and of what might lie before us.
I was startled out of a fit of musing by the forecastle bell ringing
five. The clear, keen chimes floated like an echo from the sea, and I
caught a faint reverberation of them in the hollow canvas. It was
half-past ten. I knocked the ashes out of my pipe, and, going on to
the quarter-deck, dropped through the hatch.
The lantern swinging in the corridor betwixt the berths was burning.
I lightly called to Helga to know if all was well with her, but she was
silent, and, as I might suppose, asleep. I put out the light, as my
custom now was, and, partially unclothing myself in the dark, got
into my bunk and lay for a little watching the dance of a phantom
star or two in the dim black round of the scuttle close against my
head, sleepily wondering how long this sort of life was to continue,
what time was to pass, and how much was to happen before I
should be restored to the comfort of my own snug bedroom at
home; and thus musing, too drowsy perhaps for melancholy, I fell
asleep.
I was awakened by someone beating heavily upon the bulkhead of
the next-door cabin.
'Mr. Tregarthen! Mr. Tregarthen!' roared a voice; then thump! thump!
went the blows of a massive fist or handspike. 'For Gor' a'mighty's
sake wake up and turn out!—there's murder a-doing! Which is your
cabin?'
I recognised the voice of Abraham, disguised as it was by horror and
by the panting of his breath.
The exclamation, There's murder a-doing! collected my wits in a
flash, and I was wide awake and conscious of the man's meaning
ere he had fairly delivered himself of his cry.
'I am here—I will be with you!' I shouted, and, without pausing
further to attire myself, dropped from my bunk and made with
outstretched hands for the door, which I felt for and opened.
It was pitch dark in this passage betwixt the cabins, without even
the dim gleam the porthole in the berth offered to the eye to rest
on.
'Where are you, Abraham?' I cried.
'Here, sir!' he exclaimed, almost in my ear, and, lifting my hand, I
touched him.
'The crew's up!' he cried. 'They've killed the mate, and by this time, I
allow, the Capt'n's done for.'
'Where's Jacob?'
'Gor' He only knows, sir!'
'Are you armed? Do you grip anything?'
'Nothen, nothen. I run without stopping to arm myself. I'll tell ye
about it—but it's awful to be a-talking in this here blackness with
murder happening close by.'
He still panted as from heavy recent exertion, and his voice faltered
as though he were sinking from a wound.
'What is it?' cried the clear voice of Helga from her berth.
'Open your door!' I said, knowing that it was her practice to shoot
the bolt. 'All is darkness here. Let us in—dress yourself by feeling for
your clothes—the Malays have risen upon the Captain and mate—it
may be our turn next, and we must make a stand in your cabin.
Hush!'
In the interval of her quitting her bunk to open the door, I strained
my ears. Nothing was to be heard save near and distant noises
rising out of the vessel as she heeled on the long westerly swell. But
then we were deep down, with two decks for any noise made on the
poop to penetrate.
'The door is open,' said Helga.
I had one hand on Abraham's arm, and, feeling with the other, I
guided him into Helga's berth, the position of which, as he had never
before been in this part of the vessel, he could not have guessed. I
then closed the door and bolted it.
'Dress yourself quickly, Helga!' said I, talking to her in the mine-like
blindness of this interior that was untouched by the star or two that
danced in her cabin window as in mine.
'Tell me what has happened!' she exclaimed.
'Speak, Abraham!' said I.
'Lor'! but Oi don't seem able to talk without a light,' he answered.
'Ain't there no lantern here? If there's a lantern, I've got three or
four loocifers in my pocket.'
'Hist!' I cried. 'I hear footsteps.'
We held our breath: all was still. Some sound had fallen upon my
ear. It resembled the slapping of planks with naked feet to my fancy,
that had been terrified by Abraham's sudden horrible report, before
there was time for my muscles and nerves to harden into full waking
strength.
'What d'ye hear?' hoarsely whispered Abraham.
'It was imagination. Helga, can we light the lantern?'
She answered 'Yes'—she was ready.
'Strike a match, Abraham, that I may see where the lantern hangs!'
said I.
He did so, holding the flame in his fist. I opened the door, whipped
out, took down the lantern and darted in again, bolting the door
anew with a thrill of fear following upon the haste I had made
through imagination of one of those yellow-skins crouching outside
with naked knife in hand. I swiftly lighted the lantern, and placed it
in Helga's bunk. Abraham was of an ashen paleness, and I knew my
own cheeks to be bloodless.
'Ought we to fear the crew?' cried Helga. 'We have not wronged
them. They will not want our lives.'
'Dorn't trust 'em, dorn't trust 'em!' exclaimed Abraham. 'Ain't there
nothen here to sarve as weapons?' he added, rolling his eyes around
the cabin.
'What is the story? Tell it now, man, tell it!' I cried, in a voice
vehement with nerves.
He answered, speaking low, very hastily and hoarsely: 'Oi'd gone
below at eight bells. Oi found Nakier haranguing some of the men as
was in the fok'sle; but he broke off when he see me. Oi smoked a
pipe, and then tarned in and slep' for an hour or so; then awoke and
spied five or six of the chaps a-whispering together up in a corner of
the fok'sle. They often looked moy way, but there worn't loight
enough to let 'em know that my eyes was open, and I lay secretly a-
watching 'em, smelling mischief. Then a couple of 'em went on deck,
and the rest lay down. Nothen happened for some time. Meanwhile
Oi lay woide awake, listening and watching. 'Twas about seven bells,
Oi reckon, when someone—Oi think it was Nakier—calls softly down
through the hatch, and instantly all the fellows, who as I could ha'
swore was sound asleep, dropped from their hammocks like one
man, and the fok'sle was empty. I looked round to make sure that it
were empty, then sneaks up and looks aft with my chin no higher
than the coaming. I heered a loud shriek, and a cry of "O God! O
God! Help! help!" and now, guessing what was happening, and
believing that the tastin' of blood would drive them fellows mad, and
that Oi should be the next if Jacob worn't already gone, him being at
the wheel, as I might calculate by his not being forrard, Oi took and
run, and here Oi am.'
He passed the back of his hand over his brow, following the action
with a fling of his fingers from the wrist; and, indeed, it was now to
be seen that his face streamed with sweat.
'Do you believe they have murdered the Captain?' cried Helga.
'I dorn't doubt it—I can't doubt it. There seemed two gangs of 'em.
Oi run for my life, and yet I see two gangs,' answered Abraham.
'Horrible!' exclaimed the girl, looking at me with fixed eyes, yet she
seemed more shocked than frightened.
'Did not I foresee this?' I exclaimed. 'Where were your senses, man
—you who lived amongst them, ate and drank with them? It would
be bad enough if they were white men; but how stands our case, do
you think, in a ship seized by savages who have been made to hate
us for our creed and for the colour of our skins?'
'Hark!' cried Helga.
We strained our hearing, but nothing was audible to me saving my
heart, that beat loud in my ears.
'I thought I heard the sound of a splash,' she said.
'If they should ha' done for my mate, Jacob!' cried Abraham. 'As the
Lord's good, 'twill be too hard. Fust wan, then another, and now
nowt but me left of our little company as left Deal but a day or tew
ago, as it seems when Oi looks back.'
'Are we to perish here like poisoned rats in a hole?' said I. 'If they
clap the hatch-cover on, what's to become of us?'
'Who among them can navigate the ship?' asked Helga.
'Ne'er a one,' replied Abraham; 'that I can tell 'ee from recollecting
of the questions Nakier's asted me from toime to toime.'
'But if the body of them should come below,' cried I, 'and force that
door—as easily done as blowing out that light there—are we to be
butchered with empty hands, looking at them without a lift of our
arms, unless it be to implore mercy? Here are two of us—
Englishmen! Are we to be struck down as if we were women?'
'There are three of us!' said Helga.
'What are our weapons?' I exclaimed, wildly sweeping the little hole
of a cabin with my eyes. 'They have their knives!'
'Give me the handling of 'em one arter the other,' said Abraham,
fetching a deep breath and then spitting on his hands, 'and I'll take
the whole 'leven whilst ye both sit down and look on. But all of them
at wanst—all dronk with rage and snapping round a man as if he
was a sheep and they wolves!'—he breathed deeply again, slowly
shaking his head.
'The planks in that bunk are loose,' said I, 'but what can we do with
boards?'
'I will go on deck!' suddenly exclaimed Helga.
'You?' cried I. 'No, indeed! You will remain here. There must be two
of us for them to deal with before the third can be come at!'
'I will go on deck!' she repeated. 'I have less cause to fear them
than you. They know that I am acquainted with navigation—they
have always looked at me with kindness in their faces. Let me go
and talk to them!'
She made a step to the door—I gripped her arm, and brought her to
my side and held her.
'What is to be done is for us two men to do!' said I. 'We must think,
and we must wait.'
'Let me go!' she cried. 'They will listen to me, and I shall be able to
make terms. Unless there be a navigator among them, what can
they do with the ship in this great ocean?' She struggled, crying
again: 'Let me go to them, Hugh!'
'Dorn't you do nothen of the sort, sir!' exclaimed Abraham. 'What'd
happen? They'd tarn to and lock her up until they'd made an end of
you and me, and then she'd be left alone aboard this wessel—alone,
I mean, with eleven yaller savages. Gor' preserve us! If you let go of
her, sir, Oi shall have to stop the road.'
There was something of deliberateness in his speech: his English
spirit was coming back with the weakening of the horror that had
filled him when he first came rushing below.
Someone knocked lightly on the door. At the same instant my eye
was taken by the glance of lamp or candle flame in the opening in
the bulkhead overlooking the narrow passage.
'Hush!' cried I.
The knock was repeated. It was a very soft tapping, as though made
by a timid knuckle.
'Who is there?' I shouted, gathering myself together with a
resolution to leap upon the first dark throat that showed; for I
believed this soft knocking—this soundless approach—a Malay ruse,
and my veins tingled with the madness that enters the blood of a
man in the supreme moment whose expiry means life or death to
him.
'It is me, master! Open, master! It is allee right!'
'That's Nakier!' exclaimed Abraham.
'Who is it?' I cried.
'Me, sah—Nakier. It is allee right, I say. Do not fear. Our work is
done. We wish to speakee with you, and be friend.'
'How many of you are there outside?' I called.
'No man but Nakier,' he answered.
'How are we to know that?' bawled Abraham. 'The most of you have
naked feet. A whole army of ye might sneak aft, and no one guess
it.'
'I swear Nakier is alone. Lady, you shall trust Nakier. Our work is
done; it is allee right, I say. See, you tink I am not alone: you are
afraid of my knife; go a leetle way back—I trow my knife to you.'
We recoiled to the bulkhead, and Abraham roared 'Heave!' The knife
fell upon the deck close to my feet. I pounced upon it as a cat upon
a mouse, but dropped it with a cry. 'Oh, God, it is bloody!'
'Give it me!' exclaimed Abraham, in a hoarse shout; 'it'll be bloodier
yet, now I've got it, if that there Nakier's a-playing false.'
Grasping it in his right hand, he slipped back the bolt, and opened
the door. The sensations of a lifetime of wild experiences might have
been concentrated in that one instant. I had heard and read so
much about the treachery of the Malay that when Abraham flung
open the little cabin door I was prepared for a rush of dusky shapes,
and to find myself grappling—but not for life, since death I knew to
be certain, armed as every creature of them was with the deadly
blade of the sailor's sheath knife. Instead—in the corridor,
immediately abreast of our cabin, holding a bull's-eye lamp in his
hand, stood Nakier, who on seeing us put the light on the deck, and
saluted us by bringing both hands to his brow. Abraham put his
head out.
'There ain't nobody here but Nakier!' he cried.
'What have you done?' I exclaimed, looking at the man, who in the
combined light showed plainly, and whose handsome features had
the modest look, the prepossessing air, I had found when my gaze
first rested on him in this ship.
'The Captain is kill—Pallunappachelly, he kill him. The mate is kill—
with this han'.' He held up his arm.
'Where's moy mate?' thundered Abraham.
'No man touch him. Jacob, he allee right. Two only.' He held up two
fingers. 'The Captain and Misser Jones. They treat us like dog, and
we bite like dog,' he added, showing his teeth, but with nothing
whatever of fierceness or wildness in his grin.
'What do you want?' I repeated.
'We wantchee you come speak with us. We allee swear on de Koran
not to hurt you, but to serve you, and you serve we.'
I stood staring, not knowing how to act.
'He is to be trusted,' said Helga.
'But the others?' I said.
'They can do nothing without us.'
'Without one of us. But the others!'
'We may trust them,' she repeated, with an accent of conviction.
Nakier's eyes, gleaming in the lantern-light, were bent upon us as
we whispered. He perceived my irresolution, and, once again putting
down the bull's-eye lamp on the deck, he clasped and extended his
hands in a posture of impassioned entreaty.
'We allee swear we no hurt you!' he cried in a voice of soft entreaty
that was absolutely sweet with the melody of its tones; 'dat beautiful
young lady—oh! I would kill here,' he cried, gesticulating as though
he would stab his heart, 'before dat good, kind, clever lady be harm.
Oh, you may trust us! We hab done our work. Mr. Wise, he be
Capt'n; you be gentleman—passengaire; you live upstair and be very
much comfortable. De beautiful young lady, she conduct dis ship to
Afric. Oh, no, no, no! you are allee safe. My men shall trow down
dere knives upon de table when you come, and we swear on de
Koran to be your friend, and you be friend to we.'
'Let's go along with him, Mr. Tregarthen,' said Abraham. 'Nakier, I
shall stick to this here knife. Where's moy mate Jacob? If 'ere a man
of ye's hurted him——'
'It is no time to threaten,' I whispered angrily, shoving past him.
'Come, Helga! Nakier, pick up that bull's-eye and lead the way, and,
Abraham, follow with that lantern, will you?'
In silence we gained the hatch. It lay open. Nakier sprang through
it, and, one after the other, we ascended. The wind had fallen
scantier since I was on deck last, and though the loftier canvas was
asleep, silent as carved marble, and spreading in spectral wanness
under the bright stars, there was no weight in the wind to hold
steady the heavy folds of the fore and main courses, which swung in
and out with the dull sound of distant artillery as the barque leaned
from side to side. The cuddy lamp was brightly burning, and the first
glance I sent through the open door showed me the whole of the
crew, as I for the instant supposed—though I afterwards found that
one of them was at the wheel—standing at the table, ranged on
either hand of it, all as motionless as a company of soldiers drawn
up on parade. Every dark face was turned our way, and never was
shipboard picture more startling and impressive than this one of
stirless figures, dusky fiery eyes, knitted brows, most of the
countenances hideous, but all various in their ugliness. Their caps
and queer headgear lay in a heap upon the table. Nakier entered
and paused, with a look to us to follow. Helga was fearlessly
pressing forwards. I caught her by the hand and cried to Nakier:
'Those men are all armed.'
He rounded upon them, and uttered some swift feverish sentence in
his native tongue. In a moment every man whipped out his knife
from the sheath in which it lay buried at the hip, and placed it upon
the table. Nakier again spoke, pronouncing the words with a
passionate gesture, on which Punmeamootty gathered the knives
into one of the caps and handed them to Nakier, who brought the
cap to Helga and placed it at her feet. On his doing this, Abraham
threw the blood-stained knife he held into the cap.
It was at that moment we were startled by a cry of 'Below there!'
'Whoy, it's Jacob!' roared Abraham, and stepping backwards and
looking straight up, he shouted, 'Jacob, ahoy! Where are ye, mate?'
'Up in the maintop, pretty nigh dead,' came down the leather-lunged
response from the silence up above.
'Thank God you're alive!' cried Abraham. 'It's all roight now—it's all
roight now.'
'Who's agoing to make me believe it?' cried Jacob.
I stared up, and fancied I could just perceive the black knob of his
head projected over the rim of the top.
'You can come down, Jacob,' I cried. 'All danger, I hope, is over.'
'Danger over?' he bawled. 'Whoy, they've killed the mate and
chucked him overboard, and if I hadn't taken to my heels and
jumped aloft they'd have killed me.'
'No, no—not true; not true, sah!' shrieked Nakier. 'Come down,
Jacob! It is allee right!'
'Where's the Captain?' cried Jacob.
'Him overboard!' answered Nakier. 'It is allee right, I say!'
A shudder ran through me as I glanced at the cabin which the
Captain had occupied. I cannot express how the horror of this
sudden, shocking, bloody tragedy was heightened by Nakier's cool
and easy acceptance of the deed, as though the two men whom he
and his had slain were less to his sympathies than had they been a
couple of fowls whose necks had been wrung.
'Pray come down, Jacob!' said Helga, sending her voice clear as a
bell into the silent towering heights. 'You, as well as Abraham, are to
be known as an Englishman.'
This little scornful stroke, which was extremely happy in that it was
unintelligible to Nakier and the others, had the desired effect.
'Why, if it is all right, then I suppose it be all right,' I heard Jacob
say, and a few moments after his figure, with 'longshore clumsiness,
came slowly down the rigging.
As he sprang from the bulwark rail on to the deck, he whipped off
his cap and dashed it down on to the planks, and with the utmost
agitation of voice and manner danced around his cap as he
vociferated while he flourished his fist at Abraham:
'Now, what did Oi say? All along Oi've been a-telling ye that that
there pork job was agoing to get our throats cut. Whoy didn't ye
stop it? Whoy didn't ye tell the Capt'n what you seed and knowed?
Froight! Whoy, I moight ha' died in that there top and rolled
overboards, and what yarn was ye going to give my missis as to my
hending, if so be as ever ye got ashore at Deal agin?'
He continued to shout after this fashion, meanwhile tumbling and
reeling about his cap as though it were a mark for him upon the
theatre of this deck on which to act his part. But though it appeared
a very ecstasy of rage in him, the outbreak seemed wholly due to
revulsion of feeling. Nakier stood motionlessly eyeing him; the
others also remained at table, all preserving their sentinel postures.
At last the fellow made an end, put his cap on, and was silent,
breathing hard.
'Will you come in, sah? Will you enter, lady? Misser Wise, it is allee
right. Come along, Jacob, my mate!'
Thus saying, Nakier re-entered the cuddy, and the four of us
followed him. There was a dark stain on the bare plank close against
the coaming or ledge of the door of the Captain's cabin. It was the
short, wild, startled sideways spring which Abraham gave that
caused me to look at it. The very soul within me seemed to shrink at
the sight.
Nakier exclaimed, 'It is easy to scrape out,' motioning with his little
delicately-shaped hand as though he scraped. He then addressed
one of the fellows at the table, who nodded, sweeping the air with
his arm as he did so.
It now occurred to me, with the marvellous swiftness of thought,
that the cap containing the men's knives still lay upon the deck
where Nakier had lodged it at Helga's feet, and the instant motion of
my mind was to return to the quarter-deck, pick the cap up, and
heave it over the rail. But I reflected that not only might an act of
this sort enrage the crew by losing them their knives—it would also
imply profound distrust on our part. I also considered that, if they
designed to kill us, they would be able to manage that business very
well without their knives—for there was the carpenter's tool-chest
forward, which would supply them with plenty of deadly weapons,
not to mention the cabin knives, which Punmeamootty had charge
of, and of which several were at all times to be found in the galley.
All this passed through my mind in the space that a man might
count five in, so amazing is the velocity of imagination; and my
resolution was formed in this matter even while I continued to
measure the few steps which separated the table from the cuddy
door.
Nakier went to the head of the table, and, putting his hand upon the
Captain's chair, exclaimed, bowing with inimitable grace to Helga as
he spoke:
'Will de sweet mees sit here?'
She passed along the little file of five men and took the chair. I do
not know whether she had seen that mark on the deck I have
spoken of. She was of a deathlike whiteness, but her eyes shone
spiritedly as she ran them over the coloured faces of the queer
figures erect on either hand the table, and never at any time since
the hour when the dawn showed me her pretty face aboard the
Anine, apparelled as she then was as a boy, had I observed more
composure and resolution in her countenance.
I stood close beside her, and Abraham and his mate were on her
right. Nakier went on gliding feet to the fore-end of the table and
said something to the men. What language he expressed himself in I
did not then, and still do not, know. The effect of his speech was to
cause the whole of them to extend their arms towards us with the
forefingers of both hands together. The posture, for the moment,
was absolutely as though to Nakier's command they had
simultaneously levelled firearms at us! Jacob fell back a step with a
growl of alarm.
'What is all this, Nakier?' I called out.
'It is to say we are all your brodders, sah. It is my country sign of
friendship.'
Their hands fell to their sides, but immediately afterwards Nakier
spoke again to them, whereupon every man levelled his forefingers,
as before, at Helga. Again Nakier spoke, and Punmeamootty left the
cuddy.
'I wish he'd talk English,' exclaimed Abraham, wiping his forehead.
'Who's to know what's agoing to happen?'
'It is allee right, Misser Wise,' said Nakier, with a soft smile, half of
reproach, half of encouragement. 'Punmeamootty hab gone to fetch
de Koran for we to swear to be true and not harm you.'
CHAPTER V.
A CONFERENCE.
There was now a pause. How am I to convey the dramatic character
of this interval of silence? The hush of the night worked like a spirit
in the vessel, and the silence seemed to be deepened rather than
disturbed by the dull, pinion-like beat of the mainsail swinging into
the mast, by the occasional creak breaking forth from some slightly
strained bulkhead, and by the half-muffled gurgling of some little lift
of dark water laving the barque's side. I could witness no temper in
the men. Wherever there lay a scowl, it was no more than a part of
the creature's make. Their faces were by this time familiar to me,
and I could not mistake. Custom had even diminished something of
the fierceness, and I may say the hideousness, of the lemon-
coloured man, whose corrugated brow and savage eyes had been
among the earliest details of this ship to attract my attention on
boarding her. Yet with the memory in me of what had just now been
enacted—with thoughts in me of two corpses scarcely yet cold
sinking, still sinking, at but a little distance from the vessel—these
men opposed a horribly formidable array of countenances to the
gaze. Their various dyes of complexion were deepened by the
lantern light; the grotesque character of their attire seemed to
intensify their tragic appearance. Their figures were as motionless as
though they were acting a part as statues in a stage representation.
At intervals one or another would look to right or left, but in the
main their eyes were directed our way, and were chiefly fixed upon
Helga.
Jacob stared as though in a dream; Abraham, with his under-jaw
hanging loose, appeared to be fascinated by Nakier. I longed to
plunge into this silence, so to speak, to expend in speech and
questions the emotions which were keeping my heart fiercely
beating; but I was held dumb by the notion that this stillness was a
part of the solemnities which were to be employed for the protection
of our lives.
Punmeamootty re-entered the cuddy holding a book. Nakier took it
from him, and, coming round to us, said:
'Look, lady! look, sah! You see dis is de Koran'—I observed that he
sometimes said de and sometimes the—'it is our religion. We swear
upon it. Look, to make sure!'
I received the volume, and examined it. It was a manuscript, bound
in leather, with a flap, and very elegantly ornamented on the sides
and back with some sort of devices in gold and colour. The writing
was in red, and every page was margined with a finely ruled red
line. What tongue it was written in I could not, of course, tell. I have
since supposed it was in Arabic; but for us it might as well have
been the Talmud as the Koran. I returned the book to Nakier.
'It is allee right, you see, sah,' he exclaimed, showing his
wonderfully white teeth in a smile of gentle, respectful
congratulation that put a deeper glow into his eyes and gave a new
beauty to his handsome features.
'It may be the Koran,' said I. 'I cannot tell. I will take your word.'
He turned to the men, and, with a passionate gesticulation,
addressed them; on which they shouted out all as one man:
'Yaas! yaas! Al-Koran! Al-Koran!'—nodding and pointing and writhing
and working with excess of Asiatic contortion.
'We are quite content,' said I.
Nakier withdrew to his end of the table, carrying the book with him.
He stood erect, blending the grace of a reposing dancer with an air
of reserved eagerness and enthusiasm.
'Lady and you, sah!' he exclaimed, while every dusky eye along the
table was fixed intently upon him, 'you sabbee why we kill de Capt'n
and Misser Jones? Them two bad men—them two wicked, shocking
men. They would make we poor Mussulmans sin, and would send
we to hell. And why? Dey not care at heart our soul for to save. We
came here for work: we gib dem dis for dere money'—he elevated
his clenched hands, and then gesticulated as though he pulled and
hauled—'not dis, which is Allah's,' striking his breast vehemently; by
which, I presume, he signified his spirit or conscience.
A rumbling murmur ran round the table. I should not have supposed
the fellows understood the man; but acquiescence was strong in
every tawny face, and a universal nod followed when he struck his
bosom.
'We not all Malay,' he continued, 'but we are all men, lady. We hab
feeling—we hab hunger; we drink and cry and laugh like you all who
are white and do not believe in de Prophet. We have killed dose two
shocking wicked men, and we are not sorry. No; it is justice!' he
added, with a sudden piercing rise in his melodious voice, and a
flush of the eye that was emphasized somewhat alarmingly by an
unconscious clutch of his hand at the empty sheath strapped to his
hip. But his manner instantly softened, and his voice sweetened
again, though his behaviour seemed, while it lasted, to exercise an
almost electrical influence over his people. They fluttered and
swayed to it like ears of wheat brushed by a wind, darting looks at
one another and at us. But this ceased on Nakier resuming his
former air.
'Dis ship,' said he, 'is boun' to Table Bay. Some of us belong to Cape
Town. Allee want to get to Afric, and dem as not belong to Cape
Town ship for dere own country. But dis ship must not steer for Cape
Town. When we arrive, it is asked, "Where is de Capt'n? Where is
Misser Jones?" and we must not tell,' said he, smiling.
'But where do you wish to go, then?' said I, almost oppressed by the
sudden simultaneous turning of the men's dark fiery eyes upon me.
'Near to Cape Town,' said he.
'But what do you call near to Cape Town?' I asked.
'Oh, dere will be a river—we find him. We anchor and go ashore and
walkee, walkee,' he exclaimed.
Helga gave a little start.
'What you and your mates wants is that we should put ye ashore
somewhere?' said Abraham.
'Yaas, dat's so,' called the fellow named Pallunappachelly.
'No, no!' cried Nakier, 'not somewhere, Misser Vise. Near Cape Town,
I say. Not too far for we to walkee.'
'But to set ye ashore, anyhow?' exclaimed Abraham.
The man nodded.
'I suppose you know, Nakier,' said I, with a sense of dismay pressing
like a weight upon my spirits, 'that this young lady and I wish to
return home? The Captain refused to part with us—he insisted on
carrying us with him—we have a home to return to. Surely you do
not intend that we should make the passage to the Cape in this
barque?'
'Who will navigate de ship?' said Nakier.
'Why, Mr. Wise will,' I exclaimed, turning upon the boatman.
'Blowed, then, if I dew!' cried Abraham, recoiling. 'What! along with
these—arter what's—'soides, I don't know nothen about longitude.'
'For mercy's sake, man, don't talk like that!' cried I. 'Miss Nielsen and
I must be transhipped.'
'So must Oi!' said Abraham.
'And Oi!' hoarsely shouted Jacob.
'What ees it you say?' exclaimed Nakier, smiling.
'Why, that we all of us wish to get aboard another vessel,' said I,
'and leave this barque in your hands to do whatever you like with.'
There was a sharp muttering of 'No, no!' with some fierce shaking of
heads on either side the table. Nakier made a commanding gesture
and uttered a few words in his own tongue.
'We must not speakee any ship, lady, and you, sah, and you, Misser
Vise, and Jacob, my mate. Cannot you tell why?'
'If you're going to keep us here for fear of our peaching,' cried
Abraham, 'there's me for wan as is ready to take moy oath that I'll
say nothen about what's happened, purwiding you safely set us
aboard another wessel.'
Nakier strained his ear, with a puzzled face. The language of Deal
was happily unintelligible to him, for which I was exceedingly
grateful, since nothing could be more imperilling than such talk as
this.
Helga, who all this while remained silent, seated in her chair, without
lifting her eyes to my face or turning her head, said softly, in little
more than a whisper, so that only I, who stood at her shoulder, could
catch her accents:
'You can see by their faces that they are resolved. All this has been
preconcerted. Their plans are formed, and they mean to have their
way. We must seem to consent. Let us agree, that they may take the
oath, otherwise our lives are not worth more than the Captain's or
the mate's.'
Nakier's glowing eyes were upon her, but, though the movements of
her lips might have been visible, it would seem to them as though
she whispered to herself. The conviction that she was absolutely
right in her advice came to me with her words. I needed but to
glance at the double line of determined faces to gather that
argument, that even hesitation would merely result in speedily
enraging the fellows; that they were not to be influenced by the
most reasonable of our wishes; that our lives had been spared in
order that we should convey them to a place of safety; and this, too,
I saw with the help of the illumination supplied by Helga's few words
—that, fully believing the girl qualified to navigate the vessel, they
might, if we provoked them, destroy the three of us and retain her,
counting upon their threats and her situation to achieve their ends.
I said in a hurried aside to the boatmen:
'Not a word now, from either of you! This must be left to me! If you
interfere, your blood will be on your own heads!'
Then, addressing Nakier:
'Your demands are these: the barque is to be navigated to some part
of the South African coast lying near to Table Bay?'
'Yaas, sah!' he answered, holding up one finger as though counting.
'The spot you wish to arrive at will have to be pointed out on the
chart.'
Up went a second finger, followed by another 'Yaas, sah!'
'We are not to communicate with passing ships?'
'Right, sah!' he added, nodding and smiling, and raising a third
finger.
'And then?' said I.
'Den,' said he, 'you swear to do dis and we swear by de Koran to be
true, and to serve you, and be your friend.'
'And if we refuse?' said I.
'Do not say it!' he cried, sweeping his hands forward as though to
repel the idea.
'There must be other conditions!' said I, talking with an air of
resolution which, I fear, was but poorly simulated. 'First as to the
accommodation?'
'I do not understand!' said Nakier.
'I mean, where are we to live?' I cried.
'Oh, here! oh, here!' he shouted, motioning round the cuddy; 'dis is
your room. No man of us come here.'
'And here I stop, tew,' said Abraham. 'No more of your forecastle for
me, mates!'
'Nor for me!' rumbled Jacob.
'Do not say so!' exclaimed Helga, turning hastily to address them.
'Be advised. Do not interfere. Let Mr. Tregarthen have his way.'
'And I suppose,' I continued, running my eyes over the rows of faces
till they settled on Nakier, 'that we shall be waited upon as usual,
and that we shall be as well cared for as when Captain Bunting was
alive?'
'Yaas, sah! yaas, sah!' said Nakier demonstratively, and
Punmeamootty shouted:
'Me wait allee same upon you and de sweet lady. Me sabbee what
you like. Me get dem room ready,' pointing to the mate's and the
Captain's cabins.
I shook my head with a shudder, then said softly to Helga, whose
gaze was bent on the table:
'Can you suggest anything further for me to say to them?'
'Nothing. Get them to take their oath.'
'Nakier,' I exclaimed, 'we consent to your proposals. Among us we
will navigate this ship for you. But first you and your mates will
swear by that Koran in which you believe—I suppose it is the Koran
——'
'Oh, yaas, yaas!' he cried, and there was a general chorus of
'yaases.'
'You must swear by that sacred book of yours not to harm us; to be
our friends; to serve us and do our bidding as though we were the
officers of this ship. Explain this to your men, and let them take the
oath in their and your country's fashion, and we shall be satisfied.'
On this he addressed them. I hear now his melodious voice and
witness his animated handsome face as he poured forth his rich
unintelligible syllables. It was difficult to look at the fellow and not
believe that he was some prince of his own nation. There was
nothing in his scarecrow clothes to impair the dignity of his mien and
the grace of his motions. I could conceive of him as a species of
man-serpent capable of fascinating and paralyzing with his
marvellous eyes, holding his victim motionless till he should choose
to strike. His influence over the others was manifestly supreme, and
I had no doubt whatever that the tragedy which had been enacted
was his, and wholly his, by the claim of creation and command.
While he talked I would here and there mark a dingy face with a
look of expostulation in it. The lamp swinging fairly over the table
yielded light enough to reveal expressions. When he had ceased
there was a little hubbub of voices, a running growl so to speak of
discontent. One cried out to him, and then another, and then a third,
but in notes of expostulation rather than temper.
Helga, without turning her head, said to me:
'I expect they wish us to swear too. Your bare assurance does not
satisfy them.'
The guess seemed a shrewd one, and highly probable, but the men's
talk was sheer Hebrew to the four of us. Nakier listened, darting
looks from side to side, then suddenly lifted both his hands in the
most dramatic posture of denunciation that could be imagined, and
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