diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/man.7.scd | 21 | ||||
| -rw-r--r-- | docs/verbs.7.scd | 39 |
2 files changed, 60 insertions, 0 deletions
diff --git a/docs/man.7.scd b/docs/man.7.scd new file mode 100644 index 0000000..88a5d4d --- /dev/null +++ b/docs/man.7.scd @@ -0,0 +1,21 @@ +MAN(7) + +# NAME + +man - user's manual + +# SUMMARY + +The operating system aims to be self documenting. As such a manual is written describing different aspects of the system in details in English. It is divided in multiple sections. + +# SECTIONS + +``` + 1. Utilities + 3. Libraries + 7. Miscellaneous +``` + +# TODO + +In this manual page, the sections may perhaps be organized differently.
\ No newline at end of file diff --git a/docs/verbs.7.scd b/docs/verbs.7.scd new file mode 100644 index 0000000..1598342 --- /dev/null +++ b/docs/verbs.7.scd @@ -0,0 +1,39 @@ +VERBS(7) + +# NAME + +verbs - an overview of the different verbs + +# VERBS + +The kernel codebase often makes use of the method pattern in order to codify logical operations on structures. This makes up for functions called x_verb where x represents the type of the object of the method. Some of these verbs, especially related to resource aquisition and initialization, are commonly used and are repertoried here. + +## Init + +The *init* verb initializes a structure; that is, upon success, it puts the object into a state for which it is safe to call other methods. The init operation may take zero or more arguments, depending on what is needed. + +The initialization function has the following signature: + + [int] x_init(X*, ...) + +where the return value can be used to communicate errors. See relevant documentation for implementation's meanings. + +The init operation *may* allocate resources needed to initialize members of the object, in such a case, said resources are said to be _owned_. The init operation may however not allocate memory for the structure. + +## Drop + +The *drop* verb is the opposite of the init verb: it puts the object in a state for which forgetting about it doesn't cause resource leaks: as such, it releases the object's owned resources. The state of the object after the drop operation is most often invalid and using a dropped objects is undefined behavior. + +The drop operation has the following signature: + + [int] x_drop(X*, ...) + +## Install + +The *install* verb places and initializes an object at a specified location *addr* in memory. + +The install operation has the following signature: + + X *x_install(void *addr, ...) + +A notable example of a structure that gets to be installed is the MemFramer (mem/framer.h). This frame allocator is notably used for managing physical memory. Since it can be used at times when heap allocation is not yet available, the structure can be installed at the beginning of free regions.
\ No newline at end of file |
