Hello Kenneth,

>> I agree that device drivers should not modify any register when you call
>> them, but I admit that I do not remember WHERE I have read that device
>> drivers MUST not modify any registers. In particular, fixing EMM386 would

> Well PC-DOS tech reference states regarding the The Interrupt Routines,
> "It is the responsibility of the device driver to preserve the system
> state.  For example, the device driver must save all registers on entry
> and restore them on exit."  So I agree the kernel should not have to
> save FS,GS,etc, a device driver should save and restore them if it 
> modifies them, hence my question if others drivers do similar.

MS-DOS tech reference tells the same. so far about theory.
in praxis,
EA> A comment in the kernel source code tells that the "bloody fucking" (sic!)
EA> RTSND driver changes SI and DI during the driver strategy call.

it's OK for drivers to modify SI, DI, and possibly a couple of other
registers, scince they were simply not used by MSDOS.

Now you to choose if you want a DOS that implements some (probably
incomplete, out of date, misleading, buggy) specification, or want
a DOS that executes everything that works on MS-DOS.

IMO, scince FS, GS, and the high parts of EAX,... aren't used by MSDOS
as well, drivers can get away when they destroy these resisters,
so it's a good idea to save them as well.

tom



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to