diff --git a/.gitignore b/.gitignore index 8bd3272..984354f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ _site/ .sass-cache/ .jekyll-metadata Gemfile.lock +libs/ diff --git a/libs/ali/index.markdown b/libs/ali/index.markdown deleted file mode 100644 index 5e7adba..0000000 --- a/libs/ali/index.markdown +++ /dev/null @@ -1,5 +0,0 @@ ---- ---- - -## ali -A libc. diff --git a/libs/dmm/index.markdown b/libs/dmm/index.markdown deleted file mode 100644 index bd39ca9..0000000 --- a/libs/dmm/index.markdown +++ /dev/null @@ -1,12 +0,0 @@ ---- ---- - -## dmm - -A memory management library made for -[awooOS](https://github.com/awooos/awooos). - -## License - -The code is available as open source under the [MIT -License](https://github.com/awoos/dmm/raw/master/LICENSE.txt). diff --git a/libs/flail/index.markdown b/libs/flail/index.markdown deleted file mode 100644 index 135cfd0..0000000 --- a/libs/flail/index.markdown +++ /dev/null @@ -1,36 +0,0 @@ ---- ---- - -## flail - -A library for implementing kernel panics. - -### Requirements - -1. An `stddef.h` which defines `size_t`. -2. A `putchar()`-equivalent. It does not need to have any specific name. - * Accepts a single `int` and, presumably, prints it (after casting to an `unsigned char`). - * The return value isn't used, but I recommend following the POSIX/C standards. - -### Usage - -```c -##include /* Note: flail.h uses stddef.h. */ - -// Operating system information to include in the panic message. -const char *info_str = "Some Operating System v1.0"; - -int custom_putchar(int c) { - // Implement me! - return c; // It "worked." -} - -void kernel_main() { - flail_init(info_str, &custom_putchar); - flail_panic("oh no"); -} -``` - -### License - -The code is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). diff --git a/libs/greeter/index.markdown b/libs/greeter/index.markdown deleted file mode 100644 index 36c8ad2..0000000 --- a/libs/greeter/index.markdown +++ /dev/null @@ -1,25 +0,0 @@ ---- ---- - -## Greeter - -AwooOS's Greeter library listens for the `"greeter display"` event, -expecting to get a `char**`, and prints each string. - -### Usage - -Simplified example, based on how awooOS' HAL uses it: - -```c -char *os_name = "awooOS"; - -const char *greeting[] = { - os_name, - "\r\n", - "Compiled with: ", - &kernel_comment_start, - NULL -}; - -event_trigger("greeter display", &greeting); -``` diff --git a/libs/hal/index.markdown b/libs/hal/index.markdown deleted file mode 100644 index fc9d02c..0000000 --- a/libs/hal/index.markdown +++ /dev/null @@ -1,8 +0,0 @@ ---- ---- - -## HAL (Hardware Abstraction Layer) - -The duct tape that holds awooOS together. - -This needs to be split up a lot _and_ documented. diff --git a/libs/shell/index.markdown b/libs/shell/index.markdown deleted file mode 100644 index f9e17d9..0000000 --- a/libs/shell/index.markdown +++ /dev/null @@ -1,8 +0,0 @@ ---- ---- - -## AwooOS Shell - -An extremely shittastic shell that doesn't do much of anything. - -Relies on at least a libc, Ali (events + strings), and the HAL. diff --git a/libs/tests/index.markdown b/libs/tests/index.markdown deleted file mode 100644 index 39e7797..0000000 --- a/libs/tests/index.markdown +++ /dev/null @@ -1,6 +0,0 @@ ---- ---- - -## awooOS Tests - -Registers all the test functions, then runs Tinker. diff --git a/libs/tinker/index.markdown b/libs/tinker/index.markdown deleted file mode 100644 index 83193ec..0000000 --- a/libs/tinker/index.markdown +++ /dev/null @@ -1,69 +0,0 @@ ---- ---- - -## Tinker - -A low-level test framework for C code, which only requires a C11 -compiler and a pointer to a `putchar()`-compatible function. - -(It may work with a pre-C11 compiler, but this has not been tested.) - -Source: https://github.com/awooos/tinker -Issues: https://github.com/awooos/tinker/issues - - -This makes it incredibly useful for testing memory managers, a libc -implementation, and other things. - -### Usage - -TODO: Actual good documentation. - -For now, here's an example: - -``` -##include // for putchar() - -// unit test -void test_some_function() { - bool result = some_function(); - - if (result == 0) { - tinker_pass() - } else if (result == 1) { - tinker_fail("Failure reason #1."); - } else if (result == 2) { - tinker_fail("Failure reason #2."); - } -} - -// collection of assertions. -void test_math() { - tinker_assert(1 + 1 == 2); - tinker_assert(1 - 1 == 0); - tinker_assert(2 * 2 == 4); - tinker_assert(4 / 2 == 2); -} - -void test_unfinished() { - tinker_skip("Not implemented."); - return; - - // -} - -void add_tests() { - tinker_add_test(some_function); - tinker_add_test(math); - tinker_add_test(unfinished); -} - -int main() { - add_tests(); - tinker_run_tests(&putchar); -} -``` - -### License - -The code is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).