Re: [9fans] acid -k

2015-03-31 Thread cinap_lenrek
theres kinit() in -lkernel which prints the rc() acid command that
generate the .acid files it needs. (besides initializing some variables)

--
cinap



[9fans] mips linker hoisting stack freeing operation

2015-03-31 Thread cinap_lenrek
Point
Pt(int x, int y)
{
int buf[1000];  /* 
added for demonstration */
Point p;

buf[0] = x;
p.x = x;
p.y = y;
return p;
}

vc -S compiler output looks ok, but i dont quite understand why it
doesnt directly move x and y to the caller passed storage in R1:

TEXTPt+0(SB),0,$4012
MOVWy+8(FP),R8
MOVWx+4(FP),R7
MOVWR1,.ret+0(FP)
MOVWR7,buf-4000(SP)
MOVWR7,p-4008(SP)
MOVWR8,p-4004(SP)
MOVW.ret+0(FP),R4
MOVW$p-4008(SP),R6
MOVW0(R6),R2
MOVW4(R6),R3
MOVWR2,0(R4)
MOVWR3,4(R4)
RET ,

and after linking it becomes:

Pt 0x4020   ADD $-0xfb0,R29 /* allocate 
stack frame */
Pt+0x4 0x4024   MOVWR1,.ret+4(FP)
Pt+0x8 0x4028   ADDU$0x8,R29,R6 /* local p */
Pt+0xc 0x402c   MOVW.ret+4(FP),R4
Pt+0x10 0x4030  MOVWx+8(FP),R7
Pt+0x14 0x4034  MOVWy+12(FP),R8
Pt+0x18 0x4038  MOVWR7,buf+16(SP)
Pt+0x1c 0x403c  MOVWR7,p+8(SP)
Pt+0x20 0x4040  MOVWR8,0xc(R29)
Pt+0x24 0x4044  ADD $0xfb0,R29  /* free stack 
frame (now R6  SP) */
Pt+0x28 0x4048  MOVW0x0(R6),R2  /* p.x = x; NEIN! */
Pt+0x2c 0x404c  MOVW0x4(R6),R3  /* p.y = y; NEIN! */
Pt+0x30 0x4050  MOVWR2,0x0(R4)  /* ret-x = p.x */
Pt+0x34 0x4054  JMP (R31)
Pt+0x38 0x4058  MOVWR3,0x4(R4)  /* ret-y = p.y */

the problem appears to be the linker hoisting the ADD $const,SP up.
this works until we hit a interrupt or a note, then the local variables
get corrupted. and this is not the interrupt handlers fault,
as this depends on the size of the local variables of the
function, not some fixed redzone area. (thats what int buf[1000]
is trying to demonstrate).

theres my attempt at preventing the linker from doing so:

diff -r 192be1470c05 -r 359ae373800c sys/src/cmd/vl/sched.c
--- a/sys/src/cmd/vl/sched.cMon Mar 30 20:53:49 2015 -0400
+++ b/sys/src/cmd/vl/sched.cWed Apr 01 01:30:16 2015 +0200
@@ -85,7 +85,7 @@
for(t=s+1; t=se; t++) {
if(!(t-p.mark  LOAD))
continue;
-   if(t-p.mark  BRANCH)
+   if(t-p.mark  BRANCH || t-set.ireg  (1REGSP))
break;
if(conflict(s, t))
break;
@@ -102,7 +102,7 @@
 
/* put schedule fodder above load */
for(t=s+1; t=se; t++) {
-   if(t-p.mark  BRANCH)
+   if(t-p.mark  BRANCH || t-set.ireg  (1REGSP))
break;
if(s  sch  conflict(s-1, t))
continue;

which seems to work in this case:

Pt 0x4020   ADD $-0xfb0,R29 /* allocate 
stackframe */
Pt+0x4 0x4024   MOVWR1,.ret+4(FP)
Pt+0x8 0x4028   ADDU$0x8,R29,R6
Pt+0xc 0x402c   MOVW.ret+4(FP),R4
Pt+0x10 0x4030  MOVWx+8(FP),R7
Pt+0x14 0x4034  MOVWy+12(FP),R8
Pt+0x18 0x4038  MOVWR7,buf+16(SP)
Pt+0x1c 0x403c  MOVWR7,p+8(SP)
Pt+0x20 0x4040  MOVWR8,0xc(R29)
Pt+0x24 0x4044  MOVW0x0(R6),R2  /* p.x = x; JA! */
Pt+0x28 0x4048  MOVW0x4(R6),R3  /* p.y = y; JA! */
Pt+0x2c 0x404c  MOVWR2,0x0(R4)  /* ret-x = p.x */
Pt+0x30 0x4050  MOVWR3,0x4(R4)  /* ret-y = p.y */
Pt+0x34 0x4054  JMP (R31)
Pt+0x38 0x4058  ADD $0xfb0,R29  /* free stack 
frame last */

any comments (charles)?

--
cinap



Re: [9fans] p9p mouse problem

2015-03-31 Thread Steve Simon
There was a hook to allow you to use 2 button mice with plan9 which used
(as I remember) the shift key to make button 3 bring up the menu normally
used for button 2.

I cannot make this work any more but I have a usb mouse and keyboard,
perhaps it was a feature of the PS2 mouse/keyboard drievr?

Anyway, perhaps your keyboard is the problem, not sending a key-up event
when you release the shift key somtimes?

Just a guess.

-Steve



Re: [9fans] p9p mouse problem

2015-03-31 Thread Rudolf Sykora
Hi everybody,

On 18 February 2015 at 11:14, Rudolf Sykora rudolf.syk...@gmail.com wrote:
 I now encounter a problem with my mouse in plan9port.
 Every now and then it happens that my left button starts
 to behave as the right button. What helps is pressing a
 ctrl key on the keyboard: immediately after that things
 are ok again for a while.

I now see this happen on several machines... (always
on Slackware)
Hasn't anybody else seen this? Or does anybody
have a clue about what could cause it?
(It only happens in p9p programs [sam, acme], never
in linux ones.)


Thanks
Ruda



[9fans] puzzling 9P server / 9pcon interaction

2015-03-31 Thread Skip Tavakkolian
i'm trying to test a new 9P fs with 9pcon. after posting the file server's
fd to /srv, it can be mounted (e.g. mount /srv/foo /n/foo) and walked
correctly.  trying 9pcon on the same fd (e.g. aux/9pcon /srv/foo) results
in inappropriate use of fd.

any ideas?  fyi, the 9p code is from scartch based on re-re-reading of
0intro(5) docs, so it is entirely possible i missed something subtle that
9pcon doesn't tolerate.


Re: [9fans] acid -k

2015-03-31 Thread Tharaneedharan Vilwanathan
Hi Steve,

I remember using acid for debugging inferno kernel rather than plan 9.

Regards
dharani


On Tue, Mar 31, 2015 at 3:27 PM, Steve Simon st...@quintile.net wrote:

 hi,

 Trying to debug a driver using acid.

 none of the mkfiles in /sys/src/9 contain rules
 to make .acid files, why?

 Does noone use acid -k -l kernel ?

 is there a way to generate these files I have missed?

 -Steve (confused of Winchester).





[9fans] acid -k

2015-03-31 Thread Steve Simon
hi,

Trying to debug a driver using acid.

none of the mkfiles in /sys/src/9 contain rules
to make .acid files, why?

Does noone use acid -k -l kernel ?

is there a way to generate these files I have missed?

-Steve (confused of Winchester).