Re: [9fans] Partitioning the disk

2014-04-03 Thread Alexander Kapshuk
On 04/03/2014 09:08 PM, Szymon Olewniczak wrote:
> On Wed, Apr 02, 2014 at 06:02:23PM -0400, erik quanstrom wrote:
>> On Wed Apr  2 17:49:51 EDT 2014, szymon.olewnic...@rid.pl wrote:
 if you do a pull as glenda, or alternately

mount /srv/boot /n/root &&
9fs atom && 
disk/mkfs -vkU -s /n/atom/plan9^`{pwd} -d . <{echo +}

 you can then try "mkusbboot -p `{echo +}".  this may actually work.
>>> srv: dial tcp!atom.9atom.org!fs: cs: can't translate address: 
>>> '/srv/dns' file
>>> does not exist.
>>> It seems to me like an issue with internet connection. Am I right?
>>> One more question to this command. You've used pwd in it, so what directory 
>>> should I be in, in
>>> order to run command successfully? Why do I need to run this first mount 
>>> command(the /n/root seems
>>> to be used nowhere)? 
>> yes.  you can either run ndb/dns -r and ndb/cs and then try again, or replace
>> "9fs atom" with
>>
>>  attaip=208.71.233.235
>>  nflag=-n
>>  srv $nflag -q tcp!$attaip atom &&
>>  mount $nflag /srv/atom /n/atom atom
> But my ethernet device probably is not recognised. When I run ip/ipconfig I 
> get:
>   ipconfig: /net/ipifc/clone: bind ether /net/ether0: '/net/ether0' cs: 
> file does not exist
>
> It looks to me like the need of ordering a new ethernet card. I will try to 
> order 8169 as you've recomended
> and try to connect to the internet again.
>
 there is not enough room on the usb key to install all.
>>> The other problem is that after compiling usb and all it dependences when 
>>> I've rebooted
>>> the plan 9 atom all programs disappeared and I've needed to compile them 
>>> again. Is there any method to
>>> make the changes to the disk persistent? 
>> changes to the disk are persistent.  i suspect the executables are
>> misplaced.  are you booting from the hard drive?
> I'm booting from pendirve which I've setuped as you described earlier(using 
> dd). Maybe it's happening becouse
> I turn off my computer by pressing power button.
> How can I turn off plan9 in a clear way?
>
> BR,
> Szymon
>
fshalt(8).




Re: [9fans] writing to /dev/$winid/addr

2014-04-22 Thread Alexander Kapshuk
Howdy,

I'm working on a script where I want to get hold of a particular string
and use it as a new name of a particular window.

What I've tried so far, although not successfully, is writing to
/dev/$winid/addr with the intention of then being able to read the
string found from the /dev/$winid/data or /dev/$winid/xdata.

acme(4) says,
addrmay be written with any textual address (line number,
   regular expression, etc.), in the format understood by
   button 3 but without the initial colon, including com-
   pound addresses, to set the address for text accessed
   through the data file.

Here's an example of what I tried.
echo '/[A-Z]+\![a-z0-9]+\![0-9a-z]+' >/dev/$winid/addr

Which results in an 'address out of bounds' message being generated.

How does one write to 'addr'? Clearly, the shortcoming is on my part.
I'm just not sure what it is that's missing.

Thanks.




Re: [9fans] writing to /dev/$winid/addr

2014-04-23 Thread Alexander Kapshuk
Turns out, the reason why writing '/[A-Z]+\![a-z0-9]+\![0-9a-z]+' to
/dev/$winid/addr would fail for me is because sending a string
represented by the regular expression in question to /dev/$winid/body
was immediately followed by writing the regexp to addr. Putting a
while loop on the 'echo regexp >addr' followed by sleep, seems to have
been the answer. The script sets the prompt and the name of the window
running win when logged onto a UNIX machine.
Here's the script for those interested.

#!/bin/rc
{
 echo 'echo $SYSNAME!`uname -n`!$USER'
 echo 'PS1='':; '' PS2='' '''
} >/dev/$winid/body
while(! echo -n '/[A-Z]+\![a-z0-9]+\![0-9a-z]+' >/dev/$winid/addr >[2]/dev/null)
 sleep 0.2
sel=`{cat /dev/$winid/xdata}
echo name $sel >/dev/$winid/ctl

On Tue, Apr 22, 2014 at 4:53 PM, Alexander Kapshuk
 wrote:
> Howdy,
>
> I'm working on a script where I want to get hold of a particular string
> and use it as a new name of a particular window.
>
> What I've tried so far, although not successfully, is writing to
> /dev/$winid/addr with the intention of then being able to read the
> string found from the /dev/$winid/data or /dev/$winid/xdata.
>
> acme(4) says,
> addrmay be written with any textual address (line number,
>regular expression, etc.), in the format understood by
>button 3 but without the initial colon, including com-
>pound addresses, to set the address for text accessed
>through the data file.
>
> Here's an example of what I tried.
> echo '/[A-Z]+\![a-z0-9]+\![0-9a-z]+' >/dev/$winid/addr
>
> Which results in an 'address out of bounds' message being generated.
>
> How does one write to 'addr'? Clearly, the shortcoming is on my part.
> I'm just not sure what it is that's missing.
>
> Thanks.
>



Re: [9fans] writing to /dev/$winid/addr

2014-04-23 Thread Alexander Kapshuk

On 04/23/2014 09:07 PM, erik quanstrom wrote:
>> is '!' a metacharacter in regexes? regex(6) doesn't say anything about it.
>>
> it is not.
>
> however
>
>>> #!/bin/rc
>>> {
>>>  echo 'echo $SYSNAME!`uname -n`!$USER'
>>>  echo 'PS1='':; '' PS2='' '''
>>> } >/dev/$winid/body
> this is not valid rc.
>
> - erik
>
If it's not too much trouble, would you mind demonstrating what valid rc
would be for the part of the script in question.

Thanks.




Re: [9fans] writing to /dev/$winid/addr

2014-04-23 Thread Alexander Kapshuk
That's OK. It's actually ksh on AIX.

Thanks for your feedback anyway.


On Wed, Apr 23, 2014 at 10:34 PM, erik quanstrom  wrote:
>> >>> #!/bin/rc
>> >>> {
>> >>>  echo 'echo $SYSNAME!`uname -n`!$USER'
>> >>>  echo 'PS1='':; '' PS2='' '''
>> >>> } >/dev/$winid/body
>> > this is not valid rc.
>> >
>> > - erik
>> >
>> If it's not too much trouble, would you mind demonstrating what valid rc
>> would be for the part of the script in question.
>
> i'm wrong of course if the shell you're running is bash,
> the script itself is reasonable rc.  i was confused by an
> rc script emitting bash.
>
> - erik
>



Re: [9fans] writing to /dev/$winid/addr

2014-04-23 Thread Alexander Kapshuk
I'm sorry I confused you. In my second email I did mention that the
script was used to set a prompt and an acme window name when running
win and being logged onto UNIX.


On Thu, Apr 24, 2014 at 7:18 AM, Jacob Todd  wrote:
> Then why did you say it was rc? What's wrong with you.
>
> On Apr 24, 2014 12:18 AM, "Alexander Kapshuk" 
> wrote:
>>
>> That's OK. It's actually ksh on AIX.
>>
>> Thanks for your feedback anyway.
>>
>>
>> On Wed, Apr 23, 2014 at 10:34 PM, erik quanstrom 
>> wrote:
>> >> >>> #!/bin/rc
>> >> >>> {
>> >> >>>  echo 'echo $SYSNAME!`uname -n`!$USER'
>> >> >>>  echo 'PS1='':; '' PS2='' '''
>> >> >>> } >/dev/$winid/body
>> >> > this is not valid rc.
>> >> >
>> >> > - erik
>> >> >
>> >> If it's not too much trouble, would you mind demonstrating what valid
>> >> rc
>> >> would be for the part of the script in question.
>> >
>> > i'm wrong of course if the shell you're running is bash,
>> > the script itself is reasonable rc.  i was confused by an
>> > rc script emitting bash.
>> >
>> > - erik
>> >
>>
>



Re: [9fans] Acme 2-1 chord arguments

2015-07-16 Thread Alexander Kapshuk
On Wed, Jul 15, 2015 at 5:06 PM, Brian Zwahr  wrote:
> According to the man page, using the 2-1 chord sends selected text as a 
> *distinct* argument to the executed command. This is all well and good for 
> Edit, Look, etc. However, it keeps me from being able to, for instance, 
> select “checkout .” or “pull —prune” and then 2-1 on “git”. So, two questions:
>
> 1.) Is there a way to do what I’m trying to do?
>
> 2.) What was the reasoning behind 2-1 chording sending distinct arguments?
>
>

Have you tried typing git into the win tag and typing and selecting
the subsequent arguments in another window, passing them to git via
the 2-1 chord?

I've just tried doing that with 'git pull', and 'ls -ld .', both
commands working as expected for me.

Is this what you've been trying to do, or am I thinking wrong here?



Re: [9fans] Acme 2-1 chord arguments

2015-07-16 Thread Alexander Kapshuk
I just tried typing 'git' into my '/project/root/dir/+Errors' with
'log' selected in a different Acme window. Executing chord 2-1 on
'git' did work for me. The 'log' argument has to be selected in its
entirety, but not the trailing new line, which would generate an
'invalid key error' message, if passed to 'git'. Alternatively, you
may just click with  button 1 on the argument being passed, and then
do the 2-1 chord on 'git'. This worked for me as well. Hope this
helps.

Do you get any output when you try doing the 2-1 mouse chord on git?

On Thu, Jul 16, 2015 at 8:15 PM, Brian Zwahr  wrote:
> I guess I should clarify that I’m not using win. I normally do everything in 
> a +Errors window. So, for git, I run all the commands in 
> /project/root/dir/+Errors.
>
> I just tried in a win window, and it does work. I’m assuming this is because 
> win parses what’s passed in differently.
>
>> On Jul 16, 2015, at 11:54 AM, Alexander Kapshuk 
>>  wrote:
>>
>> On Wed, Jul 15, 2015 at 5:06 PM, Brian Zwahr  wrote:
>>> According to the man page, using the 2-1 chord sends selected text as a 
>>> *distinct* argument to the executed command. This is all well and good for 
>>> Edit, Look, etc. However, it keeps me from being able to, for instance, 
>>> select “checkout .” or “pull —prune” and then 2-1 on “git”. So, two 
>>> questions:
>>>
>>> 1.) Is there a way to do what I’m trying to do?
>>>
>>> 2.) What was the reasoning behind 2-1 chording sending distinct arguments?
>>>
>>>
>>
>> Have you tried typing git into the win tag and typing and selecting
>> the subsequent arguments in another window, passing them to git via
>> the 2-1 chord?
>>
>> I've just tried doing that with 'git pull', and 'ls -ld .', both
>> commands working as expected for me.
>>
>> Is this what you've been trying to do, or am I thinking wrong here?
>>
>
>



Re: [9fans] Acme 2-1 chord arguments

2015-07-16 Thread Alexander Kapshuk
I see. Sorry. I don't have any other ideas for you to try at the moment.


On Thu, Jul 16, 2015 at 8:45 PM, Brian Zwahr  wrote:
> Sorry, let me be more clear. The issue when I need to send multiple 
> arguments. For instance using 2-1 to add “pull” or “checkout” to “git” works. 
> However, using 2-1 to add “pull --prune” or “checkout .” does not work. At 
> least, not in +Errors. It does work in win, though, apparently.
>
>> On Jul 16, 2015, at 12:39 PM, Alexander Kapshuk 
>>  wrote:
>>
>> I just tried typing 'git' into my '/project/root/dir/+Errors' with
>> 'log' selected in a different Acme window. Executing chord 2-1 on
>> 'git' did work for me. The 'log' argument has to be selected in its
>> entirety, but not the trailing new line, which would generate an
>> 'invalid key error' message, if passed to 'git'. Alternatively, you
>> may just click with  button 1 on the argument being passed, and then
>> do the 2-1 chord on 'git'. This worked for me as well. Hope this
>> helps.
>>
>> Do you get any output when you try doing the 2-1 mouse chord on git?
>>
>> On Thu, Jul 16, 2015 at 8:15 PM, Brian Zwahr  wrote:
>>> I guess I should clarify that I’m not using win. I normally do everything 
>>> in a +Errors window. So, for git, I run all the commands in 
>>> /project/root/dir/+Errors.
>>>
>>> I just tried in a win window, and it does work. I’m assuming this is 
>>> because win parses what’s passed in differently.
>>>
>>>> On Jul 16, 2015, at 11:54 AM, Alexander Kapshuk 
>>>>  wrote:
>>>>
>>>> On Wed, Jul 15, 2015 at 5:06 PM, Brian Zwahr  wrote:
>>>>> According to the man page, using the 2-1 chord sends selected text as a 
>>>>> *distinct* argument to the executed command. This is all well and good 
>>>>> for Edit, Look, etc. However, it keeps me from being able to, for 
>>>>> instance, select “checkout .” or “pull —prune” and then 2-1 on “git”. So, 
>>>>> two questions:
>>>>>
>>>>> 1.) Is there a way to do what I’m trying to do?
>>>>>
>>>>> 2.) What was the reasoning behind 2-1 chording sending distinct arguments?
>>>>>
>>>>>
>>>>
>>>> Have you tried typing git into the win tag and typing and selecting
>>>> the subsequent arguments in another window, passing them to git via
>>>> the 2-1 chord?
>>>>
>>>> I've just tried doing that with 'git pull', and 'ls -ld .', both
>>>> commands working as expected for me.
>>>>
>>>> Is this what you've been trying to do, or am I thinking wrong here?
>>>>
>>>
>>>
>>
>
>



Re: [9fans] p9p sed vs linux sed

2015-08-14 Thread Alexander Kapshuk
On Wed, Aug 12, 2015 at 10:39 AM, Rudolf Sykora  wrote:
> Hello,
>
> is this as expected?
>
> perseus=; echo -n aaa | 9 sed 's/^/  perseus=; echo -n aaa | sed 's/^/ 
>
> For me the linux sed does what I expect,
> but not the p9p one (it adds a newline). Why?
>
> Thanks!
> Ruda
>

In case you were still wondering about the 'why' of the behaviour of
sed you encountered. See below.

P9p sed
---
/usr/local/plan9/src/cmd/sed.c:1316,1324
void
putline(Biobuf *bp, Rune *buf, int n)
{
while (n--)
Bputrune(bp, *buf++);
Bputc(bp, '\n');
if(lflag)
Bflush(bp);
}

Plan9 sed
-
/sys/src/cmd/sed.c:1315,1321
void
putline(Biobuf *bp, Rune *buf, int n)
{
   while (n--)
   Bputrune(bp, *buf++);
   Bputc(bp, '\n');
 }

Modified local copy
--
/usr/$user/src/nsed.c:1315,1321
void
putline(Biobuf *bp, Rune *buf, int n)
{
while (n--)
Bputrune(bp, *buf++);
/* Bputc(bp, '\n'); */
}

term% echo -n aaa | sed 's/^/

Re: [9fans] acme search backwards

2015-09-02 Thread Alexander Kapshuk
On Wed, Sep 2, 2015 at 5:01 PM,   wrote:
>> Also there was a discussion on 9fans about it with other
>> suggestions/solutions.
>
>  :-/RE
>
> is what I remember Russ recommending,  It's not perfect, but it does help.
>
> Lucio.
>
>

Page 4 of A Tutorial for Sam Command Language, by Rob Pike, suggests
the following usage:
>>>
Just precede the pattern with a minus
sign, which reverses the direction of the search:
-/Emacs/

Similarly,
$-/Emacs/
finds the last occurrence in the file, so
0/Emacs/,$-/Emacs/
selects the text from the first to last Emacs, inclusive.
<<<



Re: [9fans] Replacement for find

2015-09-29 Thread Alexander Kapshuk
 On Wed, Sep 30, 2015 at 9:26 AM, Wolfgang Helbig  wrote:
> Hello 9fans,
> in Unix I use find() like
> $ ed `find . -name blabla.java`
>
> to edit a file in a deeply nested directory.
>
> How would you accomplish this with commands from plan9 for user space?
>
> Greetings,
>
> Wolfgang Helbig
>

One way is,

du -a | sed '/blabla.java$/!d; s/.* //'



Re: [9fans] Why does Plan 9 use “snarf” instead of “copy”?

2016-09-12 Thread Alexander Kapshuk
Both 'Zerox' and 'Snarf' are there:

/sys/src/cmd/acme/cols.c:34
textinsert(t, 0, L"New Cut Paste Snarf Sort Zerox Delcol ", 38, TRUE);

On Mon, Sep 12, 2016 at 1:38 PM, Robert Raschke  wrote:
> Hi Mateusz,
>
> as far as I remember, it was originally called "xerox". But that is
> trademarked. No idea where the word "snarf" comes from.
>
> Cheers,
> Robby
>
> On 12 Sep 2016 12:19, "Mateusz Piotrowski"  wrote:
>
> Hello,
>
> I've discovered Plan 9 recently and became curious about some
> design decisions.
>
> Why there is a snarf buffer and not a copy buffer?
>
> As it might seem to be a dull question, it is not. I am very
> interested in the reason behind this decision. I've browsed
> numerous websites (including cat-v.org and the 9fans archives)
> but I wasn't able to find anything about it.
>
> I decided to ask this question [1] on Unix & Linux StackExchange
> but its community doesn't seem to know the answer.
>
> My guess is that "copying" is not as an atomic action.
> "Copying" is in fact:
>
> - obtaining the content you want to copy (_snarfing_)
> - inserting the content where you want it to be (_pasting_)
>
> Hence the use of snarf instead of copy.
>
> Am I right? Is there a document / book / article where
> it is explained?
>
> Cheers!
>
> Mateusz Piotrowski
>
> [1]:
> http://unix.stackexchange.com/questions/308943/why-does-plan-9-use-snarf-instead-of-copy



Re: [9fans] How can I clone the plan9 source code to my local

2016-11-05 Thread Alexander Kapshuk
On Sat, Nov 5, 2016 at 7:43 AM, Kaviraj Launchyard
 wrote:
> Hi everyone,
>
> I'm new to Plan9 community. Just wondering how can I clone the source code
> repo of plan9 to my local. I looked around and found a place to browse the
> source code online http://plan9.bell-labs.com/sources/plan9/sys/src/ (even
> this is off line for past 2 days I guess.) but I how can I clone the latest
> code to my local?
>
> Any help?
>
> Thanks in advance.
>
>

https://bitbucket.org/plan9-from-bell-labs/plan9



Re: [9fans] How can I clone the plan9 source code to my local

2016-11-05 Thread Alexander Kapshuk
No worries.

On Sat, Nov 5, 2016 at 10:47 AM, Kaviraj Launchyard
 wrote:
> Thanks Alex
>
>
>
> On Saturday 05 November 2016 01:39 PM, Alexander Kapshuk wrote:
>>
>> On Sat, Nov 5, 2016 at 7:43 AM, Kaviraj Launchyard
>>  wrote:
>>>
>>> Hi everyone,
>>>
>>> I'm new to Plan9 community. Just wondering how can I clone the source
>>> code
>>> repo of plan9 to my local. I looked around and found a place to browse
>>> the
>>> source code online http://plan9.bell-labs.com/sources/plan9/sys/src/
>>> (even
>>> this is off line for past 2 days I guess.) but I how can I clone the
>>> latest
>>> code to my local?
>>>
>>> Any help?
>>>
>>> Thanks in advance.
>>>
>>>
>> https://bitbucket.org/plan9-from-bell-labs/plan9
>>
>
>



Re: [9fans] Inferno on Plan9

2017-12-23 Thread Alexander Kapshuk
On Sat, Dec 23, 2017 at 7:13 PM, G B  wrote:
> I've installed Inferno on FreeBSD but how do you build it for Plan 9?  The
> makemk.sh file and without looking, I think the mkconfig file too, reference
> gcc.  And the makemk.sh has /bin/sh.  Do I have to install a Bourne or Korn
> shell plus gcc from contrib to compile?
>
> Thanks.
>

No need to run makemk.sh on Plan9. See INSTALL for details:
Quote:
On Plan 9, of course, the host system's normal version of  mk should
be adequate.



Re: [9fans] Inferno on Plan9

2017-12-28 Thread Alexander Kapshuk
On Thu, Dec 28, 2017 at 9:54 PM, Brian L. Stuart  wrote:
> On Sat, Dec 23, 2017 at 7:13 PM, G B  wrote:
>> I've installed Inferno on FreeBSD but how do you build it for Plan 9?  The
>> makemk.sh file and without looking, I think the mkconfig file too, reference
>> gcc.  And the makemk.sh has /bin/sh.  Do I have to install a Bourne or Korn
>> shell plus gcc from contrib to compile?
>
> Which version of FreeBSD did you use, and did you use the
> Inferno on bitbucket?  I'm finding it a long way from building
> out of the box there these days.
>
> BLS
>

While not a FreeBSD user, the bitbucket repository is:
grep bitbucket ~/inferno-os/.hg/hgrc
default = https://bitbucket.org/inferno-os/inferno-os

Care to elaborate a bit more on what sort of trouble you're having
building Inferno on your system?



Re: [9fans] simple rc problem in p9p (on OpenBSD)

2018-04-26 Thread Alexander Kapshuk
On Thu, Apr 26, 2018 at 5:45 PM, Rudolf Sykora  wrote:
> Hello
>
> I, using OpenBSD's p9p, see this
>
> % w='A
> B
> C'
> % echo $w
> A
> B
> C
> % for(i in $w) {echo $i; echo XXX}
> A
> B
> C
> XXX
>
> ie, w in for is taken as just one argument instead of
> 3. What can I do with it?
>
> I haven't modified ifs (it should be \n space and tab).
> (How can I check, say see the character codes?)
>
> Thanks for comments
> Ruda
>

Here, $w's value is a string.
% w='A
B
C'
% echo $#w
1

And here, it's a list.
% w=(A B C)
% echo $#w
3
% for(i in $w) {echo $i; echo XXX}
A
XXX
B
XXX
C
XXX



Re: [9fans] simple rc problem in p9p (on OpenBSD)

2018-04-26 Thread Alexander Kapshuk
On Thu, Apr 26, 2018 at 6:08 PM, Rudolf Sykora  wrote:
> On 26 April 2018 at 16:54, Lucio De Re  wrote:
>> w=(A B C)
>>
>> ?
>
> 1) this is not an answer
> 2) the use of it all was that I wanted to send to print
> certain files, the list of which I got from ls followed
> by manual deletion (in 9term) of some... Newline separation
> is thus natural.
>
> Thanks anyway
> Ruda
>

You could initialise $w to hold a list of files output by ls like so:
% w=`{ls}
% echo $#w
40

Is this what you had in mind?



[9fans] Static ip configuration for a standalone cpu server in qemu on Linux

2018-07-06 Thread Alexander Kapshuk
I've installed Plan 9 in qemu on Linux as instructed here:
https://9p.io/wiki/plan9/Installing_Plan_9_on_Qemu/index.html

Now I'm in the process of converting it into a standalone cpu server.
I'm following the instructions given here:
https://9p.io/wiki/plan9/Configuring_a_Standalone_CPU_Server/index.html

I would like to configure a static IP address for the cpu server, so I
can drawterm into it from other machines on my home network.
My knowledge of networking is limited. I understand that I need to put this:
ip/ipconfig -g  ether /net/ether0  

into my /cfg/$sysname/cpurc.

What I don't understand, and am asking for assistance with, is where
those three ip addresses in the example above have to come from. Do I
add them to the ethernet interface on the host system, or is there a
way to do this from within the Plan 9 system?

Thanks.
Alexander Kapshuk.



Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux

2018-07-07 Thread Alexander Kapshuk
Thanks. I'll give that a try.

On Fri, Jul 6, 2018 at 10:37 PM Skip Tavakkolian
 wrote:
>
> You could use private network addresses (10.0.0.0/8,  172.16.0.0/12 or 
> 192.168.0.0/16). Your /lib/ndb/local file can then be setup around a subnet 
> like 192.168.9.0/24.  According to the following, qemu uses 10.0.2.0/24 when 
> using "user mode networking" and provides a virtual dhcp (10.0.2.2), dns 
> (10.0.2.3) and cifs (10.0.2.4).  Using "tap" mode, you get to pick the subnet 
> in qemu-ifup script.
>
> https://en.wikibooks.org/wiki/QEMU/Networking
>
>
> On Fri, Jul 6, 2018 at 9:43 AM Alexander Kapshuk 
>  wrote:
>>
>> I've installed Plan 9 in qemu on Linux as instructed here:
>> https://9p.io/wiki/plan9/Installing_Plan_9_on_Qemu/index.html
>>
>> Now I'm in the process of converting it into a standalone cpu server.
>> I'm following the instructions given here:
>> https://9p.io/wiki/plan9/Configuring_a_Standalone_CPU_Server/index.html
>>
>> I would like to configure a static IP address for the cpu server, so I
>> can drawterm into it from other machines on my home network.
>> My knowledge of networking is limited. I understand that I need to put this:
>> ip/ipconfig -g  ether /net/ether0  
>>
>> into my /cfg/$sysname/cpurc.
>>
>> What I don't understand, and am asking for assistance with, is where
>> those three ip addresses in the example above have to come from. Do I
>> add them to the ethernet interface on the host system, or is there a
>> way to do this from within the Plan 9 system?
>>
>> Thanks.
>> Alexander Kapshuk.
>>



Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux

2018-08-25 Thread Alexander Kapshuk
I am trying to follow the instructions given here:

http://fqa.9front.org/fqa3.html#3.3.1.4.4
3.3.1.4.4 - Linux TAP

Here's what I've done so far:
(1). Set up a tap0 device as user root:
ip tuntap add dev tap0 mode tap user sasha
ip address add 10.0.0.1/24 dev tap0

ip addr show dev tap0
4: tap0:  mtu 1500 qdisc noop state DOWN group
default qlen 1000
link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
inet 10.0.0.1/24 scope global tap0
   valid_lft forever preferred_lft forever

(2). Started qemu with Bell Labs system image as a regular user like so:
qemu-system-x86_64 \
-boot order=d \
-drive file=$HOME/Plan9.raw.img,format=raw \
-netdev tap,id=eth,ifname=tap0,script=no,downscript=no \
-device e1000,netdev=eth,mac=C6:1C:63:D9:91:1D

(3). Put these details into /lib/ndb/local:
sys=gnot ether=c61c63d9911d ip=10.0.0.2 ipmask=255.255.255.0 ipgw=10.0.0.1
dns=10.0.0.1
dom=gnot.plan9

(4). And these into /cfg/gnot/termrc
ip/ipconfig -g 10.0.0.1 ether /net/ether0 10.0.0.2 255.255.255.0

(5). And rebooted the system.

Current state of things:
(1). MAC address is recognised:
cat /net/ether0/addr
c61c63d9911d

(2). Still no networking.
ping'ing 10.0.0.2 from my Linux host results in all packets being dropped.
ip/ping 10.0.0.1 from qemu plan9 sees all packates dropped also.

I understand that it is something I am not doing right because of my
lack of networking knowledge.  In all likelyhood, the answer was given
by Skip in his reply to my original email.
The 9front wiki article probably too has all the information needed to
setup networking in qemu.
I am probably just not seeing it.

A further tip(s) would be much appreciated.
This list's patience for my ignorance is much appreciated.

On Sat, Jul 7, 2018 at 5:33 PM Alexander Kapshuk
 wrote:
>
> Thanks. I'll give that a try.
>
> On Fri, Jul 6, 2018 at 10:37 PM Skip Tavakkolian
>  wrote:
> >
> > You could use private network addresses (10.0.0.0/8,  172.16.0.0/12 or 
> > 192.168.0.0/16). Your /lib/ndb/local file can then be setup around a subnet 
> > like 192.168.9.0/24.  According to the following, qemu uses 10.0.2.0/24 
> > when using "user mode networking" and provides a virtual dhcp (10.0.2.2), 
> > dns (10.0.2.3) and cifs (10.0.2.4).  Using "tap" mode, you get to pick the 
> > subnet in qemu-ifup script.
> >
> > https://en.wikibooks.org/wiki/QEMU/Networking
> >
> >
> > On Fri, Jul 6, 2018 at 9:43 AM Alexander Kapshuk 
> >  wrote:
> >>
> >> I've installed Plan 9 in qemu on Linux as instructed here:
> >> https://9p.io/wiki/plan9/Installing_Plan_9_on_Qemu/index.html
> >>
> >> Now I'm in the process of converting it into a standalone cpu server.
> >> I'm following the instructions given here:
> >> https://9p.io/wiki/plan9/Configuring_a_Standalone_CPU_Server/index.html
> >>
> >> I would like to configure a static IP address for the cpu server, so I
> >> can drawterm into it from other machines on my home network.
> >> My knowledge of networking is limited. I understand that I need to put 
> >> this:
> >> ip/ipconfig -g  ether /net/ether0  
> >>
> >> into my /cfg/$sysname/cpurc.
> >>
> >> What I don't understand, and am asking for assistance with, is where
> >> those three ip addresses in the example above have to come from. Do I
> >> add them to the ethernet interface on the host system, or is there a
> >> way to do this from within the Plan 9 system?
> >>
> >> Thanks.
> >> Alexander Kapshuk.
> >>



Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux

2018-08-25 Thread Alexander Kapshuk
Thanks Hiro and Bakul for your prompt responses.

Here's what I've got to report...

I brought tap0 as user root:
ip link set dev tap0 up

ip addr show dev tap0
4: tap0:  mtu 1500 qdisc pfifo_fast
state UP group default qlen 1000
link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
inet 10.0.0.1/24 scope global tap0
   valid_lft forever preferred_lft forever
inet6 fe80::c41c:63ff:fed9:911d/64 scope link
   valid_lft forever preferred_lft forever

ping -c4 10.0.0.2
PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
>From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
>From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
>From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
>From 10.0.0.1 icmp_seq=4 Destination Host Unreachable

--- 10.0.0.2 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 75ms
pipe 4

# In qemu I got this output:
arpreq: 10.0.0.1 also has ether address c61c63d9911d

# Tcpdump output on Linux host:
tcpdump -nS -vv -i tap0
tcpdump: listening on tap0, link-type EN10MB (Ethernet), capture size
262144 bytes
22:12:40.302180 IP6 (hlim 255, next-header ICMPv6 (58) payload length:
16) fe80::c41c:63ff:fed9:911d > ff02::2: [icmp6 sum ok] ICMP6, router
solicitation, length 16
  source link-address option (1), length 8 (1): c6:1c:63:d9:91:1d
0x:  c61c 63d9 911d
22:12:47.874535 IP (tos 0x0, ttl 1, id 18152, offset 0, flags [DF],
proto UDP (17), length 195)
10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
22:12:48.875587 IP (tos 0x0, ttl 1, id 18675, offset 0, flags [DF],
proto UDP (17), length 195)
10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
22:12:49.875963 IP (tos 0x0, ttl 1, id 19386, offset 0, flags [DF],
proto UDP (17), length 195)
10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
22:12:50.876052 IP (tos 0x0, ttl 1, id 20194, offset 0, flags [DF],
proto UDP (17), length 195)
10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
22:13:25.356189 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28
22:13:26.382153 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28
22:13:27.406149 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28
22:13:28.430247 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28
22:13:29.454154 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28
22:13:30.478150 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
10.0.0.2 tell 10.0.0.1, length 28

Thanks.
On Sat, Aug 25, 2018 at 9:29 PM Bakul Shah  wrote:
>
> On Sat, 25 Aug 2018 14:20:44 +0300 Alexander Kapshuk 
>  wrote:
> > I am trying to follow the instructions given here:
> >
> > http://fqa.9front.org/fqa3.html#3.3.1.4.4
> > 3.3.1.4.4 - Linux TAP
> >
> > Here's what I've done so far:
> > (1). Set up a tap0 device as user root:
> > ip tuntap add dev tap0 mode tap user sasha
> > ip address add 10.0.0.1/24 dev tap0
> >
> > ip addr show dev tap0
> > 4: tap0:  mtu 1500 qdisc noop state DOWN group
> > default qlen 1000
> > link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
> > inet 10.0.0.1/24 scope global tap0
> >valid_lft forever preferred_lft forever
>
> I see that tap0 state is DOWN. Try bringing it up.
> If that still doesn't work, run
> tcpdump -ni tap0
> and tell us what you discover.
>



Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux

2018-08-25 Thread Alexander Kapshuk
I thought that the mac address in the qemu command had to be the same as
the link/ether address of the tap device.
Should I make one up and use that in the qemu command?
Thanks.


On Sat, Aug 25, 2018, 22:49 hiro <23h...@gmail.com> wrote:

> the qemu error seems helpful: how did you chose mac=C6:1C:63:D9:91:1D
> in the qemu command? i see no mention in the fqa that it should be the
> same as the hypervisor's interface!
>
> On 8/25/18, Alexander Kapshuk  wrote:
> > Thanks Hiro and Bakul for your prompt responses.
> >
> > Here's what I've got to report...
> >
> > I brought tap0 as user root:
> > ip link set dev tap0 up
> >
> > ip addr show dev tap0
> > 4: tap0:  mtu 1500 qdisc pfifo_fast
> > state UP group default qlen 1000
> > link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
> > inet 10.0.0.1/24 scope global tap0
> >valid_lft forever preferred_lft forever
> > inet6 fe80::c41c:63ff:fed9:911d/64 scope link
> >valid_lft forever preferred_lft forever
> >
> > ping -c4 10.0.0.2
> > PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
> > From 10.0.0.1 icmp_seq=1 Destination Host Unreachable
> > From 10.0.0.1 icmp_seq=2 Destination Host Unreachable
> > From 10.0.0.1 icmp_seq=3 Destination Host Unreachable
> > From 10.0.0.1 icmp_seq=4 Destination Host Unreachable
> >
> > --- 10.0.0.2 ping statistics ---
> > 4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 75ms
> > pipe 4
> >
> > # In qemu I got this output:
> > arpreq: 10.0.0.1 also has ether address c61c63d9911d
> >
> > # Tcpdump output on Linux host:
> > tcpdump -nS -vv -i tap0
> > tcpdump: listening on tap0, link-type EN10MB (Ethernet), capture size
> > 262144 bytes
> > 22:12:40.302180 IP6 (hlim 255, next-header ICMPv6 (58) payload length:
> > 16) fe80::c41c:63ff:fed9:911d > ff02::2: [icmp6 sum ok] ICMP6, router
> > solicitation, length 16
> >   source link-address option (1), length 8 (1): c6:1c:63:d9:91:1d
> > 0x:  c61c 63d9 911d
> > 22:12:47.874535 IP (tos 0x0, ttl 1, id 18152, offset 0, flags [DF],
> > proto UDP (17), length 195)
> > 10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> > 22:12:48.875587 IP (tos 0x0, ttl 1, id 18675, offset 0, flags [DF],
> > proto UDP (17), length 195)
> > 10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> > 22:12:49.875963 IP (tos 0x0, ttl 1, id 19386, offset 0, flags [DF],
> > proto UDP (17), length 195)
> > 10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> > 22:12:50.876052 IP (tos 0x0, ttl 1, id 20194, offset 0, flags [DF],
> > proto UDP (17), length 195)
> > 10.0.0.1.49968 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
> > 22:13:25.356189 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> > 22:13:26.382153 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> > 22:13:27.406149 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> > 22:13:28.430247 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> > 22:13:29.454154 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> > 22:13:30.478150 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> > 10.0.0.2 tell 10.0.0.1, length 28
> >
> > Thanks.
> > On Sat, Aug 25, 2018 at 9:29 PM Bakul Shah  wrote:
> >>
> >> On Sat, 25 Aug 2018 14:20:44 +0300 Alexander Kapshuk
> >>  wrote:
> >> > I am trying to follow the instructions given here:
> >> >
> >> > http://fqa.9front.org/fqa3.html#3.3.1.4.4
> >> > 3.3.1.4.4 - Linux TAP
> >> >
> >> > Here's what I've done so far:
> >> > (1). Set up a tap0 device as user root:
> >> > ip tuntap add dev tap0 mode tap user sasha
> >> > ip address add 10.0.0.1/24 dev tap0
> >> >
> >> > ip addr show dev tap0
> >> > 4: tap0:  mtu 1500 qdisc noop state DOWN group
> >> > default qlen 1000
> >> > link/ether c6:1c:63:d9:91:1d brd ff:ff:ff:ff:ff:ff
> >> > inet 10.0.0.1/24 scope global tap0
> >> >valid_lft forever preferred_lft forever
> >>
> >> I see that tap0 state is DOWN. Try bringing it up.
> >> If that still doesn't work, run
> >> tcpdump -ni tap0
> >> and tell us what you discover.
> >>
> >
> >
>
>


Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux

2018-08-25 Thread Alexander Kapshuk
Understood.
I'll give it a try and let you know how I go.
Thanks.


On Sun, Aug 26, 2018, 00:20 hiro <23h...@gmail.com> wrote:

> nothing in the fqa mentions the tap device's mac address (which linux
> generated randomly in order not to conflict with whatever you might be
> using on the other side).
>
> look at the tap device as an ethernet interface that is plugged into
> the same L2 switch as the VM's virtual interface.
>
> you don't want mac address collisions in one L2 network, so yes, use a
> different one for the VM.
>
>


Re: [9fans] Static ip configuration for a standalone cpu server in qemu on Linux

2018-08-26 Thread Alexander Kapshuk
With the tap device up:
ip addr show dev tap0
4: tap0:  mtu 1500 qdisc pfifo_fast
state UP group default qlen 1000
link/ether 9a:44:ad:1f:39:d9 brd ff:ff:ff:ff:ff:ff
inet 10.0.0.1/24 scope global tap0
   valid_lft forever preferred_lft forever
inet6 fe80::9844:adff:fe1f:39d9/64 scope link
   valid_lft forever preferred_lft forever

And the qemu command using the mac address given in the fqa example:
qemu-system-x86_64 \
-boot order=d \
-drive file=$HOME/Plan9.raw.img,format=raw \
-netdev tap,id=eth,ifname=tap0,script=no,downscript=no \
-device e1000,netdev=eth,mac=52:54:00:00:EE:03

And the ether= attribute removed from /lib/ndb/local,

Both pings below work now.
ping 10.0.0.2 # Linux
ip/ping 10.0.0.1 # Plan 9

tcpdump -nS -vv -i tap0
tcpdump: listening on tap0, link-type EN10MB (Ethernet), capture size
262144 bytes
16:35:00.265147 IP (tos 0x0, ttl 1, id 46876, offset 0, flags [DF],
proto UDP (17), length 195)
10.0.0.1.48952 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
16:35:01.266364 IP (tos 0x0, ttl 1, id 47164, offset 0, flags [DF],
proto UDP (17), length 195)
10.0.0.1.48952 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
16:35:02.266828 IP (tos 0x0, ttl 1, id 47770, offset 0, flags [DF],
proto UDP (17), length 195)
10.0.0.1.48952 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
16:35:03.267406 IP (tos 0x0, ttl 1, id 48737, offset 0, flags [DF],
proto UDP (17), length 195)
10.0.0.1.48952 > 239.255.255.250.1900: [udp sum ok] UDP, length 167
16:35:28.213321 IP (tos 0x0, ttl 255, id 5, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24833, length 44
16:35:28.213374 IP (tos 0x0, ttl 64, id 2728, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24833, length 44
16:35:29.212816 IP (tos 0x0, ttl 255, id 6, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24834, length 44
16:35:29.212873 IP (tos 0x0, ttl 64, id 2867, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24834, length 44
16:35:30.223989 IP (tos 0x0, ttl 255, id 7, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24835, length 44
16:35:30.224042 IP (tos 0x0, ttl 64, id 2906, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24835, length 44
16:35:31.223030 IP (tos 0x0, ttl 255, id 8, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24836, length 44
16:35:31.223086 IP (tos 0x0, ttl 64, id 3895, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24836, length 44
16:35:32.222034 IP (tos 0x0, ttl 255, id 9, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24837, length 44
16:35:32.222090 IP (tos 0x0, ttl 64, id 4241, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24837, length 44
16:35:33.233714 IP (tos 0x0, ttl 255, id 10, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.2 > 10.0.0.1: ICMP echo request, id 46534, seq 24838, length 44
16:35:33.233769 IP (tos 0x0, ttl 64, id 4545, offset 0, flags [none],
proto ICMP (1), length 64)
10.0.0.1 > 10.0.0.2: ICMP echo reply, id 46534, seq 24838, length 44


On to the standalone CPU + auth server setup instructions now.
Thanks very much for all your help.
On Sun, Aug 26, 2018 at 7:56 AM Alexander Kapshuk
 wrote:
>
> Understood.
> I'll give it a try and let you know how I go.
> Thanks.
>
>
> On Sun, Aug 26, 2018, 00:20 hiro <23h...@gmail.com> wrote:
>>
>> nothing in the fqa mentions the tap device's mac address (which linux
>> generated randomly in order not to conflict with whatever you might be
>> using on the other side).
>>
>> look at the tap device as an ethernet interface that is plugged into
>> the same L2 switch as the VM's virtual interface.
>>
>> you don't want mac address collisions in one L2 network, so yes, use a
>> different one for the VM.
>>



Re: [9fans] plan 9 : any pager?

2018-10-02 Thread Alexander Kapshuk
On Wed, Oct 3, 2018 at 6:16 AM Mayuresh Kathe  wrote:
>
> did plan 9 have any pager? or did every text file to be read had to be
> opened in acme or a similar tool?
>
> btw, is there any pager under plan9port? didn't know what to search for,
> hence couldn't find any.
>
> thanks,
>
> ~mayuresh
>
>

https://9p.io/magic/man2html/1/p
https://9p.io/magic/man2html/1/cat
https://9p.io/magic/man2html/1/page



[9fans] Ssh configuration from within drawterm

2018-11-12 Thread Alexander Kapshuk
I would like to set up ssh on plan9 so I can dial out to the Linux
systems on my LAN.
What I've done so far is:
(1). I've generated rsa and dsa keys and put them in my secstore.
auth/rsagen
auth/dsagen
(2). I've converted both rsa and dsa keys to ssh format and put those in my
 $HOME/.ssh/authorized_keys file on Linux.
grep rsa /mnt/factotum/ctl | rsa2ssh2
auth/dsagen -t 'service=ssh' >key
auth/dsa2ssh key
(3). I've put a key for proto=pass in my sectore as well:

Ssh connection fails with these records found in /sys/log/ssh:
plan9 Nov 12 21:05:46 netssh: server id 9 new connection on fd 3
plan9 Nov 12 21:05:46 netssh: client id 9 connect handshake failed: tcp conn 26
plan9 Nov 12 21:06:41 netssh: no proto=dsa key in factotum

The line about netssh not finding proto=dsa key in factotum is printed
even though I did put it in factotum as it was output by auth/dsagen
verbatum.

Any tips on how to proceed with this would be much appreciated.



Re: [9fans] Ssh configuration from within drawterm

2018-11-14 Thread Alexander Kapshuk
On Tue, Nov 13, 2018 at 1:20 AM hiro <23h...@gmail.com> wrote:
>
> did you try with proto=rsa instead of proto=pass ?!
> you don't need both rsa and dsa. why not use just rsa?
>

Thanks for your prompt response.

I got rid of the dsa key in my factotum.

Here's my current rsa key record in factotum
cpu% grep ssh /mnt/factotum/ctl
key proto=rsa service=ssh role=client role=sign
comment=sasha@plan9.domain size=1024 ek=23
n=F69A9E3314E579E9C6A18D9804029849B5CF441E41E2D1CC3A41EE39D296C692B39291128CA86DD714BE78BDDBFC54766D34712A77E04EFC7869055217E2DCC3684E0612AB7E9EA350778BBEA87348BB43A8BDC37A86B0433EBB8ADDC0EB5A314DC35AE10721C9E33BB760ED7DAB70C8D65801EAE7DC7021222E42976C133E47
!dk? !p? !q? !kp? !kq? !c2?
key proto=pass service=ssh server=pc-sasha user=sasha !password?

Ssh debugging output:
cpu% ssh -d pc-sasha
/386/bin/ssh2: mounting /srv/netssh on /net
/386/bin/ssh2: can't open /srv/netssh: '/srv/netssh' file does not exist
/386/bin/ssh2: mounting /srv/ssh on /net
/386/bin/ssh2: can't open /srv/ssh: '/srv/ssh' file does not exist
/386/bin/ssh2: mounting /srv/ssh.sasha on /net
/386/bin/ssh2: dial conn /net/ssh!pc-sasha!22: connect handshake failed

Here are the contents of my /net/ssh:
cpu% ls -l /net/ssh
d-r-xr-xr-x M 90 sasha sasha 0 Nov 14 20:47 /net/ssh/0
d-r-xr-xr-x M 90 sasha sasha 0 Nov 14 20:47 /net/ssh/1
d-r-xr-xr-x M 90 sasha sasha 0 Nov 14 20:48 /net/ssh/2
d-r-xr-xr-x M 90 sasha sasha 0 Nov 14 20:48 /net/ssh/3
d-r-xr-xr-x M 90 sasha sasha 0 Nov 14 20:55 /net/ssh/4
d-r-xr-xr-x M 90 sasha sasha 0 Nov 14 20:57 /net/ssh/5
d-r-xr-xr-x M 90 sasha sasha 0 Nov 14 20:58 /net/ssh/6
d-r-xr-xr-x M 90 sasha sasha 0 Nov 14 20:58 /net/ssh/7
--rw-rw-rw- M 90 sasha sasha 0 Nov 14 20:47 /net/ssh/clone
--rw-rw-rw- M 90 sasha sasha 0 Nov 14 20:47 /net/ssh/ctl
--rw--- M 90 sasha sasha 0 Nov 14 20:47 /net/ssh/keys


The Keys and Management section of SSH(4), refers to various keys
required for the operation of ssh.
(1). The first key needed is the host key for server operation.
In the case of the keys being stored in factotum(4), these
keys will be the first ones listed with proto=rsa and
proto=dss.

That's what I already have in my factotum shown above.

(2). The next set of keys are the public host keys used by
clients to verify the identities of servers.  As with the
original Plan 9 SSH implementation, there is a system-wide
list of these in /sys/lib/ssh/keyring and each user may have
a list in $home/lib/keyring.
If a public key for a remote server is listed and matches the one
offered by the server,
the connection proceeds.  If a public key for a remote server is
listed but does not match
the one offered by the server, or if no public key is listed for a
remote server,
ssh (see ssh2(1)) presents the key to the user and asks whether to
reject the key,
accept the key only for that session, or accept the key permanently.
The last option causes the key to be written to the user's keyring.
In the case of
a mismatching key, the accept option can either be to add to or
replace the old key.

I have neither of the keyring files, nor do I get prompted to accept any keys.

What am I missing?

Thanks.



Re: [9fans] any git client?

2019-02-06 Thread Alexander Kapshuk
On Mon, Feb 4, 2019 at 12:52 PM Richard Miller <9f...@hamnavoe.com> wrote:
>
> > to add to the last comment from skip, also note the availability of a
> > working ssh and sshfs on 9front :)
>
> Ssh also works fine on traditional plan9 if you apply these patches
> from http://9legacy.org/patch.html :
> tls-devtls12.diff
> tls-tlshand12.diff
> libsec-x509-sha2.diff
> libsec-tlshand12-nossl3.diff
> libsec-tlshand12-norc4.diff
> libsec-tlshand12-fixes.diff
> libsec-x509-sig.diff
>
> These are already applied in the raspberry pi image:
> http://9p.io/sources/contrib.miller/9pi.img.gz
>
>
How does one apply these patches?
By mounting http://9legacy.org/9legacy/patch on /n/sources/patch and
then using patch/apply? Or is there some other way?
Thanks.



Re: [9fans] any git client?

2019-02-06 Thread Alexander Kapshuk
On Wed, Feb 6, 2019 at 11:44 AM Richard Miller <9f...@hamnavoe.com> wrote:
>
> > How does one apply these patches?
> > By mounting http://9legacy.org/9legacy/patch on /n/sources/patch and
> > then using patch/apply? Or is there some other way?
>
> I download them with hget and apply them with ape/patch.  There might
> be other ways too.
>
>
Understood.
Thanks.



[9fans] Plan 9 won't boot on Xen 8.0

2019-07-04 Thread Alexander Kapshuk
I had Plan 9 running on Xen 7.5. After upgrading to Xen 8.0 Plan 9
won't boot any more.
I get a 'No bootable device' message displayed.

The system was previously setup by someone else.
If I can, I would like to try and make it run on Xen 8.0.

Any tips would be much appreciated.



Re: [9fans] Plan 9 won't boot on Xen 8.0

2019-07-17 Thread Alexander Kapshuk
Thanks for your response, and apologies for the delay in replying.
I was thinking if it would also be possible to migrate the current
Plan 9 setup that is used with Xen to Qemu.
Thanks.

On Mon, Jul 8, 2019 at 10:53 AM Alexander Sychev  wrote:
>
> Hi,
>
> Xen now looks for a section with name '__xen_guest' starting from a second 
> section.
> A simple workaround is to make two '__xen_guest' sections (with a small patch 
> of xenelf.c):
>
> diff -r xen/mkfile xen2/mkfile
> 105c107,108
> <   ./xenelf.$cputype $target.elf $target __xen_guest ''$XENELF''
> ---
> >   ./xenelf.$cputype $target.elf $target.elf2 __xen_guest ''$XENELF''
> >   ./xenelf.$cputype $target.elf2 $target __xen_guest ''$XENELF''
> diff -r xen/xenelf.c xen2/xenelf.c
> 131c131,132
> <   ns = 0; //GETS(&e.shnum);
> ---
> >   ns = GETS(&e.shnum);
>
> I run it on Xen 4.10.3
>
> On Fri, Jul 5, 2019 at 9:25 AM Alexander Kapshuk 
>  wrote:
>>
>> I had Plan 9 running on Xen 7.5. After upgrading to Xen 8.0 Plan 9
>> won't boot any more.
>> I get a 'No bootable device' message displayed.
>>
>> The system was previously setup by someone else.
>> If I can, I would like to try and make it run on Xen 8.0.
>>
>> Any tips would be much appreciated.
>>
>
>
> --
> Best regards,
>   Alexander



[9fans] Stdout and stderr of remote cmd not returned in acme window

2019-12-12 Thread Alexander Kapshuk
When running a command remotely via ssh2 in acme/win, I get both
stdout and stderr:
% ssh2 host date
Thu Dec 12 10:21:27 EET 2019
% ssh2 host nodate
ksh: nodate:  not found.

However, when running those same commands in an acme window,
stdout/stderr are not returned:


Running a command locally in an acme window works fine though.
What could be causing this?

Any pointers would be much appreciated.
Alexander Kapshuk.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T8c9b5df754a4a88a-M1d6884165fcda39814941962
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] Stdout and stderr of remote cmd not returned in acme window

2019-12-13 Thread Alexander Kapshuk
Sure.
By remotely, I meant executing a command via ssh2 and returning stdout
of the command executed on a remote host in an acme window by typing
' wrote:
>
> I'm bit confused, but, what mean:
> - remotely
> - acme/win
> - acme window
>
> Could you, please, give more details. :)
>
> чт, 12 дек. 2019 г. в 11:27, Alexander Kapshuk :
>>
>> When running a command remotely via ssh2 in acme/win, I get both
>> stdout and stderr:
>> % ssh2 host date
>> Thu Dec 12 10:21:27 EET 2019
>> % ssh2 host nodate
>> ksh: nodate:  not found.
>> 
>> However, when running those same commands in an acme window,
>> stdout/stderr are not returned:
>> > 
>> 
>> Running a command locally in an acme window works fine though.
>> What could be causing this?
>> 
>> Any pointers would be much appreciated.
>> Alexander Kapshuk.
>
>
>
> --
> С наилучшими пожеланиями
> Жилкин Сергей
> With best regards
> Zhilkin Sergey
> 9fans / 9fans / see discussions + participants + delivery options Permalink

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T8c9b5df754a4a88a-M9062d51c1e76b94f8f1d59dc
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] `test -x` returns wrong results for directories

2020-06-06 Thread Alexander Kapshuk
On Sat, Jun 6, 2020 at 9:38 AM Ethan Gardener  wrote:
>
> On Fri, Jun 5, 2020, at 8:22 PM, Richard Miller wrote:
> > Looks to me like access(2) is not doing the right thing for directory
> > execute (=search) permission.
>
> thanks for the tip. access is a very simple function. it doesn't do the right 
> thing, but there's a reason:
>
>  BUGS
>   Since file permissions are checked by the server and group
>   information is not known to the client, access must open the
>   file to check permissions.  (It calls stat(2) to check sim-
>   ple existence.)
>
> it's open() which is failing. i suppose it should.
>
> if the open fails, maybe access should stat the file, and if it's a 
> directory, try dirread(2). or maybe just opening it for reading will work. i 
> don't know, i'm new to this bit of plan 9 & i haven't slept.
>

In sysopen, there is a call to namec:
/sys/src/9/port/sysfile.c:272
c = namec((char*)arg[0], Aopen, arg[1], 0);

Namec would return an error when called to open a directory with
execute permissions:
/sys/src/9/port/chan.c:1453,1454
if(amode == Aopen && (omode&3) == OEXEC && (c->qid.type&QTDIR))
error("cannot exec directory");

But I'm not sure if this is where the problem actually is, as I haven't seen
the 'cannot exec directory' message when running 'test -x dir' in
acid:

cpu% test -x ch7
cpu% echo $status
test 528: false

cpu% acid -l truss /bin/test
/bin/test:386 plan 9 executable
/sys/lib/acid/port
/sys/lib/acid/386
/sys/lib/acid/truss
acid: progargs = "-x ch7"
acid: new()
acid: truss()
open("ch7", 3)
return value: -1
open("#c/pid", 0)
return value: 3
pread(3, 0xdfffef08, 20, 4294967295)
return value: 12
data: "533 "
close(3)
return value: 0
533: breakpoint _exits+0x5 INTB $0x40

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tdd7a9b1b32d01f54-Mb30227ca46f50cf45e98546c
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] problem with installing plan9 from USB disk image

2021-03-25 Thread Alexander Kapshuk
Have you tried downloading the archive that contains the CD iso image,
https://9p.io/plan9/download/plan9.iso.bz2, and burning that onto a CD
or USB drive?
If your hardware is supported,
https://9p.io/wiki/plan9/Supported_PC_hardware/index.html, you would
be able to boot the system off the CD/USB drive.
Alternatively, you could use the iso image to set up a Plan 9 system
in a virtual environment as described here,
https://9p.io/wiki/plan9/virtual_machines/index.html.


On Fri, Mar 26, 2021 at 7:47 AM  wrote:
>
> I'm a Windows 10 user. I'm facing huge trouble to burn it. Can you please do 
> this for me:
>
> download the CD Image from here: https://9p.io/plan9/download/plan9.iso.bz2
> extract it and then burn it on a USB using your plan9 system.
> then copy everything  from the USB in a folder then compress the folder in a 
> format you prefer
> then upload it on GDrive or somewhere I can download it from.
>
>
> Would you please do that for me?
> 9fans / 9fans / see discussions + participants + delivery options Permalink

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T4a54d17e4c0f6c20-M149ee14f6aaa3051977460fe
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] Help with a sam cleanup script

2021-07-21 Thread Alexander Kapshuk
On Wed, Jul 21, 2021 at 12:18 PM  wrote:
>
> In ed I have a cleanup script which I can apply to several files at once. The 
> script removes things like blank lines and spaces between words. To run it on 
> a file or multiple files, I type this command:
> ed [name of file(s)] < cleanup-script
> I converted all the regular expressions in the file into sam regex format and 
> tried the same, but to no avail.  Here is a list of some of the commands:
>
> .x s/\*//g
> ,x/^ +/s///
> ,x/ +$/s///
> ,x/  +/s// /
> ,x/^$\n/d
> ,x/‘‘|’’/s//"/
> ,x/“|”/s//"/
> ,x/‘|’/s//"/
> ,x/^ +/s///
> ,x/ +$/s///
> ,x/  +/s// /
> ,x/^$\n/d
> ,x/‘‘|’’/s//"/
> ,x/“|”/s//"/
> ,x/‘|’/s//"/
> ,x/teh/c/the/
> wq
>
> I am not even sure sam can do this, but if it can, I would appreciate some 
> guidance on how to do it.
>
>
> 9fans / 9fans / see discussions + participants + delivery options Permalink

As far as having sam commands apply to multiple files, the X command is there:
sam(1):
X/regexp/ command
   For each file whose menu entry matches the regular
expression, make that the current file and run the command.
   If the expression is omitted, the command is run in every file.

Given these target files:
grep . file[12]
file1:line1
file2:line2

And a file that contains some sam commands:
cat cmd
X ,p
q

The following output is printed:
sam -d file[12] https://9fans.topicbox.com/groups/9fans/T10b1d559ae7d981e-Mbddcbb3fb3e41229d32d0ca7
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] mk results in rc: suicide:

2024-07-04 Thread Alexander Kapshuk
On Thu, Jul 4, 2024 at 4:44 PM Marco Feichtinger  wrote:
> 
> Trying to compile a kernel on a local fossil machine,
> I get following errors during the build
> rc: 1844: suicide: sys: trap: fault read addr=0x965708 pc=0xb5d9
> mk: 8c -I../boot -FTVw ../boot/printstub.c : exit status=rc 1844: 
> suicide: sys: trap: fault read addr=0x965708 pc=0xb5d9
> 
> At the same time /dev/kprint outputs
> 1844 rc: checked 20 page table entries
> 
> Every time i retried to compile, that error comes up, but on different steps 
> during the build.
> It even happens during 'mk clean'.
> 
> One time i even got
> rc 1148: suicide: sys: trap: general protection violation 
> pc=0x744c
> mk: 8c -I../boot -FTVw ../port/print.c: exit status=rc 1148: suicide: 
> sys: trap: general protection violation pc=0x744c
> 
> What do these error mean?
> 
> -marco
> 

Inspecting the process in the debugger might be insightful.
The Debugging section of https://9p.io/sys/doc/comp.pdf demonstrates
how to do it, and the error message exemplified is very similar to
what you got.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T68f44cf88ca61ff3-Mfb345e61d3b891c4ee4ba725
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: [9fans] mk results in rc: suicide:

2024-07-13 Thread Alexander Kapshuk
On Sat, Jul 13, 2024 at 10:13 AM Marco Feichtinger  wrote:
> 
> This is what acid prints out:
> rc 505: suicide: sys: trap: fault read addr=0x965708 pc=0xb5d9
> mk: 8c -FTVw -I. ../port/devcons.c  : exit status=rc 505: sys: trap: 
> fault read addr=0x965708 pc=0xb5d9
> term%
> term% acid 505
> /proc/505/text:386 plan 9 executable
> /sys/lib/acid/port
> /sys/lib/acid/386
> acid: lstk()
> :2: (error) no stack frame: './acid' file does not exist
> acid: asm(Readdir)
> Readdir 0xb5ac SUBL $0xc,SP
> Readdir+0x3 0xb5af  MOVLf+0x0(FP),BX
> Readdir+0x7 0xb5b3  CMPLBX,$0x0
> Readdir+0xa 0xb5b6  JLT Readdir+0x160(SB)
> Readdir+0x10 0xb5bc CMPLBX,$0x32
> Readdir+0x13 0xb5bf JGE Readdir+0x160(SB)
> Readdir+0x19 0xb5c5 LEAL0x0(BX)(BX*2),CX
> Readdir+0x1c 0xb5c8 SHLL$0x2,CX
> Readdir+0x1f 0xb5cb MOVLdir+0x4(SB)(CX*1),AX
> Readdir+0x26 0xb5d2 LEAL0x0(BX)(BX*2),CX
> Readdir+0x29 0xb5d5 SHLL$0x2,CX
> Readdir+0x2c 0xb5d8 CMPLdir+0x8(SB)(CX*1),AX
> Readdir+0x33 0xb5df JNE Readdir+0xd8(SB)
> Readdir+0x39 0xb5e5 LEAL0x0(BX)(BX*2),CX
> Readdir+0x3c 0xb5e8 SHLL$0x2,CX
> Readdir+0x3f 0xb5eb MOVLdir(SB)(CX*1),AX
> Readdir+0x46 0xb5f2 MOVLAX,0x0(SP)
> Readdir+0x49 0xb5f5 CALLfree(SB)
> Readdir+0x4e 0xb5fa MOVLf+0x0(FP),BX
> Readdir+0x52 0xb5fe LEAL0x0(BX)(BX*2),AX
> Readdir+0x55 0xb601 SHLL$0x2,AX
> Readdir+0x58 0xb604 MOVL$0x0,dir(SB)(AX*1)
> Readdir+0x63 0xb60f MOVLBX,0x0(SP)
> Readdir+0x66 0xb612 LEAL0x0(BX)(BX*2),DX
> Readdir+0x69 0xb615 SHLL$0x2,DX
> Readdir+0x6c 0xb618 LEALdir(SB)(DX*1),CX
> Readdir+0x73 0xb61f MOVLCX,0x4(SP)
> Readdir+0x77 0xb623 CALLdirread(SB)
> Readdir+0x7c 0xb628 MOVLf+0x0(FP),BX
> Readdir+0x80 0xb62c MOVLAX,BP
> acid: casm()
> Readdir+0x82 0xb62e CMPLAX,$0x0
> Readdir+0x85 0xb631 JLE Readdir+0x14a(SB)
> Readdir+0x8b 0xb637 CMPLonlydirs+0x8(FP),$0x0
> Readdir+0x90 0xb63c JEQ Readdir+0xba(SB)
> Readdir+0x92 0xb63e LEAL0x0(BX)(BX*2),DX
> Readdir+0x95 0xb641 SHLL$0x2,DX
> Readdir+0x98 0xb644 MOVLdir(SB)(DX*1),CX
> Readdir+0x9f 0xb64b MOVLCX,0x0(SP)
> Readdir+0xa2 0xb64e MOVLBP,0x4(SP)
> Readdir+0xa6 0xb652 CALLtrimdirs(SB)
> Readdir+0xab 0xb657 MOVLf+0x0(FP),BX
> Readdir+0xaf 0xb65b MOVLAX,BP
> Readdir+0xb1 0xb65d CMPLAX,$0x0
> Readdir+0xb4 0xb660 JEQ Readdir+0x19(SB)
> Readdir+0xba 0xb666 LEAL0x0(BX)(BX*2),CX
> Readdir+0xbd 0xb669 SHLL$0x2,CX
> Readdir+0xc0 0xb66c MOVLBP,dir+0x8(SB)(CX*1)
> Readdir+0xc7 0xb673 LEAL0x0(BX)(BX*2),AX
> Readdir+0xca 0xb676 SHLL$0x2,AX
> Readdir+0xcd 0xb679 MOVL$0x0,dir+0x4(SB)(AX*1)
> Readdir+0xd8 0xb684 LEAL0x0(BX)(BX*2),CX
> Readdir+0xdb 0xb687 SHLL$0x2,CX
> Readdir+0xde 0xb68a MOVLdir+0x4(SB)(CX*1),AX
> Readdir+0xe5 0xb691 LEAL0x0(BX)(BX*2),CX
> Readdir+0xe8 0xb694 SHLL$0x2,CX
> Readdir+0xeb 0xb697 CMPLdir+0x8(SB)(CX*1),AX
> Readdir+0xf2 0xb69e JNE Readdir+0xfa(SB)
> Readdir+0xf4 0xb6a0 XORLAX,AX
> Readdir+0xf6 0xb6a2 ADDL$0xc,SP
> Readdir+0xf9 0xb6a5 RET
> acid:
> 
> I am lost here.
> I read the acid manual, but I still don't know what this output is about.
> 
> -marco
> 

The error message lstk() emits is about an acid file which is supposed
to contain symbolic debugging information so values of local variable
may be displayed being missing:
> acid: lstk()
> :2: (error) no stack frame: './acid' file does not exist

If I'm reading the following section of https://9p.io/sys/doc/comp.pdf right:
To make things simple, the default rules in the system mkfiles include
entries to make foo.acid from foo.c, so one may use mk to automate the
production of acid definitions for a given C source file.

You could descend into the directory that houses the source file that
fails to compile, e.g.:
../port/devcons.c

And see if there's a devcons.acid file there. It's supposed to be
generated by the following mkfile rule:
https://github.com/plan9foundation/plan9/blob/9db62717612a49f78a83b26ff5a176971c6cdd18/sys/src/9/port/portmkfile#L21C1-L22C48
%.acid: ../port/%.c
$CC $CFLAGS -a -I. ../port/$stem.c >$stem.acid

If there is, you could laun

Re: [9fans] 9vx instability

2011-11-21 Thread Alexander Kapshuk
have you considered running plan 9 from within virtualbox?

plan 9 seems to be fairly responsive running within the latest version of
virtualbox on debian squeeze here.


On Mon, Nov 21, 2011 at 10:31 AM, Anton  wrote:

> Hello all,
>
> Recently I've discovered Plan 9 and I'm fascinated by it's numerous
> beauties, and I want to try it for more or less regular use, probably port
> something.
>
> However, as it won't work on my laptop natively, i'm forced to use 9vx
> (running in kvm is too slow). It has one magor drawback - it is freezing my
> entire system after some random time.
> Symptoms are - no reaction on input (mouse/keyboard), no changes in output
> (screen is showing me what was going on just before freeze). The only thing
> I can do is to press power button for 10 secs and wait until my laptop
> turned off.
> I've tried to find the reasons of this behaviour, but all system logs are
> silent - last kernel.log messages are prior to hang, the same with
> messages.log and Xorg.log, console output from 9vx are empty, too. What
> causes the hang is also seems unclear - it can froze on 9vx startup, or
> when I use terminal, or installing something, or just browsing web (not in
> 9vx) in chrome, while 9vx window is hidden.
> My system:
> Linux hippo 3.0-ARCH #1 SMP PREEMPT Wed Oct 19 12:14:48 UTC 2011 i686
> Intel(R) Core(TM) Duo CPU T2600 @ 2.16GHz GenuineIntel GNU/Linux (Archlinux)
> 9vx-hg (checked out 2011.11.17) - cmd line (9vx -r 9front -u glenda)
> 9front iso image - 9front-1131.664b953bfdde (I've copied it's contents and
> `chmod -R u+w`ed it)
> xf86-video-intel 2.16.0 - VGA compatible controller: Intel Corporation
> Mobile 945GME Express Integrated Graphics Controller (rev 03)
> xorg-server 1.11.2
> xorg-apps 7.6
>
> Also, I've seen the following message for a few times: "9vx panic: sigsegv
> on cpu7", but I don't know if it related to freeze (it can show up in the
> middle of my boot-work-freeze session).
>
> Previously, I've used stock Plan 9 from Bell Labs with 9vx - it has the
> same problem.
>
> P.S.: Sorry for my English.
>
> Anton.
>


Re: [9fans] Supported_PC_hardware list

2011-11-22 Thread Alexander Kapshuk
i was wondering if the Supported_PC_hardware list found here:
http://plan9.bell-labs.com/wiki/plan9/Supported_PC_hardware/index.html, was
fairly up-to-date?
i am particularly interested in the VGA section
thanks.


Re: [9fans] Supported_PC_hardware list

2011-11-22 Thread Alexander Kapshuk

On 11/22/2011 03:56 PM, erik quanstrom wrote:

On Tue Nov 22 08:30:20 EST 2011, alexander.kaps...@gmail.com wrote:

   

i was wondering if the Supported_PC_hardware list found here:
http://plan9.bell-labs.com/wiki/plan9/Supported_PC_hardware/index.html, was
fairly up-to-date?
i am particularly interested in the VGA section
thanks.
 

the vga section is modest.  i rarely see vga failures.  i'm
also using cinap's real mode emulation to make vesa
more robust.

- erik

   

thanks to everyone for your input.




Re: [9fans] assembly syntax in plan 9

2012-01-16 Thread Alexander Kapshuk
i have a question about putting things on the stack for x86 arch under plan
9...

under unix/linux, when defining a function, i would:
(1). push the address the base pointer is pointing to prior to this
function being called, onto the stack; e.g. pushl %ebp
(2). then i would have the base pointer point to the current stack pointer;
e.g. movl %esp, %ebp
(3). then i would allocate space on the stack for local variables, if any;
e.g. subl $n, %esp;
(4). then follows the function body;
to return from the function i would:
(1). restore the stack pointer; e.g. movl %ebp, %esp;
(2). restore the base pointer, e.g. popl %ebp;
(3). then return to the calling function;

i searched the 9fans archives for posts on assembly programming under plan
9; found some bits and pieces; e.g. in one of the posts it was mentioned
that BP is a general purpose register, not the base pointer; and that FP is
what ebp is under unix/linux;

in the paper for the plan 9 assembler, it says that there are three
registers available to manipulate the stack, FP, SP, and TOS; would the
following comparison stand true then?
plan9unix/linux
--- -
FPEBP
SP-4(%EBP)...-n(%EBP) /* local variables */
TOS ESP

thanks;

sasha kapshuk


Re: [9fans] assembly syntax in plan 9

2012-01-16 Thread Alexander Kapshuk
On Mon, Jan 16, 2012 at 3:08 PM, Charles Forsyth
wrote:

>
> You should read /sys/doc/asm.pdf first.
> careful: TOS is only for 68k. nothing else defines or uses it.
>
> Plan 9 doesn't use a base pointer, because everything can be addressed
> relative to the stack pointer,
> and the loader keeps track of the SP level. thus FP is a virtual register,
> that the loader implements
> by replacing offsets relative to it by the current appropriate offset from
> the hardware stack pointer register (whatever
> that might be on a given platform). That's esp on the x86. the TEXT
> directive specifies the space a function
> requires for its stack frame, and the loader then adds appropriate code at
> start and end to provide it.
> 0(FP) is the first argument, 4(FP) is the second, and so on. 0(SP) is the
> bottom of the current frame,
> and 0(SP), 4(SP) etc are referenced to build the arguments for outgoing
> calls (but that space must
> be accounted for in the TEXT directive).
>
> (it's probably not very different in effect from -fno-frame-pointer or
> whatever it is for gcc,
> which also doesn't use ebp except that is implemented entirely by the
> compiler.)
>
> On 16 January 2012 12:30, Alexander Kapshuk 
> wrote:
>
>> i have a question about putting things on the stack for x86 arch under
>> plan 9...
>>
>> under unix/linux, when defining a function, i would:
>> (1). push the address the base pointer is pointing to prior to this
>> function being called, onto the stack; e.g. pushl %ebp
>> (2). then i would have the base pointer point to the current stack
>> pointer; e.g. movl %esp, %ebp
>> (3). then i would allocate space on the stack for local variables, if
>> any; e.g. subl $n, %esp;
>> (4). then follows the function body;
>> to return from the function i would:
>> (1). restore the stack pointer; e.g. movl %ebp, %esp;
>> (2). restore the base pointer, e.g. popl %ebp;
>> (3). then return to the calling function;
>>
>> i searched the 9fans archives for posts on assembly programming under
>> plan 9; found some bits and pieces; e.g. in one of the posts it was
>> mentioned that BP is a general purpose register, not the base pointer; and
>> that FP is what ebp is under unix/linux;
>>
>> in the paper for the plan 9 assembler, it says that there are three
>> registers available to manipulate the stack, FP, SP, and TOS; would the
>> following comparison stand true then?
>> plan9unix/linux
>> --- -
>> FPEBP
>> SP-4(%EBP)...-n(%EBP) /* local variables */
>> TOS ESP
>>
>> thanks;
>>
>> sasha kapshuk
>>
>>
>
thanks;

i'll look into that;


Re: [9fans] using memory stick

2012-02-05 Thread Alexander Kapshuk

On 02/05/2012 08:08 PM, bs...@urdirect.net wrote:

I am trying to figure out whether a memory stick can be used
in a usb port on an IBM T23 laptop to transfer files to and
from the memory stick, and if so, how to mount the stick
and copy files to and from it.

The Plan 9 installation I have is from November 2009.
/dev/usb shows a ctl file and three directories,
ep1.0, ep2.0, and ep3.0.
The T23 has only two usb interfaces on the back.

Robert


   


you may want to run
usbfat:
the output will be the path to your memory stick, e.g. /n/dev_name




Re: [9fans] I will buy laptop pre-installed with plan9!!!

2012-05-09 Thread Alexander Kapshuk

On 05/09/2012 05:44 PM, Vincent Zhao wrote:

I will buy laptop pre-installed with plan9, can my dream come true?

   

Toshiba Portege M300. Everything but wifi works as expected.




Re: [9fans] Logitech T400 mouse with Plan9 and Plan9port Acme

2013-02-25 Thread Alexander Kapshuk
I stumbled upon this one a while back. Never used one though. Been
using a two-button mouse with a scroll wheel. Does the job.
 http://h30094.www3.hp.com/product/sku/2545791


On Mon, Feb 25, 2013 at 3:38 PM, Ruslan Khusnullin
 wrote:
> Considering how difficult it is to find a new usb mouse with 3 real
> buttons I'm looking for workarounds. I have a Contour Mouse Perfit and
> I enjoy it a lot but buying a new Contour Mouse is expensive and very
> difficult in terms of shipping when you live in Russia, Contour just
> don't ship it.
>
> I see there are few new "touch scroll" mice in stores and one of them
> Logitech T400 looks not bad to me. Unfortunately they don't have wired
> version but the "touch scroll" feels like a "styled 3rd button".
>
> Did anyone had a chance to test Logitech T400 mouse? Does it's middle
> "touch scroll" work as a normal B2? Does it react on soft accidental
> touch? Is it configurable?
>
> Thanks in advance.
>



Re: [9fans] 9Front network (driver?) issue

2013-12-23 Thread Alexander Kapshuk

On 12/23/2013 04:59 PM, Blake McBride wrote:
> BTW, how do I abort a command such as the cat /dev/kpeint?  I tried
> ^c, ^d. ^\.  Nothing worked.  I ended up having to delete the entire
> window.
Try the Delete key.




Re: [9fans] 9Front network (driver?) issue

2013-12-23 Thread Alexander Kapshuk

On 12/23/2013 05:11 PM, Blake McBride wrote:
> Amazing how something so simple could stump someone.  Thanks!
>
>
> On Mon, Dec 23, 2013 at 9:04 AM, Alexander Kapshuk
> mailto:alexander.kaps...@gmail.com>> wrote:
>
>
> On 12/23/2013 04:59 PM, Blake McBride wrote:
> > BTW, how do I abort a command such as the cat /dev/kpeint?  I tried
> > ^c, ^d. ^\.  Nothing worked.  I ended up having to delete the entire
> > window.
> Try the Delete key.
>
>
>
No worries.