Journal

Let's Write an Operating System from Scratch (0)

2011·07·17

Machine-translated from Chinese.  ·  Read original

Introduction to the Series

This series of articles aims to guide readers step by step in writing an operating system. Unlike Orange’s “Implementation of an Operating System”, this series will start directly with C language to write our own kernel, skipping the more difficult assembly content. As the author is also attempting to write a kernel for the first time, there should be many errors in the articles, and I hope readers can point them out in a timely manner.

This series of articles uses UIUC’s SIGOPS code. I would like to pay tribute to the experts at UIUC!

Foreword

Being able to write an operating system by oneself is the dream of many programming enthusiasts. However, we must acknowledge that writing an operating system is more difficult than writing everyday programs. Because this time, what you are writing is an operating system, and this system must be able to run programs written by others. Creating an operating system is a process of starting from scratch, where you have nothing but the hardware and the corresponding manual. In the early stages of our operating system development, we will face the dilemma of lacking various common libraries, debuggers, and common code. Fortunately, we now have the internet, and the rich resources online make everything easier.

Required Knowledge and Equipment

  • C or C++ syntax knowledge
  • Understanding of computer architecture and assembly language. Because we use SigOPS, which provides an i386 structure, readers do not need to get bogged down in the details of assembly and computer architecture from the start. We will introduce them gradually as needed.
  • A machine with Linux installed: I only like using Linux.
  • Perseverance, perseverance, perseverance, perseverance, perseverance, perseverance, perseverance

Ultimate Goal

I hope that by the end of this series of tutorials, we can complete a very basic operating system. Although I have not reached this goal yet, I will keep working hard. The basic operating system I am talking about should at least have:

  • The ability to run multiple programs
  • A process scheduling program
  • System calls
  • Hardware interrupts… and so on

Now that the pit has been dug, let’s get started!

留 · 言