home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / pascal / 7596 < prev    next >
Encoding:
Text File  |  1992-12-21  |  2.6 KB  |  63 lines

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