9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] compilers
@ 2005-03-26 20:16 Tim Newsham
  2005-03-26 20:43 ` Russ Cox
  2005-03-27  6:01 ` kazumi iwane
  0 siblings, 2 replies; 12+ messages in thread
From: Tim Newsham @ 2005-03-26 20:16 UTC (permalink / raw)
  To: 9fans

The compilers share a bit of code through copy-paste.  I was wondering
if there are any important changes in recent years that were made
in a popularly used compiler (ie. 8[cal]) that might benefit other
compilers (ie. k[cal])?

Also, is there any documentation out there other than "How to
Use the Plan 9 C Compiler" and "Plan 9 C Compilers" that cover
the compilers?  I've been perusing the code and some of the
code takes quite a while to figure out.  Some quick notes would
go a long way (ie. "this function is a recursive tree walk that
checks types and inserts casts").

Tim N.


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

* Re: [9fans] compilers
  2005-03-26 20:16 [9fans] compilers Tim Newsham
@ 2005-03-26 20:43 ` Russ Cox
  2005-03-27  6:01 ` kazumi iwane
  1 sibling, 0 replies; 12+ messages in thread
From: Russ Cox @ 2005-03-26 20:43 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> The compilers share a bit of code through copy-paste.  I was wondering
> if there are any important changes in recent years that were made
> in a popularly used compiler (ie. 8[cal]) that might benefit other
> compilers (ie. k[cal])?

We do try to make the changes in all the compilers when
the changes are general, though that's no guarantee that
things haven't slipped through.

> Also, is there any documentation out there other than "How to
> Use the Plan 9 C Compiler" and "Plan 9 C Compilers" that cover
> the compilers?  I've been perusing the code and some of the
> code takes quite a while to figure out.  Some quick notes would
> go a long way (ie. "this function is a recursive tree walk that
> checks types and inserts casts").

A more detailed implementation document for any one
of the compilers is yet to be written.

More seriously, I found that matching the text in
section 5 of /sys/doc/compiler.ps against the compiler
code was quite informative.  It would be great if
there were better documentation.

Russ


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

* Re: [9fans] compilers
  2005-03-26 20:16 [9fans] compilers Tim Newsham
  2005-03-26 20:43 ` Russ Cox
@ 2005-03-27  6:01 ` kazumi iwane
  2005-03-27  6:04   ` boyd, rounin
                     ` (2 more replies)
  1 sibling, 3 replies; 12+ messages in thread
From: kazumi iwane @ 2005-03-27  6:01 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> in a popularly used compiler (ie. 8[cal]) that might benefit other
> compilers (ie. k[cal])?

It looks like 5[cal] will benefit, too, considering efforts going on for
ts7200 and simpad.

- kazumi


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

* Re: [9fans] compilers
  2005-03-27  6:01 ` kazumi iwane
@ 2005-03-27  6:04   ` boyd, rounin
  2005-03-27 14:56     ` Russ Cox
  2005-03-27 16:40   ` Charles Forsyth
  2005-03-28 15:27   ` [9fans] ts7200 Ronald G. Minnich
  2 siblings, 1 reply; 12+ messages in thread
From: boyd, rounin @ 2005-03-27  6:04 UTC (permalink / raw)
  To: kazumi iwane, Fans of the OS Plan 9 from Bell Labs

reading the compilers is enough doc.
--
MGRS 31U DQ 52572 12604




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

* Re: [9fans] compilers
  2005-03-27  6:04   ` boyd, rounin
@ 2005-03-27 14:56     ` Russ Cox
  2005-03-28 23:50       ` boyd, rounin
  0 siblings, 1 reply; 12+ messages in thread
From: Russ Cox @ 2005-03-27 14:56 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> reading the compilers is enough doc.

yeah, they're crystal clear.  that's why it took you and me
three attempts to fix that quoting-in-a-macro bug.

russ


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

* Re: [9fans] compilers
  2005-03-27  6:01 ` kazumi iwane
  2005-03-27  6:04   ` boyd, rounin
@ 2005-03-27 16:40   ` Charles Forsyth
  2005-03-28 15:27   ` [9fans] ts7200 Ronald G. Minnich
  2 siblings, 0 replies; 12+ messages in thread
From: Charles Forsyth @ 2005-03-27 16:40 UTC (permalink / raw)
  To: kiwane, 9fans

>> in a popularly used compiler (ie. 8[cal]) that might benefit other
>> compilers (ie. k[cal])?

>It looks like 5[cal] will benefit, too, considering efforts going on for

5[cal] already is popularly-used, as is q[acl]


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

* [9fans] ts7200
  2005-03-27  6:01 ` kazumi iwane
  2005-03-27  6:04   ` boyd, rounin
  2005-03-27 16:40   ` Charles Forsyth
@ 2005-03-28 15:27   ` Ronald G. Minnich
  2 siblings, 0 replies; 12+ messages in thread
From: Ronald G. Minnich @ 2005-03-28 15:27 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs



it's almost coming up as a cpu server, I just have to finish up making
memory mapping sane.

ron


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

* Re: [9fans] compilers
  2005-03-27 14:56     ` Russ Cox
@ 2005-03-28 23:50       ` boyd, rounin
  0 siblings, 0 replies; 12+ messages in thread
From: boyd, rounin @ 2005-03-28 23:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> yeah, they're crystal clear.  that's why it took you and me
> three attempts to fix that quoting-in-a-macro bug.

to be fair, i think the problem was more linked to the nature of the preprocessor letting you get away with murder
--
MGRS 31U DQ 52572 12604




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

* Re: [9fans] ts7200
  2005-04-02  3:54 Ronald G. Minnich
  2005-04-02  3:55 ` Ronald G. Minnich
@ 2005-04-02  6:49 ` Michael Zappe
  1 sibling, 0 replies; 12+ messages in thread
From: Michael Zappe @ 2005-04-02  6:49 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Could you send the code when you get the chance?  I've been thinking of
getting one of these guys and porting to it: http://www.gumstix.com/ . 
Nifty little ARM devices!  I've also been working on our port of OpenBSD
to ARM, and going through all of the wonderful fun of getting the caches
to stay coherent.  (I'm working on one of their IXP chips, which has the
added fun of 3 attached microcode engines "Network Processing Engines",
associated coherency problems and a spaghetti-code library to use them. 
Yeesh.)  

I can also take a look and see which of the two scenarios it is.

Have fun in Italy!

    Mike

Ronald G. Minnich wrote:

>It boots and runs fine. I can drawterm into it. 
>
>IF ... l2 pte does not enable caching. 
>
>I am caching the kernel text and data space (I just enable caching in the 
>1 Mbyte L1 PTE for 2 MB of kernel text + data; and the conf.base1 starts 
>at the next MB boundary) and that is fine. 
>
>Here's the fun part. 
>
>I have boot.c fork and exec /boot/rc. 
>
>So I have an rc prompt. If caching is enabled, all rc system calls run
>fine until the first Rfork from rc. In other words, all the RTC clock and
>OS clock interrupts are fine, running at 50hz or so, all the page fault
>activity from rc parent and child are fine, fine fine ... until the first
>syscall by the parent.  The parent then explodes.
>
>Possibilities:
>1. mmuswitch is not working. But I've ripped off the linux code for cache
>   writeback/invalidate, and it sure looks right at present.  I can send
>   code to this list if there is interest.
>
>2. The more interesting one. Something in the rfork/newproc path is
>   setting something up wrong. Reason this could be it is that the two
>   procs run fine until the first syscall ... that strikes me as odd. And,
>   more interesting, there are a number of context switches back and forth
>   between rc parent and rc child (I count 9) and they continue to run. I
>   get the impression, looking at this, that they could run all day until
>   a syscall and then they would die.  If mmuswitch were really broken I
>   would expect that to fail more quickly.  But once the rc parent calls
>   Pwrite (why that and not Await, I wonder)  it's all over.  And, even
>   more odd, it's always repeatable. Same PC at the failure. 
>
>This is typical:
>(syscall debug)
>rc:4 pc 15f20, Pwrite: 2014 9008 40 14604
>rc: note: sys: trap: fault write va=0x0 pc=0x0001a
>
>Check out the bogus va,pc. Almost like the stack the kernel is seeing is 
>junk. And the fd is certainly weird: 2014? 
>
>Wonder if the process stacks are getting trashed up somehow -- but how 
>would enabling caching affect this?
>
>ron
>
>p.s. I'm going to italy for the next 10 days (not as long as I'd like)  
>but I'll try to catch up on this list and hope some smart person fixes my
>problem :-) Have a nice week, everyone, whereever you are.
>  
>



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

* Re: [9fans] ts7200
  2005-04-02  3:54 Ronald G. Minnich
@ 2005-04-02  3:55 ` Ronald G. Minnich
  2005-04-02  6:49 ` Michael Zappe
  1 sibling, 0 replies; 12+ messages in thread
From: Ronald G. Minnich @ 2005-04-02  3:55 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs



On Fri, 1 Apr 2005, Ronald G. Minnich wrote:

> fine until the first Rfork from rc. In other words, all the RTC clock and

sorry, this is supposed to be:
> fine until the first Rfork from rc. In other words, all the RTC clock and
            ^-after

i.e. the Rfork is fine, but the first syscall after the rfork is very, 
very not fine.

ron


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

* [9fans] ts7200
@ 2005-04-02  3:54 Ronald G. Minnich
  2005-04-02  3:55 ` Ronald G. Minnich
  2005-04-02  6:49 ` Michael Zappe
  0 siblings, 2 replies; 12+ messages in thread
From: Ronald G. Minnich @ 2005-04-02  3:54 UTC (permalink / raw)
  To: 9fans


It boots and runs fine. I can drawterm into it. 

IF ... l2 pte does not enable caching. 

I am caching the kernel text and data space (I just enable caching in the 
1 Mbyte L1 PTE for 2 MB of kernel text + data; and the conf.base1 starts 
at the next MB boundary) and that is fine. 

Here's the fun part. 

I have boot.c fork and exec /boot/rc. 

So I have an rc prompt. If caching is enabled, all rc system calls run
fine until the first Rfork from rc. In other words, all the RTC clock and
OS clock interrupts are fine, running at 50hz or so, all the page fault
activity from rc parent and child are fine, fine fine ... until the first
syscall by the parent.  The parent then explodes.

Possibilities:
1. mmuswitch is not working. But I've ripped off the linux code for cache
   writeback/invalidate, and it sure looks right at present.  I can send
   code to this list if there is interest.

2. The more interesting one. Something in the rfork/newproc path is
   setting something up wrong. Reason this could be it is that the two
   procs run fine until the first syscall ... that strikes me as odd. And,
   more interesting, there are a number of context switches back and forth
   between rc parent and rc child (I count 9) and they continue to run. I
   get the impression, looking at this, that they could run all day until
   a syscall and then they would die.  If mmuswitch were really broken I
   would expect that to fail more quickly.  But once the rc parent calls
   Pwrite (why that and not Await, I wonder)  it's all over.  And, even
   more odd, it's always repeatable. Same PC at the failure. 

This is typical:
(syscall debug)
rc:4 pc 15f20, Pwrite: 2014 9008 40 14604
rc: note: sys: trap: fault write va=0x0 pc=0x0001a

Check out the bogus va,pc. Almost like the stack the kernel is seeing is 
junk. And the fd is certainly weird: 2014? 

Wonder if the process stacks are getting trashed up somehow -- but how 
would enabling caching affect this?

ron

p.s. I'm going to italy for the next 10 days (not as long as I'd like)  
but I'll try to catch up on this list and hope some smart person fixes my
problem :-) Have a nice week, everyone, whereever you are.



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

* [9fans] ts7200
@ 2005-03-11 15:37 Ronald G. Minnich
  0 siblings, 0 replies; 12+ messages in thread
From: Ronald G. Minnich @ 2005-03-11 15:37 UTC (permalink / raw)
  To: 9fans



well, it got into main, I think.

What this means is that I got the mmu set up probably right, since I do
turn it on and once it's on, it has to be right or the post code won't
make it out to the POST display.

I'm shocked.

ron


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

end of thread, other threads:[~2005-04-02  6:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-26 20:16 [9fans] compilers Tim Newsham
2005-03-26 20:43 ` Russ Cox
2005-03-27  6:01 ` kazumi iwane
2005-03-27  6:04   ` boyd, rounin
2005-03-27 14:56     ` Russ Cox
2005-03-28 23:50       ` boyd, rounin
2005-03-27 16:40   ` Charles Forsyth
2005-03-28 15:27   ` [9fans] ts7200 Ronald G. Minnich
  -- strict thread matches above, loose matches on Subject: below --
2005-04-02  3:54 Ronald G. Minnich
2005-04-02  3:55 ` Ronald G. Minnich
2005-04-02  6:49 ` Michael Zappe
2005-03-11 15:37 Ronald G. Minnich

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).