Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Protectmode handler called from realmode (Developers)

posted by Japheth Homepage, Germany (South), 13.08.2010, 07:31

> 1) the original SP is necessary to shift by 6 (as cm suggested) not by 4
> (as microsoft suggested)

It depends on how your FAR routine is supposed to exit: a RETF requires 4 bytes, an IRET requires 6 bytes.

> {I know, it does nothing but in first step would be enough not to crash}
> asm
> cld
> lodsd;mov es:[edi+2Ah],eax {restores CS:IP}
> lodsd;mov es:[edi+20h],ax {flags}
> add word ptr es:[edi+2Eh],6 {sets SP}
> iret
> end;

The second "lodsd" should be a "lodsw". There's a small risk that lodsd might cause a crash.

There is another risk that Int 13h might be called recursively. IIRC, Jack R. Ellis told me that USBDRIVE.SYS is supposed to do this occasionally.

---
MS-DOS forever!

 

Complete thread:

Back to the forum
Board view  Mix view
22755 Postings in 2121 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum