9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: steve@quintile.net, 9fans@9fans.net
Subject: Re: [9fans] kernel, errfmt
Date: Fri, 25 Jul 2008 07:47:32 -0400	[thread overview]
Message-ID: <c0ac78fdc42afa4540b05a4f87ef83cd@quanstro.net> (raw)

> I have become confused trying to understand
> the kernel's linkage.
>
> the kernel uses print() in many places, e.g.
> /sys/src/9/port/xalloc.c:80
>
> /sys/src/9/port/devcons.c:211 This calls vseprint().
>
> /sys/src/libc/fmt/fmt.c:47 The fmt library installs %r
> (errfmt) by default.
>
> /sys/src/libc/fmt/errfmt.c:10 references rerrstr().
>
> /sys/src/libc/9sys/rerrstr.c:10 references errstr().
>
> Errstr() is a system call and does not exist in the
> kernel (where it becomes syserrstr()).
>
> How can this work? ...or does the kernel itself
> perform system calls?

i believe /sys/src/libc/9syscall generates entry points.
there are text symbols in libc.a for the symbols you
mention.

however, using %r might be a problem.  the kernel
should likely have a stub

int
errfmt(Fmt *f)
{
	return fmtstrcpy(f, up->errstr);
}

- erik



             reply	other threads:[~2008-07-25 11:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-25 11:47 erik quanstrom [this message]
2008-07-25 12:11 ` Charles Forsyth
  -- strict thread matches above, loose matches on Subject: below --
2008-07-25 11:15 Steve Simon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c0ac78fdc42afa4540b05a4f87ef83cd@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    --cc=steve@quintile.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).