Micronúcleo de Sistema Operativo para tiempo real sobre la arquitectura Intel de 32 bits



Micronúcleo de Sistema Operativo para tiempo real sobre la arquitectura Intel de 32 bits

William Martínez Cortés
 

Texto completo de la Tesis     

 



Resumen

 

En 2003 fue creado un micronúcleo experimental de sistema operativo de tiempo real, denominado PARTEMOS. Este micronúcleo ha servido de plataforma de prueba para muchas investigaciones en el área de sistemas operativos y de tiempo real, contando con características avanzadas como su novedosa técnica de manejo de interrupciones. El micronúcleo fue programado para ejecutarse en el modo real de 16 bits, disponible en los procesadores 80x86 y compatibles, lo que unido al uso de un modelo de memoria “small” limitaba todo el sistema a 64 KB de memoria para código y otros 64 KB para datos. En el presente trabajo, el código de PARTEMOS fue adaptado para poder ejecutarse en el modo protegido de 32 bits de los procesadores 80386 y superiores, como método para obtener una versión fácilmente portable del mismo e identificar los pasos necesarios para portar PARTEMOS a otras plataformas. Adicionalmente, esta adaptación permite la ejecución del sistema en 32 bits sin restricciones de memoria. Aunque la arquitectura de PARTEMOS fue diseñada pensando en su portabilidad, el sistema nunca había sido portado a otras plataformas, y el código fuente del micronúcleo contenía muchas secciones no portables. Para reducir este problema, el código del sistema fue sometido a modificaciones que mejoraron su portabilidad. Adicionalmente se realizaron cambios para mejorar la eficiencia y hacer más simples algunas secciones de código. La nueva versión de PARTEMOS obtenida no solo puede ejecutarse en el modo protegido de 32 bits, sino que mantiene la capacidad de ejecutarse en la plataforma de 16 bits original, constituyendo la primera versión multiplataforma de este sistema. Adicionalmente, la nueva versión de 32 bits de PARTEMOS es capaz de utilizar el controlador de interrupciones programable avanzado (APIC), como alternativa al clásico PIC 8259, para administrar las interrupciones del sistema. Para poder desarrollar la versión de 32 bits de PARTEMOS, fue necesario hacerse de las herramientas de desarrollo adecuadas y de sus técnicas de uso, lo que resultó en una metodología para el desarrollo de sistemas operativos de 32 bits. También se crearon metodologías para el desarrollo de aplicaciones sobre PARTEMOS, y para portar PARTEMOS a otras arquitecturas de hardware. Entre otros logros de este trabajo podemos resaltar la asimilación de conocimiento acerca del funcionamiento de la arquitectura Intel de 32 bits, y de los controladores APIC; conocimiento que en buena medida ha quedado plasmado en el presente documento de tesis.

 

Abstract

In 2003, an experimental real time operating system microkernel, called PARTEMOS, was created. This microkernel has been used as a testing ground for several investigations in the operating systems and real-time areas, having advanced features like a novel technique of interrupt handling. The microkernel was built to run in 16-bit real mode, available in 80x86 and compatible processors; this, in conjunction with use of a “small” memory model, limits the system to 64 KB of memory for code and 64 KB for data. In this work the PARTEMOS code was adapted to run in the 32-bit protected-mode of the 80386 and above processors, as a means to obtain an easily portable version of it, and identify the steps required to port PARTEMOS to other platforms. Additionally, this adaptation allows the 32 bits system execution without memory restrictions. Although the PARTEMOS architecture was designed thinking in its portability, the system had never been ported to other platforms, and the microkernel source code contained many not portable sections. To reduce this problem, the system code was modified to improve its portability. Further changes were made to improve the efficiency and simplify some sections of code. The new obtained version of PARTEMOS not only can run in the 32-bit protected mode, it also retains the ability to run on the original 16-bit platform, so it is the first multiplatform version of this system. Additionally, the new 32-bit version of PARTEMOS can use the Advanced Programmable Interrupt Controller (APIC), as an alternative to the classic PIC 8259 to manage system interrupts. In order to develop the 32-bit version of PARTEMOS, it was necessary to take appropriate development tools and the techniques to use them, resulting in a methodology for 32-bit operating system development. Also, methodologies for application development on PARTEMOS and for PARTEMOS porting were created. Among other results of this work we have the knowhow assimilation about the internals of the Intel 32-bit architecture, and the APIC controllers; knowledge that has largely been captured in the present document. Keywords: Real Time Operating System (RTOS), Embedded Systems, Interrupt handling, 32 bits Intel Architecture (IA-32), Hardware Abstraction layer (HAL), Advanced Programmable Interrupt Controller (APIC)