Multi Tasking Kernel for DDP-516 / H-316

  • Home
  • Although much of the original software produced for these machines is still available on the Web, it is only the paper tape software. Neither an operating system nor any software for disk support can be found. When testing the interrupt mechanism of the 316 SIMH simulator with a bit more complex program, I got the idea to structure that test program like a small executive. Step by step the result was a real executive like the ones which were very popular for minicomputers like the DDP-516 in the late sixties. At that time, the 'standard' software did not provide an operating system (yet), so for many applications a kind of OS was made, some specialized for real time operation, others just for multitasking or foreground / background operation. It was only around 1969/1970 that Honeywell came with an OS type of system like DOP, including disk support and directed to software development.

    This page reflects the results so far of my exercises of testing the interrupt system of the simulator and the moving head disk. The executive became to something which might be of some interest to others as well and the exercise with the disk resulted in a driver. The driver was tested with a straightforward standalone test program and is not yet integrated in the executive. Via the link Moving Head Disk driver more details of that driver can be accessed. The remaining part of this page explains the characteristics of the current version of the executive, which for brevity is called MTK16.

    MTK16 characteristics

    The executive currently supports the following devices:

  • TTY, for keyboard input and printing;
  • PTR, high speed paper tape reader;
  • PTP, high speed paper tape puncher;
  • RTC, a 50 Hz real time clock.
  • Peripheral support can be extended without too much effort.

    MTK16 is a core resident multitasking kernel for the execution of core resident tasks, exploits simple round-robin scheduling and takes only less than a sector of core space. Kernel and tasks must run in the lower 16k of memory. To prevent cross sector links, the kernel has to start at a sector boundary. As default it uses the highest sector of the lowest 8k or 16k memory block. The kernel is provided as a package of subroutines, which has to be linked to the tasks to run.

    A complete running system is structured in 3 rings:

  • Ring-0: interrupt handling
  • Ring-1: interrupt initiation, service primitives, task scheduling
  • Ring-2: program tasks/testing programs
  • The rings are not protected from each other; Ring-0 and Ring-1 are the kernel and the application programs (tasks) run in Ring-2.

    Task Control Blocks (TCB's)

    A task is presented to the system by its Task Control Block (TCB). All TCB's are collected in the Task Control Block table. A task uses Service Primitives provided by Ring-1. Ring-1 also provides a scheduler with a few standard calls to support the coding of the Ring-1 services. The Ring-2 tasks run with the interrupt enabled and use the Service Primitives (provided by Ring-1) by means of subroutine calls.

    Service Primitives

    The Service Primitives are not reentrant; Ring-1 code is not allowed to call Ring-1 primitives and, because the interrupt is enabled when Ring-1 is entered and in parts of Ring-1, also Ring-0 is not allowed to use Ring-1 primitives (e.g. the call address of a primitive Ring-1 primitive could be overwritten). The main consequence of this design is that Ring-0, after handling an interrupt, is not allowed to go to the scheduler. After interrupt completion, Ring-0 has just to resume at the location were the processing was interrupted (in Ring-2 or Ring-1). Communication between Ring-1 and Ring-0 is by means of events.

    Preemption

    As an option however, a simple form of preemption can be configured. In that case the scheduler is entered after interrupt completion (e.g. after a clock interrupt) when the interrupt did not occur while executing Ring-1 code. With this option a task not using Ring-1 primitives can be executed in parallel of the multi tasking of other tasks, although the throughput of those tasks slows down.

    Overview of the Ring-1 Service Primitives

    Services are provided in the following categories:

  • Timer service (to be used by Ring-2 code)
  • Device management services (to be used by Ring-2 code)
  • Input/Output services (to be used by Ring-2 code)
  • Task synchronization services (to be used by Ring-2 code)
  • Task management services (to be used by Ring-2 code)
  • The task scheduler (to be used by Ring-1 code)
  • A complete overview, including the calling sequences can be found in "Services".

    Configuration

    At least three parts are required to make a running system:

    1) The basic kernel (MTK16-VX-Y)

    This module provides support for the standard devices: RTC, TTY, PTR and PTP and the Ring-1 Service Primitives. This module can be used as is; no configuration modifications are required.

    2) The config module (MTK16-CONF)

    Providing the initialization code, Task Control Block table, Timer table, Soft Interrupt table, interrupt enable mask, preemption flag, address range used by Ring-1 code, interrupt skip chain extension, with the option to add external interrupt service routines. All these parts may need modifications for a specific configuration.

    3) The program tasks

    These determine the application and must all be provided as a single or multiple modules. For each task, a TCB must be provided in the Task Control Block table in the config module. To get the system running, all parts have to be linked together with one of the standard loaders; the 1st address of the config module is the start address of the whole system.

    Demo

    The 3 files:

  • MTK16-V1-3
  • MTK16-CONF
  • MTK16-TEST3
  • together create a small demo system, which shows the operation of the multi tasking kernel. The files can be found in the Software Archive.

     

    Page last updated on: October 10 2007 | Contact: Info@theoengel.nl