Arkady V.Belousov wrote:

...

+                cmp  word [_OemHook21], -1
+                je   no_oemhndlr
+                cmp  word [_OemHook21+2], -1
+                je   no_oemhndlr


     This is "if (FP_OFF (OemHook21) != -1 && FP_SEG (OemHook21) != -1)",
which is not equal to "if (OemHook21 != -1)" _and_ prevents OemHook21 point
to HMA. I suggest, check only for offset is enough. (And in this case you
may restore DS right before JE.)

sounds like a reasonble solution as I doubt anyone really would set this to XXXX:FFFF for a valid pointer.



+                pop  dx
+                pop  ds
+                jmp  far [ds:_OemHook21]  ; invoke OEM handler (no return)


     Looks like bug: if before "ds=cs:_DGROUP_" DS doesn't contains segment
of _OemHook21, then it willn't contain it after POP DS (and JMP then tries
to get jump address from wrong point). Else, if DS contains segment of
_OemHook21 before this code, then why MOV DS above?


...

I agree there is a bug here, I originally coded this differently (copied address to a variable in code segment which I believe a comments still has remnants of) and then simplified it at some point (which introduced the bug). I have a fix locally (just need to compile and test).

Jeremy





-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Freedos-kernel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to