From 527a5ea7a896a9b00e0563abbbed7771a398971b Mon Sep 17 00:00:00 2001 From: aqua Date: Tue, 8 Nov 2022 10:46:07 +0200 Subject: Add python-sphinx docs --- doc.src/arch.rst | 14 ++++++++++++++ doc.src/conf.py | 28 ++++++++++++++++++++++++++++ doc.src/devices.rst | 33 +++++++++++++++++++++++++++++++++ doc.src/index.rst | 23 +++++++++++++++++++++++ doc.src/libk.rst | 17 +++++++++++++++++ doc.src/mem.rst | 32 ++++++++++++++++++++++++++++++++ doc.src/mem/constinit.rst | 4 ++++ 7 files changed, 151 insertions(+) create mode 100644 doc.src/arch.rst create mode 100644 doc.src/conf.py create mode 100644 doc.src/devices.rst create mode 100644 doc.src/index.rst create mode 100644 doc.src/libk.rst create mode 100644 doc.src/mem.rst create mode 100644 doc.src/mem/constinit.rst (limited to 'doc.src') diff --git a/doc.src/arch.rst b/doc.src/arch.rst new file mode 100644 index 0000000..44bc9e7 --- /dev/null +++ b/doc.src/arch.rst @@ -0,0 +1,14 @@ +============= +Architectures +============= + +i686 +==== +Supported are CPUs with PSE (Page Size Extentions) + +Building for i686 +----------------- +Requirements: + +* i686-elf-gcc `gcc-PKGBUILD `_ +* i686-elf-binutils `binutils-PKGBUILD `_ diff --git a/doc.src/conf.py b/doc.src/conf.py new file mode 100644 index 0000000..02bd18c --- /dev/null +++ b/doc.src/conf.py @@ -0,0 +1,28 @@ +# Configuration file for the Sphinx documentation builder. +# +# For the full list of built-in configuration values, see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Project information ----------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information + +project = 'glitch' +copyright = '2022, aqua@' +author = 'aqua@' +release = '0.0.0' + +# -- General configuration --------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration + +extensions = ['hawkmoth'] + +templates_path = ['_templates'] +exclude_patterns = [] + + + +# -- Options for HTML output ------------------------------------------------- +# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output + +html_theme = "sphinx_rtd_theme" +html_static_path = ['_static'] diff --git a/doc.src/devices.rst b/doc.src/devices.rst new file mode 100644 index 0000000..7c8b41d --- /dev/null +++ b/doc.src/devices.rst @@ -0,0 +1,33 @@ +======= +Devices +======= + +VGA +=== + +Text mode +--------- +osdev wiki: `Text UI `_ + +.. c:autodoc:: ../devices/vga.h + +PS/2 Controller +=============== +.. c:autodoc:: ../devices/ps2_controller.h + +Keyboard +-------- +.. c:autodoc:: ../devices/keyboard.h + +Mouse +----- +.. c:autodoc:: ../devices/mouse.h + +Programmable Interrupt Controller +================================= +.. c:autodoc:: ../devices/pic.h + +UART +==== +.. c:autodoc:: ../devices/uart_16550.h + diff --git a/doc.src/index.rst b/doc.src/index.rst new file mode 100644 index 0000000..b62b1ad --- /dev/null +++ b/doc.src/index.rst @@ -0,0 +1,23 @@ +.. glitch documentation master file, created by + sphinx-quickstart on Mon Nov 7 17:29:02 2022. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to the glitch documentation +=================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + arch + libk + devices + mem + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`search` diff --git a/doc.src/libk.rst b/doc.src/libk.rst new file mode 100644 index 0000000..7c30f41 --- /dev/null +++ b/doc.src/libk.rst @@ -0,0 +1,17 @@ +==== +libk +==== + +libk is the kernel's C standard library implementation. + +stdio.h +======= +.. c:autodoc:: ../lib/stdio.h + +stdlib.h +======== +.. c:autodoc:: ../lib/stdlib.h + +string.h +======== +.. c:autodoc:: ../lib/string.h diff --git a/doc.src/mem.rst b/doc.src/mem.rst new file mode 100644 index 0000000..2dd86a9 --- /dev/null +++ b/doc.src/mem.rst @@ -0,0 +1,32 @@ +================= +Memory management +================= + +A frame is a fixed-sized block of physical memory. A page is a fixed-size block of virtual memory. Both are of the same size (4kB). + +Physical memory allocator +========================= +The FrameAllocator takes a bitmap describing available physical memory and allocates free frames. There is one global +instance. + +Virtual memory allocator +======================== +The PageAllocator takes allocated Frames and mounts them in virtual memory. + +.. table:: Virtual address space layout + :widths: auto + + ============== ==================== =========== + address symbol description + ============== ==================== =========== + ``ffff ffff`` virtual memory end + ``d000 0000`` MMIO + ``c040 0000`` kernel allocator + page-aligned ``__data_begin`` + page-aligned ``__bss_begin`` + page-aligned ``__rodata_begin`` + ``c000 0000`` ``__text_begin`` kernel text + ``0000 0000`` virtual memory start + ============== ==================== =========== + +.. include:: mem/constinit.rst diff --git a/doc.src/mem/constinit.rst b/doc.src/mem/constinit.rst new file mode 100644 index 0000000..7e069bf --- /dev/null +++ b/doc.src/mem/constinit.rst @@ -0,0 +1,4 @@ +constinit section +================= + +``constinit`` is a part of ``.rodata`` -- cgit v1.2.1