The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
* [TUHS] user struct on SYSIII / V7
@ 2015-11-13 18:48 Oliver Lehmann
  2015-11-13 18:51 ` Ronald Natalie
  2015-11-13 19:33 ` Oliver Lehmann
  0 siblings, 2 replies; 10+ messages in thread
From: Oliver Lehmann @ 2015-11-13 18:48 UTC (permalink / raw)


Hi,

does someone know where "u" is defined on SYSIII or V7?

sys/user.h states:

extern struct user u;

But I wonder where it is defined? On ZEUS I have u.o but I'm
not able to correctly disassemble it. Right now I'm guessing
that it should be something like:

u module
$segmented
$abs %F600

   global

_u array [%572 byte]

end u

But the resulting object (u.o.hd) does not match 100% the existing
u.o on the system (u.o.orig.hd).

--- u.o.orig.hd 2008-05-16 21:52:12.000000000 +0200
+++ u.o.hd      2008-05-16 21:52:16.000000000 +0200
@@ -3,6 +3,6 @@
  00000020  00 00 00 01 00 00 00 00  01 00 00 00 00 00 00 00   
|................|
  00000030  00 00 00 02 00 00 00 00  00 00 00 00 1e 00 75 5f   
|..............u_|
  00000040  70 00 00 00 00 00 01 00  00 00 1e 01 75 5f 64 00   
|p...........u_d.|
-00000050  00 00 00 00 3e 00 f6 00  61 3e 5f 75 00 00 00 00  |....>..a>_u....|
+00000050  00 00 00 00 01 00 f6 00  61 01 5f 75 00 00 00 00  |.......a._u....|
  00000060  00 00                                             |..|
  00000062



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [TUHS] user struct on SYSIII / V7
  2015-11-13 18:48 [TUHS] user struct on SYSIII / V7 Oliver Lehmann
@ 2015-11-13 18:51 ` Ronald Natalie
  2015-11-13 18:53   ` Ronald Natalie
  2015-11-13 19:12   ` Oliver Lehmann
  2015-11-13 19:33 ` Oliver Lehmann
  1 sibling, 2 replies; 10+ messages in thread
From: Ronald Natalie @ 2015-11-13 18:51 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 669 bytes --]


> On Nov 13, 2015, at 1:48 PM, Oliver Lehmann <lehmann at ans-netz.de> wrote:
> 
> Hi,
> 
> does someone know where "u" is defined on SYSIII or V7?
> 
> sys/user.h states:
> 
> extern struct user u;
> 
> But I wonder where it is defined? On ZEUS I have u.o but I'm
> not able to correctly disassemble it. Right now I'm guessing
> that it should be something like:
> 

In Version 7 it’s in /usr/sys/h/user.h



-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2284 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20151113/aff2c927/attachment.bin>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [TUHS] user struct on SYSIII / V7
  2015-11-13 18:51 ` Ronald Natalie
@ 2015-11-13 18:53   ` Ronald Natalie
  2015-11-13 19:12   ` Oliver Lehmann
  1 sibling, 0 replies; 10+ messages in thread
From: Ronald Natalie @ 2015-11-13 18:53 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

>> 
> 
> In Version 7 it’s in /usr/sys/h/user.h
> 
> 
And in System III it is in /usr/include/sys/user.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2284 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20151113/2811788b/attachment.bin>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [TUHS] user struct on SYSIII / V7
  2015-11-13 18:51 ` Ronald Natalie
  2015-11-13 18:53   ` Ronald Natalie
@ 2015-11-13 19:12   ` Oliver Lehmann
  2015-11-13 19:15     ` Ronald Natalie
  1 sibling, 1 reply; 10+ messages in thread
From: Oliver Lehmann @ 2015-11-13 19:12 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 696 bytes --]


Ronald Natalie <ron at ronnatalie.com> wrote:

>> On Nov 13, 2015, at 1:48 PM, Oliver Lehmann <lehmann at ans-netz.de> wrote:
>>
>> Hi,
>>
>> does someone know where "u" is defined on SYSIII or V7?
>>
>> sys/user.h states:
>>
>> extern struct user u;
>>
>> But I wonder where it is defined? On ZEUS I have u.o but I'm
>> not able to correctly disassemble it. Right now I'm guessing
>> that it should be something like:
>>
>
> In Version 7 it’s in /usr/sys/h/user.h

There is the  definition of the user struct  and the declaration of
"u" as _external_ variable. I'm looking for the place where u is
"implemented". Without a definition of "u" somewhere _u will caus
a symbol undefined error.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [TUHS] user struct on SYSIII / V7
  2015-11-13 19:12   ` Oliver Lehmann
@ 2015-11-13 19:15     ` Ronald Natalie
  2015-11-13 19:27       ` Oliver Lehmann
  0 siblings, 1 reply; 10+ messages in thread
From: Ronald Natalie @ 2015-11-13 19:15 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]

Someone “sanitized” your include directory.

Take a look here in the browsable archives...http://minnie.tuhs.org/cgi-bin/utree.pl?file=SysIII/usr/include/sys/user.h <http://minnie.tuhs.org/cgi-bin/utree.pl?file=SysIII/usr/include/sys/user.h>

> On Nov 13, 2015, at 2:12 PM, Oliver Lehmann <lehmann at ans-netz.de> wrote:
> 
> 
> Ronald Natalie <ron at ronnatalie.com> wrote:
> 
>>> On Nov 13, 2015, at 1:48 PM, Oliver Lehmann <lehmann at ans-netz.de> wrote:
>>> 
>>> Hi,
>>> 
>>> does someone know where "u" is defined on SYSIII or V7?
>>> 
>>> sys/user.h states:
>>> 
>>> extern struct user u;
>>> 
>>> But I wonder where it is defined? On ZEUS I have u.o but I'm
>>> not able to correctly disassemble it. Right now I'm guessing
>>> that it should be something like:
>>> 
>> 
>> In Version 7 it’s in /usr/sys/h/user.h
> 
> There is the  definition of the user struct  and the declaration of
> "u" as _external_ variable. I'm looking for the place where u is
> "implemented". Without a definition of "u" somewhere _u will caus
> a symbol undefined error.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20151113/5814de14/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2284 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20151113/5814de14/attachment.bin>


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [TUHS] user struct on SYSIII / V7
  2015-11-13 19:15     ` Ronald Natalie
@ 2015-11-13 19:27       ` Oliver Lehmann
  2015-11-13 20:16         ` Ronald Natalie
  0 siblings, 1 reply; 10+ messages in thread
From: Oliver Lehmann @ 2015-11-13 19:27 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 659 bytes --]


Ronald Natalie <ron at ronnatalie.com> wrote:

> Someone “sanitized” your include directory.
>
> Take a look here in the browsable  
> archives...http://minnie.tuhs.org/cgi-bin/utree.pl?file=SysIII/usr/include/sys/user.h

Where do you see u defined? I only see it declared as external:

extern struct user u;

You need one single global u definition (memory reservation) so all
sources accessing u accessing the same struct, don't you? At least
this is what I have here and there is also the memory adress in my
param.h:

# define UBASE             0x3E00F600      /* kernel virtual addr of  
user struct */

This is where "u" is located on my system.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [TUHS] user struct on SYSIII / V7
  2015-11-13 18:48 [TUHS] user struct on SYSIII / V7 Oliver Lehmann
  2015-11-13 18:51 ` Ronald Natalie
@ 2015-11-13 19:33 ` Oliver Lehmann
       [not found]   ` <CE36BEBC-DA9F-4E95-B238-1D5C303700B9@icloud.com>
  2015-11-13 20:07   ` Oliver Lehmann
  1 sibling, 2 replies; 10+ messages in thread
From: Oliver Lehmann @ 2015-11-13 19:33 UTC (permalink / raw)



Oliver Lehmann <lehmann at ans-netz.de> wrote:

> u module
> $segmented
> $abs %F600
>
>   global
>
> _u array [%572 byte]
>
> end u

By any way - is here someone on the list understanding Z8000 PLZ/ASM? ;)

The problem is, that "u" must be available in the address space on this
location for the kernel to function correctly:

# define UBASE             0x3E00F600      /* kernel virtual addr of  
user struct */

And with the above ASM code, it is placed on 0x0100F600. I also tried
of course $abs 0x3E00F600 but it makes no difference. It is always
placed at 0x0100F600 and I have zero clue why

the original object from the system:

#67 nm /usr/sys/conf/u.o
3e00f600 A _u
01000000 s u_d
     0000 s u_p


my object generated from my u.s:

#68 nm u.o
0100f600 A _u
01000000 s u_d
     0000 s u_p

Somehow I need to get the address right.... This is why I wanted to
look up how the original SYSIII or V7 was doing it (even if the asm
would be of course completely different).



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [TUHS] user struct on SYSIII / V7
       [not found]   ` <CE36BEBC-DA9F-4E95-B238-1D5C303700B9@icloud.com>
@ 2015-11-13 19:42     ` Brantley Coile
  0 siblings, 0 replies; 10+ messages in thread
From: Brantley Coile @ 2015-11-13 19:42 UTC (permalink / raw)




iPhone email

> On Nov 13, 2015, at 2:38 PM, Brantley Coile <brantleycoile at icloud.com> wrote:
> 
> For performance reasons an assembly symbol "u" was defined to be a fixed address. That allowed us to use constructions like u.u_procp to generate a single address.  It was very fast. Does this help?
> 
> iPhone email
> 
>> On Nov 13, 2015, at 2:33 PM, Oliver Lehmann <lehmann at ans-netz.de> wrote:
>> 
>> 
>> Oliver Lehmann <lehmann at ans-netz.de> wrote:
>> 
>>> u module
>>> $segmented
>>> $abs %F600
>>> 
>>> global
>>> 
>>> _u array [%572 byte]
>>> 
>>> end u
>> 
>> By any way - is here someone on the list understanding Z8000 PLZ/ASM? ;)
>> 
>> The problem is, that "u" must be available in the address space on this
>> location for the kernel to function correctly:
>> 
>> # define UBASE             0x3E00F600      /* kernel virtual addr of user struct */
>> 
>> And with the above ASM code, it is placed on 0x0100F600. I also tried
>> of course $abs 0x3E00F600 but it makes no difference. It is always
>> placed at 0x0100F600 and I have zero clue why
>> 
>> the original object from the system:
>> 
>> #67 nm /usr/sys/conf/u.o
>> 3e00f600 A _u
>> 01000000 s u_d
>>   0000 s u_p
>> 
>> 
>> my object generated from my u.s:
>> 
>> #68 nm u.o
>> 0100f600 A _u
>> 01000000 s u_d
>>   0000 s u_p
>> 
>> Somehow I need to get the address right.... This is why I wanted to
>> look up how the original SYSIII or V7 was doing it (even if the asm
>> would be of course completely different).
>> _______________________________________________
>> TUHS mailing list
>> TUHS at minnie.tuhs.org
>> https://minnie.tuhs.org/mailman/listinfo/tuhs



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [TUHS] user struct on SYSIII / V7
  2015-11-13 19:33 ` Oliver Lehmann
       [not found]   ` <CE36BEBC-DA9F-4E95-B238-1D5C303700B9@icloud.com>
@ 2015-11-13 20:07   ` Oliver Lehmann
  1 sibling, 0 replies; 10+ messages in thread
From: Oliver Lehmann @ 2015-11-13 20:07 UTC (permalink / raw)


Hi,

I found out so far, that %3e00.... means, that the data is put on
segment 62 (0x3e). Regarding to the Z8000 ASM handbook, segmented
adresses are notated as <<segment>>offset, so in my case
<<62>>%F600 - but of course it does not work and the assembler
yields and error :(


Oliver Lehmann <lehmann at ans-netz.de> wrote:

> Oliver Lehmann <lehmann at ans-netz.de> wrote:
>
>> u module
>> $segmented
>> $abs %F600
>>
>>  global
>>
>> _u array [%572 byte]
>>
>> end u
>
> By any way - is here someone on the list understanding Z8000 PLZ/ASM? ;)
>
> The problem is, that "u" must be available in the address space on this
> location for the kernel to function correctly:
>
> # define UBASE             0x3E00F600      /* kernel virtual addr of  
> user struct */
>
> And with the above ASM code, it is placed on 0x0100F600. I also tried
> of course $abs 0x3E00F600 but it makes no difference. It is always
> placed at 0x0100F600 and I have zero clue why
>
> the original object from the system:
>
> #67 nm /usr/sys/conf/u.o
> 3e00f600 A _u
> 01000000 s u_d
>     0000 s u_p
>
>
> my object generated from my u.s:
>
> #68 nm u.o
> 0100f600 A _u
> 01000000 s u_d
>     0000 s u_p
>
> Somehow I need to get the address right.... This is why I wanted to
> look up how the original SYSIII or V7 was doing it (even if the asm
> would be of course completely different).
> _______________________________________________
> TUHS mailing list
> TUHS at minnie.tuhs.org
> https://minnie.tuhs.org/mailman/listinfo/tuhs





^ permalink raw reply	[flat|nested] 10+ messages in thread

* [TUHS] user struct on SYSIII / V7
  2015-11-13 19:27       ` Oliver Lehmann
@ 2015-11-13 20:16         ` Ronald Natalie
  0 siblings, 0 replies; 10+ messages in thread
From: Ronald Natalie @ 2015-11-13 20:16 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1100 bytes --]

I can’t say how the Z8000 wants to implement it.   On the PDP11, the _u variable is set to the absolute 140000.   This isn’t really an “allocation.”  It’s just the base of one of the kernel address segments.   The kernel maps the per process data area (essentially the user structure and the kernel stack) there.    It’s just allocated as a hunk of usize memory (usize is in 64 byte chunks on the PDP).   The code one is “not expected to understand” handles this context switch.   In fact, the user structure is only ever “initialized” for the first process (init).   After that fork just copies it from the parent to the child and then all the other system calls, etc… change it as required.

Gosh it’s been a long time since I was this deep into a UNIX kernel (especially on a primitive machine).   
Hope this helps.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2284 bytes
Desc: not available
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20151113/6b045248/attachment.bin>


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-11-13 20:16 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-13 18:48 [TUHS] user struct on SYSIII / V7 Oliver Lehmann
2015-11-13 18:51 ` Ronald Natalie
2015-11-13 18:53   ` Ronald Natalie
2015-11-13 19:12   ` Oliver Lehmann
2015-11-13 19:15     ` Ronald Natalie
2015-11-13 19:27       ` Oliver Lehmann
2015-11-13 20:16         ` Ronald Natalie
2015-11-13 19:33 ` Oliver Lehmann
     [not found]   ` <CE36BEBC-DA9F-4E95-B238-1D5C303700B9@icloud.com>
2015-11-13 19:42     ` Brantley Coile
2015-11-13 20:07   ` Oliver Lehmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).