aboutsummaryrefslogtreecommitdiff
path: root/doc.src
diff options
context:
space:
mode:
Diffstat (limited to 'doc.src')
-rw-r--r--doc.src/arch.rst14
-rw-r--r--doc.src/conf.py28
-rw-r--r--doc.src/devices.rst33
-rw-r--r--doc.src/index.rst23
-rw-r--r--doc.src/libk.rst17
-rw-r--r--doc.src/mem.rst32
-rw-r--r--doc.src/mem/constinit.rst4
7 files changed, 151 insertions, 0 deletions
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 <https://neueland.iserlohn-fortress.net/cgit/glitch/i686-elf-gcc/>`_
+* i686-elf-binutils `binutils-PKGBUILD <https://neueland.iserlohn-fortress.net/cgit/glitch/i686-elf-binutils/>`_
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 <https://wiki.osdev.org/Text_mode>`_
+
+.. 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``