Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

In reply to : Bret 'll have to hate FreeDOS mKEYB, too (Developers)

posted by bretjohn Homepage E-mail, Rio Rancho, NM, 18.05.2011, 19:08

> > Most likely, but not necessarily. It is at least theoretically possible
> to
> > flush the SMARTDRV caches with INT 15.4F even if you don't intend to
> > reboot.
>
> I don't think this idea will work - at least not when EMM386 is loaded. The
> MS tool:
>
>
> MOV AH,0D                 ; Disk Reset
> INT 21h                   ; causes SmartDrv 4.x to write cache
> MOV AX, 40                ; set up segment addressing
> MOV DS, AX
> DS:
> OR  BYTE PTR    [17],0C   ; equivalent of pressing CTRL+ALT
> MOV AX,4F53               ; Issue a "DEL" (53h = DEL scan code)
> INT 15h                   ; EMM386 sees this & shuts down
> DS:
> MOV WORD PTR [72],1234    ; Set REBOOT flag to Warm-Boot (0=cold)
> JMP F000:FFF0             ; Execute the internal restart routine
>

>
> uses int 15.4F53 to "shut down" EMM386 ( note that int 21h is used
> to clear the cache ). If EMM386 detects int 15h.4f53, it will reboot
> immediately and won't return - because it could do this only if no EMS or
> UMBs are supplied - which is a very rare case.

You're correct -- I had the SMARTDRV part confused with the EMM386 part. This still doesn't negate the fact that MS thinks it's OK to call INT 15.4F from outside INT 09, though they may think it's OK only when you're about to shut down or reboot.

This code is supposed to work whether EMM386 is installed or not, so it must assume that if EMM386 is installed, EMM386 will do the rebooting, and if EMM386 isn't installed, INT 15.4F will simply return and this code must do the rebooting itself.

I don't know if anybody has recognized this yet, but for this code to work properly, INT 15.4F must be fully re-entrant (at least if EMM386 is not being used). If not, this code could get "stuck" if a real keystroke is being processed at the same time this code is trying to reboot. That is, the machine will simply hang (or possibly do something else really nasty that the user doesn't want), and not actually reboot.

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 240 users online (0 registered, 240 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum