9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] a simple question
@ 2002-09-19 18:55 yan zhao
  0 siblings, 0 replies; 34+ messages in thread
From: yan zhao @ 2002-09-19 18:55 UTC (permalink / raw)
  To: 9fans

Hi, there:

Can someone tell me whether factotum exists on the side of the client or
on the side of server? Thanks!

Best,
Yan




^ permalink raw reply	[flat|nested] 34+ messages in thread
* Re: [9fans] a simple question
@ 2002-09-19 19:34 Charles Forsyth
  0 siblings, 0 replies; 34+ messages in thread
From: Charles Forsyth @ 2002-09-19 19:34 UTC (permalink / raw)
  To: 9fans

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

(excluding the /sys/src/fs file server)

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

[-- Attachment #2.1.1: Type: text/plain, Size: 4 bytes --]

both

[-- Attachment #2.1.2: Type: message/rfc822, Size: 1567 bytes --]

From: yan zhao <yzhao2@math.luc.edu>
To: 9fans@cse.psu.edu
Subject: [9fans] a simple question
Date: Thu, 19 Sep 2002 13:55:08 -0500 (CDT)
Message-ID: <Pine.GSO.4.05.10209191351040.5784-100000@abel>

Hi, there:

Can someone tell me whether factotum exists on the side of the client or
on the side of server? Thanks!

Best,
Yan


^ permalink raw reply	[flat|nested] 34+ messages in thread
* Re: [9fans] a simple question
@ 2002-09-19 19:36 presotto
  0 siblings, 0 replies; 34+ messages in thread
From: presotto @ 2002-09-19 19:36 UTC (permalink / raw)
  To: 9fans

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

both

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

From: yan zhao <yzhao2@math.luc.edu>
To: 9fans@cse.psu.edu
Subject: [9fans] a simple question
Date: Thu, 19 Sep 2002 13:55:08 -0500 (CDT)
Message-ID: <Pine.GSO.4.05.10209191351040.5784-100000@abel>

Hi, there:

Can someone tell me whether factotum exists on the side of the client or
on the side of server? Thanks!

Best,
Yan


^ permalink raw reply	[flat|nested] 34+ messages in thread
* [9fans] A simple question
@ 2003-07-09 13:20 ron minnich
  2003-07-10  3:59 ` Russ Cox
  0 siblings, 1 reply; 34+ messages in thread
From: ron minnich @ 2003-07-09 13:20 UTC (permalink / raw)
  To: 9fans

I have a little program, a.c:
#include <blahblah.h>
int a(){ print("hi\n"); }

I want to link the a.8 program produced by 8.c against the 9pcdisk image
and produce an 8.out, something like this:
8l -T some-base-address a.8 9pcdisk

I want the 8.out to be JUST the a.8 with symbol fixups from 9pcdisk, and
based at 'some-base-address'.

Now obviously that doesn't *quite* work, since 9pcdisk is not something
you can link against. So what I'm really after is something like this:
8l -T some-base-address -d 9pcdisk a.8
This would use 9pcdisk to define the symbols.

I don't really want to work with 9pcdisk directly, so I did this:
nm 9pcdisk > kname
I get a log of entries in kname like this:
0x80400040  T somesymbol

And then all I need to do is set up 8l to read this file and pre-define a
bunch of symbols (or so I think).

So as a test I put this code into 8l, ripping off the readundefs code
(defs is an array of names of define files to use, defsp is how many there
are):

void
readdefs(void)
{
        int i, n;
        Sym *s;
        Biobuf *b;
        char *l, buf[256], *fields[3];

        for(i = 0; i < defsp; i++) {
                b = Bopen(defs[i], OREAD);
                if(b == nil) {
                        diag("could not open %s: %r", defs[i]);
                        errorexit();
                }
                while((l = Brdline(b, '\n')) != nil) {
                        n = Blinelen(b);
                        if(n >= sizeof(buf)) {
                                diag("%s: line too long", defs[i]);
                                errorexit();
                        }
                        strncpy(buf, l, n);
                        n = getfields(buf, fields, nelem(fields), 1, "
\t\r\n");
                        if(n == nelem(fields)) {
                                diag("%s: bad format", defs[i]);
                                errorexit();
                        }
                        if ((*fields[1] != 'T') && (*fields[1] != 'D'))
                                continue;
                        s = lookup(fields[2], 0);
                        if (*fields[1] == 'T')
                                s->type = STEXT;
                        else
                                s->type = SDATA;
                        s->value = strtol(fields[0], 0, 0);
                }
                Bterm(b);
        }
}

I.e. read the kname file, and for all the 'T' and 'D' entries, put a
symbol table entry in for those names.

Well, this sort of works, but I have not figured out how to make 8l NOT
change the values of these symbols. In other words, print starts out with
some value from 9pcdisk, but in 8.out it has a different value. Not what
I want at all. I want 8.out to have a fixed up symbol for print, with the
value found in 9pcdisk.

I also think I'm missing some bits which are probably needed to link
correctly. I set name, value, and type;  I think I might need to set
frame; are version and become required?

If it's not obvious I need this to allow me to put code images into kernel
space and call them. I'm doing this via a device I've called zoot (#z)
since I don't believe anybody else is using #z. This work is for two uses:
modules and Plan 9 booting Plan 9. I started on Plan 9 booting Plan 9
since fixing 9load AND Plan 9 issues for linuxbios is twice as much work
as just trying to fix Plan 9 for linuxbios. If Plan 9 can boot Plan 9,
then I can stop worrying about 9load.

Now if somebody has already done both these things just tell me and I can
stop :-)

BTW #z, so far, is in port, not pc, and I hope to keep it that way.

ron



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

end of thread, other threads:[~2003-07-12  0:29 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-19 18:55 [9fans] a simple question yan zhao
2002-09-19 19:34 Charles Forsyth
2002-09-19 19:36 presotto
2003-07-09 13:20 [9fans] A " ron minnich
2003-07-10  3:59 ` Russ Cox
2003-07-10  5:37   ` Tad Hunt
2003-07-10  6:46     ` boyd, rounin
2003-07-10 11:14     ` ron minnich
2003-07-10 14:46       ` jmk
2003-07-10 16:32         ` Dan Cross
2003-07-10 16:37           ` boyd, rounin
2003-07-10 18:13             ` jmk
2003-07-10 19:13               ` boyd, rounin
2003-07-10 23:47               ` Bruce Ellis
2003-07-11 14:59                 ` ron minnich
2003-07-10 17:15       ` Tad Hunt
2003-07-10 11:11   ` ron minnich
2003-07-10 11:31     ` Lucio De Re
2003-07-10 12:03       ` David Presotto
2003-07-10 14:14       ` boyd, rounin
2003-07-10 14:08         ` Lucio De Re
2003-07-10 14:24           ` David Presotto
2003-07-10 14:25             ` Lucio De Re
2003-07-10 15:06               ` boyd, rounin
2003-07-10 15:09               ` Jack Johnson
2003-07-11  4:41                 ` Lucio De Re
2003-07-11  6:03                   ` boyd, rounin
2003-07-11  6:11                     ` Lucio De Re
2003-07-11  6:59                       ` boyd, rounin
2003-07-11  8:13                         ` northern snowfall
2003-07-11 16:10                           ` Jack Johnson
2003-07-12  0:29                             ` northern snowfall
2003-07-11 23:33                               ` boyd, rounin
2003-07-10 15:09           ` rog

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).