i am trying to write a device driver for my gps module. somehow the linux os when loaded to my arm board have /dev directory read only. when i try to do a "vi /dev/gps" it says file is read only.

due to this reason my application program can't open the /dev/gps.

Anybody know what is the problem here. May be i am too vague.

  • 2
    You are doing this as root, right? What is the output of mount? – Faheem Mitha Apr 4 '11 at 15:37
  • Have you mounted devfs yet? Do you run a with a read-only root filesystem? Why on earth are you trying to run an editor on the device file? – Gilles 'SO- stop being evil' Apr 4 '11 at 18:42
  • 1
    You can't run a text editor against a character device. You might be able to run it against a block device like /dev/fd0 as I have done in the past, but that will read in the whole block device (floppy in this case) into memory and the text editor may still have issues reading/writing. For a character device, try using cat to monitor it's output. That works with my GPS. – penguin359 Apr 6 '11 at 4:07
  • 1
    Also, post the output of id, ls -l /dev/gps, and ls -lL /dev/gps if you can. – penguin359 Apr 6 '11 at 4:09

Running ls -l /dev/gps will show you the actual permissions on the device file (probably not read-only).

Seeing as this is in fact a device file, you won't be able to open it in a text editor (for obvious reasons).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.