flat assembler
Message board for the users of flat assembler.

Index > DOS > how to check if EMM386 is ON and switch it off?

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
rugxulo



Joined: 09 Aug 2005
Posts: 2341
Location: Usono (aka, USA)
rugxulo 23 Mar 2010, 15:22
(I was hoping Japheth would respond this way. Thanks!)

Yes, this is the reason "JEMM386 OFF" only works in some situations. There is also "AUTO", but it usually doesn't work well, in my limited experience. It might be easier just to not load EMM386 at all!

Or just use a DOS extender, e.g. WDOSX or D3X. Most usually support raw, XMS, VCPI, DPMI (usually in that order). For WDOSX, the overhead is "only" 10k, which isn't much, even to the biggest whiners like me. Wink

P.S. Modern Windows doesn't even enable EMM386 by default, and allegedly?? some chipsets wouldn't support it anyways. (But see EMSMagic, which can run in real mode).
Post 23 Mar 2010, 15:22
View user's profile Send private message Visit poster's website Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 413
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 24 Nov 2013, 12:07
I found this code, it works
Code:
        mov     ax,1605h
        xor     dx,dx
        xor     cx,cx
        xor     dx,dx
        xor     si,si
        mov     ds,si
        mov     es,si
        mov     di,030Ah        ; windows version 3.10
        int     2Fh

        test    cx,cx           ; if cx=0 we can proceed
        jnz     some_error_handler
        mov     ax,ds
        or      ax,si
        jz      some_error_handler

; address of V86 toggle function is in ds:si. we store it for later use.
        push    ds si
        pop     [cs:v86switch]

        mov     ax,1608h        ; send startup complete
        int     2Fh

        xor     ax,ax           ; curcial part: we exit protected mode
        call    [cs:v86switch]  ; by calling function 0

        smsw    ax              ; check if protected mode is active
        test    ax,1            ; and if so, jump to an error handler
        jnz     some_error_handler

        call    set4gb          ; initialize flat real mode
        jc      some_error_handler

; here we have initialised flat real mode under emm386. we can do many
; things here, but when you return do _not_ forget to restore segment
; registers because EMM386 might not like to have 4 GB segments.
;
; restoring segment limits can be done by modifying the variables used to
; initialise flat real mode and then call flat real mode init again.

        mov     ax,1            ; switch to V86 mode with EMM function
        call    [cs:v86switch]

        mov     ax,1609h        ; begin exit
        int     2Fh
        mov     ax,1606h
        int     2Fh

some_error_handler:

        mov     ax,4C00h        ; here is it safe to exit to dos
        int     21h

set4gb: ;...
        ret

v86switch       dd ?
    

_________________
smaller is better
Post 24 Nov 2013, 12:07
View user's profile Send private message Reply with quote
Bitdog



Joined: 18 Jan 2004
Posts: 97
Bitdog 23 May 2014, 00:01
DOS is dead to some, yet others find it's a great programming environment for programs that run on other operating systems. Copy to floppy, run on machine 2, and you can still work in DOS while the blue screen of death wastes another half an hour on machine 2.

The DOS that came with Windoze 98 can be used as straight DOS programming in an old machine you would have thrown out anyway. Just set it up in directories and path like the old DOS was.

You can comment out EMM386 stuff in your autoexec.bat and config.sys with REM & reboot
REM emm386 (load some stuff here ####)
I hope this helps somehow. bitdog
Post 23 May 2014, 00:01
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 23 May 2014, 00:07
Bitdog wrote:
DOS is dead to some, yet others find it's a great programming environment for programs that run on other operating systems. Copy to floppy, run on machine 2, and you can still work in DOS while the blue screen of death wastes another half an hour on machine 2.

The DOS that came with Windoze 98 can be used as straight DOS programming in an old machine you would have thrown out anyway. Just set it up in directories and path like the old DOS was.

You can comment out EMM386 stuff in your autoexec.bat and config.sys with REM & reboot
REM emm386 (load some stuff here ####)
I hope this helps somehow. bitdog

Use Linux.

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD
Post 23 May 2014, 00:07
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.