Chapter 10 — Timer-Driven Preemptive Multitasking

This entry is part 10 of 19 in the series Writing A Linux Style Operating System From Scratch

In Chapter 9, we built cooperative multitasking: That works, but it has a major weakness: A thread like that can monopolize the CPU forever. This chapter adds the next step: timer-driven preemption. With preemptive scheduling: OSDev describes preemptive multitasking as scheduling where an interrupt, usually timer-driven, allows the kernel to take control away from the

Chapter 9 — Cooperative Multitasking and Kernel Threads

This entry is part 9 of 19 in the series Writing A Linux Style Operating System From Scratch

We now have enough foundation to start multitasking: This chapter adds the first scheduler. Not a preemptive scheduler yet. A cooperative scheduler. That means each kernel thread keeps running until it voluntarily calls: “` cthread_yield(); textkernel thread objectper-thread kernel stackready queuex86 context switch assemblythread_create()thread_yield()thread_exit()round-robin cooperative schedulingtwo-thread test textcreate two kernel threadsswitch between them cooperativelyprove both

Chapter 7 — A Real Virtual Memory Mapping Layer

Chapter 7 — A Real Virtual Memory Mapping Layer
This entry is part 7 of 19 in the series Writing A Linux Style Operating System From Scratch

In Chapter 5 we enabled paging, but only with a fixed identity map: In Chapter 6 we built a heap, but it still had an important weakness: because only the first 16 MiB were identity-mapped. Now we fix the architectural problem. This chapter adds a small virtual memory manager, or VMM: This lets the kernel

Chapter 4 — Reading the Memory Map and Building a Physical Page Allocator

Chapter 4 — Reading the Memory Map and Building a Physical Page Allocator
This entry is part 4 of 19 in the series Writing A Linux Style Operating System From Scratch

Before we add paging, a heap, processes, filesystems, or user programs, the kernel must answer a basic question: Which physical 4 KiB pages of RAM are safe for me to use? Right now, our kernel can boot, print text, catch CPU exceptions, and receive timer/keyboard interrupts. But it still cannot safely allocate memory. This chapter

Writing a Linux-style Operating System From Scratch

Writing a Linux-style Operating System From Scratch
This entry is part 1 of 19 in the series Writing A Linux Style Operating System From Scratch

Today, we are beginning a new article series: “Writing a Linux-Style Operating System From Scratch.” In this series, we will walk step by step through the process of creating our own operating system from the ground up. Many operating system tutorials stop shortly after the system boots and prints a simple message on the screen.

Developing an Open Hardware Device Programmer

This entry is part 1 of 1 in the series Open Universal Device Programmer

Introduction As an electronics enthusiast with over 50 years of experience, I’ve had the privilege of witnessing the dramatic evolution of computing systems. From the early days of 4 and 8-bit machines with minimal RAM to today’s powerful 64-bit computers with terabytes of storage, the progress has been nothing short of extraordinary. The same transformative

Understanding Unicode: A Deep Dive into Universal Text Encoding

Understanding Unicode: A Deep Dive into Universal Text Encoding

Unicode is a universal encoding standard designed to support every language and symbol in use today. This article provides an in-depth look into how Unicode works in application development, exploring the challenges of string comparison, normalization, and the multiple ways that the same visual character can be represented. Learn how to handle Unicode strings in Python, JavaScript, and C, and discover how normalization can resolve issues when comparing visually identical characters.

Going Nostalgic With Text Adventures And QB64!

Embark on an exciting journey into the world of text adventure game development with this comprehensive guide to creating your own game in BASIC. Explore the intricacies of game design, programming techniques, and interactive storytelling as you learn to craft immersive experiences for players.

Building Machines In Code – Part 9

This entry is part 9 of 9 in the series Building Machines in Code

Tooling for the Tiny-T When we completed the console, last installment, I had said I was unsure what I would cover next. I’m really wanting to begin implementing our audio device, but I felt that adding a GUI for the Tiny-T system was a target much more achievable in the limited time I had. However,