From fcf3fec67fa934d0c6964c785168167ab3cb7517 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Sun, 19 Jul 2020 11:45:00 +0200 Subject: Add current status --- .gitignore | 4 + Makefile | 21 + README.md | 32 ++ fix-links.lua | 4 + .../et-book-bold-line-figures.eot | Bin 0 -> 40888 bytes .../et-book-bold-line-figures.svg | 243 +++++++++ .../et-book-bold-line-figures.ttf | Bin 0 -> 70912 bytes .../et-book-bold-line-figures.woff | Bin 0 -> 45364 bytes .../et-book-display-italic-old-style-figures.eot | Bin 0 -> 39297 bytes .../et-book-display-italic-old-style-figures.svg | 244 +++++++++ .../et-book-display-italic-old-style-figures.ttf | Bin 0 -> 74464 bytes .../et-book-display-italic-old-style-figures.woff | Bin 0 -> 43780 bytes .../et-book-roman-line-figures.eot | Bin 0 -> 39628 bytes .../et-book-roman-line-figures.svg | 244 +++++++++ .../et-book-roman-line-figures.ttf | Bin 0 -> 71688 bytes .../et-book-roman-line-figures.woff | Bin 0 -> 44016 bytes .../et-book-roman-old-style-figures.eot | Bin 0 -> 39513 bytes .../et-book-roman-old-style-figures.svg | 244 +++++++++ .../et-book-roman-old-style-figures.ttf | Bin 0 -> 71380 bytes .../et-book-roman-old-style-figures.woff | Bin 0 -> 43900 bytes .../et-book-semi-bold-old-style-figures.eot | Bin 0 -> 40769 bytes .../et-book-semi-bold-old-style-figures.svg | 243 +++++++++ .../et-book-semi-bold-old-style-figures.ttf | Bin 0 -> 70824 bytes .../et-book-semi-bold-old-style-figures.woff | Bin 0 -> 45108 bytes html/style.css | 594 +++++++++++++++++++++ index.md | 88 +++ kernel.md | 158 ++++++ nord.theme | 225 ++++++++ 28 files changed, 2344 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 README.md create mode 100644 fix-links.lua create mode 100755 html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.eot create mode 100755 html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.svg create mode 100755 html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.ttf create mode 100755 html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.woff create mode 100755 html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot create mode 100755 html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.svg create mode 100755 html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf create mode 100755 html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff create mode 100755 html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.eot create mode 100755 html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.svg create mode 100755 html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.ttf create mode 100755 html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.woff create mode 100755 html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot create mode 100755 html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.svg create mode 100755 html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf create mode 100755 html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff create mode 100755 html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.eot create mode 100755 html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.svg create mode 100755 html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.ttf create mode 100755 html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.woff create mode 100644 html/style.css create mode 100644 index.md create mode 100644 kernel.md create mode 100644 nord.theme diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cbb539f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.vimwiki_tags +html/* +!html/style.css +!html/fonts diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..957671f --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +.PHONY: all clean + +WIKI_FILES := $(wildcard *.md) +HTML_FILES := $(patsubst %.md,html/%.html,$(WIKI_FILES)) + +all: $(HTML_FILES) + +clean: + $(RM) $(HTML_FILES) + +html/%.html: %.md html/style.css nord.theme fix-links.lua + @# TODO: change css path + pandoc $< \ + --from markdown \ + --css style.css \ + --toc \ + --highlight-style nord.theme \ + --lua-filter=fix-links.lua \ + --filter pandoc-sidenote \ + --section-divs \ + -so $@ diff --git a/README.md b/README.md new file mode 100644 index 0000000..b9ce0de --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +% WTF is Linux website + +This contains the source code of the WTF is Linux support website. + +Acknowledgements +---------------- + +These resources helped me create and design this website: + +[Pandoc](https://pandoc.org/) + +: Converts the Markdown into HTML and potentially other formats + +[pandoc-sidenote](https://github.com/jez/pandoc-sidenote/) + +: A Pandoc filter that generates the HTML for sidenotes + +[tufte-css](https://edwardtufte.github.io/tufte-css/) + +: A stylesheet for web articles (contains the CSS for sidenotes) + +[latex-css](https://latex.now.sh/) + +: A stylesheet for the LaTeX feel on the web + +[et-book](https://edwardtufte.github.io/et-book/) + +: The fonts used in this website, and in Tufte CSS + +[Nord theme](https://www.nordtheme.com/) + +: The palette used in this website diff --git a/fix-links.lua b/fix-links.lua new file mode 100644 index 0000000..e265e74 --- /dev/null +++ b/fix-links.lua @@ -0,0 +1,4 @@ +function Link(el) + el.target = el.target:gsub('%.md', '.html') + return el +end diff --git a/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.eot b/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.eot new file mode 100755 index 0000000..3610c74 Binary files /dev/null and b/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.eot differ diff --git a/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.svg b/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.svg new file mode 100755 index 0000000..1b1b7dd --- /dev/null +++ b/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.svg @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.ttf b/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.ttf new file mode 100755 index 0000000..9798360 Binary files /dev/null and b/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.ttf differ diff --git a/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.woff b/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.woff new file mode 100755 index 0000000..c6685a1 Binary files /dev/null and b/html/fonts/et-book-bold-line-figures/et-book-bold-line-figures.woff differ diff --git a/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot b/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot new file mode 100755 index 0000000..88a6c74 Binary files /dev/null and b/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot differ diff --git a/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.svg b/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.svg new file mode 100755 index 0000000..2a82d8a --- /dev/null +++ b/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.svg @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf b/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf new file mode 100755 index 0000000..9da91de Binary files /dev/null and b/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf differ diff --git a/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff b/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff new file mode 100755 index 0000000..b0e5b68 Binary files /dev/null and b/html/fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff differ diff --git a/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.eot b/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.eot new file mode 100755 index 0000000..22fff5b Binary files /dev/null and b/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.eot differ diff --git a/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.svg b/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.svg new file mode 100755 index 0000000..96ea45f --- /dev/null +++ b/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.svg @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.ttf b/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.ttf new file mode 100755 index 0000000..daceffb Binary files /dev/null and b/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.ttf differ diff --git a/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.woff b/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.woff new file mode 100755 index 0000000..440ae04 Binary files /dev/null and b/html/fonts/et-book-roman-line-figures/et-book-roman-line-figures.woff differ diff --git a/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot b/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot new file mode 100755 index 0000000..4ef9973 Binary files /dev/null and b/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.eot differ diff --git a/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.svg b/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.svg new file mode 100755 index 0000000..df40333 --- /dev/null +++ b/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.svg @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf b/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf new file mode 100755 index 0000000..5ae5198 Binary files /dev/null and b/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.ttf differ diff --git a/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff b/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff new file mode 100755 index 0000000..10eb336 Binary files /dev/null and b/html/fonts/et-book-roman-old-style-figures/et-book-roman-old-style-figures.woff differ diff --git a/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.eot b/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.eot new file mode 100755 index 0000000..bcc6f9d Binary files /dev/null and b/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.eot differ diff --git a/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.svg b/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.svg new file mode 100755 index 0000000..e5e41f1 --- /dev/null +++ b/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.svg @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.ttf b/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.ttf new file mode 100755 index 0000000..725af42 Binary files /dev/null and b/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.ttf differ diff --git a/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.woff b/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.woff new file mode 100755 index 0000000..5753ca4 Binary files /dev/null and b/html/fonts/et-book-semi-bold-old-style-figures/et-book-semi-bold-old-style-figures.woff differ diff --git a/html/style.css b/html/style.css new file mode 100644 index 0000000..bdb6739 --- /dev/null +++ b/html/style.css @@ -0,0 +1,594 @@ +/*! + * LaTeX.css (https://latex.now.sh/) + * + * Source: https://github.com/vincentdoerig/latex-css + * Licensed under MIT (https://github.com/vincentdoerig/latex-css/blob/master/LICENSE) + * Edit-by: Minijackson based on the Nord theme, the default VimWiki theme, and Tufte CSS +*/ + +/* +@font-face { + font-family: 'Latin Modern'; + font-style: normal; + font-weight: normal; + font-display: swap; + src: url('./fonts/LM-regular.woff2') format('woff2'), + url('./fonts/LM-regular.woff') format('woff'), + url('./fonts/LM-regular.ttf') format('truetype'); +} + +@font-face { + font-family: 'Latin Modern'; + font-style: italic; + font-weight: normal; + font-display: swap; + src: url('./fonts/LM-italic.woff2') format('woff2'), + url('./fonts/LM-italic.woff') format('woff'), + url('./fonts/LM-italic.ttf') format('truetype'); +} + +@font-face { + font-family: 'Latin Modern'; + font-style: normal; + font-weight: bold; + font-display: swap; + src: url('./fonts/LM-bold.woff2') format('woff2'), + url('./fonts/LM-bold.woff') format('woff'), + url('./fonts/LM-bold.ttf') format('truetype'); +} + +@font-face { + font-family: 'Latin Modern'; + font-style: italic; + font-weight: bold; + font-display: swap; + src: url('./fonts/LM-bold-italic.woff2') format('woff2'), + url('./fonts/LM-bold-italic.woff') format('woff'), + url('./fonts/LM-bold-italic.ttf') format('truetype'); +} +*/ + + +@font-face { + font-family: "et-book"; + src: url("fonts/et-book-roman-line-figures/et-book-roman-line-figures.eot"); + src: url("fonts/et-book-roman-line-figures/et-book-roman-line-figures.eot?#iefix") format("embedded-opentype"), url("fonts/et-book-roman-line-figures/et-book-roman-line-figures.woff") format("woff"), url("fonts/et-book-roman-line-figures/et-book-roman-line-figures.ttf") format("truetype"), url("fonts/et-book-roman-line-figures/et-book-roman-line-figures.svg#etbookromanosf") format("svg"); + font-weight: normal; + font-style: normal +} + +@font-face { + font-family: "et-book"; + src: url("fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot"); + src: url("fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.eot?#iefix") format("embedded-opentype"), url("fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.woff") format("woff"), url("fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.ttf") format("truetype"), url("fonts/et-book-display-italic-old-style-figures/et-book-display-italic-old-style-figures.svg#etbookromanosf") format("svg"); + font-weight: normal; + font-style: italic +} + +@font-face { + font-family: "et-book"; + src: url("fonts/et-book-bold-line-figures/et-book-bold-line-figures.eot"); + src: url("fonts/et-book-bold-line-figures/et-book-bold-line-figures.eot?#iefix") format("embedded-opentype"), url("fonts/et-book-bold-line-figures/et-book-bold-line-figures.woff") format("woff"), url("fonts/et-book-bold-line-figures/et-book-bold-line-figures.ttf") format("truetype"), url("fonts/et-book-bold-line-figures/et-book-bold-line-figures.svg#etbookromanosf") format("svg"); + font-weight: bold; + font-style: normal +} + +/* Box sizing rules */ +*, +*::before, +*::after { + box-sizing: border-box; +} + +/* Remove default margin */ +body, +h1, +h2, +h3, +h4, +p, +ul[class], +ol[class], +li, +figure, +figcaption, +dl, +dd { + margin: 0; +} + +/* Make default font-size 1rem and add smooth scrolling to anchors */ +html { + font-size: 1.4rem; + scroll-behavior: smooth; +} + +body { + font-family: /*'Latin Modern', Georgia, Cambria, 'Times New Roman', Times,*/ 'et-book', serif; + line-height: 1.8; + + max-width: 80ch; + min-height: 100vh; + overflow-x: hidden; + margin: 0 auto; + padding: 2rem 1.25rem; + + counter-reset: theorem; + counter-reset: definition; + counter-reset: sidenote-counter; + + color: #eceff4; + background-color: #2e3440; + + text-rendering: optimizeLegibility; +} + +/* Hyphenate all paragraphs */ +p { + /*text-align: justify;*/ + hyphens: auto; + -webkit-hyphens: auto; + -moz-hyphens: auto; + margin-top: 1rem; +} + +/* A elements that don't have a class get default styles */ +a:not([class]) { + text-decoration-skip-ink: auto; +} + +a, +a:visited { + color: #8fbcbb; +} + +a:focus { + outline-offset: 2px; + outline: 2px solid #81a1c1; +} + +/* Make images easier to work with */ +img { + max-width: 100%; + display: block; +} + +/* Inherit fonts for inputs and buttons */ +input, +button, +textarea, +select { + font: inherit; +} + +/* Prevent textarea from overflowing */ +textarea { + width: 100%; +} + +/* Natural flow and rhythm in articles by default */ +article > * + * { + margin-top: 1em; +} + +/* Styles for inline code or code snippets */ +code, +pre, +kbd { + font-family: /*Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New',*/ + monospace; + font-size: 85%; +} +/* inline code */ +:not(pre) > code { + background: #434c5e; + padding: 3px 6px; + border-radius: 3px; +} +pre { + padding: 1rem 1.4rem; + max-width: 100%; + overflow: auto; + border-radius: 4px; + background: #3b4252; +} +pre code { + font-size: 95%; + position: relative; +} +kbd { + background: #434c5e; + border: 1px solid #e5e9f0; + border-radius: 2px; + padding: 2px 4px; + font-size: 75%; +} + +/* Make table 100% width, add borders between rows */ +table { + border-collapse: collapse; + border-spacing: 0; + width: 100%; + max-width: 100%; +} +th, +td { + text-align: left; + padding: 0.5rem; +} +td { + border-bottom: 1px solid #d8dee9; +} +/* thead */ th { + border-bottom: 2px solid #e5e9f0; +} +tfoot th { + border-top: 2px solid #e5e9f0; +} + +/* Center align the title */ +h1:first-child { + text-align: center; +} + +/* Nested ordered list for ToC */ +nav ol, nav ul { + counter-reset: item; + padding-left: 2rem; +} +nav li { + display: block; +} +nav li:before { + content: counters(item, '.') ' '; + counter-increment: item; + padding-right: 0.85rem; +} + +/* Definitions */ +dl { + margin-top: 1rem; +} + +dt { + font-weight: bold; +} + +dd { + margin: 0 0 .8rem 2rem; +} + +/* Theorem */ +.theorem { + counter-increment: theorem; + display: block; + margin: 12px 0; + font-style: italic; +} +.theorem::before { + content: 'Theorem ' counter(theorem) '. '; + font-weight: bold; + font-style: normal; +} + +/* Lemma */ +.lemma { + counter-increment: theorem; + display: block; + margin: 12px 0; + font-style: italic; +} +.lemma::before { + content: 'Lemma ' counter(theorem) '. '; + font-weight: bold; + font-style: normal; +} + +/* Proof */ +.proof { + display: block; + margin: 12px 0; + font-style: normal; + position: relative; +} +.proof::before { + content: 'Proof. ' attr(title); + font-style: italic; +} +.proof:after { + content: '◾️'; + position: absolute; + right: -12px; + bottom: -2px; +} + +/* Definition */ +.definition { + counter-increment: definition; + display: block; + margin: 12px 0; + font-style: normal; +} +.definition::before { + content: 'Definition ' counter(definition) '. '; + font-weight: bold; + font-style: normal; +} + +/* Center align author name, use small caps and add vertical spacing */ +.author { + margin: 0.85rem 0; + font-variant-caps: small-caps; + text-align: center; +} + +/* Make footnote text smaller and left align it (looks bad with long URLs) */ +.footnotes p { + text-align: left; + line-height: 1.5; + font-size: 85%; + margin-bottom: 0.4rem; +} +.footnotes { + border-top: 1px solid hsl(0, 0%, 39%); +} + +/* Center title and paragraph */ +.abstract, +.abstract p { + text-align: center; +} +.abstract { + margin: 2.25rem 0; +} + +/* Format the LaTeX symbol correctly (a higher up, e lower) */ +.latex span:nth-child(1) { + text-transform: uppercase; + font-size: 0.75em; + vertical-align: 0.28em; + margin-left: -0.48em; + margin-right: -0.15em; + line-height: 1ex; +} + +.latex span:nth-child(2) { + text-transform: uppercase; + vertical-align: -0.5ex; + margin-left: -0.1667em; + margin-right: -0.125em; + line-height: 1ex; +} + +/* Heading typography */ +h1 { + font-size: 2.5rem; + line-height: 3.25rem; + margin-bottom: 1.625rem; +} + +h2 { + font-size: 1.7rem; + line-height: 2rem; + margin-top: 3rem; +} + +h3 { + font-size: 1.4rem; + margin-top: 2.5rem; +} + +h4 { + font-size: 1.2rem; + margin-top: 2rem; +} + +h5 { + font-size: 1rem; + margin-top: 1.8rem; +} + +h6 { + font-size: 1rem; + font-style: italic; + font-weight: normal; + margin-top: 2.5rem; +} + +h3, +h4, +h5, +h6 { + line-height: 1.625rem; +} + +h1 + h2 { + margin-top: 1.625rem; +} + +h2 + h3, +h3 + h4, +h4 + h5 { + margin-top: 0.8rem; +} + +h5 + h6 { + margin-top: -0.8rem; +} + +h2, +h3, +h4, +h5, +h6 { + margin-bottom: 0.8rem; +} + +blockquote { + color: #d8dee9; + margin: 0; + padding-left: 3em; + border-left: 0.5em #4c566a solid; + margin-top: 1rem; +} + +.todo { + font-weight: bold; + background-color: #bf616a; + font-size: 0.8em; + padding: 3px 6px; + border-radius: 3px; +} + +.tag { + background-color: #5e81ac; + font-family: monospace; + padding: 3px 6px; + border-radius: 3px; +} + +/* classes for items of todo lists */ + +.rejected { + /* list-style: none; */ + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAMAAAAMCGV4AAAACXBIWXMAAADFAAAAxQEdzbqoAAAAB3RJTUUH4QgEFhAtuWgv9wAAAPZQTFRFmpqam5iYnJaWnJeXnpSUn5OTopCQpoqKpouLp4iIqIiIrYCAt3V1vW1tv2xsmZmZmpeXnpKS/x4e/x8f/yAg/yIi/yQk/yUl/yYm/ygo/ykp/yws/zAw/zIy/zMz/zQ0/zU1/zY2/zw8/0BA/0ZG/0pK/1FR/1JS/1NT/1RU/1VV/1ZW/1dX/1pa/15e/19f/2Zm/2lp/21t/25u/3R0/3p6/4CA/4GB/4SE/4iI/46O/4+P/52d/6am/6ur/66u/7Oz/7S0/7e3/87O/9fX/9zc/93d/+Dg/+vr/+3t/+/v//Dw//Ly//X1//f3//n5//z8////gzaKowAAAA90Uk5T/Pz8/Pz8/Pz8/Pz8/f39ppQKWQAAAAFiS0dEEnu8bAAAAACuSURBVAhbPY9ZF4FQFEZPSKbIMmWep4gMGTKLkIv6/3/GPbfF97b3w17rA0kQOPgvAeHW6uJ6+5h7HqLdwowgOzejXRXBdx6UdSru216xuOMBHHNU0clTzeSUA6EhF8V8kqroluMiU6HKcuf4phGPr1o2q9kYZWwNq1qfRRmTaXpqsyjj17KkWCxKBUBgXWueHIyiAIg18gsse4KHkLF5IKIY10WQgv7fOy4ST34BRiopZ8WLNrgAAAAASUVORK5CYII=); + background-repeat: no-repeat; + background-position: 0 .2em; + padding-left: 1.5em; +} +.done0 { + /* list-style: none; */ + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAxQAAAMUBHc26qAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAA7SURBVCiR7dMxEgAgCANBI3yVRzF5KxNbW6wsuH7LQ2YKQK1mkswBVERYF5Os3UV3gwd/jF2SkXy66gAZkxS6BniubAAAAABJRU5ErkJggg==); + background-repeat: no-repeat; + background-position: 0 .2em; + padding-left: 1.5em; +} +.done1 { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAxQAAAMUBHc26qAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABtSURBVCiR1ZO7DYAwDER9BDmTeZQMFXmUbGYpOjrEryA0wOvO8itOslFrJYAug5BMM4BeSkmjsrv3aVTa8p48Xw1JSkSsWVUFwD05IqS1tmYzk5zzae9jnVVVzGyXb8sALjse+euRkEzu/uirFomVIdDGOLjuAAAAAElFTkSuQmCC); + background-repeat: no-repeat; + background-position: 0 .15em; + padding-left: 1.5em; +} +.done2 { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAxQAAAMUBHc26qAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAB1SURBVCiRzdO5DcAgDAVQGxjAYgTvxlDIu1FTIRYAp8qlFISkSH7l5kk+ZIwxKiI2mIyqWoeILYRgZ7GINDOLjnmF3VqklKCUMgTee2DmM661Qs55iI3Zm/1u5h9sm4ig9z4ERHTFzLyd4G4+nFlVrYg8+qoF/c0kdpeMsmcAAAAASUVORK5CYII=); + background-repeat: no-repeat; + background-position: 0 .15em; + padding-left: 1.5em; +} +.done3 { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAPCAYAAAA71pVKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAxQAAAMUBHc26qAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAABoSURBVCiR7dOxDcAgDATA/0DtUdiKoZC3YhLkHjkVKF3idJHiztKfvrHZWnOSE8Fx95RJzlprimJVnXktvXeY2S0SEZRSAAAbmxnGGKH2I5T+8VfxPhIReQSuuY3XyYWa3T2p6quvOgGrvSFGlewuUAAAAABJRU5ErkJggg==); + background-repeat: no-repeat; + background-position: 0 .15em; + padding-left: 1.5em; +} +.done4 { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAAQCAYAAAAbBi9cAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAzgAAAM4BlP6ToAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAIISURBVDiNnZQ9SFtRFMd/773kpTaGJoQk1im4VDpWQcTNODhkFBcVTCNCF0NWyeDiIIiCm82QoIMIUkHUxcFBg1SEQoZszSat6cdTn1qNue92CMbEr9Sey+XC/Z/zu+f8h6ukUil3sVg0+M+4cFxk42/jH2wAqqqKSCSiPQdwcHHAnDHH9s/tN1h8V28ETdP+eU8fT9Nt62ancYdIPvJNtsu87bmjrJlrTDVM4RROJs1JrHPrD4Bar7A6cpc54iKOaTdJXCUI2UMVrQZ0Js7YPN18ECKkYNQcJe/OE/4dZsw7VqNXQMvHy3QZXQypQ6ycrtwDjf8aJ+PNEDSCzLpn7+m2pD8ZKHlKarYhy6XjEoCYGcN95qansQeA3fNdki+SaJZGTMQIOoL3W/Z89rxv+tokubNajlvk/vm+LFpF2XnUKZHI0I+QrI7Dw0OZTqdzUkpsM7mZTyfy5OPGyw1tK7AFSvmB/Ks8w8YwbUYbe6/3QEKv0vugfxWPnMLJun+d/kI/WLdizpNjMbAIKrhMF4OuwadBALqqs+RfInwUvuNi+fBd+wjogfogAFVRmffO02q01mZZ0HHdgXIzdz0QQLPezIQygX6llxNKKgOFARYCC49CqhoHIUTlss/Vx2phlYwjw8j1CAlfAiwQiJpiy7o1VHnsG5FISkoJu7Q/2YmmaV+i0ei7v38L2CBguSi5AAAAAElFTkSuQmCC); + background-repeat: no-repeat; + background-position: 0 .15em; + padding-left: 1.5em; +} + +/* Tufte CSS, the sidenote part */ + +.sidenote, .marginnote { + float: right; + clear: right; + margin-right: -45ch; + width: 35ch; + margin-top: 0; + margin-bottom: 1rem; + font-size: 0.9rem; + line-height: 1.3; + color: #abb9cf; + border-top: 1px solid #4c566a; + border-bottom: 1px solid #4c566a; + /* no padding bottom to compensate extra
by pandoc-sidenote */ + padding-top: 1em; + position: relative; +} + +.sidenote-number { + counter-increment: sidenote-counter; +} + +.sidenote-number:after, .sidenote:before { + position: relative; + vertical-align: baseline; +} + +.sidenote-number:after { + content: counter(sidenote-counter); + font-size: 0.9rem; + top: -0.5rem; + left: 0.1rem; +} + +.sidenote:before { + content: counter(sidenote-counter) ":"; + font-size: 0.9rem; + position: absolute; + left: -2em; +} + +blockquote .sidenote, blockquote .marginnote { + margin-right: -82%; + min-width: 59%; + text-align: left; +} + +.marginnote > code, .sidenote > code { + font-size: 1rem; +} + +input.margin-toggle { + display: none; +} + +label.sidenote-number { + display: inline; +} + +label.margin-toggle:not(.sidenote-number) { + display: none; +} + +@media (max-width: 165ch) { + body { + padding: 2rem 1.25rem; + max-width: 80ch; + } + + section > p, section > footer, section > table, section > div { + width: 100%; + } + + label.margin-toggle:not(.sidenote-number) { + display: inline; + color: #8fbcbb; + } + + .sidenote, .marginnote { + display: none; + } + + .sidenote-number:after { + color: #a3be8c; + /*text-decoration: underline;*/ + } + + .margin-toggle:checked + .sidenote, + .margin-toggle:checked + .marginnote { + display: block; + float: left; + left: 1rem; + clear: both; + width: 95%; + margin: 1rem 2.5%; + vertical-align: baseline; + position: relative; + } + + label { + cursor: pointer; + } +} diff --git a/index.md b/index.md new file mode 100644 index 0000000..bd6fffb --- /dev/null +++ b/index.md @@ -0,0 +1,88 @@ +% WTF is Linux + +> What I cannot create, I do not understand. +> +> --- Richard Feynman, 1988 + +TODO: add the LM fonts referenced in the CSS + +TODO: reference a mono font in the CSS + +TODO: fix TOC CSS + +TODO: have a POSIX / UNIX / Linux section + +TODO: have a QEMU section + +TODO: specify dependencies + +TODO: Add a plan checklist? + +TODO: fix pandoc\'s vimwiki (syntax highlighting, quotes) + +TODO: Link manpages + +TODO: Add pretty pictures + +The Linux Kernel +---------------- + +Main article: [kernel](kernel.md) + +The Linux kernel is the glue between the hardware and the user space +programs. + +Each time a user program needs to access the hardware (e.g. hard drives, +network card), it has to go through the kernel through system calls (e.g. +read/write on a file, `sendto`/`recvfrom` on a socket). + +It also decides how processes are run, and is in charge of enforcing +security. + +The filesystem +-------------- + +TODO: link to main article + +A filesystem is a way of organizing data in the form of files and +directories. Another way to see it is that since hard drives stores only +bytes, it is the responsibility of the filesystem to organize these +bytes such that the kernel can interpret them as files and directories +and present them to the user (TODO: link mount). + +Init +---- + +TODO: link to main article + +The init program is the first user-space program that the kernel +launches on boot. Every other program is launched either by init or a +child of init (direct child or transitive child). Since init is the +first program launched it always has a PID of 1. + +TODO: link to first steps to "user-space booting" + +The Shell +--------- + +TODO: link to main article + +A shell is a programming language whose main goal is to launch other +programs. + +Special filesystems +------------------- + +Some filesystem aren't used to store data, but instead to communicate +with the kernel. This allows doing various things using only the +`read`, `write`, and other file-related system calls. + +For example, you can list USB devices by listing the content of the +directory `/sys/bus/usb/devices/`. + +TODO: add links to article with list of common special filesystems. + +Networking +---------- + +TODO: quickly explain static IP vs DHCP, networking interfaces diff --git a/kernel.md b/kernel.md new file mode 100644 index 0000000..db1680a --- /dev/null +++ b/kernel.md @@ -0,0 +1,158 @@ +% The Linux Kernel + +[back](index.md) + +TODO: A word about how the kernel is in charge of enforcing security + +TODO: Talk about `dmesg` + +Role +---- + +A kernel is a piece of software that is loaded at boot time. It is a +component that is responsible for "orchestrating" the OS in different +manners. There are different types of kernel in this world, and they may +have different responsibilities. We will be focusing solely on the role +of the Linux kernel here. + +### Hardware control and abstraction + +One goal for a kernel is to be the "glue" between the hardware and +other software. + +For example, let's suppose two pieces of software want to store data in +a hard drive. Without hardware control, if these two softwares were to +run concurrently, they both would try to control the spinning hard +drive, potentially trying to make it go in different directions. + +Without hardware control, each software would have to consciously and +constantly collaborate with each other to avoid conflict when accessing +each piece of hardware. + +With the Linux kernel accessing the hardware is gated by an API: each +software that wants to access the hard drive has to go use system calls +(e.g.: `read(2)` / `write(2)`), and the kernel will then schedule +these tasks sequentially. + +Another important point, is that without the Linux kernel, each piece of +software would have to care if the hard drive is a spinning disk, an +SSD, or a USB stick, or if is connected using a SATA cable, a USB cable, +etc. + +The Linux kernel allows us to not care about this, and provides us with +the filesystem abstraction, and mount points. To the software developer +doing a `read` on a file doesn't change if the file is stored on an +SSD or even on a network filesystem, because the kernel will check that +for us, and apply the appropriate logic. + +### Multitasking + +Another big role of the Linux kernel is to allow multiple programs to +run concurrently: the CPU doesn't have knowledge of processes or +threads, it just runs binary code. + +Let's say we have a CPU with 4 cores. That means that the CPU can truly run +only 4 tasks in parallel. + +As a user with this CPU, this doesn't impact me that I'm running a graphical +interface, a web browser, a mail client, a terminal window, and a video player. +Each of these 5 applications feels responsive even if the CPU can only run 4 of +them at the time. + +This is because the kernel is responsible for switching the tasks that the CPU +runs (a.k.a. scheduling). Theses tasks / applications are switched quickly and +in such a way that they feel responsive to the user. + +The Linux kernel also provides developers with another abstraction to +execute tasks concurrently: threads. Threads are akin to having multiple +processes, except that when scheduled, they keep the same memory region +for their heap. + +Without the kernel, the software developer would have to care about the +CPU architecture, how much cores it has, and would have to find the +right assembly instructions for the given CPU to run code in parallel, +and if they want to run more tasks concurrently than the amount of +available CPU cores, they would have to implement their own task +scheduler. + +Thankfully we do not have to care about that, because the Linux kernel +cares about it for us instead. + +Sources +------- + +The official sources of the Linux kernel can be found in +[kernel.org](https://www.kernel.org)[^distrib-patches]. + +[^distrib-patches]: + Note that these are the *original* sources. Most GNU/Linux + distributions incorporate additional patches to their releases. + +The official programming language of the Linux kernel is C. It is +heavily documented in the `Documentation` subdirectory, using the +sphinx documentation system. + + +Versioning +---------- + +TODO: this section + +Dependencies +------------ + +To compile a Linux kernel whose version is greater than 5.2, one needs +the following dependencies: + + + +TODO: Also refer to their Debian, Ubuntu, etc. packages. + +Configuring the kernel +---------------------- + +```sh +make nconfig +``` + +Building the kernel +------------------- + +```sh +make -j8 +``` + +Running the kernel +------------------ + +TODO: link the QEMU article + + +```c +#include + +/** + * \brief The entry point of the program. + * + * \param argc the number of command line arguments + * \param argv the command line argument, as an array of NULL terminated strings + */ +int main(int argc, char** argv) { + for(int i = 0; i < argc; ++i) { + printf("Argument %i: %s\n", i, argv[i]); + } +} +``` diff --git a/nord.theme b/nord.theme new file mode 100644 index 0000000..908c3c3 --- /dev/null +++ b/nord.theme @@ -0,0 +1,225 @@ +{ + "text-color": "#D8DEE9", + "background-color": "#2E3440", + "line-number-color": "#8FBCBB", + "line-number-background-color": "#2E3440", + "text-styles": { + "Other": { + "text-color": "#ECEFF4", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Attribute": { + "text-color": "#8FBCBB", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "SpecialString": { + "text-color": "#D08770", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Annotation": { + "text-color": "#D08770", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "RegionMarker": { + "text-color": "#D8DEE9", + "background-color": "#e0e9f8", + "bold": false, + "italic": false, + "underline": false + }, + "Function": { + "text-color": "#88C0D0", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "String": { + "text-color": "#A3BE8C", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "ControlFlow": { + "text-color": "#81A1C1", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Operator": { + "text-color": "#81A1C1", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Error": { + "text-color": "#BF616A", + "background-color": null, + "bold": false, + "italic": false, + "underline": true + }, + "Normal": { + "text-color": "#81A1C1", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "BaseN": { + "text-color": "#B48EAD", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Alert": { + "text-color": "#BF616A", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Variable": { + "text-color": "#8fbcbb", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "BuiltIn": { + "text-color": "#81A1C1", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Extension": { + "text-color": "#81A1C1", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Preprocessor": { + "text-color": "#88C0D0", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Information": { + "text-color": "#b08000", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "VerbatimString": { + "text-color": "#BF616A", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Warning": { + "text-color": "#BF616A", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Documentation": { + "text-color": "#8C9DBF", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Import": { + "text-color": "#D08770", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Char": { + "text-color": "#A3BE8C", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "DataType": { + "text-color": "#8FBCBB", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Float": { + "text-color": "#B48EAD", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Comment": { + "text-color": "#8C9DBF", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "CommentVar": { + "text-color": "#88C0D0", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Constant": { + "text-color": "#D8DEE9", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "SpecialChar": { + "text-color": "#D08770", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "DecVal": { + "text-color": "#B48EAD", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Keyword": { + "text-color": "#81A1C1", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + } + } +} -- cgit v1.2.3