Skip to content

Commit 6715c6f

Browse files
bors[bot]bradjc
andcommitted
Merge tock#1130
1130: docs: Collection of small updates r=ppannuto a=bradjc ### Pull Request Overview This pull request makes a few changes to the docs to update details which have changed over time or could be a little more clear. ### Testing Strategy n/a ### TODO or Help Wanted n/a ### Documentation Updated - [x] Updated the relevant files in `/docs`, or no updates are required. ### Formatting - [x] Ran `make formatall`. Co-authored-by: Brad Campbell <[email protected]>
2 parents 757f1e6 + c89dd68 commit 6715c6f

File tree

5 files changed

+35
-39
lines changed

5 files changed

+35
-39
lines changed

doc/Lifetimes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ lifetime of that reference. For example:
3434

3535
```rust
3636
struct Foo<'a> {
37-
bar: &'a Bar
37+
bar: &'a Bar
3838
}
3939
```
4040

@@ -47,7 +47,7 @@ forever, regardless of how long the containing type (e.g. `Foo`) lives:
4747

4848
```rust
4949
struct Foo {
50-
bar: &'static Bar
50+
bar: &'static Bar
5151
}
5252
```
5353

doc/Memory_Layout.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Memory Layout
22
=============
33

44
This document describes how the memory in Tock is structured and used for the
5-
kernel, applications, and supporting state.
5+
kernel, applications, and supporting state.
66

77
<!-- npm i -g markdown-toc; markdown-toc -i Memory_Layout.md -->
88

@@ -59,7 +59,7 @@ valid process is set to all 0x00 or 0xFF.
5959

6060
## RAM
6161

62-
The RAM holds the data currently being used by both the kernel and processes.
62+
The RAM holds the data currently being used by both the kernel and processes.
6363

6464
### Kernel RAM
6565
The kernel RAM contains three major regions:
@@ -106,4 +106,4 @@ others. The structure of its flash and RAM is as follows.
106106

107107
| Address Range | Length (bytes) | Content | Description |
108108
|-----------------------|----------------|--------------------|---------------------------------------------------------------------------------------------------|
109-
| 0x20000000-0x2000FFFF | 64k | Kernel and app RAM | The kernel links with all of the RAM, and then allocates a buffer internally for application use. |
109+
| 0x20000000-0x2000FFFF | 64k | Kernel and app RAM | The kernel links with all of the RAM, and then allocates a buffer internally for application use. |

doc/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,4 @@ Tock Guides
4141

4242
### Courses and Tutorials
4343
- **[Courses](courses)** - Workshops on multiple aspects of Tock.
44-
- **[Tutorials](tutorials)** - Tutorials that walk through specific features of
45-
Tock.
44+
- **[Tutorials](tutorials)** - Tutorials that walk through specific features of Tock.

doc/Startup.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,15 @@ An example version of this loop is in `kernel/src/process.rs` as the
130130
process from the starting address in flash and with a given amount of memory
131131
remaining. If the header is validated, it tries to load the process into memory
132132
and initialize all of the bookkeeping in the kernel associated with the process.
133-
This can fail if the process needs more memory than is available on the chip. As
134-
a part of this load process, the kernel can also perform PIC fixups for the
135-
process if it was requested in the TBF header. If the process is successfully
136-
loaded the kernel importantly notes the address of the application's entry
137-
function which is called when the process is started.
133+
This can fail if the process needs more memory than is available on the chip. If
134+
the process is successfully loaded the kernel importantly notes the address of
135+
the application's entry function which is called when the process is started.
138136
139137
The load process loop ends when the kernel runs out of statically allocated
140138
memory to store processes in, available RAM for processes, or there is an
141139
invalid TBF header in flash.
142140
143141
## Scheduler Execution
144142
145-
The final thing that the reset handler must do is call `kernel::main()`. This
146-
starts the Tock scheduler and the main operation of the kernel.
143+
The final thing that the reset handler must do is call `kernel.kernel_loop()`.
144+
This starts the Tock scheduler and the main operation of the kernel.

doc/Userland.md

+24-25
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,16 @@ Applications in Tock are the user-level code meant to accomplish some type of
2828
task for the end user. Applications are distinguished from kernel code which
2929
handles device drivers, chip-specific details, and general operating system
3030
tasks. Unlike many existing embedded operating systems, in Tock applications
31-
are not built as one with the kernel. Instead they are entirely separate code
31+
are not compiled with the kernel. Instead they are entirely separate code
3232
that interact with the kernel and each other through [system
3333
calls](https://en.wikipedia.org/wiki/System_call).
3434

3535
Since applications are not a part of the kernel, they may be written in any
36-
language that can be compiled into code capable of running on ARM Cortex-M
37-
processors. While the Tock kernel is written in Rust, applications are commonly
38-
written in C. Additionally, Tock supports running multiple applications
39-
concurrently. Co-operatively multiprogramming is the default, but applications
40-
may also be time sliced. Applications may talk to each other via Inter-Process
41-
Communication (IPC) through system calls.
36+
language that can be compiled into code capable of running on a microcontroller.
37+
Tock supports running multiple applications concurrently. Co-operatively
38+
multiprogramming is the default, but applications may also be time sliced.
39+
Applications may talk to each other via Inter-Process Communication (IPC)
40+
through system calls.
4241

4342
Applications do not have compile-time knowledge of the address at which they
4443
will be installed and loaded. In the current design of Tock, applications must
@@ -49,9 +48,9 @@ of PIC for Tock apps is not a fundamental choice, future versions of the system
4948
may support run-time relocatable code.
5049

5150
Applications are unprivileged code. They may not access all portions of memory
52-
and may, in fact, fault if they attempt to access memory outside of their
53-
boundaries (similarly to segmentation faults in Linux code). In order to
54-
interact with hardware, applications must make calls to the kernel.
51+
and will fault if they attempt to access memory outside of their boundaries
52+
(similarly to segmentation faults in Linux code). To interact with hardware,
53+
applications must make calls to the kernel.
5554

5655

5756
## System Calls
@@ -96,30 +95,30 @@ timer fires. Specific state that you want the callback to act upon can be
9695
passed as the pointer `userdata`. After the application has started the timer,
9796
calls `yield`, and the timer fires, the callback function will be called.
9897

99-
It is important to note that `yield` must be called in order for events to be
100-
serviced in the current implementation of Tock. Callbacks to the application
101-
will be queued when they occur but the application will not receive them until
102-
it yields. This is not fundamental to Tock, and future version may service
103-
callbacks on any system call or when performing application time slicing. After
104-
receiving and running the callback, application code will continue after the
105-
`yield`. Tock automatically calls `yield` continuously for applications that
106-
return from execution (for example, an application that returns from `main`).
98+
It is important to note that `yield` must be called for events to be serviced in
99+
the current implementation of Tock. Callbacks to the application will be queued
100+
when they occur but the application will not receive them until it yields. This
101+
is not fundamental to Tock, and future version may service callbacks on any
102+
system call or when performing application time slicing. After receiving and
103+
running the callback, application code will continue after the `yield`.
104+
Applications which are "finished" (i.e. have returned from `main()`) should call
105+
`yield` in a loop to avoid being scheduled by the kernel.
107106

108107

109108
## Inter-Process Communication
110109

111110
IPC allows for multiple applications to communicate directly through shared
112111
buffers. IPC in Tock is implemented with a service-client model. Each app can
113-
support one service and the service is identified by the `PACKAGE_NAME` variable
114-
set in its Makefile. An app can communicate with multiple services and will get
115-
a unique handle for each discovered service. Clients and services communicate
116-
through shared buffers. Each client can share some of its own application memory
117-
with the service and then notify the service to instruct it to parse the shared
118-
buffer.
112+
support one service and the service is identified by its package name which is
113+
included in the Tock Binary Format Header for the app. An app can communicate
114+
with multiple services and will get a unique handle for each discovered service.
115+
Clients and services communicate through shared buffers. Each client can share
116+
some of its own application memory with the service and then notify the service
117+
to instruct it to parse the shared buffer.
119118

120119
### Services
121120

122-
Services are named by the `PACKAGE_NAME` variable in the application Makefile.
121+
Services are named by the package name included in the app's TBF header.
123122
To register a service, an app can call `ipc_register_svc()` to setup a callback.
124123
This callback will be called whenever a client calls notify on that service.
125124

0 commit comments

Comments
 (0)