home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
qbslice.zip
/
README.TXT
< prev
Wrap
Text File
|
1995-05-24
|
3KB
|
80 lines
QBSlice.BAS - A simple demonstration of how to give up time slices to OS/2
Warp from MS QuickBasic.
Motivation:
Several packages of pointers exist on how to make a DOS program give
up time slices to OS/2 (and hence let OS/2 multi-task better), and/or
adjust the session priority of a DOS session. E.g. at ftp-os2.nmsu.edu
there are the following packages:
dos:
os2sp200.zip 2166 Allow Desqview-aware programs to give up
timeslices
os2/dev32:
slice.zip 5417 Give up time slices from DOS progs, w/TASM source
os2/unix:
nice10.zip 19855 Unix nice = give up timeslices to other programs
os2/textutil:
sp102.zip 86773 SetPriority v1.20, start programs at a defined
priority
However, these packages are generally designed for someone who knows C
and/or assembly and can be difficult for a programming novice to use with
other languages.
Microsoft's QuickBasic is an old language, but is still used a great
deal to control PC interface cards (e.g. A/D and D/A converters, etc.).
Because it is so popular, it would be useful to have a way to use Basic
routines to give up time slices to OS/2.
A thread which frequently recurrs in the comp.os.os2.programmer.misc
Usenet news group concerns how to give up time slices to OS/2 inside a DOS
program. This package (QBSlice.zip) shows how to use the simplest method
of giving up time slices to the operating system - calling DOS Interrupt 2FH
- under QuickBasic. The example code provided should be simple to port to
other versions of Basic which permit calling DOS Interrupt functions.
Method:
OS/2 supports the Windows interrupt Int2FH, AX=1680H. This interrupt
releases the current virtual machine time slice to the operating system.
The use of DOS interrupts with QuickBasic is explained in Michael
Tischer's "PC Intern" (Abacus, ISBN 1-55755-145-6), pp.41-43. The
virtualization of the DOS interrupts under OS/2 is briefly documented in
IBM's OS/2 "Virtual Device Driver" manual - part of the OS/2 Technical
Library. Interrupt 2FH (and many others!) are descibed in Ralf Brown's
Interrupt List (which is available via anonymous FTP, and in hypertext form
in Shulman, et al's, "Undocumented DOS" (Addison-Wesley, ISBN
0-201-57064-5).
Contents:
The QBSlice.ZIP archive contains:
README.TXT - this file.
QBSlice.BAS - the QuickBasic source.
QBSlice.EXE - the executable version of QBSlice.BAS
Acknowledgement:
Many thanks to the programmers who've contributed to this thread in
comp.os.os2.programmer.misc, and especially Jens Glathe (author of
sp102.zip).
Limitation:
This method should work under OS/2 2.0, but the attached code has only
been tested on OS/2 Warp v3. Interrupt 2FH, AX=1680H apparently is broken
under OS/2 2.1x. Jens' package is a solution for that case.
I hope this is useful. No warranties are expressed or implied. Best
of luck.
D. Scott Katzer
katzer@estd.nrl.navy.mil
24 May 1995.