浏览代码

First commit

Carlos Fenollosa 10 年之前
父节点
当前提交
9eee9e7819
共有 4 个文件被更改,包括 67 次插入0 次删除
  1. 6 0
      00-environment/README.md
  2. 二进制
      01-boot-sector/.README.md.swp
  3. 17 0
      01-boot-sector/README.md
  4. 44 0
      README.md

+ 6 - 0
00-environment/README.md

@@ -0,0 +1,6 @@
+I'm working on a Mac, though Linux is better because it will have all the standard tools already
+available for you.
+
+On a mac, [install Homebrew](http://brew.sh) and then `brew install qemu nasm`
+
+Don't use the Xcode developer tools `nasm` if you have them installed, they won't work for the most cases.

二进制
01-boot-sector/.README.md.swp


+ 17 - 0
01-boot-sector/README.md

@@ -0,0 +1,17 @@
+This is very exciting, we're going to create our own boot sector!
+
+When the computer boots, the BIOS doesn't know how to load the OS, so it
+delegates that task to the boot sector. Thus, the boot sector must be
+placed in a known, standard location. That location is the first sector
+of the disk (cylinder 0, head 0, sector 0) and it takes 512 bytes.
+
+To make sure that the "disk is bootable", the BIOS checks that bytes
+511 and 512 of the alleged boot sector are bytes `0xAA55`.
+
+This is the simplest boot sector ever:
+
+```asm
+e9 fd ff 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa
+```

+ 44 - 0
README.md

@@ -2,3 +2,47 @@ os-tutorial
 ===========
 
 How to create an OS from scratch
+
+I have always wanted to learn how to make an OS from scratch. In college they taught us
+how to implement advanced features (pagination, semaphores, memory management, etc)
+but:
+
+- I never got to start from my own boot sector
+- College is hard so I don't remember most of it.
+
+Inspired by [this document](http://www.cs.bham.ac.uk/~exr/lectures/opsys/10_11/lectures/os-dev.pdf)
+and the [OSDev wiki](http://wiki.osdev.org/), I'll try to make short step-by-step READMEs and
+code samples for anybody to follow.
+
+I will not explain the theory. Google is your friend. Learn what assembler is, pagination, interrupts,
+segmentation, etc. That is already covered by thousands of PDFs from Universities. This course
+is a tutorial, a hands-on, not a real CS lecture.
+
+
+How to use this tutorial
+------------------------
+
+First, go through every folder in order. They build on previous code, so if 
+you jump right to folder 08, you may find a lot of stuff which is not related
+to what folder 08 is about.
+
+To see the increments between "lessons", do a diff between folders.
+
+Second, for each folder, read the README. It is **very concise**. There is
+no theory. Then, look at the code examples. You can try to write them by 
+yourself on a different folder, modify them slightly and play a bit with the 
+code.
+
+Finally, the code files provided in each folder are the final result. If
+you want to learn quickly (though not as thoroughly), just read the
+provided code files.
+
+TL;DR: First read the README on each folder, then decide if you will
+implement it yourself or just read the provided code files.
+
+
+Contributing
+------------
+
+I'm still learning this. For the moment, please restrict your contributions to fixing possible bugs
+or improving existing documents. I'm not yet ready to accept enhancements.