Real mode --> Protected mode (DPMI) 
Author Message
 Real mode --> Protected mode (DPMI)

Hi,

 I'm currently programming an assembler application that run under DOS
in real mode. I would like to make it work under DOS but in
DPMI16 mode (I use the DOS extender that comes with the PowerPack from
Borland) but I have been unsuccessfull until now ...
 This assembler code is called from a C/C++ program and is intended to find
out hardware parameters such as CPU type (386, 486, Pentium, ...),
clock frequency, privileges, ...
 The problem is that the DPMI sends back an error code ...

 The question is : Has anyone ever done such a program ? How to convert
a program written to be executed in real mode in a protected mode program ?

 Thanks for any anwser ...

Vincent Massol

--
-----------------------------+-----------------------------------------

 Ecole Nationale Superieure  | Address : 37, rue de Saussure.  
 des Telecommunications de   |           75017 Paris. France.
 Bretagne.                   |
-----------------------------+-----------------------------------------



Fri, 14 Nov 1997 03:00:00 GMT  
 Real mode --> Protected mode (DPMI)
m>  This assembler code is called from a C/C++ program and is intended to find
m> out hardware parameters such as CPU type (386, 486, Pentium, ...),
m> clock frequency, privileges, ...
m>  The problem is that the DPMI sends back an error code ...

Unfortunately, such a program may be hard to port to PM.
A question is what way the program attempts to identify CPU, and what
DPMI SW you use. There is some standard (published by Intel, look FAQ
for pointer) and DPMI should emulate it if it requires privileged
opcodes. There are some limitations in PM: cannot write to code or
execute data - if such a trick is used in the code, it can't work;
cannot use exceptions to check if a CPU recognizes some opcodes.



Sun, 16 Nov 1997 03:00:00 GMT  
 Real mode --> Protected mode (DPMI)

Quote:

>Hi,

> I'm currently programming an assembler application that run under DOS
>in real mode. I would like to make it work under DOS but in
>DPMI16 mode (I use the DOS extender that comes with the PowerPack from
>Borland) but I have been unsuccessfull until now ...
> This assembler code is called from a C/C++ program and is intended to find
>out hardware parameters such as CPU type (386, 486, Pentium, ...),
>clock frequency, privileges, ...
> The problem is that the DPMI sends back an error code ...

> The question is : Has anyone ever done such a program ? How to convert
>a program written to be executed in real mode in a protected mode program ?

> Thanks for any anwser ...

One solution is to call your procedure in real mode. This is achieved by using
the DPMI int 31h functions - I think function AX=0302h is 'CALL real mode
procedure with FAR return frame'. Get the DPMI specs, and do some inline asm to
call your routine.

Hope this helps :)
--
Anthony Williams                    /--------------------------------------/
                                   /On the Net, no-one can hear you scream/



Mon, 17 Nov 1997 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Real Mode vs. Protected Mode

2. Protected Mode / Real Address Mode

3. protected-mode and real-mode

4. Protected mode call in Real Mode

5. switching from protected mode to real mode

6. real mode vs protected mode

7. real mode or protected mode?

8. protected to real mode switch / also unreal mode

9. Segmented addressing real mode and protected mode

10. Protected mode memory access in real mode problem?

11. Flat real mode vs Protected mode

12. How to return from 386 protected mode to real-mode

 

 
Powered by phpBB® Forum Software