Ada Kalinda: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
No edit summary
Line 2: Line 2:




= Brief history and initial objectives =
=== Brief history and initial objectives ===




Line 28: Line 28:


Finally, after many years of instructive trials, I converted the initial Pascal code in something as close as possible to Ada 83, with only the "regrettable forced use" of child packages. I would have been very glad to be an Ada 83 purist, but child packages really simplify the Macintosh like OS structure of Kalinda. Only with child packages is it possible to write a complete interface to system services and complete this universal application interface layer with a sub layer which uses the same partially hidden data structures and implements the system itself. Pure Ada 83 would force to duplicate source code for data structures introducing potential compatibility problems and complicating the maintenance of the software.
Finally, after many years of instructive trials, I converted the initial Pascal code in something as close as possible to Ada 83, with only the "regrettable forced use" of child packages. I would have been very glad to be an Ada 83 purist, but child packages really simplify the Macintosh like OS structure of Kalinda. Only with child packages is it possible to write a complete interface to system services and complete this universal application interface layer with a sub layer which uses the same partially hidden data structures and implements the system itself. Pure Ada 83 would force to duplicate source code for data structures introducing potential compatibility problems and complicating the maintenance of the software.

----

=== Present state of the affair : Kalinda 2018 ===

It seems relatively few people are interested in using Ada 83 or (Ada 95 83 styled) in present developments, and OS development in Ada is rather rare. Ada Bare Bones project is one of the rare ones. Kalinda experiment could be of some use for Ada OSers as it has a peculiar development path.

Kalinda 2018 uses the following development system.

A recent gcc toolchain with gnat Ada compiler built on Ubuntu for host Linux X86-64 and targeted to i486-unknown-elf (gcc 7.3.0 with binutils 2.30). The compiler is configured with --enable-languages=ada --disable-libquadmath --disable-libada --disable-libssp and subsequently stripped to the strict minimum : the gcc / gnat_1, as, ld, gnatbind, gdb. All libraries/includes have been removed.
The NASM assembler used for historical reasons for assembling the boot block and the "amorce" which prepares flat memory, sets protected mode and jumps to Ada code.

Revision as of 22:07, 18 March 2018

The Ada Kalinda OS

Brief history and initial objectives

This project dates back from the early 1990ies.

A few years earlier computer science had seen two marked evolutions : the Macintosh and the Ada language. Both were, each in its own domain, new worlds.

Strangely, those two worlds were quickly disappearing in their initial form : - The purity of black and white Macintosh was rapidly superseded by more powerful various machines, color screens, new os versions. - Ada 83 stayed confined to some specialized area of high reliability software and twelve years later was "augmented" with Ada 95. This brought rare useful additions and a bunch of new possibilities which were more prone to degenerate the initial idea and the occasion of an added compiler complexity.

Being a Pascalist with a strong allergy to C, Ada 83 was a real wonder and a compiler performance at the time. The inside Macintosh four volumes documentation were a thorough description of the Mac Plus system. I then decided to see if rewriting a Mac Plus OS with Ada 83 was possible and brought some clarity and ease of software maintenance.

But at the time, Ada cross compiler were rare and costly, so that a rewriting of the OS began in fact in CodeWarrior Pascal. Several machines were used, as the dual PPC/i86 power pc, but development mainly progressed on a Mac LCIII with CodeWarriow Windows MetroNub to target an x86 pc. The project advanced up to a functional graphical interface and a start of usable file system. But the Pascal code was becoming very heavy to maintain for a single person and an interruption of the development showed that reinsertion in the project was rather difficult and the Pascal code not so easy to comprehend or read.

Time passing, CodeWarrior tools and machines changing, cross development became more difficult and tentative of rewriting in C was done which was quickly abandoned being an horror story in maintenance and reinsertion in source code.

Then Gnat appeared and being a new Linux user I saw that version 3.15 built on gcc 2.81 could be used with its pragma "No_Run_Time" as a sort of "half cross-compiler" x86 Linux hosted and generating x86 binary executable on a bare x86 pc.

A few trials were positive but development was not using a gdb stub and disquettes transfer for execution tests were cumbersome. The boot code was written in this configuration with much pain and beeps and all sort of debugging tricks, those who tried know. Later I decided to use the Bochs emulator to test the binary, a vast improvement indeed.

The Gnat 3.15 being an Ada 95 compiler, the appeal of novelty aiding, I took the old Code Warrior Pascal source an decided to rewrite with new objects programming possibilities. Rather than an improvement, it resembled a catastrophe, it proved that the new Ada was much more prone to spaghetti code than the Ada 83 and that the best option was to adhere as much as possible to Ada 83 programming which imposed more constraints but resulted in better structured and simpler code, so that return and reinsertion in source code was easier.

Finally, after many years of instructive trials, I converted the initial Pascal code in something as close as possible to Ada 83, with only the "regrettable forced use" of child packages. I would have been very glad to be an Ada 83 purist, but child packages really simplify the Macintosh like OS structure of Kalinda. Only with child packages is it possible to write a complete interface to system services and complete this universal application interface layer with a sub layer which uses the same partially hidden data structures and implements the system itself. Pure Ada 83 would force to duplicate source code for data structures introducing potential compatibility problems and complicating the maintenance of the software.


Present state of the affair : Kalinda 2018

It seems relatively few people are interested in using Ada 83 or (Ada 95 83 styled) in present developments, and OS development in Ada is rather rare. Ada Bare Bones project is one of the rare ones. Kalinda experiment could be of some use for Ada OSers as it has a peculiar development path.

Kalinda 2018 uses the following development system.

A recent gcc toolchain with gnat Ada compiler built on Ubuntu for host Linux X86-64 and targeted to i486-unknown-elf (gcc 7.3.0 with binutils 2.30). The compiler is configured with --enable-languages=ada --disable-libquadmath --disable-libada --disable-libssp and subsequently stripped to the strict minimum : the gcc / gnat_1, as, ld, gnatbind, gdb. All libraries/includes have been removed. The NASM assembler used for historical reasons for assembling the boot block and the "amorce" which prepares flat memory, sets protected mode and jumps to Ada code.