Browse Prior Art Database

Simple Background Task Mechanism Using Timer Interrupt on a Single Task OS

IP.com Disclosure Number: IPCOM000035014D
Original Publication Date: 1989-May-01
Included in the Prior Art Database: 2005-Jan-28
Document File: 5 page(s) / 170K

Publishing Venue

IBM

Related People

Hiraga, R: AUTHOR [+4]

Abstract

This article describes a simple method to implement a background task on a single task operating system. This method utilizes the timer interrupt mechanism. The conventional background task mechanism, such as PRINT command of PC-DOS, has two defects. One is that a background task cannot use system calls and BIOS calls because handling routines of these calls (Image Omitted) are not reentrant. The other is that a background task runs periodically, not depending on whether a foreground task is busy or not. There is also another method to realize a background task on a single task OS. A multitasking shell realizes multitask capability. However, it has overheads to create or terminate tasks, and it needs large memory. The proposed mechanism solves these problems.

This text was extracted from a PDF file.
At least one non-text object (such as an image or picture) has been suppressed.
This is the abbreviated version, containing approximately 54% of the total text.

Page 1 of 5

Simple Background Task Mechanism Using Timer Interrupt on a Single Task OS

This article describes a simple method to implement a background task on a single task operating system. This method utilizes the timer interrupt mechanism. The conventional background task mechanism, such as PRINT command of PC-DOS, has two defects. One is that a background task cannot use system calls and BIOS calls because handling routines of these calls

(Image Omitted)

are not reentrant. The other is that a background task runs periodically, not depending on whether a foreground task is busy or not. There is also another method to realize a background task on a single task OS. A multitasking shell realizes multitask capability. However, it has overheads to create or terminate tasks, and it needs large memory. The proposed mechanism solves these problems. A program of a background task and most of its control is written as a timer interrupt routine. Therefore, its size is small and task switching is quick.

(Image Omitted)

With this mechanism a background task can use system/BIOS calls. Moreover, it monitors the behavior of a foreground task, and has a background task run when the foreground task is idle. Fig. 1 shows the configuration of the system when the mechanism is loaded. The hatched area shows modules of the mechanism. The mechanism consists of a timer interrupt routine, interrupt interceptors and a background remover. A background remover removes the background task mechanism by freeing memory for the mechanism. The timer interrupt routine consists of timer counter part, status checker and main body of a background task. The timer counter part has two counters. One counts the elapsed time since the last keyboard input was done. The other counts the elapsed time since the last system/BIOS call was issued. These counters are set at 0 by interceptors when respective events happen. The status checker tests two kinds of status. One is the status of counters. This test assures the system that a background task runs when a foreground task is idle. If the counter for a keyboard input and one for a system/BIOS call have values that exceed the predefined values, the status checker proceeds to the next check of the status. The status checker also tests the status of a foreground task to realize the mutual exclusion of system/BIOS calls. The mechanism intercepts system/BIOS calls from a foreground task, and interceptors use flags to indicate that a foreground task is using handling routines of these calls. The status checker checks the flags. If all flags are off, the timer interrupt routine proceeds to the main body of a background tas...