Find the answer to your Linux question:
Results 1 to 2 of 2
Hello I want to write data to a physical address of my choice. For it I am writing a driver (just like parallel port driver). In my driver code I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2009
    Posts
    8

    Problem in writing to physical memory through a module


    Hello

    I want to write data to a physical address of my choice. For it I am writing a driver (just like parallel port driver). In my driver code I use check_region() function to check whether the address is free or not. Then I use request_region() to reserve that address for my driver. When the driver is loaded using insmod, it is loaded successfully (i-e the address is reserved for my driver). The corresponding /dev/<filename> opens successfully but when I write to the /dev/<filename>, I get segmentation fault.

    Where can the problem be?

    If an address has been reserved for me, I should be able to write on it. But I can not write.

    Kindly give me some clue.

    Regards

    Atif Shabir

  2. #2
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    top reasons for segmentation fault are using uninitialized pointers and dereferencing null pointers, most likely you have a bug in your code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •