精华区 [关闭][返回]

当前位置:网易精华区>>讨论区精华>>编程开发>>嵌入式开发>>操作系统设计与实现>>翻译计划—《写你自己的操作系统》>>翻译计划:《写你自己的操作系统》(Introduction)

主题:翻译计划:《写你自己的操作系统》(Introduction)
发信人: wenbobo()
整理人: wenbobo(2002-12-30 17:23:46), 站内信件
版主注:
我现在打算翻译Write Your Own Operating System [FAQ],希望有兴趣的朋友帮助翻译,我觉得翻译这样的文章是个很好的锻炼,至少比盲目写程序要值得。希望大家支持。有意者给我email。

本文发表于http://www.mega-tokyo.com/os/os-faq.html
作者为 Stuart 'Dark Fiber' George <[email protected]>
本文的译者为 wenbobo <[email protected]>
转载请勿删除以上版权宣示信息




Introduction 
介绍
There seems to be quite a few people out there who want to create their own Operating System (OS), and more power to them!! ^_^ The aim of this Frequently Asked Questions (FAQ) is to hopefully provide enough information to point people off in the right direction. 
看来很少有人打算创建自己的操作系统(OS),获得更大的权利!!^_^ 这个常见问题答案(FAQ)的目的是希望能够为那些正朝这个方向努力的人提供足够的引路信息。

This FAQ does not aim to teach you how to program a multitasking, multithreaded, distributed micro kernel OS, nor how to use C, C++ or any other programming language.
这个FAQ并不以教您如何写一个多任务,多线程,分部式的微内核操作系统为目的,也不打算教您学会应用C,C++或任何其它的编程语言。

*SOME* knowledge of protected mode (for i386 machines) is assumed. Sorry.
很抱歉,我们假定您已经有了*一些*关于保护模式(对于i386机器而言)的相关知识。

This FAQ does concentrate on using GCC compiler however.
另外,本FAQ也不专注于使用GCC编译器方面的事情。

This FAQ is aimed at hobbyist programmers who just want to play around at creating an OS, actual theory on operating systems design and implementation is ignored ^_^. If you know it, good for you, if you don't, don't worry.
本FAQ的对象是那些打算创建一个操作系统来玩玩的编程狂们,实际的操作系统设计与实现理论都被忽略了^_^。如果您已经掌握了这些理论,那很好,如果您不知道,也不用担心。

This FAQ is mostly a response to all the questions that appeared on the Operating System message board run by Josh McDonald.
本FAQ差不多是对于Josh McDonald的操作系统论坛上所有的问题的一个回应。
 

Getting Started 
开始吧

First things first, Its best to have a good setup of GCC on your system. Linux automatically has all the utilities you could want but for a MS-DOS DJGPP installation, you may need to download some extra files. 
重要的事情先来,在您的系统上最好安装一个完善的GCC。Linux会自动的把您所需要的全部都装好,但是要在MS-DOS下装DJGPP,您得额外下载一些文件。

Most of these files are secondary and may only be used once or twice but they come in very handy.
多数这些文件都是次要的,也许您只用得上一两次,但他们很容易获得。
SED 
GNU binutils 
GNU File Utils 
Grep 
Patch / Diff 
RCS / CVS 
SH Utils / bash 
Perl 
This assumes you already have GCC, GPP, LD, etc.
这是假设您已经装好GCC,GPP,LD,等等了。

It is highly recommended you get NASM assembler too.
高度推荐您也安装NASM汇编程序

 
What bits can't I make in C? 
哪些东西不能用C来写?
Depending on how you go about building your OS, you can't build your bootsector (bootloader) code in C, you have to resort to using someone else's code, or write your own code in assembler, be that in x86 Intel style or AT&T GNU style assembly language. 
这依赖于你如何创建你的系统,你不能用C来写引导扇区(引导程序),必须考虑采用别人的代码,或者自己用汇编语言写一个,用x86 Intel风格或者 AT&T GNU风格的汇编语言。
There is also a few CPU specific operations you cannot write in C, those being Interrupt Service Routines that return with IRET (on i386 machines) opcodes and other functions such as commands to load the GDT (i386) can be inlined but still require using assembly.
也存在少数的CPU特殊指令不能用C写的,那些用IRET(i386机器上的)返回的中断服务例程,和那些诸如装载GDT(i386)命令的函数,可以使用内联函数(inline),但是必须使用汇编语句。
 

What order should I make things in? 
我该按什么顺序来开始?
This is a style question. You can start at the start and dig straight in by writing a bootsector then write a minimal kernel and build from there. Or you can write bits and pieces in no specific order and just put them together at the very end. There is probably no right or wrong way to go about doing it. 
这是个风格问题。你可以从写引导扇区接着写个微型的内核开始,也可以不按照特别的顺序而一点点的写,仅仅在最后在把他们放在一起。

Myself, I started at the start and did the boot sector, wrote a tiny micro kernel loader, etc. I like to test and play with it as I develop it, I like to see it working.
我自己,我这样开始:做引导区,写一个微型的内核加载程序,等等。我喜欢在开发的时候遍测试边摆弄它,我喜欢看着它起作用。


----
掬水月在手
弄花香满身

[关闭][返回]