英语助手母语润色网
查找母语润色产品
立即注册
下单注意事项

浅析组件机制和操作系统的实现|行业论文中英文模板|学术论文校正润色服务

发表时间:2015-11-2  来源:www.yingyuzhushou.com  作者:yingyuzhushou.com  浏览次数:1867  
字体大小: 【小】 【中】 【大】

1 引言
当前,操作系统的功能不断扩展,操作系统的类型呈现出多样化的趋向。一个小规模的开发小组已经不可能完全从头开始实现一个实用的操作系统,而一般情况下,探究人员只对操作系统的一些特定领域感喜好,而对于另外一些元素,如启动加载代码、核心启动代码、设备驱动程序和内存分配代码等往往不感喜好,但是一个可运行的原型系统又必须包含这些内容。编写这些基础结构延缓了操作系统探究项目的进度,同时也增加了进行操作系统探究的代价。为了解决这一新问题,犹他大学的FLUX探究小组开发了OSKit,它提供了一个框架和一组模块化的、具有简单接口的库以及一组清楚的、可重用的OS组件。OSKit可以用来构建操作系统内核、外层服务和其他核心OS功能模块。OSKit提供了各种功能模块,诸如简单自举,一个可用于内核的最小化POSIX环境、和物理内存和其约束一致的内存管理、广泛的调试支持,以及高层子系统如协议栈和文件系统。开发者可以根据自己的探究喜好或所要考虑的性能来使用这些模块,或用他们自己的模块来替代标准的OSKit模块。
OSKit公开了它内部的实现细节,答应用户从成熟的操作系统中不加修改地提取代码,然后通过一小部分经过仔细设计的粘接代码将它们合并到一起,隔离它们的依靠性,并输出良好定义的接口。OSKit使用这一技术整合了许多稳定而成熟的源代码,包括设备驱动、文件系统、网络协议等等。实践表明,使用组件软件架构和重用技术会给操作系统实现领域带来大的影响。
2 组件技术简介
组件技术是一种较新的软件开发技术。到目前为止,还难以确定组件技术的明确定义。比如,对组件技术的常见说法有以下这些摘要:“二进制软件单元”、“任意场合可部署的软件”、“非凡适合第三方开发”和“规范定义的接口”等等。大致上可以这样理解摘要:所谓组件,其实就是一种可部署软件的代码包,其中包括某些可执行模块。组件单独开发并作为软件单元使用,它具有明确的接口,软件就是通过这些接口调用组件所能提供的服务,多种组件可以联合起来构成更大型的组件乃至直接建立整个系统。组件的实现必须支持一种或者多种其用户所希望获得的接口。实现组件并不一定需要采用面向对象语言。为了构造新应用程序,软件开发人员找出适当的组件,将这些组件加入到正在开发中的应用程序,同时对应用程序进行测试并保证应用程序的组装工作按照预定的规划正常进行。采用组件技术能降低开发、测试和维护成本,提高可靠性和稳定性。
3 Oskit组件综述
OSKIT的组件库提供了一般情况下更高层的功能,它通常只对外开放一些相关的公用调用接口。目标系统通过OSKit的面向对象的COM接口来和这些组件进行交互。以下几节概述了OSKit所提供的组件。
3. 1 引导程序
大多数操作系统多有自身的启动加载机制,彼此互不兼容。这种加载机制的多样性并不是由于每个OS所要求的自举服务不同而引起,而是由于构建启动加载器的特定方式造成的。因为从操作系统探究的立场来看,启动加载器是一个令人不敢喜好的领域,因此OS开发者通常进行一个最小化、快捷的设计。由于设计理念和要求的稍微差别,每个启动加载器都不适用于下一个OS。为了解决这个新问题,OSKit直接支持多启动标准,这一标准是由几个OS项目的成员共同设计的,它的目的是提供一个简单而通用的启动加载器和OS内核间的接口,从而答应一个启动加载器加载任何兼容的OS。
在进行操作系统探究时,多启动标准非常有用,这其中的主要原因是启动加载器在加载内核自身的同时还具有加载附加文件或者启动模块的能力。这里的一个启动模块只是一个普通文件,启动加载器不以任何方式解释它,而仅仅把它随同内核映像一起加载到保留物理内存块中。在启动内核时,启动加载器提供给内核以下内容摘要:物理地址的列表、所有已加载的启动模块的大小,以及和每个模块相联系的由用户定义的字符串。这些启动模块和和它们相联系的用户定义的字符串由内核解释。这样做的目的是为了通过提供内核启动时需要的数据,诸如初始化程序、设备驱动和文件系统服务器,来减轻内核启动的负担。
3.2核心支持库 
OSKit核心支持库的主要用途是让客户OS更轻易访问硬件设施。它包含了一个较大的实用函数和符号定义的集合,该集合对于管理模式代码是非常具体的。和此相对应,OSKit的大多数其他库在用户模式代码中通常很有用。和OSKit的其余部分所不同的是,多数核心支持代码必须是针对特定系统结构的,而这些特定机器的细节对客户OS也是有用的。例如,在x86机器上,核心支持库包含一些函数,用来创建和操纵x86页表和段寄存器。其他OSKit组件通常提供建立在这些低层机制上的和体系结构无关的设施,但是为了提供最大的灵活性,和特定结构相关的接口始终可以被访问。
OSKit核心支持库在x86体系结构上尤为重要,因为该体系结构的OS级编程环境非凡復杂和模煳。核心支持库仔细地设置了一个基本的32位执行环境(为了和MS-DOS兼容,x86处理器通常以16位模式开始),初始化段和页转换表,安装一个中断向量表,并提供缺省的陷阱和中断处理程序。当然,客户OS能够修改或重载这些行为。然而,在缺省情况下,核心支持库自动地做所有必要的工作,以便使处理器进入一个方便的执行环境,此时中断、陷阱、调试以及其他标准设施已经如预期的那样开始工作。该库在缺省情况下自动地定位所有随内核加载的启动模块,并保留它们所在的物理内存。接下来,应用程序可以很轻易使用它们。客户OS只需以标准C语言风格提供一个main()函数。一切都设置好以后,内核支持库将用所有参数和由启动加载器传递过来的环境变量来调用它。
3.3内存管理库
如同在一个标准C语言库中实现的malloc()一样,内存管理代码典型地用于用户空间。通常并不适用于内核。设备驱动经常需要分配特定类型的内存,并伴随具体的调整属性。例如,对于内建的DMA控制器只能访问最初的16M物理内存。为解决这些内存管理新问题,OSKit包含了两个简单而灵活的内存管理库摘要:(1)基于队列的内存管理器(或称LMM),它提供了功能强大且高效的原语来进行分配管理,并支持在一个池中管理多种类型的内存。(2)地址映射管理器(或称AMM)被设计用来管理不必直接映射到物理内存或虚拟内存的地址空间,它对OS的其他方面提供了类似的支持,诸如进程地址空间、分页、空闲块或IPC名字空间的管理。尽管这些库可以很轻易地应用在用户空间,但实际上它们是被非凡设计用来满足OS内核的需求。

 3.4 最小C语言库
成熟的OS内核一般都包含着相当数量的仅仅用来重新实现基本的C语言库函数如printf()和malloc()的代码。和此形成对比的是,OSKit提供了一个最小化C语言函数库,它围绕着最小化依靠性而不是最大化函数性和性能的原则来设计。
3.5调试支持
OSKit的一个最实用的好处是摘要:给定一个适当的硬件设置,它马上就能提供给OS开发者一个完全源代码级的内核调试环境。OSKit内核支持库包括一个可用于GNU调试器(GDB)的串行存根模块,它在客户OS环境中处理陷阱,并使用GDB的标准远程调试协议通过一个串行程序和运行在另一臺机器上的GDB通信。甚至当客户机OS执行自己的陷阱处理时,OSKit的GDB存根模块也是可用的。假如客户OS提供适当的钩子,它甚至支持多线程调试。除了基本的调试器支持,OSKit也提供了一个内存分配调试库,它可以跟踪内存分配并检测一般的错误,如缓沖区溢出和释放已释放的内存。这个库提供了和许多普通应用程序调试器相似的功能性,所不同的是它运行在由OSKit提供的最小内核环境中
3.6 设备驱动支持
在OS开发和维护中最艰巨的一个任务是支持多种多样的I/O硬件。这些復杂的设备常会含有潜在的错误,而新硬件的发布又经常伴随着不兼容的软件接口。由于这些原因,OSKit采用了为现有内核开发的稳定的、经过充分测试的驱动程序。OSKit使用了一种封装技术,将现有的驱动程序代码基本上未加修改地合并到OSKit中。这些现有的驱动程序被一个OSKit粘结代码层所包装,从而使得这些驱动程序可以在和开发它们的环境完全不同的环境中工作。目前,来自Linux的大多数以太网卡、SCSI和IDE磁盘的设备驱动程序被包括进来,总数超过了五十种。用同样的方式,来自FreeBSD的八个字符设备驱动程序也被包含了进来,它们支持标准PC控制臺和串口及不同的多串口板。由于OSKit把这些驱动仔细地进行了包装,FreeBSD驱动程序可以和Linux驱动程序一起工作。
3.7 协议栈
OSKit提供了一个完整的TCP/IP网络协议栈。如同驱动程序一样,有关网络的代码也可以通过封装机制被合并进来。OSKit当前可以从Linux中获取网络设备驱动程序,它们是PC平臺可获得的最大的免费资源。OSKit的网络组件继续于FreeBSD4.4,它通常被认为具有更多成熟的网络协议。这显示了使用封装机制将现有软件包装成灵活的组件的第二个优点摘要:即从不同的资源中获取最好的组件,并让它们一起被使用。
3.8文件系统
通过使用封装技术,OSKit吸收了NetBSD的基于磁盘的文件系统代码。NetBSD之所以被选择为首要资源库,是因为在可用的系统中,它的文件系统代码被最清楚地分离了出来,而FreeBSD和Linux的文件系统和它们的虚拟内存系统结合的更紧密。当前,OSKit也把Linux文件系统合并了进来,以便能够支持多种类型的文件系统格式,如Windows95、OS/2和System V的文件系统格式等等。
OSKit文件系统输出的COM接口类似于许多Unix文件系统所使用的内部VFS接口。这些接口具有很好的粒度,使我们可以不必接触OSKit文件系统的内部。例如,OSKit接口只接受简单的路径名组件,答应平安封装的代码执行适当的访问许可检查。
4 OSKit的目前状况
自从在1996年6月发布了OSKit的第一个公开发行版以来,OSKit已经更新了多次,每次更新都增加了一些算法,并修正了一些错误。最新的发行版是2002年3月的版本。由此可见,OSKit一直处于操作系统开发平臺的前沿,其自身也在不断完善和发展。
5 结论

作为一个操作系统探究和开发的平臺,OSKit大大减轻了操作系统探究和开发者的负担。它可以让开发人员避开復杂的底层,而把喜好集中和他们所感喜好的领域。开发者可以用自己编写的组件来取代OSKit中的部分组件,以满足自己特定的需要,从而丰富了操作系统的应用层。总之,OSKit满足了实际客户系统的需求,有助于操作系统的探究和开发。

译文:

Currently, the operating system functionality continues to expand, operating system type showing a variety of trends. A small development team has not completely from scratch to achieve a practical operating system, and under normal circumstances, only the operating system to explore people's sense of taste specific areas, while for some other elements, such as boot loader code, core promoter code, device drivers and memory allocation code, and so often do not feel like, but a working prototype system and must contain the content. These infrastructure delayed the preparation of the operating system to explore the project's progress, but also increases the cost of the operating system to explore. In order to solve this new problem, the University of Utah FLUX inquiry team developed OSKit, it provides a framework and a set of modular, with a simple interface and a set of libraries that clear, reusable OS components. OSKit can be used to build the operating system kernel, the outer core OS services and other functional modules. OSKit offers a variety of functional modules, such as the simple bootstrap, a kernel can be used to minimize the POSIX environment, and physical memory and memory management consistent with its constraints and extensive debugging support, as well as high-level subsystems such as protocol stacks and file systems. Developers can explore according to their own preferences or the performance to be considered to use these modules, or to use their own modules to replace the standard OSKit modules. 

OSKit discloses its internal implementation details, allows the user from a mature operating system without modifying the code to extract, and then through a small part of the glue code carefully designed to merge them together, their dependence isolation and outputs well-defined interfaces. OSKit use of this technology integrates many stable and mature source code, including device drivers, file systems, network protocols and so on. Practice shows that the use of component software architecture and reuse technology will bring the field of operating systems to achieve a big impact. 

Two component technology Introduction Component technology is a relatively new software development technologies. So far, it is difficult to determine a clear definition of component technology. For example, a common argument against component technology are the following summary: 'Binary software unit', 'software that can be deployed at any occasion,' 'extraordinary suitable for third-party developers' and 'specification defines interfaces' and so on. Can generally be understood Abstract: The so-called component, in fact, is a deployable software code package, which includes some of the executable module. As a software component and separate development unit, or which has a clear interface, software components is through these interfaces can provide service calls, various components can be combined together to form a larger assembly or even directly establish the system. Component implementation must support one or more of its users want to get the interface. Implementation component does not necessarily need to use object-oriented language. In order to construct new applications, software developers identify appropriate components, these components will be added to the application being developed, while the application for testing and to ensure the application of the assembly work according to a predetermined plan normally. Can reduce the use of component technology development, testing, and maintenance costs, improve reliability and stability. 

3 Oskit Component Summary

OSKIT component library provides a general higher level function, which is usually only open to a number of related public call interface. Target system through the COM OSKit object-oriented interface to interact with these components. The following sections provide an overview of the components OSKit. 

3. A multi-boot program Most operating systems have their own boot loader mechanism incompatible with each other. The loading mechanism is not due to the diversity of each OS bootstrap services required due to the difference, but because of build boot loader caused a particular way. Because the operating system from the standpoint of the inquiry, the boot loader is a matter of not liking the area, so OS developers often carry a minimum, fast design. Because of the design concepts and requirements slightly different, each boot loader does not apply to the next OS. To solve this new problem, OSKit directly supports multi-start standard, which is composed of several members of the OS project to design, and its purpose is to provide a simple and universal boot loader and OS interface between the kernel, which promised a boot loader to load any compatible OS. 

During the operating system to explore, the more useful start standard, which is mainly due to the boot loader loads the kernel itself also has to load additional files or start module capability. Here's a startup module is just a regular file, the boot loader is not in any way to explain it, but just put it together along with the kernel image is loaded into physical memory block reserved. The kernel at boot time, the boot loader to the kernel provides a summary of the following: a list of physical addresses, all loaded boot size of the module, as well as associated with each module by a user-defined string. These startup module and and their associated user-defined string interpreted by the kernel. The purpose of doing so is to provide core activated by the required data such as the initialization procedure, the device driver and the file system server, to reduce the burden of the kernel boot. 

3.2 Core Support Library

OSKit core support library's primary purpose is to allow customers to more easily access the OS hardware facilities. It contains a large utility functions and symbols defined collection, the collection for the management mode code is very specific. And this corresponds, OSKit most other libraries in user mode code is often useful. And in the rest of the OSKit different, most of the core support code must be for the specific system structure, and these specific details of the machine is also useful for the client OS. For example, on an x86 machine, the core support library contains functions used to create and manipulate x86 page tables and segment registers. Other OSKit components typically build on these low-level mechanisms to provide the facilities and architecture-independent, but in order to provide maximum flexibility, and the particular structure of the relevant interface can always be accessed. 

OSKit core support library in the x86 architecture is particularly important, because the architecture of the OS-level programming environment extraordinary complexity and ambiguity. Core support library carefully set up a basic 32-bit execution environment (in order and MS-DOS compatible, x86 processor in 16-bit mode usually starts), the initialization section and page conversion tables, installing an interrupt vector table and provides default trap and interrupt handlers. Of course, the client OS can modify or override these behaviors. However, by default, the core support library automatically do all the necessary work in order to make the processor into a convenient execution environment, the interrupt, trap, debugging, and other standard amenities already started working as expected. The library by default to automatically locate all start with the kernel module is loaded, and retain their physical memory. Next, the application can easily use them. Client OS simply to provide a standard C language style main () function. After everything is set, the kernel will be used to support the library and all parameters passed by the boot loader environment variable to call it. 

3.3 memory management library as in a standard C language library implemented malloc (), like memory management code typically used for user space. Generally does not apply to the kernel. Device drivers often need to assign a specific type of memory, and accompanied by specific adjustment properties. For example, the built-in DMA controller can only access the first 16M physical memory. To address these new memory management issues, OSKit contains two simple and flexible memory management library Abstract: (a) queue-based memory manager (or called LMM), which provides a powerful and efficient primitives to be allocated management, and support in a variety of types of memory pool management. (2) address mapping manager (or called AMM) is designed to manage without directly mapped to physical memory or virtual memory address space, and other aspects of its OS provides similar support, such as the process address space, paging, idle blocks or IPC name space management. Although these libraries can be easily applied in user space, but in fact they are designed to meet the extraordinary demand for the OS kernel.
3.4 Minimum C language library mature OS kernel generally contain a considerable amount of used only to re-implement the basic C language library functions such as printf () and malloc () code. And this contrast, OSKit provides a minimal C language function library, which revolves around minimizing dependence rather than to maximize the function and performance of the design principles. 

3.5 Debugging Support

OSKit one of the most practical benefits Abstract: Given a suitable hardware setup, it can immediately available to OS developers a complete source-level kernel debugging environment. OSKit kernel support library includes a GNU debugger can be used (GDB) serial stub module, which dealt with the client OS environment traps, and use the standard GDB remote debugging protocol via a serial program and run on another machine The GDB communication. Even when the client OS performs its own trap handling, OSKit the GDB stub modules are also available. If the guest OS to provide appropriate hook, and it even supports multi-threaded debugging. In addition to basic debugger support, OSKit also provides a memory allocation debugging library, which can track and detect general memory allocation errors, such as buffer overflows and release freed memory. This library provides and many common application debugger similar functionality, the difference is that it runs in the minimum provided by the kernel OSKit environment 
3.6 device driver support in OS development and maintenance of the most daunting task is to support a variety of I / O hardware. These complex devices often contain potential errors, and the release of new hardware and is often accompanied by incompatible software interface. For these reasons, OSKit using existing kernel development stable, well-tested drivers. OSKit uses a packaging technology, the existing driver code is basically unmodified into OSKit in. These existing drivers are a code OSKit adhesive layer packaging, so that the driver can develop their environment and different environment. Currently, the majority from the Linux Ethernet cards, SCSI and IDE disk device drivers are included, the total number of more than 150 kinds. In the same way, eight characters from FreeBSD device drivers are also included in, they support standard PC and various consoles and serial multiport serial boards. Since these drives carefully OSKit were packaged, FreeBSD drivers and Linux drivers can work together. 

3.7 Protocol Stack

OSKit provides a complete TCP / IP network protocol stack. As drivers, network-related code encapsulation mechanism can also be merged in. OSKit can currently get from a Linux network device driver, which is the largest PC platform available free resource. OSKit network components continue FreeBSD4.4, it is generally considered to have more sophisticated network protocols. This mechanism shows the use of existing software packages packaged into flexible component Abstract second advantage: that is, from different sources to obtain the best components and allow them to be used together. 

3.8 file system through the use of packaging technology, OSKit absorb the NetBSD disk-based file system code. NetBSD was chosen primary repository, because the available systems, its file system code is most clearly separated out, and FreeBSD and Linux file system and virtual memory system combines them closer. Current, OSKit also put Linux file system incorporated in, to be able to support multiple types of file system formats, such as Windows95, OS / 2 and System V file system format and so on. 

OSKit file system output COM interface similar to many Unix file system used by the internal VFS interface. The interface has a good particle size, so that we can not touch the inside OSKit file system. For example, OSKit interface only accept the simple path name components, promised peace package code executes the appropriate access permission checks. 

4 OSKit Since the current status in June 1996 issued a OSKit first public release since, OSKit has been updated several times, each update adds some algorithms, and bug fixes. The latest release is the March 2002 version. Thus, OSKit operating system development platform has been in the forefront of their own is constantly being improved and developed. 

5 Conclusions as an operating system platform to explore and develop, OSKit greatly reducing the operating system to explore and develop the burden. It allows developers to avoid the complexities of the underlying, and the concentration and their sense of taste preferences fields. Developers can write your own components to replace some components OSKit in order to meet their own specific needs, thus enriching the operating system, application layer. In short, OSKit meet the actual needs of the client system, the operating system will help explore and develop.

文章评论
发表评论:(匿名发表无需登录,已登录用户可直接发表。) 登录状态: 未登录,点击登录

地址:上海徐汇区田林东路55号汇阳广场20楼C23和C22室(英文论文润色服务) 热线电话:400-0871-070

旗下母公司:上海译境翻译服务有限公司   联系电话:021-6131 4984

                            英语助手英文论文润色官方网版权所有沪ICP备14046471号-1 © 2007-2027 E-ging All Rights Reserved.

                           咨询电话:137 6474 0063      咨询QQ:229632732          服务邮箱:info@e-ging.xyz