1、 I 摘 要 作为学习操作系统的新手, 商用 的操作系统设计复杂, 代码量大, 不适合作为学习的蓝本, 如果能够从零开始开发一个小型的操作系统雏形, 不但 可以全面深入地了解操作系统的工作原理, 还可以为读大型开源操作系统的代码积累经验。 这个 取名为 MyOS 的 从头开始开发的系统虽然结构简单,但是具备了内存管理、多任务控制、任务切换、基本输入输出管理并且运行在 32 位保护模式下 ,在用户接口方面,它采用的 是图形界面和命令行界面混合的方式来与用户交互,在程序接口方面, 设计了部分 API,主要是针对于图形显示和计时器两方面, 本文 利用这 些 API, 实现了 “贪吃蛇”、“时钟计时器
2、” 两个例子 程序。 本 文首先介绍操作系统运行所 依赖的硬件系统组成,然后重点地介绍了操作系统的基本特征和主要功能, 接着详细地说明了 80386 以上 Intel CPU 所运行的贯穿整个操作系统开发的 32 位保护模式 ,接下来简述了 MyOS 的开发环境和语言,以及 MyOS 的基本运行原理 ,然后重点 介绍了 MyOS 的设计与实现, 最后 叙述 MyOS 的程序接口 API,以及利用 MyOS中的 API 设计的应用程序。 关键词: 操作系统 , 运行原理, 32 保护模式 II ABSTRACT As a fresh man who want to learn Operating
3、 System deeply, commercial using OS are too complex to learn .So ,if we develop a demo of OS from blank, if we start from scratch ,we can not only have a good know for the running principle of a OS, but also accumulate many experience which are of significant importance to our further study and rese
4、arch for the operating system. This thesis is about a Operating System which is developed from the blank,and its name is MyOS.This MyOS is simple in structure, however, it possesses the management of memery and task and basic input and out, it support the multitask and run under the 32 bit protect m
5、ode. In addition, it using both graphical interfaces and command line interfaces to interact with user.As for the API, the MyOS get some API for the graphical display and timer, by which we develop some program which may run on the MyOS. This thesis are composed by these elements.First of all, it de
6、scribe the hardware which Operating System run on, and then ,it present the fundamental character and main function of the Operating System. Secondly ,it illuminates the protect mode which is one of the two important elements of the thesis, and the other one is particularize the design and realization of the MyOS, before which ,it will briefly tell you the developing circumstance and the developing language. At last, it deals with the API of MyOS and the program developed based on these APIs. Keywords: Operating System , Principle of Running ,32bit Protect Mode