cpf_grant_magic - Minix

This is a discussion on cpf_grant_magic - Minix ; hi all! i'll try to talk to "at_wini" from another driver, but it not really works.. mess.m_type = DEV_IOCTL_S; mess.REQUEST = DIOCGETP; size = _MINIX_IOCTL_SIZE(mess.REQUEST); if((*gid = cpf_grant_magic(driver_e,getprocnr(), (vir_bytes)part, size, CPF_READ | CPF_WRITE)) panic(__FILE__, "dm: error: getsize: cpf_grant_direct of vector ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: cpf_grant_magic

  1. cpf_grant_magic

    hi all!

    i'll try to talk to "at_wini" from another driver, but it not really
    works..

    mess.m_type = DEV_IOCTL_S;
    mess.REQUEST = DIOCGETP;

    size = _MINIX_IOCTL_SIZE(mess.REQUEST);

    if((*gid = cpf_grant_magic(driver_e,getprocnr(),
    (vir_bytes)part, size,
    CPF_READ | CPF_WRITE)) < 0) {
    panic(__FILE__,
    "dm: error: getsize: cpf_grant_direct of vector failed", NO_NUM);
    }

    mess.DEVICE = (dev >> MINOR) & BYTE;
    mess.IO_ENDPT = getprocnr();
    mess.IO_GRANT = (char*)gid;
    mess.COUNT = size;
    mess.ADDRESS = (char*)part;

    r=sendrec(driver_e,&mess);

    answer is -22 /* invalid argument */

    any hint what i'm doing wrong here?

    thx,
    markus.


  2. Re: cpf_grant_magic


    one step further:

    -----
    magic grant verify failed: granter (4975488) is not FS (1)
    -----

    so, only FS can magic grant? alternatives?


  3. Re: cpf_grant_magic


    solution is cpf_grant_direct and to not set mess.COUNT


+ Reply to Thread