9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] bind -c[ab] -- what am I doing wrong?
@ 2003-07-17 16:13 andrey mirtchovski
  2003-07-17 17:42 ` northern snowfall
  0 siblings, 1 reply; 16+ messages in thread
From: andrey mirtchovski @ 2003-07-17 16:13 UTC (permalink / raw)
  To: 9fans

It is my understanding that a bind() should be "commutative" with respect to
before/after, i.e.:

	bind -cb new old <==> bind -ca old new

why does the following create fail?

	plan9% bind -cb $home/kern/cmd /sys/src/cmd
	plan9% touch /sys/src/cmd/blah		# expected to succeed
	plan9% ls -l $home/kern/cmd/blah
	--rw-rw-r-- M 159 andrey andrey 0 Jul 17 10:06 /usr/andrey/kern/cmd/blah
	plan9% unmount /sys/src/cmd
	plan9% rm $home/kern/cmd/blah
	plan9% bind -ca /sys/src/cmd $home/kern/cmd
	plan9% touch $home/kern/cmd/blah	# expected to succeed
	touch: /usr/andrey/kern/cmd/blah: cannot create: permission denied
	plan9% touch /sys/src/cmd/blah		# expected to fail
	touch: /sys/src/cmd/blah: cannot create: permission denied
	plan9%

who's to blame?



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

* Re: [9fans] bind -c[ab] -- what am I doing wrong?
  2003-07-17 17:42 ` northern snowfall
@ 2003-07-17 17:10   ` andrey mirtchovski
  2003-07-17 17:18     ` boyd, rounin
  0 siblings, 1 reply; 16+ messages in thread
From: andrey mirtchovski @ 2003-07-17 17:10 UTC (permalink / raw)
  To: 9fans

On Thu, 17 Jul 2003, northern snowfall wrote:

>
> Hope that helps!
>

well, it doesn't. what you describe is the bahaviour of the command
according to the  man page. but here's what I observe:

	plan9% touch kern/test			# clearly I can write to it
	plan9% rm kern/test
	plan9% bind -ac /sys kern
	plan9% touch kern/test			# but not anymore
	touch: kern/test: cannot create: permission denied
	plan9%
	plan9% unmount kern
	plan9% bind -ac kern /sys
	plan9% touch /sys/blah			# this works as expected
	plan9%

given the man page i expect 'bind -ac new /something/i/can/write/to' to
allow me to continue to write to '/something/i/can/write/to'.

in fact, I expect to be able to write to '/something/i/can/write/to'
irregardless of whether it corresponds to 'new', 'old', is bound before or
bound after a directory. the only case when I wouldn't expect to be able to
write to it is when I'm not able to walk to it because of a bind -b earlier
in the walk.

in functional languages this technique is used as a formal proof of
a program's correctness, observe this example from the haskell prelude:

    -- Minimal complete definition: (==) or (/=)
    x == y      = not (x/=y)
    x /= y      = not (x==y)

a similar definition for 'bind' would be:

    bind -cb new old == bind -ca old new

where, of course, we consider only the resulting directory, and not the path
to it.

andrey








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

* Re: [9fans] bind -c[ab] -- what am I doing wrong?
  2003-07-17 17:10   ` andrey mirtchovski
@ 2003-07-17 17:18     ` boyd, rounin
  2003-07-17 17:34       ` andrey mirtchovski
  2003-07-17 17:35       ` [9fans] bind -c[ab] -- what am I doing wrong? David Presotto
  0 siblings, 2 replies; 16+ messages in thread
From: boyd, rounin @ 2003-07-17 17:18 UTC (permalink / raw)
  To: 9fans

union directories are a linked list.

    - open finds you the first file in the list bound directories,
      in the order they were bound [before/after]

    - create choose the first directory which allows creation,
      in the order they were bound [before/after]

the order they were bound is not temporal, it's where you bind them.

it's that easy.




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

* Re: [9fans] bind -c[ab] -- what am I doing wrong?
  2003-07-17 17:18     ` boyd, rounin
@ 2003-07-17 17:34       ` andrey mirtchovski
  2003-07-17 17:37         ` David Presotto
  2003-07-17 17:45         ` boyd, rounin
  2003-07-17 17:35       ` [9fans] bind -c[ab] -- what am I doing wrong? David Presotto
  1 sibling, 2 replies; 16+ messages in thread
From: andrey mirtchovski @ 2003-07-17 17:34 UTC (permalink / raw)
  To: 9fans

On Thu, 17 Jul 2003, boyd, rounin wrote:

> it's that easy.
>

how easy is that then:


 	plan9% ls -l | grep 'tmp|kern'
	d-rwxrwxr-x M 113 andrey andrey    0 Jul 17 10:53 kern
	d-rwxrwxr-x M 113 andrey andrey    0 Jul 17 11:32 tmp
	plan9% bind -ac /sys kern
	plan9% touch kern/blah
	touch: kern/blah: cannot create: permission denied
	plan9% bind -ac /sys tmp
	plan9% touch tmp/blah
	plan9%



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

* Re: [9fans] bind -c[ab] -- what am I doing wrong?
  2003-07-17 17:18     ` boyd, rounin
  2003-07-17 17:34       ` andrey mirtchovski
@ 2003-07-17 17:35       ` David Presotto
  1 sibling, 0 replies; 16+ messages in thread
From: David Presotto @ 2003-07-17 17:35 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

The confusing part may be the implicit bind that happens
when you do

	bind -ca /sys/src/cmd $home/kern/cmd

The resulting mount point has to things in the link
list bound there:

	/sys/src/cmd	- containing the create flag
	$home/kern/cmd	- not containing the create flag

The latter is implicit since you were binding -a onto a
directory.  You would have gotten the semantics you
wanted if you had said instead:

	bind -c $home/kern/cmd $home/kern/cmd
	bind -ca /sys/src/cmd $home/kern/cmd

[-- Attachment #2: Type: message/rfc822, Size: 2559 bytes --]

From: "boyd, rounin" <boyd@insultant.net>
To: <9fans@cse.psu.edu>
Subject: Re: [9fans] bind -c[ab] -- what am I doing wrong?
Date: Thu, 17 Jul 2003 19:18:22 +0200
Message-ID: <00b901c34c87$6d509780$b9844051@insultant.net>

union directories are a linked list.

    - open finds you the first file in the list bound directories,
      in the order they were bound [before/after]

    - create choose the first directory which allows creation,
      in the order they were bound [before/after]

the order they were bound is not temporal, it's where you bind them.

it's that easy.


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

* Re: [9fans] bind -c[ab] -- what am I doing wrong?
  2003-07-17 17:34       ` andrey mirtchovski
@ 2003-07-17 17:37         ` David Presotto
  2003-07-17 17:45         ` boyd, rounin
  1 sibling, 0 replies; 16+ messages in thread
From: David Presotto @ 2003-07-17 17:37 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

tmp is already a union directory (I'm assuming) so that the

	plan9% bind -ac /sys tmp

is binding a directory with create permissions behind a mount point
that already has a directory with create permissions.

[-- Attachment #2: Type: message/rfc822, Size: 2660 bytes --]

From: andrey mirtchovski <mirtchov@cpsc.ucalgary.ca>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] bind -c[ab] -- what am I doing wrong?
Date: Thu, 17 Jul 2003 11:34:25 -0600 (MDT)
Message-ID: <Pine.LNX.4.44.0307171132500.7478-100000@fbsd.cpsc.ucalgary.ca>

On Thu, 17 Jul 2003, boyd, rounin wrote:

> it's that easy.
>

how easy is that then:


 	plan9% ls -l | grep 'tmp|kern'
	d-rwxrwxr-x M 113 andrey andrey    0 Jul 17 10:53 kern
	d-rwxrwxr-x M 113 andrey andrey    0 Jul 17 11:32 tmp
	plan9% bind -ac /sys kern
	plan9% touch kern/blah
	touch: kern/blah: cannot create: permission denied
	plan9% bind -ac /sys tmp
	plan9% touch tmp/blah
	plan9%

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

* Re: [9fans] bind -c[ab] -- what am I doing wrong?
  2003-07-17 16:13 [9fans] bind -c[ab] -- what am I doing wrong? andrey mirtchovski
@ 2003-07-17 17:42 ` northern snowfall
  2003-07-17 17:10   ` andrey mirtchovski
  0 siblings, 1 reply; 16+ messages in thread
From: northern snowfall @ 2003-07-17 17:42 UTC (permalink / raw)
  To: 9fans; +Cc: andrey mirtchovski, dbailey27

>
>
>who's to blame?
>
You are! Binds make a list of directories like a linked
list chain. Our operations on these directories can always
be considered one of two primaries: read or write. Respectively,
we can think as the first link in the chain as the link we
Read from:
    cpu% cd
    cpu% mkdir testme
    cpu% cat > testme/u.h << EOF
        hello!
        EOF
    cpu% bind -bc testme /386/include
    cpu% wc -l /386/include/u.h
          1 /386/include/u.h
    cpu% cat /386/include/u.h
    hello!
    cpu% unmount /386/include

Or, we Read from the first bound directory that contains the
file we've requested access to. So, if 'testme' didn't contain
an u.h, the Read would return /386/include/u.h, despite testme
being bound 'before' /386/include/u.h.

Writes always take effect in the first directory we have permission
to write to in the chain. Most often this is the last link in the
chain:
    cpu% bind -ac testme /386/include/
    cpu% touch /386/include/foo
    cpu% ls -l testme/foo
    --rw-rw-r-- M 2265 snowfall snowfall 0 Jul 17 11:35 testme/foo
    cpu% unmount /386/include
    cpu%

So, if multiple directories we can write to were bound 'after'
our primary unwritable, we write to the first:
    cpu% bind -ac /tmp /386/include
    cpu% bind -ac testme /386/include
    cpu% touch /386/include/foo2
    cpu% ls -l /tmp/foo2
    --rw-rw-r-- M 2265 snowfall snowfall 0 Jul 17 11:38 /tmp/foo2
    cpu%

Hope that helps!
Don

http://www.7f.no-ip.com/~north_







>



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

* Re: [9fans] bind -c[ab] -- what am I doing wrong?
  2003-07-17 17:34       ` andrey mirtchovski
  2003-07-17 17:37         ` David Presotto
@ 2003-07-17 17:45         ` boyd, rounin
  2003-07-17 18:07           ` andrey mirtchovski
  1 sibling, 1 reply; 16+ messages in thread
From: boyd, rounin @ 2003-07-17 17:45 UTC (permalink / raw)
  To: 9fans

> plan9% bind -ac /sys kern
> plan9% touch kern/blah
> touch: kern/blah: cannot create: permission denied

you don't have PERMISSION -- read the message.

> plan9% touch tmp/blah

i creates a file called blah in tmp -- nothing to do with sys.

i'm going to stollys ...



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

* Re: [9fans] bind -c[ab] -- what am I doing wrong?
  2003-07-17 17:45         ` boyd, rounin
@ 2003-07-17 18:07           ` andrey mirtchovski
  2003-07-17 19:29             ` [9fans] Laptop and VM software vdharani
  0 siblings, 1 reply; 16+ messages in thread
From: andrey mirtchovski @ 2003-07-17 18:07 UTC (permalink / raw)
  To: 9fans

On Thu, 17 Jul 2003, boyd, rounin wrote:

> you don't have PERMISSION -- read the message.
>

read my mail. i was EXPECTING to have permission.

as usual, those who knew what's happening explained it clearly enough, thanx
Dave.



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

* Re: [9fans] Laptop and VM software
  2003-07-17 19:29             ` [9fans] Laptop and VM software vdharani
@ 2003-07-17 18:34               ` jmk
  2003-07-18  4:21                 ` Adrian Tritschler
  2003-07-19 17:28                 ` Russ Cox
  0 siblings, 2 replies; 16+ messages in thread
From: jmk @ 2003-07-17 18:34 UTC (permalink / raw)
  To: 9fans

On Thu Jul 17 14:16:28 EDT 2003, vdharani@infernopark.com wrote:
> Hi,
>
> I am planning to buy a laptop. I want to install Win, Linux and Plan 9.
>
> Can you please suggest what VM software I should go for? VMware or Virtual
> PC?
>
> Also, can you suggest what model I should go for? IBM T23? Or better Txx
> model? Or someother brand/model?
>
> I kind-of figured from the mailing list and Wiki pages that T23 and VMware
> 4.0 are the ones I should go for but I just want to make sure.
>
> Any help appreciated.
>
> Thanks
> dharani

Even the T23 is not uniform. We have ones with the internal Intel 82557 ethernet
controller, the T23 is also available with an internal 3Com controller and, if I
remember correctly, there was a problem with that.

VMware is the only choice. Virtual PC doesn't implement the PC it says it does and
Plan 9 finds that out.


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

* [9fans] Laptop and VM software
  2003-07-17 18:07           ` andrey mirtchovski
@ 2003-07-17 19:29             ` vdharani
  2003-07-17 18:34               ` jmk
  0 siblings, 1 reply; 16+ messages in thread
From: vdharani @ 2003-07-17 19:29 UTC (permalink / raw)
  To: 9fans

Hi,

I am planning to buy a laptop. I want to install Win, Linux and Plan 9.

Can you please suggest what VM software I should go for? VMware or Virtual
PC?

Also, can you suggest what model I should go for? IBM T23? Or better Txx
model? Or someother brand/model?

I kind-of figured from the mailing list and Wiki pages that T23 and VMware
4.0 are the ones I should go for but I just want to make sure.

Any help appreciated.

Thanks
dharani





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

* Re: [9fans] Laptop and VM software
  2003-07-17 18:34               ` jmk
@ 2003-07-18  4:21                 ` Adrian Tritschler
  2003-07-18  9:07                   ` vdharani
  2003-07-18 11:52                   ` C H Forsyth
  2003-07-19 17:28                 ` Russ Cox
  1 sibling, 2 replies; 16+ messages in thread
From: Adrian Tritschler @ 2003-07-18  4:21 UTC (permalink / raw)
  To: 9fans

jmk@plan9.bell-labs.com wrote:

>On Thu Jul 17 14:16:28 EDT 2003, vdharani@infernopark.com wrote:
>
>
>>Hi,
>>
>>I am planning to buy a laptop. I want to install Win, Linux and Plan 9.
>>
>>Can you please suggest what VM software I should go for? VMware or Virtual
>>PC?
>>
>>Also, can you suggest what model I should go for? IBM T23? Or better Txx
>>model? Or someother brand/model?
>>
>>I kind-of figured from the mailing list and Wiki pages that T23 and VMware
>>4.0 are the ones I should go for but I just want to make sure.
>>
>>Any help appreciated.
>>
>>Thanks
>>dharani
>>
>>
>
>Even the T23 is not uniform. We have ones with the internal Intel 82557 ethernet
>controller, the T23 is also available with an internal 3Com controller and, if I
>remember correctly, there was a problem with that.
>
That'd be my[1] IBM T21. :-(

Plan9's 3com driver doesn't work with the "3Com 10/100 Mini PCI Ethernet
Adapter" that was supplied with it.  It's not really a case of "internal
vs external" controller, both are internal mini-PCI cards, one works,
one doesn't.

If anyone can give me any hints on making it work, or how to debug a
network card driver, I'm all ears...

>VMware is the only choice. Virtual PC doesn't implement the PC it says it does and plan 9 finds that out.
>
    Adrian

[1] my employer's T21, provided for "work and work-related purposes"




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

* Re: [9fans] Laptop and VM software
  2003-07-18  9:07                   ` vdharani
@ 2003-07-18  8:24                     ` Adrian Tritschler
  0 siblings, 0 replies; 16+ messages in thread
From: Adrian Tritschler @ 2003-07-18  8:24 UTC (permalink / raw)
  To: 9fans

vdharani@infernopark.com wrote:

> Hi,

>>Plan9's 3com driver doesn't work with the "3Com 10/100 Mini PCI
>>Ethernet Adapter" that was supplied with it.  It's not really a case of
>>"internal vs external" controller, both are internal mini-PCI cards,
>>one works, one doesn't.

>>If anyone can give me any hints on making it work, or how to debug a
>>network card driver, I'm all ears...

> This could be a dumb question. If it is Mini PCI card, why cant you replace
> it with an 82557 card? Is availability an issue?

*I* could, if it belonged to me, but the PC belongs to my employer and was
purchased for my work, which involves running Windows (in various flavours)
and supporting NetWare and Windows servers.  Any plan9 installation on it is
purely for my own enjoyment and education, it falls under the "reasonable
personal use" clause of the IT Acceptable Use Policy.

I've got three begged/borrowed bits of equipment that run plan9 in their spare
time, none of them belong to me.  Two desktop PCs, neither of which can run
rio properly due to Trio3d oddities, and a laptop with working video but no
network.  It's educational, there's a log of what I do sitting on the boxes at
http://ws-cl-28-g09-a.its.monash.edu.au/  I'm sure that a working 3com driver
on the T21 would help others as well.

There's also a Pentium133 at home that really does belong to me, and once
there's a new distribution CD that lets me build venti/fossil at install time
I'll give that one a try...

A thought I had as a final part of the install routine, some way of sending a
report back to the developers of "here's a working machine with xyz hardware,
pci.txt, etc.."

> Regards
> dharani

	Adrian




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

* Re: [9fans] Laptop and VM software
  2003-07-18  4:21                 ` Adrian Tritschler
@ 2003-07-18  9:07                   ` vdharani
  2003-07-18  8:24                     ` Adrian Tritschler
  2003-07-18 11:52                   ` C H Forsyth
  1 sibling, 1 reply; 16+ messages in thread
From: vdharani @ 2003-07-18  9:07 UTC (permalink / raw)
  To: 9fans

Hi,

> Plan9's 3com driver doesn't work with the "3Com 10/100 Mini PCI
> Ethernet Adapter" that was supplied with it.  It's not really a case of
> "internal vs external" controller, both are internal mini-PCI cards,
> one works, one doesn't.
>
> If anyone can give me any hints on making it work, or how to debug a
> network card driver, I'm all ears...

This could be a dumb question. If it is Mini PCI card, why cant you replace
it with an 82557 card? Is availability an issue?

Regards
dharani





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

* Re: [9fans] Laptop and VM software
  2003-07-18  4:21                 ` Adrian Tritschler
  2003-07-18  9:07                   ` vdharani
@ 2003-07-18 11:52                   ` C H Forsyth
  1 sibling, 0 replies; 16+ messages in thread
From: C H Forsyth @ 2003-07-18 11:52 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 16 bytes --]

what went wrong?

[-- Attachment #2: Type: message/rfc822, Size: 4235 bytes --]

From: Adrian Tritschler <ajft@ajft.org>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Laptop and VM software
Date: Fri, 18 Jul 2003 14:21:05 +1000
Message-ID: <3F1775B1.3090904@ajft.org>

jmk@plan9.bell-labs.com wrote:

>On Thu Jul 17 14:16:28 EDT 2003, vdharani@infernopark.com wrote:
>
>
>>Hi,
>>
>>I am planning to buy a laptop. I want to install Win, Linux and Plan 9.
>>
>>Can you please suggest what VM software I should go for? VMware or Virtual
>>PC?
>>
>>Also, can you suggest what model I should go for? IBM T23? Or better Txx
>>model? Or someother brand/model?
>>
>>I kind-of figured from the mailing list and Wiki pages that T23 and VMware
>>4.0 are the ones I should go for but I just want to make sure.
>>
>>Any help appreciated.
>>
>>Thanks
>>dharani
>>
>>
>
>Even the T23 is not uniform. We have ones with the internal Intel 82557 ethernet
>controller, the T23 is also available with an internal 3Com controller and, if I
>remember correctly, there was a problem with that.
>
That'd be my[1] IBM T21. :-(

Plan9's 3com driver doesn't work with the "3Com 10/100 Mini PCI Ethernet
Adapter" that was supplied with it.  It's not really a case of "internal
vs external" controller, both are internal mini-PCI cards, one works,
one doesn't.

If anyone can give me any hints on making it work, or how to debug a
network card driver, I'm all ears...

>VMware is the only choice. Virtual PC doesn't implement the PC it says it does and plan 9 finds that out.
>
    Adrian

[1] my employer's T21, provided for "work and work-related purposes"


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

* Re: [9fans] Laptop and VM software
  2003-07-17 18:34               ` jmk
  2003-07-18  4:21                 ` Adrian Tritschler
@ 2003-07-19 17:28                 ` Russ Cox
  1 sibling, 0 replies; 16+ messages in thread
From: Russ Cox @ 2003-07-19 17:28 UTC (permalink / raw)
  To: 9fans

> VMware is the only choice. Virtual PC doesn't implement the PC it says it does and
> Plan 9 finds that out.

It might not be that hard to get Plan 9 going under VPC, but no one has
done the work.

Russ



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

end of thread, other threads:[~2003-07-19 17:28 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-17 16:13 [9fans] bind -c[ab] -- what am I doing wrong? andrey mirtchovski
2003-07-17 17:42 ` northern snowfall
2003-07-17 17:10   ` andrey mirtchovski
2003-07-17 17:18     ` boyd, rounin
2003-07-17 17:34       ` andrey mirtchovski
2003-07-17 17:37         ` David Presotto
2003-07-17 17:45         ` boyd, rounin
2003-07-17 18:07           ` andrey mirtchovski
2003-07-17 19:29             ` [9fans] Laptop and VM software vdharani
2003-07-17 18:34               ` jmk
2003-07-18  4:21                 ` Adrian Tritschler
2003-07-18  9:07                   ` vdharani
2003-07-18  8:24                     ` Adrian Tritschler
2003-07-18 11:52                   ` C H Forsyth
2003-07-19 17:28                 ` Russ Cox
2003-07-17 17:35       ` [9fans] bind -c[ab] -- what am I doing wrong? David Presotto

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