home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.pascal
- Path: sparky!uunet!demos!news-server
- From: Andrew Kovalenko <Andrew.Kovalenko@p5.f81.n5020.z2.fidonet.org>
- Subject: Protected mode and EXTEND
- References: <66.67.256.0.CABDAEF3@infos.msk.su>
- Date: Mon, 14 Dec 1992 10:24:28 GMT
- Reply-To: Andrew.Kovalenko@p5.f81.n5020.z2.fidonet.org
- Organization: InfoSoft (Gid:infos.msk.su)
- Sender: news-server@kremvax.hq.demos.su
- Message-ID: <2.5020.81.5.2b2c8ec1@infos.msk.su>
- Lines: 50
-
- Hi, Jan!
-
- 10 Dec 92 16:41, barendregt@mgz.fgg.eur.nl wrote to All:
-
- bfen> fillchar(NewHandleTable,sizeof(NewHandleTable),$FF);
- bfen> { Initialize new handles as unused }
- bfen> OldNumHandles := mem[prefixseg:$0032];
- bfen> { Get old table length }
- bfen> OldHandleTable := pointer(ptr(prefixseg,$0034)^);
- bfen> { Save address of old table }
- bfen> mem[prefixseg:$0032] := sizeof(NewHandleTable);
- bfen> { Set new table length }
- bfen> pointer(meml[prefixseg:$0034]) := @NewHandleTable;
- bfen> { Point to new handle table }
- bfen> move(OldHandleTable^,NewHandleTable,OldNumHandles)
- bfen> { Copy the current handle table to the new handle
- bfen> table }
-
- bfen> This move statement generates the error.
-
- Yes, because you perform memory access here. You use REAL-MODE pointers in
- VIRTUAL mode. So, you should transform real-mode segment parts of pointers to
- virtual-mode selectors. You can do it, using standard DPMI function call, but i
- don't remember, whitch function.
-
- bfen> Now how can we get around this. The way I was thinking is to force
- bfen> the compiler to put this code in the real mode stub, where it is
- bfen> executed before the system is switched to protected mode. The problem
- bfen> is I have no idea how to do this, and I can't find any function calls,
- bfen> compiler directives, or whatever to acomplish it.
-
- The real-mode stub usually is a little standard .EXE file, and the DPMI program
- is appended to it's tail. To extract it, cut any protected mode application &
- disassemble it. Correct the stub source & assemble it again.
-
- bfen> Is there any Protected Mode Virtuoso out there that might enlighten
- bfen> me how to do this, or explain to me that I'm way off track, or do
- bfen> anything else that may shed some light. All help will be appreciated.
-
- I am not a Protected Mode Virtuoso, but if you needed in the DPMI function
- description, i can white it. Or read DPMI specification yourself, if you have
- it.
-
- P.S. I'm sorry for my bad English...
-
- Andrew Kovalenko
-
- --- GoldED 2.40.P0621+
- * Origin: *********** AGAMA online *********** :-) (FidoNet 2:5020/81.5)
-
-