Re: [9fans] kernel, errfmt - Plan9

This is a discussion on Re: [9fans] kernel, errfmt - Plan9 ; > 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) ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: [9fans] kernel, errfmt

  1. Re: [9fans] kernel, errfmt

    > 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


  2. Re: [9fans] kernel, errfmt

    >> How can this work? ...or does the kernel itself
    >> perform system calls?


    it doesn't; syscall will panic.



+ Reply to Thread