Skip to content

Commit a89b112

Browse files
committed
Clean Up Documentation
1 parent 831e0b5 commit a89b112

18 files changed

+242
-123
lines changed

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
44
and this project adheres to
55
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [Unreleased]
8+
9+
### Added
10+
- Documentation for existing Code
11+
12+
### Removed
13+
- Remove `make doc` functionality.
14+
15+
### Changed
16+
- Rewrite of docs/ subdirectory
17+
718
## [0.0.5] - 2022-09-10
819
### Added
920
- Raspberry Pi 4 Support (In Progress)
@@ -87,3 +98,11 @@ This is documenting the state of the kernel before CHANGELOG was implemented
8798
- Implemented `printf()`, `putchar()`, and `puts()` from stdio
8899
- Abstract Data Types
89100
- Ring Buffer
101+
102+
[Unreleased]: https://github.com/primis/apollo/compare/v0.0.5...HEAD
103+
[0.0.5]: https://github.com/primis/apollo/compare/0.0.4...v0.5.0
104+
[0.0.4]: https://github.com/primis/apollo/compare/0.0.3...0.0.4
105+
[0.0.3]: https://github.com/primis/apollo/compare/0.0.2...0.0.3
106+
[0.0.2]: https://github.com/primis/apollo/compare/0.0.1...0.0.2
107+
[0.0.1]: https://github.com/primis/apollo/compare/0.0.0...0.0.1
108+
[0.0.0]: https://github.com/primis/apollo/releases/tag/0.0.0

Makefile

+1-19
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@
66
# Git revision number
77
GIT_REV != git rev-parse --short HEAD 2>/dev/null |tr '[:lower:]' '[:upper:]'
88

9-
# Documentation
10-
MDSOURCES != find docs -type f -name '*.md'
11-
MARKDOWN := markdown
12-
HTMLDIR := html
13-
HTMLDOCS := $(patsubst docs/%.md,$(HTMLDIR)/%.html,$(MDSOURCES))
14-
HTMLDIRS := $(shell cd docs && find -type d | tr '\n' ' ')
15-
169
INCLUDEDIR != find src -type d -name "include" -printf "-I%p "
1710

1811
include .config
@@ -40,7 +33,7 @@ endif
4033
OBJECTS := $(patsubst %.o,$(BUILD)/%.o,$(OBJECTS))
4134
SRCDIR != find src/ -type d | tr '\n' ' '
4235

43-
all: $(BUILD)/apollo.iso doc
36+
all: $(BUILD)/apollo.iso
4437

4538
# C files are compiled universally the same, assembler targets are defined in
4639
# The target specific makefiles
@@ -62,17 +55,6 @@ clean:
6255
@find . -type d -name "build*" -exec rm -rf {} +
6356
@rm -rf $(HTMLDIR)
6457

65-
doc_setup:
66-
@mkdir -p $(HTMLDIR)
67-
@cd $(HTMLDIR) && mkdir -p $(HTMLDIRS)
68-
69-
doc: $(HTMLDOCS)
70-
71-
$(HTMLDIR)/%.html: docs/%.md
72-
@mkdir -p $(@D)
73-
@printf "\033[1mHTML\033[0m $<\n"
74-
$(MARKDOWN) $< > $@
75-
7658
menuconfig:
7759
@kconfig-mconf Kconfig
7860

docs/CONTRIBUTING.md

+14-13
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ interactions with the project.
1919
## Pull Request Process
2020

2121
1. Update CHANGELOG.md with details of the changes implemented. This includes
22-
any tests created as well
22+
any tests created as well.
2323
2. Don't break any old tests or functionality when updating unless the test has
24-
been determined to be wrong (requires discussion beforehand)
24+
been determined to be wrong. (requires discussion beforehand)
2525
3. Add tests for any new functionality in the appropriate `test` folder
2626
in the source tree. Tests should be comprehensive to make sure the kernel
2727
does not lose stability.
2828
4. Any commits *must* be gpg signed with a key associated with your account.
2929
This keeps a chain of custody to allow proper back tracking of commits.
30-
5. Pull requests should be flattened into a single commit.
30+
5. Pull requests should be flattened into a single commit where relevant.
3131
6. Recognize that all code will be considered under the license found in
3232
LICENSE.md, any code which cannot be legally distributed under this license
33-
will not be considered for pull requests
33+
will not be considered for pull requests.
3434

3535
## Coding style
3636
All code should follow the standard coding style enforced herein.
@@ -41,7 +41,8 @@ All code should follow the standard coding style enforced herein.
4141
2. K&R style bracing should be used consistently.
4242
3. Comments should be used, but not overused for obvious content. Comments
4343
should use the c++ `//` style except for file descriptors at the beginning
44-
of each file. Comments should not include any inappropriate or offensive
44+
of each file, and function description blocks, following the doxygen
45+
standard. Comments should not include any inappropriate or offensive
4546
language.
4647
4. Avoid monolithic functions. Indented code should never drop below 4 indents.
4748
Consider exposing that to a separate function or rewriting the logic at that
@@ -72,7 +73,7 @@ include:
7273
Examples of unacceptable behavior by participants include:
7374

7475
* The use of sexualized language or imagery and unwelcome sexual attention or
75-
advances
76+
advances
7677
* Trolling, insulting/derogatory comments, and personal or political attacks
7778
* Public or private harassment
7879
* Publishing others' private information, such as a physical or electronic
@@ -104,20 +105,20 @@ further defined and clarified by project maintainers.
104105
### Enforcement
105106

106107
Instances of abusive, harassing, or otherwise unacceptable behavior may be
107-
reported by contacting the project team at [email protected]. All
108-
complaints will be reviewed and investigated and will result in a response that
109-
is deemed necessary and appropriate to the circumstances. The project team is
110-
obligated to maintain confidentiality with regard to the reporter of an incident.
111-
Further details of specific enforcement policies may be posted separately.
108+
reported by contacting the project team at [email protected]. All complaints
109+
will be reviewed and investigated and will result in a response that is deemed
110+
necessary and appropriate to the circumstances. The project team is obligated to
111+
maintain confidentiality with regard to the reporter of an incident. Further
112+
details of specific enforcement policies may be posted separately.
112113

113114
Project maintainers who do not follow or enforce the Code of Conduct in good
114115
faith may face temporary or permanent repercussions as determined by other
115116
members of the project's leadership.
116117

117118
### Attribution
118119

119-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
120-
available at [http://contributor-covenant.org/version/1/4][version]
120+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
121+
version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
121122

122123
[homepage]: http://contributor-covenant.org
123124
[version]: http://contributor-covenant.org/version/1/4/

docs/arch.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Architectures
2+
=============
3+
4+
Tier 1 Support
5+
--------------
6+
Tier 1 support architectures are platforms which active development is
7+
considered vital to the movement of progress of the kernel.
8+
9+
* [x86-pc](arch/x86/pc)
10+
* [Raspberry Pi 4](arch/aarch64/rpi4)
11+
12+
Tier 2 Support
13+
--------------
14+
Tier 2 support architectures are platforms which develop on their own time.
15+
These are not needed to be feature complete for a release of the kernel.
16+
17+
* There are no Tier 2 Support architectures currently
18+
19+
Tier 3 Support
20+
--------------
21+
Tier 3 support architectures are platforms which are "on life support" so to
22+
speak. These are architectures which aren't currently compiling and have had no
23+
progress in that direction in over a year.
24+
25+
* There are no Tier 3 Support architectures currently
26+
27+
Create a New Architecture
28+
-------------------------
29+
* If there is a platform in which you want added to the apollo kernel support list
30+
please follow the [Create Your Own](arch/new-arch/Making-A-New-Arch)
31+
Architecture guide.

docs/arch/aarch64/rpi4.jpg

116 KB
Loading

docs/arch/aarch64/rpi4.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Raspberry Pi 4
2+
==============
3+
4+
![Raspberry Pi 4](rpi4.jpg)
5+
6+
Introduction
7+
------------
8+
9+
The Rasberry Pi 4 board is based on the BCM2711 System on a chip. It features
10+
a 1.5 GHz 64-bit quad core ARM Cortex-A72 processor, and 1-8 gigabytes of ram
11+
depending on the model.
12+
There are currently two Models being produced, The model B (shown above), and
13+
the mode 400, which is built into a keyboard case.
14+
15+
16+
Availible Drivers
17+
-----------------
18+
19+
* [16550 Compatible UART](../../../drivers/console/16550_uart/)
20+
- This is available via the GPIO header's UART0 on pins 8 and 10
21+

docs/arch/index.md

-7
This file was deleted.

docs/arch/new-arch/Making-A-Console-Driver.md

+21-20
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,38 @@ Creating a Console Driver
33

44
Introduction
55
-------------
6-
76
One of the essential parts of the boot process is a console terminal driver.
87
This driver allows the kernel to output early debug information before the
98
system comes online. The console driver is part of the kernel. The kernel
10-
defines console_write(), which allows a string to be outputted to console.
11-
12-
Inside the architecture folder itself, you must implement a function called
13-
void console_put(char). The Console driver will call this function to output
14-
a single charecter to the console device.
9+
defines access to logging functions but it is up to the architecture to create
10+
a console driver and initialize it.
1511

1612
Initialization
1713
---------------
18-
19-
The kernel will call archInit() before it attempts to use the Console driver.
20-
See [Making a New Architecture](Making-A-New-Arch.html) for more information
21-
about archInit().
14+
Calling `register_console()` is how you register a new console with the kernel.
15+
The only functions required to implement are `init()` and `write()`.
2216

2317
Control Charecters
2418
-------------------
19+
The kernel internally accepts ascii data for logging, but it also uses several
20+
ASCII control codes which should be implemented by your console:
2521

26-
console_put(char) accepts an ASCII charecter as input, but it should also
27-
support the following basic ascii control characters:
22+
\t Tab. This should move the cursor to the next tab indent.
23+
We recommend using 8 space tabs, though this is left up to
24+
the implementation.
2825

29-
\t or 0x09 : Tab. This should move the cursor to the next tab indent.
30-
We recommend using 8 space tabs, though this is left up to
31-
the implementation.
26+
\n Newline. This should drop to a new line, and also perform a
27+
carriage return back to Column 0.
3228

33-
\n or 0x0A : Newline. This should drop to a new line, and also perform a
34-
carriage return back to Column 0.
29+
\f Form feed. This should either clear the screen, or on a non-screen
30+
console, create some sort of page break like a horizontal rule
31+
does in html.
3532

36-
\f or 0x0C : Form feed: This should either clear the screen, or on a non-screen
37-
console, create some sort of page break like a horizontal rule
38-
does in html.
33+
\b Backspace. This should move the cursor backwards one character but not null
34+
out the character glyph at that location.
3935

36+
Color Codes
37+
-----------
38+
Parts of the kernel use ANSI escape codes for colors. If your console supports
39+
color codes, try to support them. If your console does not, these codes may need
40+
to be stripped out of the data stream.

docs/arch/new-arch/Making-A-New-Arch.md

+13-30
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Apollo Architectures : Creating a New one
44
Introduction
55
------------
66

7-
So You've decided to create a new archetecture support for the Apollo kernel?
7+
So You've decided to create a new architecture support for the Apollo kernel?
88
There is a few tasks to complete on your platform before Apollo will happily
99
run on top of it.
1010

@@ -16,54 +16,37 @@ items availible.
1616

1717
* Your platform has to be a 32 or 64 bit system. Apollo won't support 16 bit
1818
without massive core arch change.
19-
* A Console device of some kind for boot messages, be it serial, a screen
19+
* A console device of some kind for boot messages, be it serial, a screen
2020
buffer, or even a line printer.
2121
* Interrput capability. Without this, the system can't do syscalls from
2222
usermode.
2323
* A timer. The kernel uses this for scheduling, and timekeeping. High
24-
precision isn't needed, just at least 10KHz.
24+
precision isn't needed, just at least 1KHz.
2525

2626
Boot time
2727
---------
28-
29-
The Apollo kernel is a multiboot compliant kernel. The linker script tells
30-
multiboot to look for a symbol called 'start'.
31-
32-
The multiboot bootloader will be looking for a multiboot header, it's the
33-
job of the boot.s file (or equivilent) to provide that. The flags used in the
34-
Kernel should be:
35-
36-
* MULTIBOOT_MEMORY_INFO
37-
* MULTIBOOT_PAGE_ALIGN
38-
39-
You can find more about the multiboot header from the multiboot specification.
40-
41-
It is your responsibility to write a function called start
42-
28+
It is a requirement that you set up your system into a well known state.
4329
In your start function you should set up a stack, preferably at least 4k large.
44-
It is also start's task to pass the multiboot header to main, stop interrupts,
45-
and call main.
30+
It is also start's task to set up the stack, stop interrupts, and call main.
4631

4732
The stack should be aligned to a 32 byte boundary, in accordance to the SYSV
4833
ABI.
4934

5035
Drivers To Implement
5136
--------------------
5237

53-
When Apollo boots, it runs archInit() before doing kernel setup. archInit()
54-
should initialize all of the drivers listed below to a known state.
38+
After main has been called, Apollo enumerates all modules compiled within it and
39+
runs their init functions. The bare minimum a platform should support is:
5540

56-
* A [Console Driver](Making-A-Console-Driver.html). This is a character output
57-
device used to output the status of the kernel during bootup.
41+
* A [Console Module](Making-A-Console-Driver.html), implementing a console
42+
driver. This device used to output the status of the kernel during bootup.
5843

59-
* An Interrupt Vector Driver. This driver should expose a function for creating
44+
* An interrupt vector module. This driver should expose a function for creating
6045
interrupt functions for syscalls. The actual syscall interface is handled
6146
by the kernel.
6247

63-
* A Timer Driver. This should be a system timer that exposes functions to help
64-
with scheduling such as alarm() and getTicks().
48+
* A time keeping module. This should be a system timer that exposes functions to
49+
help with scheduling such as alarm() and getTicks().
6550

66-
* Memory handler Driver. This driver basically should give the kernel 4k pages
51+
* Memory handler driver. This driver basically should give the kernel 4k pages
6752
when requested. This is used internally to power malloc().
68-
69-

docs/arch/x86/pc.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
x86 PC
2+
======
3+
4+
Introduction
5+
------------
6+
7+
The IBM compatible PC has been around since the 80's. In respect to the Apollo
8+
kernel, this architecture specifically refers to 32 bit processors. Apollo
9+
currently targets i686+ processors. This places a lower bound on machines to
10+
around 1995 with the Pentium Pro.
11+
12+
Standard Porting Base
13+
---------------------
14+
Due to the ubiquity of this platform, it has been determined that the Apollo
15+
kernel shall be developed with it as it's porting base. This makes the x86 PC
16+
architecture a Tier 1 supported platform.
17+
18+
Availible Drivers
19+
-----------------
20+
21+
* [VGA Console](../../../drivers/console/vga/)
22+
* [16550 Compatible UART](../../../drivers/console/16550_uart/)
23+
* [Real Time Clock](../../../drivers/clock/rtc-cmos)
24+
* [Intel 8254 PIC](../../../drivers/clock/i8254)

docs/arch/x86/pc/index.md

-15
This file was deleted.

0 commit comments

Comments
 (0)