9front - general discussion about 9front
 help / color / mirror / Atom feed
* /dev/wsys/*/screen not present for nested rio?
@ 2012-05-07  5:28 vrtra
  2012-05-07 20:09 ` sl
  0 siblings, 1 reply; 9+ messages in thread
From: vrtra @ 2012-05-07  5:28 UTC (permalink / raw)
  To: 9front

Hi,
    I notice that /dev/wsys/*/screen is visible only on the top rio
windows. If I start a nested rio instance, 'ls' still shows me that
the file is present, but on access, it returns back saying file does
not exist.

i.e from top:
% ls /dev/wsys/1
...
 /dev/wsys/1/screen
% file /dev/wsys/1/screen
plan9 image

Now start a rio instance in the term, and do the same,
% ls /dev/wsys/2
...
 /dev/wsys/2/screen
% file /dev/wsys/2/screen
Unable to acces, file /dev/wsys/2/screen does not exist

Why does it do so? I would have expected the screen to either provide
access to the original display or the screen from which rio was
started. If not, I would have expected 'ls' not to report the file to
be present. So is this intensional? if not, does copying the window of
the child rio over to child screen provide an acceptable behavior?



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

* Re: /dev/wsys/*/screen not present for nested rio?
  2012-05-07  5:28 /dev/wsys/*/screen not present for nested rio? vrtra
@ 2012-05-07 20:09 ` sl
  2012-05-08  4:13   ` vrtra
  0 siblings, 1 reply; 9+ messages in thread
From: sl @ 2012-05-07 20:09 UTC (permalink / raw)
  To: 9front

> I notice that /dev/wsys/*/screen is visible only on the top rio
> windows. If I start a nested rio instance, 'ls' still shows me that
> the file is present, but on access, it returns back saying file does
> not exist.

Cannot reproduce. Make sure the screen number you are trying to access
actually exists in the nested rio. Compare the output of 'ls /dev/wsys'
in both the main rio and from within the nested rio.

-sl

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

* Re: /dev/wsys/*/screen not present for nested rio?
  2012-05-07 20:09 ` sl
@ 2012-05-08  4:13   ` vrtra
  2012-05-08 12:10     ` sl
  0 siblings, 1 reply; 9+ messages in thread
From: vrtra @ 2012-05-08  4:13 UTC (permalink / raw)
  To: 9front

> > I notice that /dev/wsys/*/screen is visible only on the top rio
> > windows. If I start a nested rio instance, 'ls' still shows me that
> > the file is present, but on access, it returns back saying file does
> > not exist.
>
> Cannot reproduce. Make sure the screen number you are trying to access
> actually exists in the nested rio. Compare the output of 'ls /dev/wsys'
> in both the main rio and from within the nested rio.

Thanks, actually cinap_lenrek told me that it is an intended behavior,
that is rio/fsys.c has
  if(strcmp(x->wname[i], "screen")==0 && access("/dev/screen",
AEXIST)==0)
     break;
and it does not serve the screen in individual /dev/wsys because it is
already provided in the /dev/screen. Though I suppose it would be
interesting if I can get access to it. I was motivated by your example
at http://9fans.net/archive/2012/04/204 to try and make a tiling
window
manager for rio. :) .

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

* Re: /dev/wsys/*/screen not present for nested rio?
  2012-05-08  4:13   ` vrtra
@ 2012-05-08 12:10     ` sl
  2012-05-08 17:56       ` vrtra
  0 siblings, 1 reply; 9+ messages in thread
From: sl @ 2012-05-08 12:10 UTC (permalink / raw)
  To: 9front

> > > windows. If I start a nested rio instance, 'ls' still shows me that
> > > the file is present, but on access, it returns back saying file does
> > > not exist.
> >
> > Cannot reproduce. Make sure the screen number you are trying to access
> > actually exists in the nested rio. Compare the output of 'ls /dev/wsys'
> > in both the main rio and from within the nested rio.
> 
> Thanks, actually cinap_lenrek told me that it is an intended behavior,
> that is rio/fsys.c has
>   if(strcmp(x->wname[i], "screen")==0 && access("/dev/screen",
> AEXIST)==0)
>      break;
> and it does not serve the screen in individual /dev/wsys because it is
> already provided in the /dev/screen. Though I suppose it would be
> interesting if I can get access to it. I was motivated by your example
> at http://9fans.net/archive/2012/04/204 to try and make a tiling
> window
> manager for rio. :) .

I think I understand what you're saying, now.

The reason I asked you to verify that the screen number you are trying
to access actually exists in the nested rio is because from your example:

	i.e from top:
	% ls /dev/wsys/1
	...
	 /dev/wsys/1/screen
	% file /dev/wsys/1/screen
	plan9 image
	
	Now start a rio instance in the term, and do the same,
	% ls /dev/wsys/2
	...
	 /dev/wsys/2/screen
	% file /dev/wsys/2/screen
	Unable to acces, file /dev/wsys/2/screen does not exist

it seemed as if /dev/wsys/2/ itself likely did not exist. Had you
really started two windows already within the nested rio?

This is what happens on my system:

	term% file /dev/wsys/1/screen
	/dev/wsys/1/screen: plan 9 image, depth 32

And from within a nested rio:

	term% file /dev/wsys/1/screen
	/dev/wsys/1/screen: plan 9 image, depth 32

And from within a third rio, nested within the first nested rio:

	term% file /dev/wsys/1/screen
	/dev/wsys/1/screen: plan 9 image, depth 32

In both nested rios there is no /dev/wsys/2/screen because there
is no second window at all:

	term% ls /dev/wsys/2
	ls: /dev/wsys/2: '/dev/wsys/2' does not exist

-sl

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

* Re: /dev/wsys/*/screen not present for nested rio?
  2012-05-08 12:10     ` sl
@ 2012-05-08 17:56       ` vrtra
  2012-05-08 18:23         ` sl
  0 siblings, 1 reply; 9+ messages in thread
From: vrtra @ 2012-05-08 17:56 UTC (permalink / raw)
  To: 9front

... snip...

> it seemed as if /dev/wsys/2/ itself likely did not exist. Had you
> really started two windows already within the nested rio?

yes, I did, I also tried with the exact steps you mention below
without creating extra windows.

> This is what happens on my system:
>
>         term% file /dev/wsys/1/screen
>         /dev/wsys/1/screen: plan 9 image, depth 32

This works, Now, following your procedure, I start
rio in the same terminal. Then open a terminal and
type file /dev/wsys/1/screen

> And from within a nested rio:
>
>         term% file /dev/wsys/1/screen
>         /dev/wsys/1/screen: plan 9 image, depth 32

Here I get /dev/wsys/1/screen does not exist.
If I type ls /dev/wsys then it shows
/dev/wsys/1

(Also this commit went in, that does not expose the screen any more in
nested rios.)

http://code.google.com/p/plan9front/source/detail?r=20799ee25a269b545712cb45220a9b94eba04c24

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

* Re: /dev/wsys/*/screen not present for nested rio?
  2012-05-08 17:56       ` vrtra
@ 2012-05-08 18:23         ` sl
  2012-05-08 18:57           ` cinap_lenrek
  2012-05-08 20:49           ` vrtra
  0 siblings, 2 replies; 9+ messages in thread
From: sl @ 2012-05-08 18:23 UTC (permalink / raw)
  To: 9front

>> And from within a nested rio:
>>
>>         term% file /dev/wsys/1/screen
>>         /dev/wsys/1/screen: plan 9 image, depth 32
>
> Here I get /dev/wsys/1/screen does not exist.
> If I type ls /dev/wsys then it shows
> /dev/wsys/1

Interesting. I do run a slightly modified rio, but it's not clear to me
that the modifications should cause it to behave differently in this
instance. My rio is here:

http://plan9.stanleylieber.com/pkg/386/hjrio-2012.04.17.tbz


> (Also this commit went in, that does not expose the screen any more in
> nested rios.)

I haven't advanced my rio to this commit, yet.

-sl

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

* Re: /dev/wsys/*/screen not present for nested rio?
  2012-05-08 18:23         ` sl
@ 2012-05-08 18:57           ` cinap_lenrek
  2012-05-08 20:49           ` vrtra
  1 sibling, 0 replies; 9+ messages in thread
From: cinap_lenrek @ 2012-05-08 18:57 UTC (permalink / raw)
  To: 9front

the patch that stops serving /dev/screen is here:

1165.1ccc5dd3a9f54176837bc485b128d4ce79493450

the reason we dont serve /dev/screen anymore if its here already there by the
topmost rio is this:

previously, /dev/screen used the image from the display, wich gets initialized
in initdraw(). this is always the whole display image like defined in the
manpage. problem is, that image doesnt work when the screen is resized or
changes its colordepth. like when you run aux/vga to change to a different
mode.

the solution was to use the Image *screen; instead wich gets updated on resize.
problem is, this is always the image of the "window" or whatever your program
(or rio) runs in. so to make it work, only the topmost rio serves the screen
file so the manpage definition of /dev/screen holds and represents the whole
display. similat that only the topmost rio serves /dev/snarf so all programs
and subrios share the same snarf buffer.

--
cinap

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

* Re: /dev/wsys/*/screen not present for nested rio?
  2012-05-08 18:23         ` sl
  2012-05-08 18:57           ` cinap_lenrek
@ 2012-05-08 20:49           ` vrtra
  2012-05-08 21:10             ` cinap_lenrek
  1 sibling, 1 reply; 9+ messages in thread
From: vrtra @ 2012-05-08 20:49 UTC (permalink / raw)
  To: 9front


>
> Interesting. I do run a slightly modified rio, but it's not clear to me
> that the modifications should cause it to behave differently in this
> instance. My rio is here:
>
> http://plan9.stanleylieber.com/pkg/386/hjrio-2012.04.17.tbz

It works perfectly in your rio. :)
- that is, /dev/wsys/*/screen is accessible always.

I see that in fsys.c, only /dev/snarf is skipped. (in the main line,
both /dev/screen and /dev/snar are skipped.)

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

* Re: /dev/wsys/*/screen not present for nested rio?
  2012-05-08 20:49           ` vrtra
@ 2012-05-08 21:10             ` cinap_lenrek
  0 siblings, 0 replies; 9+ messages in thread
From: cinap_lenrek @ 2012-05-08 21:10 UTC (permalink / raw)
  To: 9front

your observation is correct.

--
cinap

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

end of thread, other threads:[~2012-05-08 21:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-07  5:28 /dev/wsys/*/screen not present for nested rio? vrtra
2012-05-07 20:09 ` sl
2012-05-08  4:13   ` vrtra
2012-05-08 12:10     ` sl
2012-05-08 17:56       ` vrtra
2012-05-08 18:23         ` sl
2012-05-08 18:57           ` cinap_lenrek
2012-05-08 20:49           ` vrtra
2012-05-08 21:10             ` cinap_lenrek

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