Board index » delphi » going 32bit pmode in a .COM (possible?)

going 32bit pmode in a .COM (possible?)

In article <saauji7ofo...@corp.supernews.com>,
  James Smith <se9...@dmu.ac.uk> wrote:

Quote

> Hey folks,

> Here's a puzzle for you. I've been told that it would be impossible to
> enter 32bit pmode using just a simple dos .com file, but i'm sure it
> can be done.

> I think you could do so with minimal work by talking to the dpmi
> host in the usual way, making the jmp to pmode, usual selector +
> descriptor manipulations, then a jmp to a 32bit segment. Ah... i hear
> you cry... only a single segment in .COM files.

> BUT surely we could assemble the 32bit segment else where, then
> include it as data in the 16bit seg (with alignment) and simple pass
> control.

> I have not tried this, but it seems to make sense. Shout out me if i'm
> horribly wrong. If anyone plays with this, let me know.

Go to <http://community.borland.com/museum/> and download TP V3.02. It's
an example of a .COM file that does some fascinating things with
segments. (A copy of ida375fw.zip to find out what exactly it is
doing would also be useful)

Robert
--
Robert AH Prins
prin...@willis.com

Sent via Deja.com http://www.deja.com/
Before you buy.

 

Re:going 32bit pmode in a .COM (possible?)


Quote
> > Here's a puzzle for you. I've been told that it would be impossible to
> > enter 32bit pmode using just a simple dos .com file, but i'm sure it
> > can be done.

It can be done, since you can simply code the 32-bits. The problem is
not switching to 32-bit mode (either protected or not (flat real)), but
to provide access to common used resources (like dos-interrupts).

So you can switch to real mode, but you can't program in it like you do
in TP/BP. It requires a very thorough lowlevel knowledge to create a
program that does something in such a mode without help (read
dos-extender)

 > I think you could do so with minimal work by talking to the dpmi

Quote
> > host in the usual way, making the jmp to pmode, usual selector +
> > descriptor manipulations, then a jmp to a 32bit segment. Ah... i hear
> > you cry... only a single segment in .COM files.

Sure. But what do you do next? You have to temporarily switch to 16-bit
mode for *each* dos-interrupt, and make sure that *everything* you pass
to those interrupts is in real memory (<1MB).

Again: The problem is NOT the actual switch, but supplying services
common
in 16-bit (like interrupts, usable RTL routines etc). You would
basically
have to rewrite the RTL, and emulate dos interrupt (read switch  to
16-bit mode, execute, back to 32)

This is the reason why everybody uses ready to go extenders (like
go32.exe, dos4gw etc), simpy because these programs provide such
interupt
replacements. You still have to rewrite the RTL though.

Other Threads