1

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.

David
  • 111
  • 2
    You are doing this as root, right? What is the output of mount? – Faheem Mitha Apr 04 '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 04 '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 06 '11 at 04:07
  • 1
    Also, post the output of id, ls -l /dev/gps, and ls -lL /dev/gps if you can. – penguin359 Apr 06 '11 at 04:09

1 Answers1

2

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).

nopcorn
  • 9,559