Re: [9fans] 9vx os x

2008-06-30 Thread Bakul Shah
On Sun, 29 Jun 2008 21:56:10 EDT "Russ Cox" <[EMAIL PROTECTED]>  wrote:
> > The native version is different from the x11 in the following ways:
> > - Top right acme `term' window doesn't open
> > - The top row in acme doesn't show win before newcol 
> 
> Haven't tried to reproduce these.  Are you sure your
> acme config isn't different?

I just unpacked 0.11 and ran both kernels on it.



Re: [9fans] 9vx os x

2008-06-30 Thread David Leimbach
My caps lock problem is gone with this!  Thanks Russ (nevermind my other
message regarding it still starting in X11... I'm extra-scatterbrained
today)
Dave

On Sun, Jun 29, 2008 at 10:00 AM, Russ Cox <[EMAIL PROTECTED]> wrote:

> I have not bothered to create a new package,
> but there is a new binary available for OS X:
>
>hget -o 9vx.OSX.gz http://pdos.csail.mit.edu/~rsc/9vx.OSX.gz
>gunzip 9vx.OSX.gz
>chmod +x 9vx.OSX
>./9vx.OSX -r your-root
>
> Please try it on 10.5 and see how it works.
>
> Sources are not packaged up until things
> are stable for a little while, but they are in
> the Mercurial repository at
>
>hg clone http://hg.pdos.csail.mit.edu/hg/vx32
>
> Russ
>
>
>


Re: [9fans] 9vx os x

2008-06-30 Thread jas
On Jun 29, 8:56 pm, "Russ Cox" <[EMAIL PROTECTED]> wrote:

> > When we do get to see a glenda icon for 9vx?:-)
>
> I made an icon and a 9vx.app directory, but I have not
> gotten it completely working.  I have been using the 9ball
> from second edition, because it is easier to recognize at
> tiny scales.  
>
> If you know how to attach an icon without using the .app
> directory, please let me know.

You should be able to use the Carbon API to
SetApplicationDockTileImage(img).  Most likely keeping the icon in
some path based off of the root, construct a CGImageRef from the data
and call the mentioned function.

-jas



Re: [9fans] 9vx os x

2008-06-29 Thread underspecified
The scroll wheel just works under the native OS-X Acme SAC. I will try
to figure out why.

--underspecified

On Mon, Jun 30, 2008 at 10:57 AM, Russ Cox <[EMAIL PROTECTED]> wrote:
>> I know you did not ask, but: on 10.4 it seems to work ok.
>>
>> two minor UI nits:
>>
>>  - the native version doesn't seem to support the scroll point(wheel?);
>>the X11 version does (but somehow responds a bit slowish to it).
>
> It tries.  Feel free to have a look at the code.
>
>>  - when I resize a window with B3 on border in the native version
>>the red border responds much slower to movements with the mouse
>>than in the X11 version (on 10.4)
>>did not try it much, but overall it feels rather responsive, though
>
> Should be more or less the same.  Again not
> sure what's going on.
>
> Russ
>
>
>



Re: [9fans] 9vx os x

2008-06-29 Thread underspecified
Greetings,

It is running smoothly for me under 10.5.3 too.

On Mon, Jun 30, 2008 at 10:56 AM, Russ Cox <[EMAIL PROTECTED]> wrote:
>> Another bug in both x11 and native mode 9vx: occasionally,
>> resizing the window can make it crash with a
>> 9vx panic: sigsegv on cpu6
>> But of course when I try to cause it, it doesn't happen!
>> Also, quickly dragging the corner on the x11 version can
>> render the window completely black.
>
> Presumably there is a race that needs fixing.
> I'll add it to the BUGS list and leave it for someone
> else for now.
>
>> The native version is different from the x11 in the following ways:
>> - Top right acme `term' window doesn't open
>> - The top row in acme doesn't show win before newcol
>
> Haven't tried to reproduce these.  Are you sure your
> acme config isn't different?
>
>> - The window geometry is different.
>
> This is true, but it seemed better.  If there were some
> way to make the window start maximized (not full screen,
> but just where it would be if you clicked the +), I'd do that.

If you are willing to calculate the screen geometry and manually
specify the max size, this should be possible.
I think it defaults to 3/4 of max in Acme SAC currently.

>> - it has to be explicitly put in background.
>
> If you know how to do that without OS X complaining
> (like it does if you use fork), please let me know.
>
>> A UI nit: the cursor shape doesn't change when moving it out
>> of the 9vx window.
>>
>> When we do get to see a glenda icon for 9vx?:-)
>
> I made an icon and a 9vx.app directory, but I have not
> gotten it completely working.  I have been using the 9ball
> from second edition, because it is easier to recognize at
> tiny scales.
>
> If you know how to attach an icon without using the .app
> directory, please let me know.

You can add icons to arbitrary files by right-clicking on the file,
choosing "Get Info,"
and pasting/drag-and-dropping the desired icon onto the tiny icon in
the upper-left
hand corner of the info window. The advantage to this approach is it's
extremely simple.
The disadvantage is only .app directories can be included in the dock
as applications :-\

>> A comment on networking: Since 9vx uses the host's IP stack,
>> two instances can't open the same port.  But at least on
>> FreeBSD one can use jail(1) so that each 9vx instance has a
>> full complement of ports.
>
> It's true.  It's a different model.
>
> Russ
>
>
>

--underspecified



Re: [9fans] 9vx os x

2008-06-29 Thread a
On my 10.5 system, resizing the window causes the screen to get...
wrong. The error makes it look like the lines aren't aligned; things
come out slanted at about right of 10° vertical. If rio's running,
windows sometimes have the left edge cropped to vertical and the
left edge isn't updated with the rest of the window. The keyboard
and rio menus still work, although the fact that the left edge isn't
getting updated makes that hard to see at times.

Resizing to the original size either fixes the problem or yields:
9vx panic: sigsegv on cpu1
(have also seen cpu4). 

This doesn't happen with the X11 version, but does with the first
native OS X GUI code in 0.11 forward. In case it makes a difference,
this system has multiple displays.
Anthony
--- Begin Message ---
I have not bothered to create a new package,
but there is a new binary available for OS X:

hget -o 9vx.OSX.gz http://pdos.csail.mit.edu/~rsc/9vx.OSX.gz
gunzip 9vx.OSX.gz
chmod +x 9vx.OSX
./9vx.OSX -r your-root

Please try it on 10.5 and see how it works.

Sources are not packaged up until things
are stable for a little while, but they are in
the Mercurial repository at

hg clone http://hg.pdos.csail.mit.edu/hg/vx32

Russ
--- End Message ---


Re: [9fans] 9vx os x

2008-06-29 Thread Russ Cox
> Does anyone else get errors about missing files when pulling? Many
> other files are copied successfully before this:
> 
> error: copying /n/boot/sys/src/games/mp3dec/COPYING:
> '/n/boot/sys/src/games' does not exist
> 
> error: copying /n/boot/sys/src/games/mp3dec/COPYRIGHT:
> '/n/boot/sys/src/games' does not exist
> 
> error: copying /n/boot/sys/src/games/mp3dec/D.dat:
> '/n/boot/sys/src/games' does not exist
> 
> error: copying /n/boot/sys/src/games/mp3dec/README:
> '/n/boot/sys/src/games' does not exist
> 
> ...
> 
> Also, which man page(s) would I read to know how to work with special
> files like #Z? I am unsure of what to do when I get errors like this:
> 
> term% src echo
> src: can't find source for /bin/echo - unrecognized type special file #Z/echo

There are just a few programs that assume the only "normal" files 
come from the mount device (#M).  I have patched my local
version of file(1) to allow #Z along with #M.  That seems to fix
most of them.

Russ




Re: [9fans] 9vx os x

2008-06-29 Thread Russ Cox
> I know you did not ask, but: on 10.4 it seems to work ok.
> 
> two minor UI nits:
> 
>  - the native version doesn't seem to support the scroll point(wheel?);
>the X11 version does (but somehow responds a bit slowish to it).

It tries.  Feel free to have a look at the code.

>  - when I resize a window with B3 on border in the native version
>the red border responds much slower to movements with the mouse
>than in the X11 version (on 10.4)
>did not try it much, but overall it feels rather responsive, though

Should be more or less the same.  Again not
sure what's going on.

Russ




Re: [9fans] 9vx os x

2008-06-29 Thread Russ Cox
> Another bug in both x11 and native mode 9vx: occasionally,
> resizing the window can make it crash with a 
> 9vx panic: sigsegv on cpu6
> But of course when I try to cause it, it doesn't happen!
> Also, quickly dragging the corner on the x11 version can
> render the window completely black.

Presumably there is a race that needs fixing.
I'll add it to the BUGS list and leave it for someone
else for now.

> The native version is different from the x11 in the following ways:
> - Top right acme `term' window doesn't open
> - The top row in acme doesn't show win before newcol 

Haven't tried to reproduce these.  Are you sure your
acme config isn't different?

> - The window geometry is different.

This is true, but it seemed better.  If there were some
way to make the window start maximized (not full screen,
but just where it would be if you clicked the +), I'd do that.

> - it has to be explicitly put in background.

If you know how to do that without OS X complaining
(like it does if you use fork), please let me know.

> A UI nit: the cursor shape doesn't change when moving it out
> of the 9vx window.
> 
> When we do get to see a glenda icon for 9vx?:-)

I made an icon and a 9vx.app directory, but I have not
gotten it completely working.  I have been using the 9ball
from second edition, because it is easier to recognize at 
tiny scales.  

If you know how to attach an icon without using the .app
directory, please let me know.

> A comment on networking: Since 9vx uses the host's IP stack,
> two instances can't open the same port.  But at least on
> FreeBSD one can use jail(1) so that each 9vx instance has a
> full complement of ports.

It's true.  It's a different model.

Russ




Re: [9fans] 9vx os x

2008-06-29 Thread Fazlul Shahriar
> Does anyone else get errors about missing files when pulling? Many
> other files are copied successfully before this:
> 
> error: copying /n/boot/sys/src/games/mp3dec/COPYING:
> '/n/boot/sys/src/games' does not exist
> 
> error: copying /n/boot/sys/src/games/mp3dec/COPYRIGHT:
> '/n/boot/sys/src/games' does not exist
> 
> error: copying /n/boot/sys/src/games/mp3dec/D.dat:
> '/n/boot/sys/src/games' does not exist
> 
> error: copying /n/boot/sys/src/games/mp3dec/README:
> '/n/boot/sys/src/games' does not exist
> 
> ...

Try:
mkdir -p /sys/src/games/mp3dec
and the pull again

> Also, which man page(s) would I read to know how to work with special
> files like #Z? I am unsure of what to do when I get errors like this:
> 
> term% src echo
> src: can't find source for /bin/echo - unrecognized type special file #Z/echo

#Z is the root of the host system. #Zplan9 is 9vx's root

It seems anything that assume Dir.type == 'M' is broken.  This
includes file(1) which is used by src(1), and also diff(1).  Probably
others.

fhs




Re: [9fans] 9vx os x

2008-06-29 Thread Tom Lieber
Does anyone else get errors about missing files when pulling? Many
other files are copied successfully before this:

error: copying /n/boot/sys/src/games/mp3dec/COPYING:
'/n/boot/sys/src/games' does not exist

error: copying /n/boot/sys/src/games/mp3dec/COPYRIGHT:
'/n/boot/sys/src/games' does not exist

error: copying /n/boot/sys/src/games/mp3dec/D.dat:
'/n/boot/sys/src/games' does not exist

error: copying /n/boot/sys/src/games/mp3dec/README:
'/n/boot/sys/src/games' does not exist

...

Also, which man page(s) would I read to know how to work with special
files like #Z? I am unsure of what to do when I get errors like this:

term% src echo
src: can't find source for /bin/echo - unrecognized type special file #Z/echo

-- 
Tom Lieber
http://AllTom.com/



Re: [9fans] 9vx os x

2008-06-29 Thread Francisco J Ballesteros
Time to throw away parallels and vmware :)

thanks a lot, once more.


On Sun, Jun 29, 2008 at 9:50 PM, Axel Belinfante
<[EMAIL PROTECTED]> wrote:
> this is great!
>
>> Please try it on 10.5 and see how it works.
>
> I know you did not ask, but: on 10.4 it seems to work ok.
>
> two minor UI nits:
>
>  - the native version doesn't seem to support the scroll point(wheel?);
>   the X11 version does (but somehow responds a bit slowish to it).
>
>  - when I resize a window with B3 on border in the native version
>   the red border responds much slower to movements with the mouse
>   than in the X11 version (on 10.4)
>   did not try it much, but overall it feels rather responsive, though
>
> sidenote: I find it fascinating to see how the plan 9 gui responds
> to resizing the window.
>
>
> Axel.
>
>
>



Re: [9fans] 9vx os x

2008-06-29 Thread Axel Belinfante
this is great!

> Please try it on 10.5 and see how it works.

I know you did not ask, but: on 10.4 it seems to work ok.

two minor UI nits:

 - the native version doesn't seem to support the scroll point(wheel?);
   the X11 version does (but somehow responds a bit slowish to it).

 - when I resize a window with B3 on border in the native version
   the red border responds much slower to movements with the mouse
   than in the X11 version (on 10.4)
   did not try it much, but overall it feels rather responsive, though

sidenote: I find it fascinating to see how the plan 9 gui responds
to resizing the window.


Axel.




Re: [9fans] 9vx os x

2008-06-29 Thread Pietro Gagliardi
This new release works. Thanks! Now to take my fossil/venti off QEMU  
and onto OS X.


On Jun 29, 2008, at 1:00 PM, Russ Cox wrote:


I have not bothered to create a new package,
but there is a new binary available for OS X:

hget -o 9vx.OSX.gz http://pdos.csail.mit.edu/~rsc/9vx.OSX.gz
gunzip 9vx.OSX.gz
chmod +x 9vx.OSX
./9vx.OSX -r your-root

Please try it on 10.5 and see how it works.

Sources are not packaged up until things
are stable for a little while, but they are in
the Mercurial repository at

hg clone http://hg.pdos.csail.mit.edu/hg/vx32

Russ







Re: [9fans] 9vx os x

2008-06-29 Thread Bakul Shah
On Sun, 29 Jun 2008 14:16:10 EDT "Russ Cox" <[EMAIL PROTECTED]>  wrote:
> > Every time the option key is pressed, it generates 0xef8095
> > in addition to doing its button2 duty.  
> 
> Fixed.

Yup. Just tested it.

Another bug in both x11 and native mode 9vx: occasionally,
resizing the window can make it crash with a 
9vx panic: sigsegv on cpu6
But of course when I try to cause it, it doesn't happen!
Also, quickly dragging the corner on the x11 version can
render the window completely black.

The native version is different from the x11 in the following ways:
- Top right acme `term' window doesn't open
- The top row in acme doesn't show win before newcol 
- The window geometry is different.
- it has to be explicitly put in background.

A UI nit: the cursor shape doesn't change when moving it out
of the 9vx window.

When we do get to see a glenda icon for 9vx?:-)

A comment on networking: Since 9vx uses the host's IP stack,
two instances can't open the same port.  But at least on
FreeBSD one can use jail(1) so that each 9vx instance has a
full complement of ports.

But this is good stuff! Thank you!



Re: [9fans] 9vx os x

2008-06-29 Thread Russ Cox
>> Please try it on 10.5 and see how it works.
> 
> Every time the option key is pressed, it generates 0xef8095
> in addition to doing its button2 duty.  

Fixed.

> Also, you can't use option+apple key to escape out of full
> screen mode. This is on 10.5.3

That's because it was Ctl-Opt, not Opt-Apple.
But I got rid of that too.  Just use Apple-F, the
same key that gets you in.  The Ctl-Opt thing
was a kludge from the start.

Russ




Re: [9fans] 9vx os x

2008-06-29 Thread Bakul Shah
> Please try it on 10.5 and see how it works.

Every time the option key is pressed, it generates 0xef8095
in addition to doing its button2 duty.  Also, you can't use
option+apple key to escape out of full screen mode. This is
on 10.5.3



Re: [9fans] 9vx os x

2008-06-29 Thread Francisco J Ballesteros
This one seems to work fine for me.
(10.5.3).


On Sun, Jun 29, 2008 at 7:00 PM, Russ Cox <[EMAIL PROTECTED]> wrote:
> I have not bothered to create a new package,
> but there is a new binary available for OS X:
>
>hget -o 9vx.OSX.gz http://pdos.csail.mit.edu/~rsc/9vx.OSX.gz
>gunzip 9vx.OSX.gz
>chmod +x 9vx.OSX
>./9vx.OSX -r your-root
>
> Please try it on 10.5 and see how it works.
>
> Sources are not packaged up until things
> are stable for a little while, but they are in
> the Mercurial repository at
>
>hg clone http://hg.pdos.csail.mit.edu/hg/vx32
>
> Russ
>
>
>



Re: [9fans] 9vx - os x fix

2008-06-27 Thread Russ Cox
Thanks.  Will add the #define.

> and darwin-asm.S just seems to be missing everywhere. in fact, there
> is no definition for vx32_getcontext:

Oops.  That's on my Mac at home;
guess I forgot to copy it off.

Russ




Re: [9fans] 9vx - os x fix

2008-06-27 Thread David Leimbach
On Fri, Jun 27, 2008 at 10:00 AM, Russ Cox <[EMAIL PROTECTED]> wrote:

> Replying to many messages... please read to find yours.
>
> > Yep that's working ok.  Though I'm losing the ability to send capital
> > letters to X11 in general, I'm not sure if that's an artifact of this or
> > not.
>
> Almost certainly not.  The -F workaround is about new fork
> semantics.  The capital letters thing may be that I missed an
> OS X-specific fix in the X code, imported from p9p.
> I hope someone will take it upon themselves to hook the
> drawterm Carbon code in instead.


I think there's a high chance Carbon will be "effectively dead" in 6 months
time.  Snow Leopard looms.  (10.6),  Carbon may still exist, but I wouldn't
want to bet any future reliance on it.

It's probably time for a new Cocoa variant of this stuff.

Then again, I have to wonder about Snow Leopard and *any* 32bit
applications...  I didn't go to WWDC and even if I did, I probably couldn't
share that information thanks to Apple's openness.

Dave


Re: [9fans] 9vx - os x fix

2008-06-27 Thread andrey mirtchovski
>make 9vx/9vx

on 10.5.3 that fails with:

gcc -g -O3 -MD -std=gnu99 -I.  -I. -I9vx -I9vx/a -Wall
-Wno-missing-braces -c -o 9vx/main.o 9vx/main.c
9vx/main.c: In function 'sigsegv':
9vx/main.c:491: error: 'struct __darwin_mcontext32' has no member named 'es'
9vx/main.c:492: error: 'struct __darwin_mcontext32' has no member named 'ss'
9vx/main.c:493: error: 'struct __darwin_mcontext32' has no member named 'ss'
make: *** [9vx/main.o] Error 1

turns out that osx exposes __es and __ss for mcontext in
/usr/include/mach/i386/_structs.h. this fixes it:

gcc -D__DARWIN_UNIX03=0 -g -O3 -MD -std=gnu99 -I.  -I. -I9vx -I9vx/a
-Wall -Wno-missing-braces -c -o 9vx/main.o 9vx/main.c

a bit later on:

gcc -Ilibvx32 -c -g -O3 -MD -std=gnu99 -I.  -o libvx32/emu.o libvx32/emu.c
libvx32/emu.c: In function 'vxproc_run':
libvx32/emu.c:1796: error: storage size of 'env' isn't known
make: *** [libvx32/emu.o] Error 1

is fixed identically by:

gcc -D__DARWIN_UNIX03=0 -Ilibvx32 -c -g -O3 -MD -std=gnu99 -I.  -o
libvx32/emu.o libvx32/emu.c

and then later on we fail with:

gcc -g -O3 -MD -std=gnu99 -I.  -I. -I9vx -I9vx/a -Wall
-Wno-missing-braces -c -o 9vx/stub.o 9vx/stub.c
make: *** No rule to make target `libvx32/darwin-asm.o', needed by
`libvx32/libvx32.a'.  Stop.

and darwin-asm.S just seems to be missing everywhere. in fact, there
is no definition for vx32_getcontext:

$ find . -type f | xargs grep vx32_getcontext
./libvx32/emu.c:if(vx32_getcontext(&env)){
Binary file ./libvx32/emu.o matches
./libvx32/vx32impl.h:int vx32_getcontext(struct i386_thread_state*);
$



Re: [9fans] 9vx - os x fix

2008-06-27 Thread Russ Cox
Replying to many messages... please read to find yours.

> Yep that's working ok.  Though I'm losing the ability to send capital
> letters to X11 in general, I'm not sure if that's an artifact of this or
> not.

Almost certainly not.  The -F workaround is about new fork
semantics.  The capital letters thing may be that I missed an
OS X-specific fix in the X code, imported from p9p.
I hope someone will take it upon themselves to hook the
drawterm Carbon code in instead.

> Is it supposed to run at full-load? Both cores are fully utilized and
> 9vx.OSX uses 187% of the cpu at all times. dtruss reports that the
> main thread is just sitting there doing "select_nocancel(0x0,0x0,0x0)"
> with timeouts.

I think I mentioned this in an earlier message.
I don't know what's going on.  I hope someone
else will figure it out.  It doesn't do this on Linux
or FreeBSD, which suggests that perhaps there
is a bug in the OS X pthreads implementation
(or in 9vx's use of pthreads).  It does make it
somewhat unbearable.

> BTW when i try to make vx32 (under macos 10.5.3) i get the following:
> 
> % make
> make: vx32-gcc: Command not found
> make: vx32-gcc: Command not found
> gcc -m32 -c -nostdinc -Ilibvxc/include -g -O3 -MD -std=gnu99 -I.
> -m80387 -mfp-ret-in-387 -o libvxc/_exit.o libvxc/_exit.c
> libvxc/_exit.c: In function '_exit':
> libvxc/syscall.h:8: error: can't find a register in class 'BREG' while
> reloading 'asm'
> make: *** [libvxc/_exit.o] Error 1

The tree has more than just 9vx.  
To build guests for the other apps you need
the vx32-gcc cross-compilers to make
loadable ELF binaries.  If you

make 9vx/9vx

you'll still get the two "Command not found"
messages, but they're harmless, and the build
should run fine.

> [EMAIL PROTECTED] src]$ make 9vx/9vx
> make: vx32-gcc: Command not found
> make: vx32-gcc: Command not found
> make: *** No rule to make target `9vx/9vx'.  Stop.
> 
> OK, I can see that 9vx/9vx target in 9vx/Makefrag, but the alarm just
> went off and I gotta go pretend to work. More later. It would be nice
> to have this work on x86 64 :-)

Use

make ARCH=i386

to override the result of uname -m.
The 9vx Makefrag knows not to even bother 
trying on x86-64.

> trying to answer my own question about high cpu load, it looks like
> 9vx is busy switching all the time. if anyone knows these tracing
> facilities better, please step up :)

You need to figure out which kproc is the one
that is spinning so hard.  The fact that cpu is >100%
suggests that more than one thread is spinning hard,
meaning it is is probably not the single-use guys
like the x11 kproc or the timer kproc.  That leaves
all the kprocs that are waiting on i/o.

Try adding some iprints to sched.c after each
call to psleep(), and I bet you'll find an 
insomniac.

Russ




Re: [9fans] 9vx - os x fix

2008-06-27 Thread andrey mirtchovski
trying to answer my own question about high cpu load, it looks like
9vx is busy switching all the time. if anyone knows these tracing
facilities better, please step up :)

dappprof (profiles execution, elapsed time is in nanoseconds):

CALL   ELAPSED
libSystem.B.dylib swtch_pri67472182
libSystem.B.dylib sched_yield  75788623
9vx.OSX  unlock  297823144
9vx.OSX  lock362717059
9vx.OSX  canlock 516405744
libSystem.B.dylib pthread_getspecific42273900861098
9vx.OSX  getmach46118238370761
libSystem.B.dylib pthread_cond_wait  65330580967450
libSystem.B.dylib _pthread_cond_wait222897259712785
9vx.OSX  __i686.get_pc_thunk.bx   1256657382372551

dapptrace (traces execution, only a small fragment is listed, without
thread ids):

-> libSystem.B.dylib:sched_yield(0xF30E0, 0xF30E0, 0xB038CE88)  
-> libSystem.B.dylib:swtch_pri(0x0, 0x0, 0x0)   
-> libSystem.B.dylib:_sysenter_trap(0x93846BC1, 0x0, 0x0)   
<- libSystem.B.dylib:swtch_pri = 10
<- libSystem.B.dylib:sched_yield = 21
-> 9vx.OSX:canlock(0xF30E0, 0xF30E0, 0xB038CE88)
-> 9vx.OSX:__i686.get_pc_thunk.bx(0x0, 0x0, 0x0)
<- 9vx.OSX:__i686.get_pc_thunk.bx = 3
-> 9vx.OSX:getmach(0x0, 0x0, 0x0)   
-> 9vx.OSX:__i686.get_pc_thunk.bx(0x101, 0x0, 0x0)  
<- 9vx.OSX:__i686.get_pc_thunk.bx = 3
-> libSystem.B.dylib:pthread_getspecific(0x101, 0x0, 0x0)   
<- libSystem.B.dylib:pthread_getspecific = 12
<- 9vx.OSX:getmach = 31
-> 9vx.OSX:getmach(0x0, 0x0, 0x0)   
-> 9vx.OSX:__i686.get_pc_thunk.bx(0x101, 0x0, 0x0)  
<- 9vx.OSX:__i686.get_pc_thunk.bx = 3
-> libSystem.B.dylib:pthread_getspecific(0x101, 0x0, 0x0)   
<- libSystem.B.dylib:pthread_getspecific = 12
<- 9vx.OSX:getmach = 31
<- 9vx.OSX:canlock = 104
-> libSystem.B.dylib:sched_yield(0xF30E0, 0xF30E0, 0xB038CE88)  
-> libSystem.B.dylib:swtch_pri(0x0, 0x0, 0x0)   
-> libSystem.B.dylib:_sysenter_trap(0x93846BC1, 0x0, 0x0)   
<- libSystem.B.dylib:swtch_pri = 10
<- libSystem.B.dylib:sched_yield = 21

a gdb backtrace:

(gdb) attach 25798
Attaching to process 25798.
Reading symbols for shared libraries . done
Reading symbols for shared libraries ... done
0x9380a390 in _pthread_cond_wait ()
(gdb) bt
#0  0x9380a390 in _pthread_cond_wait ()
#1  0x93850371 in pthread_cond_wait ()
#2  0xabc6 in idlehands () at 9vx/sched.c:47
#3  0x000419cd in _runproc () at 9vx/a/proc.c:542
#4  0x00043696 in sched () at 9vx/a/proc.c:165
#5  0x9e48 in main (argc=2, argv=0xb6ac) at 9vx/main.c:178
(gdb) info thread
Thread 0x10b (local 0xf03) has current state "WAITING"
Thread 0x10b has a suspend count of 0.
(gdb) info threads
  9 process 25798 thread 0x1803  0x937d858a in swtch_pri ()
  8 process 25798 thread 0x1703  0x937d858a in swtch_pri ()
  7 process 25798 thread 0x1603  canlock (l=0xf30e0) at 9vx/stub.c:300
  6 process 25798 thread 0x1503  0x937d858a in swtch_pri ()
  5 process 25798 thread 0x1403  0x937d858a in swtch_pri ()
  4 process 25798 thread 0x1103  0x937d858a in swtch_pri ()
  3 process 25798 thread 0x1003  0x9384e24a in __sigwait ()
  2 process 25798 thread 0xf03  0x9383fbf6 in poll$UNIX2003 ()
* 1 process 25798 thread 0x10b  0x9380a390 in _pthread_cond_wait ()
(gdb)

and an sc_usage run (sc_usage traces system calls, i'm including it
here because it lists what the different threads are doing,
unfortunately you need to see it run interactively to get an idea of
what's happening):

TYPENUMBERCPU_TIME   WAIT_TIME
--
System Idle  0:00.000
System Busy  0:11.684( 0:00.613)
9vx.OSXUsermode   0:16.647

swtch_pri 72985(5840) 0:00.165   1:25.690( 0:05.028) 4
select_nocancel  70(1)0:00.000   0:00.844( 0:00.014)


CURRENT_TYPE  LAST_PATHNAME_WAITED_FOR CUR_WAIT_TIME THRD# PRI
--
swtch_pri 0:00.011   0   0
swtch_pri 0:00.011   1   0
Pre-empted0:00.001   2   0
Running U 0:00.001   3  30
swtch_pri 0:00.011   4   0
swtch_pri 0:00.011   5   0



Re: [9fans] 9vx - os x fix

2008-06-27 Thread andrey mirtchovski
On Fri, Jun 27, 2008 at 10:34 AM, David Leimbach <[EMAIL PROTECTED]> wrote:
> Funny!  Chording works great for me!  (I'm suspecting my X11  is borked
> though, it may be completely unrelated to this project).

button 2/3 emulation with option and apple keys works, but i'm using
button1+option+apple to snarf/paste very often, that is the one that
is not working for me (naturally it works with a 3-button mouse).



Re: [9fans] 9vx - os x fix

2008-06-27 Thread David Leimbach
Funny!  Chording works great for me!  (I'm suspecting my X11  is borked
though, it may be completely unrelated to this project).

On Fri, Jun 27, 2008 at 8:56 AM, andrey mirtchovski <[EMAIL PROTECTED]>
wrote:

> I can send capital letters just fine, but I can't chord with the
> option/apple buttons like I'm used to on the native drawterm/acme.
> Need to get the latest changes from acme-sac.osx and write a native
> client, I suppose :)
>
> Is it supposed to run at full-load? Both cores are fully utilized and
> 9vx.OSX uses 187% of the cpu at all times. dtruss reports that the
> main thread is just sitting there doing "select_nocancel(0x0,0x0,0x0)"
> with timeouts.
>
> On Fri, Jun 27, 2008 at 9:39 AM, David Leimbach <[EMAIL PROTECTED]> wrote:
> > Yep that's working ok.  Though I'm losing the ability to send capital
> > letters to X11 in general, I'm not sure if that's an artifact of this or
> > not.
> > Dave
> >
>
>


Re: [9fans] 9vx - os x fix

2008-06-27 Thread roger peppe
i discovered a macos x nasty a while ago that
means that if you've forked, then accessing certain
library calls (anything Carbon?) draws an error.

the stated reason for doing this is that the library
doesn't work if the stack has been copied,
but it's a bit of a bugger if you're just forking
to put yourself in the background.

is it possible that you're running up against this?

BTW when i try to make vx32 (under macos 10.5.3) i get the following:

% make
make: vx32-gcc: Command not found
make: vx32-gcc: Command not found
gcc -m32 -c -nostdinc -Ilibvxc/include -g -O3 -MD -std=gnu99 -I.
-m80387 -mfp-ret-in-387 -o libvxc/_exit.o libvxc/_exit.c
libvxc/_exit.c: In function '_exit':
libvxc/syscall.h:8: error: can't find a register in class 'BREG' while
reloading 'asm'
make: *** [libvxc/_exit.o] Error 1


admittedly i've only had the briefest peruse through the documentation,
so i'm probably doing something wrong.

  cheers,
rog.

On Fri, Jun 27, 2008 at 4:31 PM, Russ Cox <[EMAIL PROTECTED]> wrote:
> It looks like calling fork() in OS X 10.5 doesn't
> copy the alternate signal stack information into
> the child.  If you add the -F flag to keep it from
> forking into the background, Andrey says it
> works fine.
>
> I'll tweak the code to work around this later.
> For now, just use -F.
>
> Russ
>
>
>



Re: [9fans] 9vx - os x fix

2008-06-27 Thread ron minnich
On Fri, Jun 27, 2008 at 8:56 AM, andrey mirtchovski
<[EMAIL PROTECTED]> wrote:
>
> Is it supposed to run at full-load? Both cores are fully utilized and
> 9vx.OSX uses 187% of the cpu at all times. dtruss reports that the
> main thread is just sitting there doing "select_nocancel(0x0,0x0,0x0)"
> with timeouts.


is that hlt() :-)

ron



Re: [9fans] 9vx - os x fix

2008-06-27 Thread andrey mirtchovski
I can send capital letters just fine, but I can't chord with the
option/apple buttons like I'm used to on the native drawterm/acme.
Need to get the latest changes from acme-sac.osx and write a native
client, I suppose :)

Is it supposed to run at full-load? Both cores are fully utilized and
9vx.OSX uses 187% of the cpu at all times. dtruss reports that the
main thread is just sitting there doing "select_nocancel(0x0,0x0,0x0)"
with timeouts.

On Fri, Jun 27, 2008 at 9:39 AM, David Leimbach <[EMAIL PROTECTED]> wrote:
> Yep that's working ok.  Though I'm losing the ability to send capital
> letters to X11 in general, I'm not sure if that's an artifact of this or
> not.
> Dave
>



Re: [9fans] 9vx - os x fix

2008-06-27 Thread David Leimbach
Yep that's working ok.  Though I'm losing the ability to send capital
letters to X11 in general, I'm not sure if that's an artifact of this or
not.
Dave

On Fri, Jun 27, 2008 at 8:31 AM, Russ Cox <[EMAIL PROTECTED]> wrote:

> It looks like calling fork() in OS X 10.5 doesn't
> copy the alternate signal stack information into
> the child.  If you add the -F flag to keep it from
> forking into the background, Andrey says it
> works fine.
>
> I'll tweak the code to work around this later.
> For now, just use -F.
>
> Russ
>
>
>