Xenix files..

pgd at bbt.se pgd at bbt.se
Thu Jan 3 07:09:40 AEST 1991


In article <1991Jan1.234509.3207 at robobar.co.uk> ronald at robobar.co.uk (Ronald S H Khoo) writes:
I wrote:
>> You only need a x.out to coff converter,
>> to use it. 
>
>I don't see what you mean...
>
>	1) you don't get /lib/libc_s.a, (can you regenerate that from
>	   /shlib/libc_s ? I have no idea how COFF shared libraries work)
>
>	2) Xenix /bin/ld doesn't understand COFF anyway.
>
>So how do you go about using it ?  If there is a way, more detail please!
>
I did not even know I was missing /lib/libc_s.a, or what it contains...

Today I was trying to get it to work, since I said it does. I have a
printf("hello") program, and the only missing routines, from the link,
are Scrt0, start, exit, and cleanup. The problem is start, which has
to make special initialization for the shared library. This means that
libc_s is giving the core of libc.a

To get the xenix kernel to load the library, I use a program which
converts the executable x.out file, to an executable coff file, and
puts in the information to load the library in it. That part works
nicely. To link with /shlib/libc_s, i did a "nm" on it, and
hand-converted the output to an assembler file, to get the jump
addresses for the routines.

A COFF shared library is just a normal COFF file, which is almost
identical to a x.out file. Everything is just on different adresses.
The load address is on something like 0xa000000 etc.  To tell the
kernel to load the shared library, there is just an extra "lib"
segment, in the segment table, which contains the path of the library
file.  The rest is automagic. The x.out format could very easily be
extended to use shared libraries.

Most x.out utilities on xenix, actually work with coff format. ld
accepts coff format as input.

>> I used to use gcc with the gnu loader, and my system call library,
>> before the gnu OMF kit was out.
>
>Really ?   What executable file format did you use, and what conversion
>program did you use to generate it ?

I hacked GNU ld to produce x.out format. That is not very hard. But
next time I will hack it to produce coff format instead, since then we
get the sharable libraries also, and maybe, maybe, the patch-files for
coff format will do half the work also.

>
>> (On the first operating system i encountered, all system calls were
>> undocumented :-( ).
>
>Actually, I'd say that's true on Xenix as well.  Can you think of anything
>more stupid than the SCO manual sections ?  *everything* is in "S" section
>so no one knows what's a system call and what's not.  At least in SCO Unix
>you can find out from /usr/include/sys.s

The "S" section is really stupid. Is it there to "protect" the user from
knowledge about system calls, or what?



More information about the Comp.unix.xenix.sco mailing list