Xref: utzoo comp.windows.ms:3312 comp.sys.ibm.pc:53798 comp.sys.ibm.pc.misc:32 comp.binaries.ibm.pc.d:8549 comp.os.msdos.apps:27 comp.os.msdos.misc:29 comp.os.msdos.programmer:61 Path: utzoo!attcan!uunet!mailrus!iuvax!bsu-cs!mdlawler From: mdlawler@bsu-cs.bsu.edu (Michael D. Lawler) Newsgroups: comp.windows.ms,comp.sys.ibm.pc,comp.sys.ibm.pc.misc,comp.binaries.ibm.pc.d,comp.os.msdos.apps,comp.os.msdos.misc,comp.os.msdos.programmer Subject: himem.sys 2.60 and three bugs Keywords: 32-bit AX register and 386 machines, handles and the resize function, and the interrupt 15 handler Message-ID: <11416@bsu-cs.bsu.edu> Date: 9 Jul 90 06:50:21 GMT Organization: CS Dept, Ball St U, Muncie, IN, USA Lines: 230 Checksum: 1627469037 (verify with brik -cv) I have found three bugs in himem.sys 2.60 that I will outline in this article. They are (1) himem.sys 2.60 doesn't correctly support the resize function which will cause it to incorrectly assign handles, (2) it doesn't correctly preserve the 32-bit AX register which can cause problems on 386 machines, and (3) the interrupt 15 handler incorrectly assumes the state of interrupts which can cause conflicts between himem.sys and the keyboard controller chip. I think that himem.sys does an iret instead of a far ret. It either incorrectly assumes the interrupts are always off or on. I think that it assumes that they are off. The information below is about the handles bug and the xmstest.exe program. Note that the first handle is numbered 2848 with himem.sys 2.60 and that since the handles take 6 bytes of memory that the handle numbers increase by 6 I.E. 2848, 2854, 2860, .... Use xmstest.exe menu selection 1 to allocate all of your xms memory. For this example lets say that you have 3456 K of xms like I do. Then use menu selection 5 to resize handle 2848 down to 3436 K. Then use menu selection 1 to allocate the 20 K that you freeed up by resizing the 3456 K block down to 3436 K. Repeat this procedure and note that the handle numbers start incrementing by 12 instead of 6 after the second or third resize. Note that himem.sys will goahead and use the handles it skips after it has run out of handles if it doesn't have to do a resize to use them. Note that the first handle number is only 2848 on my machine it might very on others. Please run xmstest and email your results to me. Maybe if enough people are made aware of these bugs then Microsoft will fix them. section 1 of uuencode 4.02 of file xmstest.exe by R.E.M. begin 644 xmstest.exe M35I@`1$`@0`B`'D(>1!M`@"```!_"0``'````"X````_````30```%T```!G@ M````<0```'\```"\````A@(``(L"``"=`@``H@(``+0"``"Y`@``RP(``-`"L M``!``P``6P,``'0#``"4`P``R0,``-X#``#Q`P``!@0``!`$```:!```)`0`' M`"X$```X!```0@0``$P$``!6!```7@0``&,$``"X!```O00``,<$``#/!```M M#P4``"`%```H!0``+04``&X%``!S!0``?04``(4%``#%!0``U@4``-X%``#C4 M!0``)`8``"D&```S!@``.P8``&,&``!T!@``?`8``($&``#$!@``R08``-,&@ M``#;!@``_@8```\'```7!P``'`<``'('``!W!P``@0<``(D'``"A!P``I@<`; M`+`'``"X!P``^`<```D(```1"```%@@``(()``"'"0``C`D``*4)``"J"0``[ MM`D``+P)``#%"0``VPD``/P)```I"@``.0H``#X*``!0"@``8`H``&4*``!WF M"@``B`H``(T*``":"@``K`H``+$*``##"@``R`H``-H*``#?"@``\0H``/8*& M```("P``#0L``!\+```D"P``-@L``#L+``!%"P``5PL``%P+``!F"P``;@L`3 M`+4+```)`+P`30"\`%P`O`!A`+P`;P"\`!<`Q``J`,0`,@'$``$`+0'=`"T!> MG`DM`0$N58GE@>P``;0`_QZ^`*/"`(D6R`"@PP`PY#'24E`QP%"_R@`>5[C_, M`%":*@8M`8V^`/\65Z#"`##D4)H``+P`O\H!'E>X_P!0FBL#+0&-O@#_%E>_. MR@`>5YH1`RT!OP``#E>:G@,M`;_*`1Y7FIX#+0'$?@0&5[@$`%":*P,M`8GL: M7<-5B>6+1@RCR`"+'L0`BP[&`(L6R`"T#/\>O@"CP@")'L0`B0[&`(D6R`"A+ MR``QTC')NP$`FF$"+0&+R(O:H<0`,=(#P1/3Q'X()HD%)HE5`J'"`,1^!":)) M!8,^P@``=0V@Q``PY,1^!":)!>L(Q'X$,<`FB06)[%W""@!5B>6+1@BCR`"+^ M'L0`BP[&`(L6R`"T#?\>O@"CP@")'L0`B0[&`(D6R`"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?*!``&5P97)O\9"\!T`Z.V$ M`%\'PXO<'C;%?P0SR8D-N``]@7T"L==T#;`"_P6!?0*SUW0"M#R`?3``=`F-X M53#-(7)/B06XEP@SR8O9@7T"L==T*8L=N`!$S2&X[`B+R(S+]L*`=1&!?0*S% MUW4#Z"8`N,<(,\F+V<=%`K+7B444C$T6B4T8B5T:QT4<#`F,31XSP!_*!``S, MTC/)BQVX`D+-(2V``(/:`',$,\`STHO*B]"+';@`0LTAC96``+F``(L=M#_-C M(7,",\`SVSO8=""`N8``&G0#0^ORB],KT+G__XL=N`)"S2$SR8L=M$#-(<.+O MW!XVQ'\$)L55#":+300FBQVT/\TA-L1_Q M!";%50PSR2:'30@FBQVT0,TA<@(SP!_*!`"+W#;$?P0FBQV#^P1V!K0^S2%R[ M`C/`R@0`@SZV``!U"":!?0*QUW4-)HM="":+50HFQ'T,P\<&M@!H`.OK.]IT& M!2:*`?C#B_PVQ'T"Z#T`B]`[VG7LL!KYPX,^M@``=0@F@7T"LM=U#2:+70@F> MBU4$)L1]#,/'!K8`:0#KZR:(`4,[VG0!PXO\-L1]`E%6'KKH`8[:)HE="`97[ M!E6<.+W#;$?P0&5^A15 M_W44Z'#_/!IT#4,\#77TZ&3_/`IU`4-?!R:)70CK)8O<-L1_!`97Z&C_=0JPK M#>B%_[`*Z(#_7P_N+Y7PG<"+"#*`@```````````````),`````````DP``% M``````"3`````````),`````````DP````````"3```P,3(S-#4V-S@Y04)#` M1$5&!#@P.#@````$.#`X-@````=.14,@5C(P!TY%0R!6,S`%.#`Q.#@```4XJ M,#$X-@``!3@P,S@V```%.#`R.#8`````````````````````````````````B G```````````````````````````````````````````````"````" `` end sum -r/size 16096/11991 section (from "begin" to "end") sum -r/size 5889/8544 entire input file -- Mike Lawler UUCP: !{iuvax,pur-ee}!bsu-cs!mdlawler ARPA: mdlawler@bsu-cs.bsu.edu