Task 1

[ Class Overview ] [ CGA Screen ] [ Keyboard ]

Task 1: Input/Output functionality for OOStuBS

Learning objectives

Task description

For test outputs and to simplify debugging, the OOStuBS exercise operating system should first be equipped with output functionality.

These are supposed to be used similar to the C++ IO-Streams library and implemented with the help of the classes IO_Port, CGA_Screen, Stringbuffer, O_Stream and CGA_Stream. Thereby the class IO_Port is provided by us.

In order to use the output functionality everywhere in OOStuBS, a global CGA_stream object kout should be created.

In order to allow interactive applications you should additionally complete class Keyboard_Controller, which is included in the specification besides Key.

The functionality of the mentioned classes should be demonstrated with the help of a meaningful test program. For this purpose, the object kout will be used for differently formatted outputs in the main function of the "operating system" OOStuBS. For the test of the keyboard input a KeyboardController object should be created. Characters from the keyboard will then be polled in a loop and printed by using kout.

Note: In later tasks, application and test code should be implemented in the application class (from the specification) and not in main. If you want, you can of course do this already in task 1.

Implementation notes

The task essentially consists of the two parts "outputs" and "inputs", whereby the test of the "inputs" is not possible without "outputs". The subtask "outputs" can also be divided into three independent parts, which can be solved and tested individually. Therefore, we recommend the following workflow:

Outputs

  1. The class CGA_Screen and a small test application.
  2. The classes Stringbuffer and O_Stream and a small test application.
  3. The classes CGA_Stream and a small test application.

Inputs

  1. Completion of the Keyboard_Controller class and the final test application.

You should be especially careful when implementing set_repeat_rate and set_led. It is quite possible that bugs in these functions will only lead to problems in task 2 and following - which does not necessarily make troubleshooting there a lot easier.

Specifications

The provided git repository already contains some code, tools, assembler files and a Makefile, which you can use to compile your program and write it to a boot disc or a USB stick.

Additional information