Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.os.development > #18658

Re: flexible linux ELF

From Paul Edwards <mutazilah@gmail.com>
Newsgroups alt.os.development
Subject Re: flexible linux ELF
Date 2024-02-18 11:19 +0800
Organization A noiseless patient Spider
Message-ID <uqrt11$rlg6$1@dont-email.me> (permalink)
References <up912h$jq9n$1@dont-email.me> <uqosgp$2ro7$1@dont-email.me> <0s5AN.229393$yEgf.165499@fx09.iad>

Show all headers | View raw


On 18/02/24 00:49, Scott Lurndal wrote:
> Paul Edwards <mutazilah@gmail.com> 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/<PID>/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.

Back to alt.os.development | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

flexible linux ELF Paul Edwards <mutazilah@gmail.com> - 2024-01-30 04:16 +0800
  Re: flexible linux ELF Paul Edwards <mutazilah@gmail.com> - 2024-02-17 07:52 +0800
    Re: flexible linux ELF scott@slp53.sl.home (Scott Lurndal) - 2024-02-17 16:49 +0000
      Re: flexible linux ELF Paul Edwards <mutazilah@gmail.com> - 2024-02-18 11:19 +0800
        Re: flexible linux ELF Paul Edwards <mutazilah@gmail.com> - 2024-02-18 17:48 +0800
    Re: flexible linux ELF Andy Valencia <vandys@vsta.org> - 2024-02-18 06:25 -0800
      Re: flexible linux ELF Paul Edwards <mutazilah@gmail.com> - 2024-02-19 10:44 +0800

csiph-web