add a driver to minix3? - Minix

This is a discussion on add a driver to minix3? - Minix ; Hi men, I want to add a driver to minix3. 1. Write a simple driver. 1) touch a C source file: int main() { while(1); } and compile it to a.out. 2) add the belows to /etc/driver.conf: driver a.out { ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: add a driver to minix3?

  1. add a driver to minix3?

    Hi men,

    I want to add a driver to minix3.

    1. Write a simple driver.
    1) touch a C source file:
    int main() { while(1); }
    and compile it to a.out.

    2) add the belows to /etc/driver.conf:
    driver a.out {
    uid 0;
    };

    3) run 'service up /root/a.out'

    It works! But I can't shutdown it. If I run 'service down 191' (191 is
    a.out's pid), it says:
    "Request to RS failed: No such process (error 3)"
    I do not know why.

    2. I want to write a test more like a driver (using /usr/src/driver/
    libdriver/libdriver.a)

    1)touch a file (test.c):
    #include "driver.h"
    struct driver test;
    char * get_name()
    {
    static char name[] = "test";
    return name;
    }
    int main(int argc, char *argv)
    {
    test.dr_name = get_name;
    driver_task(&test);
    return 0;
    }

    And I compile it as: 'cc -I /usr/src/driver/libdriver/ test.c -o
    test.o'
    But it went wrong:
    Undefined:
    _driver_task

    I do not why the "struct driver" works well, but the "driver_task"
    dosen't.


    Thanks,
    Wu

  2. Re: add a driver to minix3?


    >
    > And I compile it as: 'cc -I /usr/src/driver/libdriver/ test.c -o
    > test.o'
    > But it went wrong:
    > Undefined:
    > _driver_task
    >


    I compile it as 'cc -c -I /usr/src/driver/libdriver/ test.c -o test.o'.

  3. Re: add a driver to minix3?


    I compile it as: cc -c -I /usr/src/drivers/libdriver/ test.c -o
    test.o
    and link it as: cc -i -L/usr/src/drivers/libdriver/ test.o -o test -
    lsysutil -lsys -ltimers -ldriver

    compile succeeded. But the link failed:
    Undefined:
    _sys_umap
    _sys_vircopy
    ....

    Would you like to tell me how to link ?

    Thanks,
    Wu

  4. Re: add a driver to minix3?

    On 06/10/08 03:19, wubingzheng wrote:

    > Would you like to tell me how to link ?


    You can find example on how to compile and link drivers at
    http://giovanni.homelinux.net/elopment/index.html

    Ciao
    Giovanni
    --
    A computer is like an air conditioner,
    it stops working when you open Windows.
    Registered Linux user #337974 < http://giovanni.homelinux.net/ >

  5. Re: add a driver to minix3?

    > > Would you like to tell me how to link ?
    >
    > You can find example on how to compile and link drivers at
    > http://giovanni.homelinux.net/elopment/index.html


    I suppose this is about developing rather than eloping? This seems to
    be the correct URL:

    http://giovanni.homelinux.net/development/index.html

    --
    With kind regards,
    Erik van der Kouwe

  6. Re: add a driver to minix3?

    On 06/10/08 10:05, Erik van der Kouwe
    >>> Would you like to tell me how to link ?

    >> You can find example on how to compile and link drivers at
    >> http://giovanni.homelinux.net/elopment/index.html

    >
    > I suppose this is about developing rather than eloping? This seems
    > to be the correct URL:
    >
    > http://giovanni.homelinux.net/development/index.html

    Oh yes. the 'd' slipped out in pasting the url :-)

    Ciao
    Giovanni
    --
    A computer is like an air conditioner,
    it stops working when you open Windows.
    Registered Linux user #337974 < http://giovanni.homelinux.net/ >

+ Reply to Thread