diff --git a/posts/algorithms/extrema-circular-buffer.html b/posts/algorithms/extrema-circular-buffer.html
index 1ee9ed5..b2d0614 100644
--- a/posts/algorithms/extrema-circular-buffer.html
+++ b/posts/algorithms/extrema-circular-buffer.html
@@ -14,7 +14,7 @@
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
async
>
- Barrett Ruth
+ extreme circular buffer
diff --git a/posts/algorithms/leetcode-daily.html b/posts/algorithms/leetcode-daily.html
index 2ca5d9f..c62bf3d 100644
--- a/posts/algorithms/leetcode-daily.html
+++ b/posts/algorithms/leetcode-daily.html
@@ -14,14 +14,14 @@
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
async
>
- Barrett Ruth
+ leetcode daily
- Leetcode Daily
+ leetcode daily
diff --git a/posts/economics/models-of-production.html b/posts/algorithms/models-of-production.html
similarity index 99%
rename from posts/economics/models-of-production.html
rename to posts/algorithms/models-of-production.html
index 33d7d7f..dbe4a45 100644
--- a/posts/economics/models-of-production.html
+++ b/posts/algorithms/models-of-production.html
@@ -13,14 +13,14 @@
async
>
- Barrett Ruth
+ models of production
- Models of Production
+ models of production
diff --git a/posts/algorithms/practice-makes-perfect.html b/posts/algorithms/practice-makes-perfect.html
index 0aadf9c..708a85b 100644
--- a/posts/algorithms/practice-makes-perfect.html
+++ b/posts/algorithms/practice-makes-perfect.html
@@ -14,14 +14,14 @@
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
async
>
- Barrett Ruth
+ practice makes perfect
- Practice Makes Perfect
+ practice makes perfect
diff --git a/posts/operating-systems/building-an-os.html b/posts/operating-systems/building-an-os.html
new file mode 100644
index 0000000..135dc8e
--- /dev/null
+++ b/posts/operating-systems/building-an-os.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ building an os
+
+
+
+
+
+
+ building an os
+
+
+
+
+ introduction
+
+
+ Building an operating system requires understanding of both hardware and software fundamentals.
+ This post will cover the basics of boot process, memory management, and process scheduling.
+
+
+ boot process
+
+ bootloader
+
+
+ The bootloader is the first piece of code executed when a computer starts up.
+ It's responsible for loading the operating system kernel into memory.
+
+
+ kernel initialization
+
+
+ After the bootloader loads the kernel, the kernel initializes various hardware components
+ and sets up memory management, interrupt handling, and other core services.
+
+
+
+ memory management
+
+
+ Memory management is a critical component of any operating system.
+ It involves tracking and allocating memory to processes, handling virtual memory,
+ and implementing paging or segmentation.
+
+
+ process scheduling
+
+
+ Process scheduling determines how CPU time is allocated to different processes.
+ Various scheduling algorithms like round-robin, priority-based, and shortest job first
+ can be implemented depending on the use case.
+
+
+
+
+
+
+
+
+
+
diff --git a/posts/software/designing-this-website.html b/posts/software/designing-this-website.html
index a4c14b2..23415ab 100644
--- a/posts/software/designing-this-website.html
+++ b/posts/software/designing-this-website.html
@@ -7,14 +7,14 @@
- Barrett Ruth
+ designing this website
- Designing This Website
+ designing this website
diff --git a/posts/software/from-github-pages-to-aws.html b/posts/software/from-github-pages-to-aws.html
index dcac281..83187d2 100644
--- a/posts/software/from-github-pages-to-aws.html
+++ b/posts/software/from-github-pages-to-aws.html
@@ -7,14 +7,14 @@
- Barrett Ruth
+ from github pages to AWS
- From GitHub Pages to AWS
+ from github pages to AWS
diff --git a/scripts/common.js b/scripts/common.js
index 71fda1c..c31539b 100644
--- a/scripts/common.js
+++ b/scripts/common.js
@@ -7,7 +7,7 @@ class SiteHeader extends HTMLElement {
const isHome = path === "/" || path === "/index.html";
const topic = this.getTopic();
- const promptText = isHome ? "barrett@ruth:~$" : `barrett@ruth:~$ ${topic}`;
+ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$";
const clickHandler = isHome ? "refresh(event)" : "goHome(event)";
@@ -20,9 +20,9 @@ class SiteHeader extends HTMLElement {
`;
@@ -30,10 +30,11 @@ class SiteHeader extends HTMLElement {
getTopic() {
const pathname = window.location.pathname.split("/");
- if (pathname.includes("about.html")) {
- return "/about";
+
+ if (pathname.length === 2 && pathname[1].endsWith(".html")) {
+ return "/" + pathname[1].replace(".html", "");
} else if (pathname.length >= 3) {
- return `/${pathname[1]}`;
+ return "/" + pathname.slice(2, -1).join("/").replace(".html", "");
}
return "";
}
@@ -45,9 +46,9 @@ class SiteFooter extends HTMLElement {
`;
@@ -69,12 +70,12 @@ document.addEventListener("DOMContentLoaded", function () {
align-items: center;
justify-content: space-between;
}
-
+
.greek-delta {
font-family: "Times New Roman", Times, serif;
font-size: 1.5em;
}
-
+
.header-links a,
.footer-links a {
margin-left: 25px;
@@ -117,7 +118,7 @@ const getTopicColor = (topicName) => {
switch (topicName) {
case "software":
return "#0073e6";
- case "economics":
+ case "operating-systems":
return "#009975";
case "algorithms":
return "#6a0dad";
diff --git a/scripts/index.js b/scripts/index.js
index 4c179b1..5550b86 100644
--- a/scripts/index.js
+++ b/scripts/index.js
@@ -1,26 +1,21 @@
const postMapping = new Map([
[
- "Software",
+ "software",
[
- { name: "from github pages to aws", link: "from-github-pages-to-aws" },
- { name: "designing this website", link: "designing-this-website" },
- // { name: "working in the terminal" },
+ "from github pages to aws",
+ "designing this website",
+ // "working in the terminal",
],
],
+ ["operating systems", ["building an os"]],
[
- "Economics",
- [{ name: "models of production", link: "models-of-production" }],
- ],
- [
- "Algorithms",
+ "algorithms",
[
- {
- name: "competitive programming log",
- link: "competitive-programming-log",
- },
- { name: "leetcode daily", link: "leetcode-daily" },
- { name: "practice makes perfect", link: "practice-makes-perfect" },
- { name: "extrema circular buffer", link: "extrema-circular-buffer" },
+ "competitive programming log",
+ "leetcode daily",
+ "practice makes perfect",
+ "extrema circular buffer",
+ "models of production",
],
],
]);
@@ -44,14 +39,29 @@ function renderPosts(topic) {
const posts = document.getElementById("posts");
posts.innerHTML = "";
- postMapping.get(topic).forEach(({ name: postName, link: postLink }) => {
+ // Normalize topic for lookup (in case it has spaces, like "operating systems")
+ const normalizedTopic = topic.trim();
+
+ // Get posts for this topic
+ const topicPosts = postMapping.get(normalizedTopic);
+
+ if (!topicPosts) {
+ console.error(`No posts found for topic: ${normalizedTopic}`);
+ return;
+ }
+
+ topicPosts.forEach((postName) => {
+ if (typeof postName !== "string") return;
+
const post = document.createElement("div");
post.classList.add("post");
const link = document.createElement("a");
- link.href = postLink
- ? `/posts/${topic.toLowerCase()}/${postLink}.html`
- : `/wip.html`;
+ const postLink = postName.toLowerCase().replace(/\s+/g, "-");
+
+ // Convert topic to URL-friendly format
+ const topicSlug = normalizedTopic.toLowerCase().replace(/\s+/g, "-");
+ link.href = `/posts/${topicSlug}/${postLink}.html`;
link.textContent = postName;
link.style.textDecoration = "underline";
@@ -71,7 +81,7 @@ function typechars(e) {
typing = true;
const topic = e.target.textContent;
- const terminalText = ` ${topic.toLowerCase()}/`;
+ const terminalText = ` /${topic.toLowerCase()}`;
const terminalPrompt = document.querySelector(".terminal-prompt");
const delay =
terminalPrompt.innerHTML.length > TERMINAL_PROMPT.length ? 250 : 500;
Leetcode Daily
+leetcode daily
diff --git a/posts/economics/models-of-production.html b/posts/algorithms/models-of-production.html
similarity index 99%
rename from posts/economics/models-of-production.html
rename to posts/algorithms/models-of-production.html
index 33d7d7f..dbe4a45 100644
--- a/posts/economics/models-of-production.html
+++ b/posts/algorithms/models-of-production.html
@@ -13,14 +13,14 @@
async
>
- Barrett Ruth
+ models of production
- Models of Production
+ models of production
diff --git a/posts/algorithms/practice-makes-perfect.html b/posts/algorithms/practice-makes-perfect.html
index 0aadf9c..708a85b 100644
--- a/posts/algorithms/practice-makes-perfect.html
+++ b/posts/algorithms/practice-makes-perfect.html
@@ -14,14 +14,14 @@
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"
async
>
- Barrett Ruth
+ practice makes perfect
- Practice Makes Perfect
+ practice makes perfect
diff --git a/posts/operating-systems/building-an-os.html b/posts/operating-systems/building-an-os.html
new file mode 100644
index 0000000..135dc8e
--- /dev/null
+++ b/posts/operating-systems/building-an-os.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ building an os
+
+
+
+
+
+
+ building an os
+
+
+
+
+ introduction
+
+
+ Building an operating system requires understanding of both hardware and software fundamentals.
+ This post will cover the basics of boot process, memory management, and process scheduling.
+
+
+ boot process
+
+ bootloader
+
+
+ The bootloader is the first piece of code executed when a computer starts up.
+ It's responsible for loading the operating system kernel into memory.
+
+
+ kernel initialization
+
+
+ After the bootloader loads the kernel, the kernel initializes various hardware components
+ and sets up memory management, interrupt handling, and other core services.
+
+
+
+ memory management
+
+
+ Memory management is a critical component of any operating system.
+ It involves tracking and allocating memory to processes, handling virtual memory,
+ and implementing paging or segmentation.
+
+
+ process scheduling
+
+
+ Process scheduling determines how CPU time is allocated to different processes.
+ Various scheduling algorithms like round-robin, priority-based, and shortest job first
+ can be implemented depending on the use case.
+
+
+
+
+
+
+
+
+
+
diff --git a/posts/software/designing-this-website.html b/posts/software/designing-this-website.html
index a4c14b2..23415ab 100644
--- a/posts/software/designing-this-website.html
+++ b/posts/software/designing-this-website.html
@@ -7,14 +7,14 @@
- Barrett Ruth
+ designing this website
- Designing This Website
+ designing this website
diff --git a/posts/software/from-github-pages-to-aws.html b/posts/software/from-github-pages-to-aws.html
index dcac281..83187d2 100644
--- a/posts/software/from-github-pages-to-aws.html
+++ b/posts/software/from-github-pages-to-aws.html
@@ -7,14 +7,14 @@
- Barrett Ruth
+ from github pages to AWS
- From GitHub Pages to AWS
+ from github pages to AWS
diff --git a/scripts/common.js b/scripts/common.js
index 71fda1c..c31539b 100644
--- a/scripts/common.js
+++ b/scripts/common.js
@@ -7,7 +7,7 @@ class SiteHeader extends HTMLElement {
const isHome = path === "/" || path === "/index.html";
const topic = this.getTopic();
- const promptText = isHome ? "barrett@ruth:~$" : `barrett@ruth:~$ ${topic}`;
+ const promptText = topic ? `barrett@ruth:~$ ${topic}` : "barrett@ruth:~$";
const clickHandler = isHome ? "refresh(event)" : "goHome(event)";
@@ -20,9 +20,9 @@ class SiteHeader extends HTMLElement {
`;
@@ -30,10 +30,11 @@ class SiteHeader extends HTMLElement {
getTopic() {
const pathname = window.location.pathname.split("/");
- if (pathname.includes("about.html")) {
- return "/about";
+
+ if (pathname.length === 2 && pathname[1].endsWith(".html")) {
+ return "/" + pathname[1].replace(".html", "");
} else if (pathname.length >= 3) {
- return `/${pathname[1]}`;
+ return "/" + pathname.slice(2, -1).join("/").replace(".html", "");
}
return "";
}
@@ -45,9 +46,9 @@ class SiteFooter extends HTMLElement {
`;
@@ -69,12 +70,12 @@ document.addEventListener("DOMContentLoaded", function () {
align-items: center;
justify-content: space-between;
}
-
+
.greek-delta {
font-family: "Times New Roman", Times, serif;
font-size: 1.5em;
}
-
+
.header-links a,
.footer-links a {
margin-left: 25px;
@@ -117,7 +118,7 @@ const getTopicColor = (topicName) => {
switch (topicName) {
case "software":
return "#0073e6";
- case "economics":
+ case "operating-systems":
return "#009975";
case "algorithms":
return "#6a0dad";
diff --git a/scripts/index.js b/scripts/index.js
index 4c179b1..5550b86 100644
--- a/scripts/index.js
+++ b/scripts/index.js
@@ -1,26 +1,21 @@
const postMapping = new Map([
[
- "Software",
+ "software",
[
- { name: "from github pages to aws", link: "from-github-pages-to-aws" },
- { name: "designing this website", link: "designing-this-website" },
- // { name: "working in the terminal" },
+ "from github pages to aws",
+ "designing this website",
+ // "working in the terminal",
],
],
+ ["operating systems", ["building an os"]],
[
- "Economics",
- [{ name: "models of production", link: "models-of-production" }],
- ],
- [
- "Algorithms",
+ "algorithms",
[
- {
- name: "competitive programming log",
- link: "competitive-programming-log",
- },
- { name: "leetcode daily", link: "leetcode-daily" },
- { name: "practice makes perfect", link: "practice-makes-perfect" },
- { name: "extrema circular buffer", link: "extrema-circular-buffer" },
+ "competitive programming log",
+ "leetcode daily",
+ "practice makes perfect",
+ "extrema circular buffer",
+ "models of production",
],
],
]);
@@ -44,14 +39,29 @@ function renderPosts(topic) {
const posts = document.getElementById("posts");
posts.innerHTML = "";
- postMapping.get(topic).forEach(({ name: postName, link: postLink }) => {
+ // Normalize topic for lookup (in case it has spaces, like "operating systems")
+ const normalizedTopic = topic.trim();
+
+ // Get posts for this topic
+ const topicPosts = postMapping.get(normalizedTopic);
+
+ if (!topicPosts) {
+ console.error(`No posts found for topic: ${normalizedTopic}`);
+ return;
+ }
+
+ topicPosts.forEach((postName) => {
+ if (typeof postName !== "string") return;
+
const post = document.createElement("div");
post.classList.add("post");
const link = document.createElement("a");
- link.href = postLink
- ? `/posts/${topic.toLowerCase()}/${postLink}.html`
- : `/wip.html`;
+ const postLink = postName.toLowerCase().replace(/\s+/g, "-");
+
+ // Convert topic to URL-friendly format
+ const topicSlug = normalizedTopic.toLowerCase().replace(/\s+/g, "-");
+ link.href = `/posts/${topicSlug}/${postLink}.html`;
link.textContent = postName;
link.style.textDecoration = "underline";
@@ -71,7 +81,7 @@ function typechars(e) {
typing = true;
const topic = e.target.textContent;
- const terminalText = ` ${topic.toLowerCase()}/`;
+ const terminalText = ` /${topic.toLowerCase()}`;
const terminalPrompt = document.querySelector(".terminal-prompt");
const delay =
terminalPrompt.innerHTML.length > TERMINAL_PROMPT.length ? 250 : 500;
Models of Production
+models of production
diff --git a/posts/algorithms/practice-makes-perfect.html b/posts/algorithms/practice-makes-perfect.html index 0aadf9c..708a85b 100644 --- a/posts/algorithms/practice-makes-perfect.html +++ b/posts/algorithms/practice-makes-perfect.html @@ -14,14 +14,14 @@ src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" async > -Practice Makes Perfect
+practice makes perfect
diff --git a/posts/operating-systems/building-an-os.html b/posts/operating-systems/building-an-os.html new file mode 100644 index 0000000..135dc8e --- /dev/null +++ b/posts/operating-systems/building-an-os.html @@ -0,0 +1,74 @@ + + + + + + + + + + + + +building an os
+ +introduction
++ Building an operating system requires understanding of both hardware and software fundamentals. + This post will cover the basics of boot process, memory management, and process scheduling. +
+boot process
+bootloader
++ The bootloader is the first piece of code executed when a computer starts up. + It's responsible for loading the operating system kernel into memory. +
+kernel initialization
++ After the bootloader loads the kernel, the kernel initializes various hardware components + and sets up memory management, interrupt handling, and other core services. +
+memory management
++ Memory management is a critical component of any operating system. + It involves tracking and allocating memory to processes, handling virtual memory, + and implementing paging or segmentation. +
+process scheduling
++ Process scheduling determines how CPU time is allocated to different processes. + Various scheduling algorithms like round-robin, priority-based, and shortest job first + can be implemented depending on the use case. +
+