How to Make a Computer Operating System
如何制作一个操作系统(翻译版)
原文地址:Github:How to Make a Computer Operating System
翻译地址:Github:How to Make a Computer Operating System-ZH-cn
目录##
Online book about how to write a computer operating system in C/C++ from scratch.
一本关于如何用C/ c++从零开始编写计算机操作系统的在线书籍。
Caution: This repository is a remake of my old course. It was written several years ago as one of my first projects when I was in High School, I'm still refactoring some parts. The original course was in French and I'm not an English native. I'm going to continue and improve this course in my free-time.
谨慎:这个资源库是我以前课程的翻版。它是几年前写的作为我高中时的第一个项目之一,我仍然在重构一些部分。这个课程最初的是用法语,我的母语不是英语。我打算在空闲时间继续改进这门课。
Book: An online version is available at (PDF, Mobi and ePub). It was generated using GitBook.
书籍: 网上版本可于 (PDF, Mobi及ePub)下载。它是使用GitBook生成的。
Source Code: All the system source code will be stored in the src directory. Each step will contain links to the different related files.
源代码:所有系统源代码将存储在src目录中。每个步骤将包含指向不同相关文件的链接。
Contributions: This course is open to contributions, feel free to signal errors with issues or directly correct the errors with pull-requests.
投稿:本课程开放投稿,有问题可以随时通知错误,也可以直接用pull-request更正错误。
Questions: Feel free to ask any questions by adding issues or commenting sections.
问题:可以通过添加问题(issues)或评论(commenting)来提问。
You can follow me on Twitter @SamyPesse or GitHub.
你可以关注我的推特@SamyPesse或者GitHub。
What kind of OS are we building? 我们在构建什么样的操作系统?The goal is to build a very simple UNIX-based operating system in C++, not just a "proof-of-concept". The OS should be able to boot, start a userland shell, and be extensible.
目标是用c++构建一个非常简单的基于UNIX的操作系统,而不仅仅是“概念验证”。操作系统应该能够引导、启动用户界面shell并具有可扩展性。
Chapter 1: Introduction to the x86 architecture and about our OS 第1章:介绍x86架构和我们的操作系统 What is the x86 architecture? 什么是x86架构?The term x86 denotes a family of backward compatible instruction set architectures based on the Intel 8086 CPU.
x86是指一组基于Intel 8086 CPU的向后兼容指令集架构。
The x86 architecture is the most common instruction set architecture since its introduction in 1981 for the IBM PC. A large amount of software, including operating systems (OS's) such as DOS, Windows, Linux, BSD, Solaris and Mac OS X, function with x86-based hardware.
x86体系结构是自1981年引入IBM PC以来最常见的指令集体系结构。大量的软件,包括DOS、Windows、Linux、BSD、Solaris和Mac OS X等操作系统,都使用基于x86的硬件。
In this course we are not going to design an operating system for the x86-64 architecture but for x86-32, thanks to backward compatibility, our OS will be compatible with our newer PCs (but take caution if you want to test it on your real machine).
在本课程中,我们不打算设计x86-64架构的操作系统,而是设计x86-32的操作系统,由于向后兼容性,我们的操作系统将与我们的新pc兼容(但如果您想在实际机器上测试它,请谨慎)。
Our Operating System 我们的操作系统The goal is to build a very simple UNIX-based operating system in C++, but the goal is not to just build a "proof-of-concept". The OS should be able to boot, start a userland shell and be extensible.
目标是用c++构建一个非常简单的基于unix的操作系统,但目标不仅仅是构建一个“概念验证”。该操作系统应该能够引导、启动用户界面shell并具有可扩展性。
The OS will be built for the x86 architecture, running on 32 bits, and compatible with IBM PCs.
该操作系统将为x86架构构建,运行在32位上,并与IBM pc兼容。
Specifications(规范):
Code in C++ | c++代码
x86, 32 bit architecture | x86, 32位架构
Boot with Grub | 使用Grub启动
Kind of modular system for drivers | 驱动程序的模块化系统
Kind of UNIX style | UNIX风格
Multitasking | 多任务
ELF executable in userland
Modules (accessible in userland using /dev/...) | 模块(可在用户区使用/dev/…访问): :
IDE disks | IDE磁盘
DOS partitions | DOS分区
Clock | 时钟
EXT2 (read only) | EXT2(只读)
Boch VBE | 卷VBE
Userland : | 用户:
API Posix
LibC
"Can" run a shell or some executables (e.g., lua) “可以”运行shell或一些可执行文件(例如lua)
Chapter 2: Setup the development environment 第2章:设置开发环境The first step is to setup a good and viable development environment. Using Vagrant and Virtualbox, you'll be able to compile and test your OS from all the OSs (Linux, Windows or Mac).