Oops in fault.c, Unable to handle kernel paging request at virtualaddress 00000004

Discussion in 'C Programming' started by mattng604@gmail.com, Nov 23, 2007.

  1. Guest

    Hi,

    I am trying to typecast a void* pointer to a structure I defined
    called _sfrdm336_mdb. However, when I try, I get the following error:
    Oops in fault.c, Unable to handle kernel paging request at virtual
    address 00000004 .

    Could you please help me? I'm very stuck! I even tried ioremap() to
    map the physical address kmalloc returns to a virtual address. The
    problem occurs when I try to do the typecast (sFRDM336_MDB *) below:

    /
    ******************************************************************************/
    typedef struct _sfrdm336_mdb
    {
    INT4 errModule; /* Global error Indicator for
    module
    calls */
    UINT2 valid; /* Indicates that this structure
    has been
    initialized */
    eFRDM336_MOD_STATE stateModule; /* Module state; can be one of
    the following
    FRDM336_MOD_START,
    FRDM336_MOD_IDLE or
    FRDM336_MOD_READY */
    UINT2 maxDevs; /* Maximum number of devices
    supported */
    UINT2 numDevs; /* Number of devices currently
    registered */
    UINT2 maxInitProfs; /* Maximum number of
    initialization
    profiles */
    sFRDM336_DDB *pddb; /* (array of) Device Data Blocks
    (DDB) in
    context memory */
    sFRDM336_DIV *pinitProfs; /* (array of) Initialization
    profiles in
    context memory */
    } sFRDM336_MDB;


    sFRDM336_MDB *frdm336Mdb; // TOP OF FILE, public variable

    INT4 frdm336ModuleOpen ()
    {

    frdm336Mdb = (sFRDM336_MDB *) kmalloc(sizeof(sFRDM336_MDB),
    GFP_KERNEL);

    sysFrdm336MemSet(frdm336Mdb, 0, size);

    return 0;

    } /* frdm336ModuleOpen */
    /
    ******************************************************************************/


    Thanks in advance for your help!
    Matt
     
    , Nov 23, 2007
    #1
    1. Advertising

  2. santosh Guest

    Re: Oops in fault.c, Unable to handle kernel paging request at virtual address 00000004

    In article
    <>,
    <> wrote on Saturday 24 Nov 2007
    1:16 am:

    > Hi,
    >
    > I am trying to typecast a void* pointer to a structure I defined
    > called _sfrdm336_mdb. However, when I try, I get the following error:
    > Oops in fault.c, Unable to handle kernel paging request at virtual
    > address 00000004 .
    >
    > Could you please help me? I'm very stuck! I even tried ioremap() to
    > map the physical address kmalloc returns to a virtual address. The
    > problem occurs when I try to do the typecast (sFRDM336_MDB *) below:


    <snip>

    If this kernel has groups devoted to it, please ask there. If you are
    developing this on your own then please ask in
    <news:alt.os.development>.
     
    santosh, Nov 24, 2007
    #2
    1. Advertising

  3. CBFalconer Guest

    santosh wrote:
    > <> wrote:
    >>
    >> I am trying to typecast a void* pointer to a structure I defined
    >> called _sfrdm336_mdb. However, when I try, I get the following
    >> error: Oops in fault.c, Unable to handle kernel paging request at
    >> virtual address 00000004 .
    >>
    >> Could you please help me? I'm very stuck! I even tried ioremap()
    >> to map the physical address kmalloc returns to a virtual address.
    >> The problem occurs when I try to do the typecast (sFRDM336_MDB *)
    >> below:

    >
    > <snip>
    >
    > If this kernel has groups devoted to it, please ask there. If you
    > are developing this on your own then please ask in
    > <news:alt.os.development>.


    No need. A void* pointer is automatically converted to anything.
    Simply have a ponter defined as type "sfrdm336_mdb*" [1] and assign
    the void * to it. All done.

    [1] Note that the initial _ in the type name is not allowed, and
    invades the implementors namespace. This may be the cause of his
    troubles.

    --
    Chuck F (cbfalconer at maineline dot net)
    <http://cbfalconer.home.att.net>
    Try the download section.



    --
    Posted via a free Usenet account from http://www.teranews.com
     
    CBFalconer, Nov 24, 2007
    #3
  4. Re: Oops in fault.c, Unable to handle kernel paging request at virtual address 00000004

    On Fri, 23 Nov 2007 11:46:20 -0800 (PST), wrote:

    >Hi,
    >
    >I am trying to typecast a void* pointer to a structure I defined


    It is never necessary to cast a void* to another pointer to object
    type. Your problem lies elsewhere.

    >called _sfrdm336_mdb. However, when I try, I get the following error:


    You have a struct tag named _sfrdm336_mdb but your struct type is
    either sFRDM336_MDB or struct _sfrdm336_mdb, never plain
    _sfrdm336_mdb.

    >Oops in fault.c, Unable to handle kernel paging request at virtual
    >address 00000004 .


    It would be nice if you told us whether this was a compile time, link
    time, or run time message.

    >
    >Could you please help me? I'm very stuck! I even tried ioremap() to
    >map the physical address kmalloc returns to a virtual address. The
    >problem occurs when I try to do the typecast (sFRDM336_MDB *) below:


    No it doesn't.

    >
    >/
    >******************************************************************************/
    >typedef struct _sfrdm336_mdb
    >{
    > INT4 errModule; /* Global error Indicator for
    >module
    > calls */
    > UINT2 valid; /* Indicates that this structure
    >has been
    > initialized */
    > eFRDM336_MOD_STATE stateModule; /* Module state; can be one of
    >the following
    > FRDM336_MOD_START,
    >FRDM336_MOD_IDLE or
    > FRDM336_MOD_READY */
    > UINT2 maxDevs; /* Maximum number of devices
    >supported */
    > UINT2 numDevs; /* Number of devices currently
    >registered */
    > UINT2 maxInitProfs; /* Maximum number of
    >initialization
    > profiles */
    > sFRDM336_DDB *pddb; /* (array of) Device Data Blocks
    >(DDB) in
    > context memory */
    > sFRDM336_DIV *pinitProfs; /* (array of) Initialization
    >profiles in
    > context memory */
    >} sFRDM336_MDB;
    >
    >
    >sFRDM336_MDB *frdm336Mdb; // TOP OF FILE, public variable
    >
    >INT4 frdm336ModuleOpen ()
    >{
    >
    > frdm336Mdb = (sFRDM336_MDB *) kmalloc(sizeof(sFRDM336_MDB),
    >GFP_KERNEL);


    Since kmalloc is not a standard function, you will probably get much
    better advice in a newsgroup devoted to whatever system it is provided
    with.

    >
    > sysFrdm336MemSet(frdm336Mdb, 0, size);
    >
    > return 0;
    >
    >} /* frdm336ModuleOpen */
    >/
    >******************************************************************************/
    >
    >
    >Thanks in advance for your help!
    >Matt



    Remove del for email
     
    Barry Schwarz, Nov 24, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. yogesh
    Replies:
    3
    Views:
    612
    Kenny McCormack
    Feb 12, 2006
  2. Ram Krishna Tripathi

    Error :-Unable to handle request without a valid action parameter.

    Ram Krishna Tripathi, Apr 27, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    373
    Ram Krishna Tripathi
    Apr 27, 2006
  3. Ross Bamford

    Oops, my fault...

    Ross Bamford, Nov 28, 2005, in forum: Ruby
    Replies:
    0
    Views:
    103
    Ross Bamford
    Nov 28, 2005
  4. Replies:
    3
    Views:
    188
  5. Lars Gierth
    Replies:
    6
    Views:
    244
    David Masover
    Mar 20, 2010
Loading...

Share This Page