From: mutazilah@gmail.com   
      
   On 18/02/24 00:49, Scott Lurndal wrote:   
   > Paul Edwards writes:   
      
   >> On 30/01/24 04:16, Paul Edwards wrote:   
   >>   
   >>> So sticking with 32-bit for now, there are two types   
   >>> of ELF executables:   
   >>>   
   >>> 1. Does INT 80H   
   >>   
   >>> So my question is - can someone suggest some ELF startup   
   >>> code design that would work on both standard Linux and   
   >>> PDOS-generic (type 2) and possibly PDOS/386 (type 1 - but   
   >>> this is less possible and less important).   
   >>   
   >> So I have an answer to this now:   
   >>   
   >> you can use the getpid() syscall to get the process ID, then open and   
   >> read /proc//cmdline   
   >>   
   >> Apparently this method exists in Unix too.   
   >   
   > But no linux code uses it to substitute for the argc and argv   
   > arguments to main.   
      
   Any executable I compile (against PDPCLIB) will though.   
      
   And that's all I'm after. "standards" for me to follow   
   myself. I am reminded of this:   
      
   https://en.wikipedia.org/wiki/Protected_mode   
      
   This was not without its limitations. If an application utilized or   
   relied on any of the techniques below, it would not run:[30]   
      
   Segment arithmetic   
   Privileged instructions   
   Direct hardware access   
   Writing to a code segment   
   Executing data   
   Overlapping segments   
   Use of BIOS functions, due to the BIOS interrupts being reserved by   
   Intel[31]   
   In reality, almost all DOS application programs violated these rules   
      
      
   So I have spent decades trying to organize my   
   own DOS code to follow the rules required to   
   transition not just to the above, but also   
   to 32-bit DOS (which never existed).   
      
   So I wanted to make my own code obey "the rules".   
      
   After all that effort it is more likely that I   
   am going to abandon the "DOS rules" altogether   
   and switch to the "OS/2 1.x rules", and apply   
   them to the 8086.   
      
   And/or switch to the "PDOS-generic rules".   
      
   And most of the above is largely irrelevant   
   because it turns out that all my applications   
   are C90 or C90 + ANSI X3.64 compliant so I   
   don't need anything special at all.   
      
   I was challenged about this a couple of days   
   ago. Someone said that to put the keyboard into   
   raw mode I needed to resort to BIOS calls, or   
   at least manipulation of the BIOS data areas.   
   But nope - the official ioctl/read are all that   
   are required.   
      
   BTW, unrelated to the above, I am planning on   
   adding OS/2 2.0 compatibility to PDOS/386, the   
   same way (limited) Win32 capability was added,   
   and the same way that I was planning to add   
   (further) ELF support above.   
      
   Anyway, I have Ubuntu Kylin installed again on   
   this Chicom computer, this time running under   
   Virtualbox, and this time from an American site   
   (I think) instead of direct from the PLA   
   (People's Suppression Army), so I will try out   
   this /proc theory now.   
      
   BFN. Paul.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|