9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Drawterm on Mac Mini w/Ubuntu Linux
@ 2006-01-17  1:14 Gregory Pavelcak
  2006-01-17  1:19 ` Russ Cox
                   ` (3 more replies)
  0 siblings, 4 replies; 23+ messages in thread
From: Gregory Pavelcak @ 2006-01-17  1:14 UTC (permalink / raw)
  To: 9fans

Hello all,

The subject line pretty much says it. I installed Ubuntu Linux on my Mac
Mini for the heck of it. I mainly use the Mini to drawterm to Plan 9.
So, the question is which drawterm, assuming that there is an
appropriate one, should I use? drawterm-linux and drawterm-osx both give
me `cannot execute binary file'. I also downloaded the sources from
Andrey's collection, but need to find out how to get mk installed on
Ubuntu. Is the build likely to work? If you know that it won't, you
could save me some trouble by filling me in :-)

Thanks a lot.

Belated Happy Holidays to all.

Greg



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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17  1:14 [9fans] Drawterm on Mac Mini w/Ubuntu Linux Gregory Pavelcak
@ 2006-01-17  1:19 ` Russ Cox
  2006-01-17 11:17   ` Gregory Pavelcak
  2006-01-17  1:20 ` Federico G. Benavento
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 23+ messages in thread
From: Russ Cox @ 2006-01-17  1:19 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> The subject line pretty much says it. I installed Ubuntu Linux on my Mac
> Mini for the heck of it. I mainly use the Mini to drawterm to Plan 9.
> So, the question is which drawterm, assuming that there is an
> appropriate one, should I use? drawterm-linux and drawterm-osx both give
> me `cannot execute binary file'. I also downloaded the sources from
> Andrey's collection, but need to find out how to get mk installed on
> Ubuntu. Is the build likely to work? If you know that it won't, you
> could save me some trouble by filling me in :-)

Use the sources referenced by http://swtch.com/drawterm/.
You'll only need make.

Russ


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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17  1:14 [9fans] Drawterm on Mac Mini w/Ubuntu Linux Gregory Pavelcak
  2006-01-17  1:19 ` Russ Cox
@ 2006-01-17  1:20 ` Federico G. Benavento
  2006-01-17  1:22 ` andrey mirtchovski
  2006-01-17  1:25 ` [9fans] " Uriel
  3 siblings, 0 replies; 23+ messages in thread
From: Federico G. Benavento @ 2006-01-17  1:20 UTC (permalink / raw)
  To: 9fans

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

http://swtch.com/drawterm/

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

From: Gregory Pavelcak <g.pavelcak@comcast.net>
To: 9fans@cse.psu.edu
Subject: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
Date: Mon, 16 Jan 2006 20:14:12 -0500
Message-ID: <1137460452.27646.8.camel@localhost.localdomain>

Hello all,

The subject line pretty much says it. I installed Ubuntu Linux on my Mac
Mini for the heck of it. I mainly use the Mini to drawterm to Plan 9.
So, the question is which drawterm, assuming that there is an
appropriate one, should I use? drawterm-linux and drawterm-osx both give
me `cannot execute binary file'. I also downloaded the sources from
Andrey's collection, but need to find out how to get mk installed on
Ubuntu. Is the build likely to work? If you know that it won't, you
could save me some trouble by filling me in :-)

Thanks a lot.

Belated Happy Holidays to all.

Greg

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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17  1:14 [9fans] Drawterm on Mac Mini w/Ubuntu Linux Gregory Pavelcak
  2006-01-17  1:19 ` Russ Cox
  2006-01-17  1:20 ` Federico G. Benavento
@ 2006-01-17  1:22 ` andrey mirtchovski
  2006-01-17  1:25 ` [9fans] " Uriel
  3 siblings, 0 replies; 23+ messages in thread
From: andrey mirtchovski @ 2006-01-17  1:22 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

get the sources from Russ' swtch.com as they are the latest. i should
remove the sources .tgz from my website anyways to avoid confusion.

if you get plan9port installed on the box it will compile mk for you,
else you can get it from:

http://www.cminusminus.org/code.html#mk

andrey

On 1/16/06, Gregory Pavelcak <g.pavelcak@comcast.net> wrote:
> Hello all,
>
> The subject line pretty much says it. I installed Ubuntu Linux on my Mac
> Mini for the heck of it. I mainly use the Mini to drawterm to Plan 9.
> So, the question is which drawterm, assuming that there is an
> appropriate one, should I use? drawterm-linux and drawterm-osx both give
> me `cannot execute binary file'. I also downloaded the sources from
> Andrey's collection, but need to find out how to get mk installed on
> Ubuntu. Is the build likely to work? If you know that it won't, you
> could save me some trouble by filling me in :-)
>
> Thanks a lot.
>
> Belated Happy Holidays to all.
>
> Greg
>
>


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

* [9fans] Re: Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17  1:14 [9fans] Drawterm on Mac Mini w/Ubuntu Linux Gregory Pavelcak
                   ` (2 preceding siblings ...)
  2006-01-17  1:22 ` andrey mirtchovski
@ 2006-01-17  1:25 ` Uriel
  2006-01-17  1:34   ` andrey mirtchovski
                     ` (3 more replies)
  3 siblings, 4 replies; 23+ messages in thread
From: Uriel @ 2006-01-17  1:25 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Andrey site is obsolete and should be replaced with a pointer to:
http://swtch.com/drawterm/
and/or
http://www.cs.bell-labs.com/wiki/plan9/drawterm/

The binaries in that site should obviously be marked as x86 binaries, for other
arches you will have to try compiling the latest source.

For building instructions see the README.

Why the hell do we bother distributing binaries for anything but windoze
anyway? They only confuse people and make sure we have to keep them in sync
with the sources.

uriel

On 1/16/06, Gregory Pavelcak <g.pavelcak@comcast.net> wrote:
> Hello all,
>
> The subject line pretty much says it. I installed Ubuntu Linux on my Mac
> Mini for the heck of it. I mainly use the Mini to drawterm to Plan 9.
> So, the question is which drawterm, assuming that there is an
> appropriate one, should I use? drawterm-linux and drawterm-osx both give
> me `cannot execute binary file'. I also downloaded the sources from
> Andrey's collection, but need to find out how to get mk installed on
> Ubuntu. Is the build likely to work? If you know that it won't, you
> could save me some trouble by filling me in :-)
>
> Thanks a lot.
>
> Belated Happy Holidays to all.
>
> Greg
>
>

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

* Re: [9fans] Re: Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17  1:25 ` [9fans] " Uriel
@ 2006-01-17  1:34   ` andrey mirtchovski
  2006-01-17  1:40   ` Russ Cox
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 23+ messages in thread
From: andrey mirtchovski @ 2006-01-17  1:34 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Why the hell do we bother distributing binaries for anything but windoze
> anyway?

because people want them.


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

* Re: [9fans] Re: Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17  1:25 ` [9fans] " Uriel
  2006-01-17  1:34   ` andrey mirtchovski
@ 2006-01-17  1:40   ` Russ Cox
  2006-01-17  7:32     ` lucio
  2006-01-17  7:29   ` lucio
  2006-01-17 10:06   ` Charles Forsyth
  3 siblings, 1 reply; 23+ messages in thread
From: Russ Cox @ 2006-01-17  1:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> The binaries in that site should obviously be marked as x86 binaries, for other
> arches you will have to try compiling the latest source.

the OS X binaries are not x86.

> Why the hell do we bother distributing binaries for anything but windoze
> anyway? They only confuse people and make sure we have to keep them in sync
> with the sources.

good point.  i just removed /n/sources/plan9/386/bin/*

russ


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

* Re: [9fans] Re: Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17  1:25 ` [9fans] " Uriel
  2006-01-17  1:34   ` andrey mirtchovski
  2006-01-17  1:40   ` Russ Cox
@ 2006-01-17  7:29   ` lucio
  2006-01-17 20:40     ` Micah Stetson
  2006-01-17 10:06   ` Charles Forsyth
  3 siblings, 1 reply; 23+ messages in thread
From: lucio @ 2006-01-17  7:29 UTC (permalink / raw)
  To: 9fans

> Why the hell do we bother distributing binaries for anything but windoze
> anyway? They only confuse people and make sure we have to keep them in sync
> with the sources.

Ubuntu does not come standard with the development system and I, with
all my years of experience, haven't yet managed to get P9P running on
it because of this incompleteness.

In fact, any hints are welcome.  But having a trusted drawterm binary
would be great.

++L



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

* Re: [9fans] Re: Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17  1:40   ` Russ Cox
@ 2006-01-17  7:32     ` lucio
  0 siblings, 0 replies; 23+ messages in thread
From: lucio @ 2006-01-17  7:32 UTC (permalink / raw)
  To: 9fans

> good point.  i just removed /n/sources/plan9/386/bin/*

You mean you left /n/sources/plan9/386/9* kernels?  How thoughtless of
you :-)

++L



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

* Re: [9fans] Re: Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17  1:25 ` [9fans] " Uriel
                     ` (2 preceding siblings ...)
  2006-01-17  7:29   ` lucio
@ 2006-01-17 10:06   ` Charles Forsyth
  3 siblings, 0 replies; 23+ messages in thread
From: Charles Forsyth @ 2006-01-17 10:06 UTC (permalink / raw)
  To: 9fans

> Why the hell do we bother distributing binaries for anything but windoze
> anyway? They only confuse people and make sure we have to keep them in sync
> with the sources.

linux, solaris, and others often do not (more often than not) come with
the compilers (``development environment'') installed these days, and it's
a nuisance to have to install all that just to have the single executable, drawterm,
especially if you don't own the system from which you're trying to escape to sanity.



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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17  1:19 ` Russ Cox
@ 2006-01-17 11:17   ` Gregory Pavelcak
  2006-01-17 12:00     ` erik quanstrom
  0 siblings, 1 reply; 23+ messages in thread
From: Gregory Pavelcak @ 2006-01-17 11:17 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Mon, 2006-01-16 at 20:19 -0500, Russ Cox wrote:
> > The subject line pretty much says it. I installed Ubuntu Linux on my Mac
> > Mini for the heck of it. I mainly use the Mini to drawterm to Plan 9.
> > So, the question is which drawterm, assuming that there is an
> > appropriate one, should I use? drawterm-linux and drawterm-osx both give
> > me `cannot execute binary file'. I also downloaded the sources from
> > Andrey's collection, but need to find out how to get mk installed on
> > Ubuntu. Is the build likely to work? If you know that it won't, you
> > could save me some trouble by filling me in :-)
> 
> Use the sources referenced by http://swtch.com/drawterm/.
> You'll only need make.
> 
> Russ

Thanks for the help. I seem to be getting close.

But, how to fix this?

make[1]: Leaving directory `/home/gp/bin/drawterm/gui-x11'
(cd libc; make)
make[1]: Entering directory `/home/gp/bin/drawterm/libc'
gcc -Wall -Wno-missing-braces -ggdb -I.. -I../include -I../kern -c
-I/usr/include/X11-D_THREAD_SAFE -pthread -O2 fmtprint.c
fmtprint.c: In function ‘fmtprint’:
fmtprint.c:20: error: incompatible types in assignment
fmtprint.c:27: error: incompatible types in assignment
make[1]: *** [fmtprint.o] Error 1
make[1]: Leaving directory `/home/gp/bin/drawterm/libc'
make: *** [libc/libc.a] Error 2

Greg



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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17 11:17   ` Gregory Pavelcak
@ 2006-01-17 12:00     ` erik quanstrom
  2006-01-17 21:11       ` Gregory Pavelcak
  0 siblings, 1 reply; 23+ messages in thread
From: erik quanstrom @ 2006-01-17 12:00 UTC (permalink / raw)
  To: 9fans, Gregory Pavelcak

with va_copy: e.g.:

int
fmtprint(Fmt *f, char *fmt, ...)
{
	va_list va;
	int n;

	f->flags = 0;
	f->width = 0;
	f->prec = 0;
	va_copy(va, f->args);
	va_end(f->args);
	va_start(f->args, fmt);
	n = dofmt(f, fmt);
	va_end(f->args);
	f->flags = 0;
	f->width = 0;
	f->prec = 0;
	va_copy(f->args,va);
	va_end(va);
	if(n >= 0)
		return 0;
	return n;
}

Gregory Pavelcak <g.pavelcak@comcast.net> writes

| 
| On Mon, 2006-01-16 at 20:19 -0500, Russ Cox wrote:
| > > The subject line pretty much says it. I installed Ubuntu Linux on my Mac
| > > Mini for the heck of it. I mainly use the Mini to drawterm to Plan 9.
| > > So, the question is which drawterm, assuming that there is an
| > > appropriate one, should I use? drawterm-linux and drawterm-osx both give
| > > me `cannot execute binary file'. I also downloaded the sources from
| > > Andrey's collection, but need to find out how to get mk installed on
| > > Ubuntu. Is the build likely to work? If you know that it won't, you
| > > could save me some trouble by filling me in :-)
| > 
| > Use the sources referenced by http://swtch.com/drawterm/.
| > You'll only need make.
| > 
| > Russ
| 
| Thanks for the help. I seem to be getting close.
| 
| But, how to fix this?
| 
| make[1]: Leaving directory `/home/gp/bin/drawterm/gui-x11'
| (cd libc; make)
| make[1]: Entering directory `/home/gp/bin/drawterm/libc'
| gcc -Wall -Wno-missing-braces -ggdb -I.. -I../include -I../kern -c
| -I/usr/include/X11-D_THREAD_SAFE -pthread -O2 fmtprint.c
| fmtprint.c: In function ‘fmtprint’:
| fmtprint.c:20: error: incompatible types in assignment
| fmtprint.c:27: error: incompatible types in assignment
| make[1]: *** [fmtprint.o] Error 1
| make[1]: Leaving directory `/home/gp/bin/drawterm/libc'
| make: *** [libc/libc.a] Error 2
| 
| Greg


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

* Re: [9fans] Re: Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17  7:29   ` lucio
@ 2006-01-17 20:40     ` Micah Stetson
  0 siblings, 0 replies; 23+ messages in thread
From: Micah Stetson @ 2006-01-17 20:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> Ubuntu does not come standard with the development system and I, with
> all my years of experience, haven't yet managed to get P9P running on
> it because of this incompleteness.
>
> In fact, any hints are welcome.  But having a trusted drawterm binary
> would be great.

I have p9p running on Ubuntu (i386), but I'm not sure exactly what I
did to get it there.  I think I ran something like 'apt-get install
build-essential x-window-system-dev' before I tried compiling it -- I
can't remember exactly which packages I needed, though.

Micah


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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17 12:00     ` erik quanstrom
@ 2006-01-17 21:11       ` Gregory Pavelcak
  2006-01-17 21:40         ` Russ Cox
  2006-01-17 22:33         ` Skip Tavakkolian
  0 siblings, 2 replies; 23+ messages in thread
From: Gregory Pavelcak @ 2006-01-17 21:11 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

OK, I can almost taste it now.
As Homer says: "Mmmm Draaawwterrrmmm, aaaaarggghh."
Any advice appreciated.

Greg


(cd posix-$arch &&  make)
make[1]: Entering directory `/home/gp/drawterm/posix-power'
gcc -Wall -Wno-missing-braces -ggdb -I.. -I../include -I../kern -c
-I/usr/X11R6/include -D_THREAD_SAFE -pthread -O2 getcallerpc.c
gcc -Wall -Wno-missing-braces -ggdb -I.. -I../include -I../kern -c
-I/usr/X11R6/include -D_THREAD_SAFE -pthread -O2 md5block.c
gcc -Wall -Wno-missing-braces -ggdb -I.. -I../include -I../kern -c
-I/usr/X11R6/include -D_THREAD_SAFE -pthread -O2 sha1block.c
gcc -Wall -Wno-missing-braces -ggdb -I.. -I../include -I../kern -c
-I/usr/X11R6/include -D_THREAD_SAFE -pthread -O2 tas.c
/tmp/cc4SeP4G.s: Assembler messages:
/tmp/cc4SeP4G.s:39: Error: unsupported relocation against r0
/tmp/cc4SeP4G.s:40: Error: unsupported relocation against r4
/tmp/cc4SeP4G.s:41: Error: unsupported relocation against r5
/tmp/cc4SeP4G.s:42: Error: unsupported relocation against r5
/tmp/cc4SeP4G.s:42: Error: unsupported relocation against r5
/tmp/cc4SeP4G.s:44: Error: unsupported relocation against r4
/tmp/cc4SeP4G.s:44: Error: unsupported relocation against r0
/tmp/cc4SeP4G.s:45: Error: unsupported relocation against r4
/tmp/cc4SeP4G.s:45: Error: unsupported relocation against r0
/tmp/cc4SeP4G.s:46: Error: unsupported relocation against r0
/tmp/cc4SeP4G.s:48: Error: unsupported relocation against r5
/tmp/cc4SeP4G.s:48: Error: unsupported relocation against r4
/tmp/cc4SeP4G.s:48: Error: unsupported relocation against r0
make[1]: *** [tas.o] Error 1
make[1]: Leaving directory `/home/gp/drawterm/posix-power'
make: *** [libmachdep.a] Error 2




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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17 21:11       ` Gregory Pavelcak
@ 2006-01-17 21:40         ` Russ Cox
  2006-01-17 22:08           ` Gregory Pavelcak
  2006-01-17 22:33         ` Skip Tavakkolian
  1 sibling, 1 reply; 23+ messages in thread
From: Russ Cox @ 2006-01-17 21:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Try removing tas.c from drawterm/posix-power and create tas.s
instead:

	.globl	_tas
_tas:
	li	%r0, 0
	mr	%r4, %r3
	lis	%r5, 0xcafe
	ori	%r5, %r5, 0xbabe
1:
	lwarx	%r3, %r0, %r4
	cmpwi	%r3, 0
	bne	2f
	stwcx.	%r5, %r0, %r4
	bne-	1b
2:
	sync
	blr

Russ


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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17 22:33         ` Skip Tavakkolian
@ 2006-01-17 21:41           ` Gregory Pavelcak
  2006-01-17 22:40           ` Skip Tavakkolian
  2006-01-18  0:37           ` Sven Moritz Hallberg
  2 siblings, 0 replies; 23+ messages in thread
From: Gregory Pavelcak @ 2006-01-17 21:41 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

In my attempt arch=power. I had to do that by hand. Maybe I made the
wrong choice. In Make.unix arch comes from uname -m, which in my case is
just 'ppc'

On Tue, 2006-01-17 at 14:33 -0800, Skip Tavakkolian wrote:
> > gcc -Wall -Wno-missing-braces -ggdb -I.. -I../include -I../kern -c
> > -I/usr/X11R6/include -D_THREAD_SAFE -pthread -O2 tas.c
> > /tmp/cc4SeP4G.s: Assembler messages:
> 
> what's $arch set to? was G4 support added recently?
> 



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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17 21:40         ` Russ Cox
@ 2006-01-17 22:08           ` Gregory Pavelcak
  2006-01-17 22:13             ` Russ Cox
  0 siblings, 1 reply; 23+ messages in thread
From: Gregory Pavelcak @ 2006-01-17 22:08 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

OK. Cut-n-pasted what you wrote into tas.s and got farther

make[1]: Leaving directory `/home/gp/drawterm/posix-power'
gcc -pthread -o drawterm main.o cpu.o readcons.o secstore.o latin1.o
posix-factotum.o  kern/libkern.a exportfs/libexportfs.a
libauth/libauth.a libauthsrv/libauthsrv.a libsec/libsec.a libmp/libmp.a
libmemdraw/libmemdraw.a libmemlayer/libmemlayer.a libdraw/libdraw.a
gui-x11/libgui.a libc/libc.a  kern/libkern.a exportfs/libexportfs.a
libauth/libauth.a libauthsrv/libauthsrv.a libsec/libsec.a libmp/libmp.a
libmemdraw/libmemdraw.a libmemlayer/libmemlayer.a libdraw/libdraw.a
gui-x11/libgui.a libc/libc.a  kern/libkern.a exportfs/libexportfs.a
libauth/libauth.a libauthsrv/libauthsrv.a libsec/libsec.a libmp/libmp.a
libmemdraw/libmemdraw.a libmemlayer/libmemlayer.a libdraw/libdraw.a
gui-x11/libgui.a libc/libc.a  libmachdep.a -L/usr/X11R6/lib -lX11 -ggdb
kern/libkern.a(devcons.o): In function `consopen':
/home/gp/drawterm/kern/devcons.c:585: undefined reference to `tas'
libc/libc.a(lock.o): In function `canlock':
/home/gp/drawterm/libc/lock.c:7: undefined reference to `tas'
collect2: ld returned 1 exit status
make: *** [drawterm] Error 1

On Tue, 2006-01-17 at 16:40 -0500, Russ Cox wrote:
> Try removing tas.c from drawterm/posix-power and create tas.s
> instead:
> 
> 	.globl	_tas
> _tas:
> 	li	%r0, 0
> 	mr	%r4, %r3
> 	lis	%r5, 0xcafe
> 	ori	%r5, %r5, 0xbabe
> 1:
> 	lwarx	%r3, %r0, %r4
> 	cmpwi	%r3, 0
> 	bne	2f
> 	stwcx.	%r5, %r0, %r4
> 	bne-	1b
> 2:
> 	sync
> 	blr
> 
> Russ



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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17 22:08           ` Gregory Pavelcak
@ 2006-01-17 22:13             ` Russ Cox
  2006-01-17 22:28               ` Gregory Pavelcak
  0 siblings, 1 reply; 23+ messages in thread
From: Russ Cox @ 2006-01-17 22:13 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

okay, now replace _tas in the first two lines
of the assembly file with plain tas (no underscore).
sorry for the runaround -- gcc can't make up its mind
from version to version.

russ


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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17 22:13             ` Russ Cox
@ 2006-01-17 22:28               ` Gregory Pavelcak
  2006-01-17 22:55                 ` Charles Forsyth
  0 siblings, 1 reply; 23+ messages in thread
From: Gregory Pavelcak @ 2006-01-17 22:28 UTC (permalink / raw)
  To: 9fans

I was about to try that when I got your mail. Maybe those error
messages aren't that cryptic after all. Just a little intimidating
for the clueless, like me.

Anyway, it works!! I'm responding via acme from drawterm now.

No need to apologize. I'm grateful for the help, and it makes me
feel like I can help in some small way at least by testing these
things out.

Thanks.

Greg

> okay, now replace _tas in the first two lines
> of the assembly file with plain tas (no underscore).
> sorry for the runaround -- gcc can't make up its mind
> from version to version.
> 
> russ



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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17 21:11       ` Gregory Pavelcak
  2006-01-17 21:40         ` Russ Cox
@ 2006-01-17 22:33         ` Skip Tavakkolian
  2006-01-17 21:41           ` Gregory Pavelcak
                             ` (2 more replies)
  1 sibling, 3 replies; 23+ messages in thread
From: Skip Tavakkolian @ 2006-01-17 22:33 UTC (permalink / raw)
  To: 9fans

> gcc -Wall -Wno-missing-braces -ggdb -I.. -I../include -I../kern -c
> -I/usr/X11R6/include -D_THREAD_SAFE -pthread -O2 tas.c
> /tmp/cc4SeP4G.s: Assembler messages:

what's $arch set to? was G4 support added recently?



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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17 22:33         ` Skip Tavakkolian
  2006-01-17 21:41           ` Gregory Pavelcak
@ 2006-01-17 22:40           ` Skip Tavakkolian
  2006-01-18  0:37           ` Sven Moritz Hallberg
  2 siblings, 0 replies; 23+ messages in thread
From: Skip Tavakkolian @ 2006-01-17 22:40 UTC (permalink / raw)
  To: 9fans

>> gcc -Wall -Wno-missing-braces -ggdb -I.. -I../include -I../kern -c
>> -I/usr/X11R6/include -D_THREAD_SAFE -pthread -O2 tas.c
>> /tmp/cc4SeP4G.s: Assembler messages:
> 
> what's $arch set to? was G4 support added recently?

never mind. i see it's "power", and posix-power/tas.c is the
same as what used to be in gccpower/ directory.

i'm glad to be of no help at all.



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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17 22:28               ` Gregory Pavelcak
@ 2006-01-17 22:55                 ` Charles Forsyth
  0 siblings, 0 replies; 23+ messages in thread
From: Charles Forsyth @ 2006-01-17 22:55 UTC (permalink / raw)
  To: 9fans

> it makes me feel like I can help in some small way at least by testing these
> things out.

that's not a small way of helping, especially if you're patient
(and of course if you're not patient, eventually you'll destroy your machine
and be unable to send complaints, so i suppose it works out)



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

* Re: [9fans] Drawterm on Mac Mini w/Ubuntu Linux
  2006-01-17 22:33         ` Skip Tavakkolian
  2006-01-17 21:41           ` Gregory Pavelcak
  2006-01-17 22:40           ` Skip Tavakkolian
@ 2006-01-18  0:37           ` Sven Moritz Hallberg
  2 siblings, 0 replies; 23+ messages in thread
From: Sven Moritz Hallberg @ 2006-01-18  0:37 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs


[-- Attachment #1.1: Type: text/plain, Size: 888 bytes --]

Skip Tavakkolian schrieb:
>>gcc -Wall -Wno-missing-braces -ggdb -I.. -I../include -I../kern -c
>>-I/usr/X11R6/include -D_THREAD_SAFE -pthread -O2 tas.c
>>/tmp/cc4SeP4G.s: Assembler messages:
> 
> 
> what's $arch set to? was G4 support added recently?

My PowerBook (also with Ubuntu Linux) sets it to "ppc", via uname -m, as
per Make.unix. For MacOS X, $arch is appearently set to "power", so as a
quick work-around to the assembly problems, I copied posix-power to
posix-ppc and changed tas.c as attached. The only problem seems to be a
slight disagreement in assembly syntax between MacOS and Linux. *shrug*

Regards,
Sven Moritz

PS. In fact, the only thing different on Linux is that register names
are not profixed with 'r', so, for example, instead of "li r0,0" on
MacOS, it's just "li 0,0" on Linux...

PPS. Do I hear the #ifdef's calling? *duck* No! No! No!

[-- Attachment #1.2: tas.c --]
[-- Type: text/x-csrc, Size: 972 bytes --]

#include "u.h"
#include "libc.h"

/*
 * first argument (l) is in r3 at entry.
 * r3 contains return value upon return.
 */
int
tas(long *x)
{
	int     v;
	/*
	 * this __asm__ works with gcc 2.95.2 (mac os x 10.1).
	 * this assembly language destroys r0 (0), some other register (v),
	 * r4 (x) and r5 (temp).
	 */
	__asm__("\n	sync\n"
	"	li	0,0\n"
	"	mr	4,%1		/* &l->val */\n"
	"	lis	5,0xdead	/* assemble constant 0xdeaddead */\n"
	"	ori	5,5,0xdead	/* \" */\n"
	"tas1:\n"
	"	dcbf	4,0	/* cache flush; \"fix for 603x bug\" */\n"
	"	lwarx	%0,4,0	/* v = l->val with reservation */\n"
	"	cmp	cr0,0,%0,0	/* v == 0 */\n"
	"	bne	tas0\n"
	"	stwcx.	5,4,0   /* if (l->val same) l->val = 0xdeaddead */\n"
	"	bne	tas1\n"
	"tas0:\n"
	"	sync\n"
	"	isync\n"
	: "=r" (v)
	: "r"  (x)
	: "cc", "memory", "r0", "r4", "r5"
	);
	switch(v) {
	case 0:		return 0;
	case 0xdeaddead: return 1;
	default:	print("tas: corrupted 0x%lux\n", v);
	}
	return 0;
}

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 264 bytes --]

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

end of thread, other threads:[~2006-01-18  0:37 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-17  1:14 [9fans] Drawterm on Mac Mini w/Ubuntu Linux Gregory Pavelcak
2006-01-17  1:19 ` Russ Cox
2006-01-17 11:17   ` Gregory Pavelcak
2006-01-17 12:00     ` erik quanstrom
2006-01-17 21:11       ` Gregory Pavelcak
2006-01-17 21:40         ` Russ Cox
2006-01-17 22:08           ` Gregory Pavelcak
2006-01-17 22:13             ` Russ Cox
2006-01-17 22:28               ` Gregory Pavelcak
2006-01-17 22:55                 ` Charles Forsyth
2006-01-17 22:33         ` Skip Tavakkolian
2006-01-17 21:41           ` Gregory Pavelcak
2006-01-17 22:40           ` Skip Tavakkolian
2006-01-18  0:37           ` Sven Moritz Hallberg
2006-01-17  1:20 ` Federico G. Benavento
2006-01-17  1:22 ` andrey mirtchovski
2006-01-17  1:25 ` [9fans] " Uriel
2006-01-17  1:34   ` andrey mirtchovski
2006-01-17  1:40   ` Russ Cox
2006-01-17  7:32     ` lucio
2006-01-17  7:29   ` lucio
2006-01-17 20:40     ` Micah Stetson
2006-01-17 10:06   ` Charles Forsyth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).