Re: [9fans] network support on virtualbox

2013-10-24 Thread Paul Patience
Selon Sakis Kasampalis s.kasampa...@zoho.com:

 Is there any chance of getting network (IP) support on virtualbox? My
 adapter according to lspci is: Ralink corp. RT3090 Wireless 802.11n
 1T/1R PCIe

9front has a driver for that:

https://plan9front.googlecode.com/hg/sys/src/9/pc/etherrt2860.c

--
pap




Re: [9fans] [GSOC 2013] Implement plan9 commands in Go, Goblin

2013-04-30 Thread Paul Patience
I don't know if you've seen this,
but there is also a plan9portport
to windows [1]. Not everything
works, but sam and rc do.

[1] https://bitbucket.org/knieriem/pf9



[9fans] 5l bug

2013-04-28 Thread Paul Patience
Mischief reported a crash with on arm with
winwatch when closing all windows excluding those
ignored through the -e flag. Cinap_lenrek
narrowed the problem down to a bug in the 5l
linker: it generates incorrect code when using
the conditional operator and dividing.
A minimal test case is the following:

term% cat foo.c
#include u.h
#include libc.h

void
main(void)
{
int i, j, k;

i = 1;
j = 0;
k = j = 0 ? 1 : 2/i;
print(%d\n, k);
exits(nil);
}

The output of asm(main) in acid is:

acid: asm(main)
main 0x1020 MOVW.W  R14,#-0x18(R13)
main+0x4 0x1024 MOVW$#0x1,R1
main+0x8 0x1028 MOVW$#0x0,R2
main+0xc 0x102c CMP.S   $#0x0,R2
main+0x10 0x1030MOVW.LE R1,R3
main+0x14 0x1034MOVW.GT $#0x2,R3
main+0x18 0x1038SUB.GT  $#0x8,R13,R13
main+0x1c 0x103cMOVWR1,#0x4(R13)
main+0x20 0x1040MOVWR3,R11
main+0x24 0x1044BL  _div
main+0x28 0x1048MOVWR11,R3
main+0x2c 0x104cADD $#0x8,R13,R13
main+0x30 0x1050MOVW$#0x7080,R0
main+0x34 0x1054MOVWR3,#0x8(R13)
main+0x38 0x1058BL  print
main+0x3c 0x105cMOVW$#0x0,R0
main+0x40 0x1060BL  exits
main+0x44 0x1064RET.P   #0x18(R13)

The problem is that the division at main+0x24
happens regardless of the comparison. The output
from the compiler is correct, however:

term% 5c -S foo.c
TEXTmain+0(SB),0,$20
MOVW$1,R1
MOVW$0,R2
CMP $0,R2,
MOVW.LE R1,R3
MOVW.GT $2,R3
DIV.GT  R1,R3,R3
MOVW$.string+0(SB),R0
MOVWR3,8(R13)
BL  ,print+0(SB)
MOVW$0,R0
BL  ,exits+0(SB)
RET ,
DATA.string+0(SB)/8,$%d\n\z\z\z\z\z
GLOBL   .string+0(SB),$8
END ,

A (temporary) workaround for this is using an
if-else statement, for which the linker generates
correct code.

--
pap




[9fans] Bug in print(2) g verb

2013-02-27 Thread Paul Patience
I already sent this mail, but it seems that 9fans didn't
receive it.

The g verb in print(2) does not work properly. The precision
flag (%.ng) is supposed to print n significant figures, but
it prints n+1 significant figures. This change fixes this
behaviour.

diff -r d6b623d4cac0 sys/src/libc/fmt/fltfmt.c
--- a/sys/src/libc/fmt/fltfmt.c Sat Feb 23 14:05:51 2013 +0100
+++ b/sys/src/libc/fmt/fltfmt.c Wed Feb 27 15:59:34 2013 -0500
@@ -187,6 +187,8 @@
 * c3 digits of trailing '0'
 * c4 digits after '.'
 */
+   if(chr == 'g') /* Significant figures. */
+   prec--;
c1 = 0;
c2 = prec + 1;
c3 = 0;