"Fossies" - the Fresh Open Source Software Archive

Member "dosemu-1.4.0/src/doc/README/HOGTHRESHOLD" (23 Jun 2003, 3798 Bytes) of package /linux/misc/old/dosemu-1.4.0.tgz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <sect1>
    2 <title>Setting HogThreshold</title>
    3 
    4 <para>
    5 Greetings DOSEMU fans,
    6 </para>
    7 
    8 <para>
    9 Hogthreshold is a value that you may modify in your DOSEMU.CONF file.  It
   10 is a measure of the "niceness" of Dosemu.  That is to say, it attempts to
   11 return to Linux while DOS is 'idling' so that DOSEMU does not hog all the
   12 CPU cycles while waiting at the DOS prompt.
   13 </para>
   14 
   15 <para>
   16 Determining the optimal Hogthreshold value involves a little bit of magic
   17 (but not so much really.)  One way is to try different values and look at
   18 the 'top' reading in another console.  Setting the value too low may
   19 mildly slow Dosemu performance.  Setting the value too high will keep the
   20 idling code from working.
   21 </para>
   22 
   23 <para>
   24 That said, a good basic value to try is "half of your Bogo-Mips value".
   25 (The Bogo-Mips value is displayed when the kernel is booting, it's an
   26 imaginary value somewhat related to CPU performance.)
   27 </para>
   28 
   29 <para>
   30 Setting the value to 0 will disable idling entirely.  The default value is
   31 10.
   32 </para>
   33 
   34 <para>
   35 This files is some kind of FAQ on how to use the 'HogThreshold' value in the
   36 dosemu config file.
   37 </para>
   38 
   39 <para>
   40 In case you have more questions feel free to ask me (
   41 <ulink
   42 url="mailto:andi@andiunx.m.isar.de"
   43 >&#60;andi@andiunx.m.isar.de&#62;</ulink
   44 >).
   45 </para>
   46 
   47 <para>
   48 Those of you who simply want to have DOSEMU running at highest possible speed
   49 simply leave the value to zero, but if you are concerned about
   50 DOSEMU eating too much CPU time it's worth playing with the HogThreshold value.
   51 <variablelist>
   52 
   53 <varlistentry>
   54 <term>Why do I need to set the HogThreshold value, why can't DOSEMU
   55 just stop if it is waiting for a keystroke ?</term>
   56 <listitem>
   57 <para>
   58 The reason is the way how DOS and a lot of applications have implemented
   59 `waiting for a keystroke'.
   60 </para>
   61 
   62 <para>
   63 It's most often done by something similar to the following code fragment :
   64 </para>
   65 
   66 <para>
   67 
   68 <screen>
   69 wait_for_key:
   70 	; do something
   71 	mov ah,1
   72 	int 0x16 ; check key status
   73 	jz	wait_for_key ; jump if no key
   74 	; found a key
   75         mov ah,0
   76         int 0x16 ; get key
   77 </screen>
   78 
   79 </para>
   80 
   81 <para>
   82 This means that the application is busy waiting for the keystroke.
   83 </para>
   84 </listitem></varlistentry>
   85 <varlistentry>
   86 <term>What is a good value for HogThreshold to start with ?</term>
   87 <listitem>
   88 <para>
   89 On a 40 MHZ 486 start with a value of 10.
   90 Increase this value if you to have your DOS application run faster,
   91 decrease it if you think too much CPU time is used.
   92 </para>
   93 </listitem></varlistentry>
   94 <varlistentry>
   95 <term>It does not work on my machine.</term>
   96 <listitem>
   97 <para>
   98 You need to have at least dosemu0.53pl40 in order to have the
   99 anti-hog code in effect.
  100 </para>
  101 </listitem></varlistentry>
  102 <varlistentry>
  103 <term>Why not simply use a very low value of "HogThreshold" ?
  104 Do I really have to try an individual value of HogThreshold ?</term>
  105 <listitem>
  106 <para>
  107 This would slow down your DOS application. But why not, DOS is slow
  108 anyway :-).
  109 </para>
  110 </listitem></varlistentry>
  111 <varlistentry>
  112 <term>How do I found out about CPU usage of DOSEMU ?</term>
  113 <listitem>
  114 <para>
  115 Simply use `top'. It displays cpu and memory usage.
  116 </para>
  117 </listitem>
  118 </varlistentry>
  119 </variablelist>
  120 </para>
  121 
  122 <para>
  123 P.S.  If you want to change the HogThreshold value during execution,
  124 simply call
  125 
  126 <screen>
  127  mov al,12h
  128  mov bx,the_new_value
  129  int e6h
  130 </screen>
  131 
  132 This is what speed.com does. If you are interested, please take a look
  133 at speed.c.
  134 </para>
  135 
  136 <para>
  137 Notes:  If your application is unkind enough to do waits using an int16h
  138 fcn 1h loop without calling the keyboard idle interrupt (int 28h), this
  139 code is not going to help much.  If someone runs into a program like this,
  140 let me (
  141 <ulink
  142 url="mailto:scottb@eecs.nwu.edu"
  143 >&#60;scottb@eecs.nwu.edu&#62;</ulink
  144 >
  145 ) know and I'll rewrite something into the
  146 int16 bios.
  147 </para>
  148 
  149 </sect1>
  150