[9fans] Xen and new venti - Plan9

This is a discussion on [9fans] Xen and new venti - Plan9 ; Hi, I'm trying to install plan9 under Xen 3.2.0 with venti but the kernel avaiable on the web is too old to support nventi. I decided to try to compile it but there were some troubles I was able to ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: [9fans] Xen and new venti

  1. [9fans] Xen and new venti

    Hi,
    I'm trying to install plan9 under Xen 3.2.0 with venti
    but the kernel avaiable on the web is too old to support nventi.
    I decided to try to compile it but there were some troubles I was able to fix
    (with the help of #plan9). Now there's a problem (or two) I do not know
    how to solve; I must inform you that I'm not an expert of both plan9 and C.
    This is what I did:

    9fs sources
    cpr /n/sources/xen/xen3/9 /sys/src/9
    cd /sys/src/9/xen3

    then I got /usr/local/xen from my xen installation and put it under xen-public
    I edited xenpcf to remove il support

    mk

    I had a problem of type in xendat.h fixed by replacing
    uint8 with uint at line 1540

    mk

    I had some other problems which I fixed by
    1) adding void mfence(void); into fns.h
    2) editing line 286 in sdxen.c to look like
    xenbio(SDunit* unit, int lun, int write, void* data, long nb, uvlong bno)
    3) adding /$objtype/lib/libip.a\ to LIB in mkfile
    4) adding in l.s
    TEXT mfence(SB), $0
    BYTE $0x0f
    BYTE $0xae
    BYTE $0xf0
    RET

    mk now gives two errors which I do not know how to fix:
    ....omissis...
    size 9xenpcf
    v4parsecidr: undefined: memcpy in v4parsecidr
    _strayintrx: _ctype: not defined
    mk: 8c -FVw '-DKERNDATE='`{date ... : exit status=rc 7851: 8l 7855: error

    any idea?
    Thank you

    S.


  2. Re: [9fans] Xen and new venti

    > I'm trying to install plan9 under Xen 3.2.0 with venti
    > but the kernel avaiable on the web is too old to support nventi.


    perhaps you mean that this kernel has an old venti linked in?

    > I had a problem of type in xendat.h fixed by replacing
    > uint8 with uint at line 1540


    i suspect you mean uchar. (or uvlong if they're counting
    bytes.)

    > mk now gives two errors which I do not know how to fix:
    > ...omissis...
    > size 9xenpcf
    > v4parsecidr: undefined: memcpy in v4parsecidr


    replace memcpy with memmove.

    > _strayintrx: _ctype: not defined


    _ctype is used by the is* functions like isascii.

    - erik

  3. Re: [9fans] Xen and new venti

    Hi,
    thanks to the suggestion erik gave me I was able to compile the kernel:
    I just needed to switch from memcpy to memmove into /sys/src/libip/parseip.c and recompile libip
    and then recompile also /sys/src/libc

    I moved the kernels to the Xen machine but all of them crashes just after the message
    "Started domain plan9"

    Am I missing something?
    S.

  4. Re: [9fans] Xen and new venti

    > Hi,
    > thanks to the suggestion erik gave me I was able to compile the kernel:
    > I just needed to switch from memcpy to memmove into /sys/src/libip/parseip.c and recompile libip
    > and then recompile also /sys/src/libc


    I can't see why this should have been necessary - libc contains memcpy
    already. I have just updated /n/sources/xen/xen3 so it compiles with
    the current Plan 9 kernel source (using Xen 3.0.2). I made the other
    changes you listed, but I didn't have to do anything about memcpy.

    > I moved the kernels to the Xen machine but all of them crashes just after the message
    > "Started domain plan9"
    >
    > Am I missing something?


    The present Plan 9 xen kernel works with Xen 3.0.x; you said you are using Xen 3.2.0.
    Xen is not known for the consistency of its interfaces from one release to the
    next, so it is quite possible that some rewriting needs to be done on the Plan 9
    side to deal with changes in Xen semantics.

    Have you enabled verbose debugging messages on the Xen console? You should see
    some indication of why the plan9 guest crashed.


  5. Re: [9fans] Xen and new venti

    > I can't see why this should have been necessary - libc contains memcpy
    > already. I have just updated /n/sources/xen/xen3 so it compiles with
    > the current Plan 9 kernel source (using Xen 3.0.2). I made the other
    > changes you listed, but I didn't have to do anything about memcpy.


    the reason it's necessary is that although the kernel links against the
    c library, it does not include libc.h. this is very much on purpose as
    not every function in libc is safe for use in the kernel.

    in this case, the definition for memcpy was likely not picked up in
    portfns.h so the linker couldn't find the proper function.

    - erik


+ Reply to Thread