home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qbslice.zip / README.TXT < prev   
Text File  |  1995-05-24  |  3KB  |  80 lines

  1. QBSlice.BAS - A simple demonstration of how to give up time slices to OS/2 
  2.               Warp from MS QuickBasic.
  3.  
  4. Motivation:
  5.  
  6.      Several packages of pointers exist on how to make a DOS program give 
  7. up time slices to OS/2 (and hence let OS/2 multi-task better), and/or 
  8. adjust the session priority of a DOS session.  E.g. at ftp-os2.nmsu.edu
  9. there are the following packages:
  10.  
  11. dos:
  12. os2sp200.zip       2166  Allow Desqview-aware programs to give up 
  13.                          timeslices
  14. os2/dev32:
  15. slice.zip          5417  Give up time slices from DOS progs, w/TASM source
  16.  
  17. os2/unix:
  18. nice10.zip        19855  Unix nice = give up timeslices to other programs
  19.  
  20. os2/textutil:
  21. sp102.zip         86773  SetPriority v1.20, start programs at a defined 
  22.                          priority
  23.  
  24. However, these packages are generally designed for someone who knows C
  25. and/or assembly and can be difficult for a programming novice to use with
  26. other languages.
  27.  
  28.      Microsoft's QuickBasic is an old language, but is still used a great
  29. deal to control PC interface cards (e.g. A/D and D/A converters, etc.).
  30. Because it is so popular, it would be useful to have a way to use Basic
  31. routines to give up time slices to OS/2.
  32.  
  33.      A thread which frequently recurrs in the comp.os.os2.programmer.misc
  34. Usenet news group concerns how to give up time slices to OS/2 inside a DOS
  35. program.  This package (QBSlice.zip) shows how to use the simplest method
  36. of giving up time slices to the operating system - calling DOS Interrupt 2FH
  37. - under QuickBasic.  The example code provided should be simple to port to
  38. other versions of Basic which permit calling DOS Interrupt functions.
  39.  
  40. Method:
  41.  
  42.      OS/2 supports the Windows interrupt Int2FH, AX=1680H.  This interrupt
  43. releases the current virtual machine time slice to the operating system. 
  44.  
  45.      The use of DOS interrupts with QuickBasic is explained in Michael
  46. Tischer's "PC Intern" (Abacus, ISBN 1-55755-145-6), pp.41-43.  The 
  47. virtualization of the DOS interrupts under OS/2 is briefly documented in
  48. IBM's OS/2 "Virtual Device Driver" manual - part of the OS/2 Technical
  49. Library.  Interrupt 2FH (and many others!) are descibed in Ralf Brown's
  50. Interrupt List (which is available via anonymous FTP, and in hypertext form
  51. in Shulman, et al's, "Undocumented DOS" (Addison-Wesley, ISBN
  52. 0-201-57064-5).
  53.  
  54. Contents:
  55.  
  56.      The QBSlice.ZIP archive contains:
  57.  
  58.       README.TXT - this file.
  59.       QBSlice.BAS - the QuickBasic source.
  60.       QBSlice.EXE - the executable version of QBSlice.BAS
  61.  
  62. Acknowledgement:
  63.  
  64.      Many thanks to the programmers who've contributed to this thread in 
  65. comp.os.os2.programmer.misc, and especially Jens Glathe (author of 
  66. sp102.zip).
  67.  
  68. Limitation:
  69.  
  70.      This method should work under OS/2 2.0, but the attached code has only
  71. been tested on OS/2 Warp v3.  Interrupt 2FH, AX=1680H apparently is broken
  72. under OS/2 2.1x.  Jens' package is a solution for that case.
  73.  
  74.      I hope this is useful.  No warranties are expressed or implied.  Best 
  75. of luck.
  76.  
  77. D. Scott Katzer
  78. katzer@estd.nrl.navy.mil
  79. 24 May 1995.
  80.