LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-20-2006, 02:44 AM   #1
nilathinesh
Member
 
Registered: Nov 2006
Distribution: Fedora 7 & 9, Ubuntu
Posts: 41

Rep: Reputation: 15
Question Is mount refers to setting under some file system ...


Hai All,

I am Newbie to Linux.. and i am not clear with the mount of the device..

"The program will be made accessible to NVRAM through mtd-device only. "

From the above statment,
the NVRAM is made to mounted.. Is this means to bring the NVRAM into the FileSystem (some ext2, JFFS, YAFFS ...)

Please clarify this ...

Hence please explain What mounting refers...

Also can you refer some materials thru which i could get more info on mounting devices...

Thanks
 
Old 12-20-2006, 04:28 AM   #2
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
As far as I know, mtd stands for "Memory Technology Device", not "mounted".

Where does that message come from?
 
Old 12-20-2006, 06:16 AM   #3
alexander_bosakov
Member
 
Registered: Mar 2006
Location: Plovdiv, Bulgaria
Distribution: OpenSuse 11.3
Posts: 55

Rep: Reputation: 15
NVRAM stands for "Non Volatile RAM", or, more familiar, so called CMOS. It's used mainly by BIOS, not a thing you want to mess about without knowing what you are doing. "/dev/nvram" is the interface to use this memory, it has nothing to do with the 'mount'. As <zhangmaike> pointed above, MTD is "Memory Technology Device" - flash and RAM chips, etc. What exactly are you trying to do?
 
Old 12-20-2006, 07:35 AM   #4
nilathinesh
Member
 
Registered: Nov 2006
Distribution: Fedora 7 & 9, Ubuntu
Posts: 41

Original Poster
Rep: Reputation: 15
Thanks zhangmaike and alexander_bosakov!

Actually,

From your
Quote:
NVRAM stands for "Non Volatile RAM", or, more familiar, so called CMOS. It's used mainly by BIOS, not a thing you want to mess about without knowing what you are doing. "/dev/nvram" is the interface to use this memory, it has nothing to do with the 'mount'. As <zhangmaike> pointed above, MTD is "Memory Technology Device" - flash and RAM chips, etc. What exactly are you trying to do?
I understand that... each of the devices, either it can be NVRAM, USB or some other I/O device.. it has to be mounted with the Linux system so that it could be accessible... Is am correct !

If i am corect then (NVRAM will be mounted as /dev/nvram..) can we access data from NVRAM as like file access in linux using... /dev/nvram.. Or we need additional File System to access these NVRAM content.. (I considerd here Flash as NVRAM)..

Please clarify my doubt.. Thanks a lot again..

zhangmaike.. actually i got this from my professor who guides me for doing embedded programming on Linux.. now i am involving programing with linux to NVRAM content read/write. (Also, I am not sure NVRAM refers to Flash or EEPROM !).. Anyway Thanks then ...:-)
 
Old 12-20-2006, 09:10 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
I think you can access any device listed in /dev using low-level routines such as dd. (Works for /dev/nvram)
Mounting relates to connecting a device to the filesystem tree to allow access with--eg--the file manager

I can read nvram with dd--piped to hexdump -C. I get 114 bytes--does that make sense?
 
Old 12-20-2006, 12:07 PM   #6
alexander_bosakov
Member
 
Registered: Mar 2006
Location: Plovdiv, Bulgaria
Distribution: OpenSuse 11.3
Posts: 55

Rep: Reputation: 15
Quote:
I understand that... each of the devices, either it can be NVRAM, USB or some other I/O device.. it has to be mounted with the Linux system so that it could be accessible... Is am correct !

If i am corect then (NVRAM will be mounted as /dev/nvram..) can we access data from NVRAM as like file access in linux using... /dev/nvram.. Or we need additional File System to access these NVRAM content.. (I considerd here Flash as NVRAM)..
"mount" is only for so called block devices, if they contain file system supported by the kernel. Eg. /dev/hda1 or /dev/fd0. "/dev/nvram" is a character device, like "/dev/tty", "/dev/null" or "/dev/dsp". I'm not certain how exactly it must be used, but it's not a file system. Character devices are accessible one byte at a time, while block, as name implies, are read and writen with blocks of data of fixed sizes. Disk drives for example address whole sectors, not single bytes, so their device files are of type "block". BTW, the files in /dev are not the mountpoints. 'Mount'ing, as mentioned above, attaches a file system (represented by some block device file) under some directory, eg. /dev/fd0 on /mnt/floppy, so files and directories on the diskette are now subdirectories under /mnt/floppy/. this can be done with the command:
$ mount -t vfat /dev/fd0 /mnt/floppy
In that particular case, /mnt/floppy is the so called 'mountpoint' and it's the place where you browse the files on the diskette. type 'mount' without arguments, and it will list all mounted filesystems, eg., on my system:

$ mount
/dev/hda1 on / type ext3 (rw)
none on /proc type proc (rw)
none on /proc/bus/usb type usbfs (rw)
none on /sys type sysfs (rw)
/dev/hda7 on /home type ext3 (rw,nosuid)
/dev/hda6 on /usr type ext3 (rw)
/dev/hdc on /mnt/cdrom type iso9660

Here '/dev/hda1' is the device corresponding to the first partition on my hard disk. It's mounted on '/' - the root directory, this partition is my root filesystem, containing '/boot', '/bin','/dev' etc. But it does not contain the files _under_ '/home', '/usr' (contains the directories themselves, not their content) - they reside on another partitions: hda7 and hda6 respectively. '/proc' and '/sys' are virtual filesystems, they do not have coresponding device file (none on /proc type proc (rw)). At the end of the list, /dev/hdc corresponds to the second IDE, master, where my CD is connected. It's mounted under /mnt/cdrom and files on it are accessible in this directory. BTW, the directories under the '/mnt' are the conventional place for mounting removable media. If you read the device file directly, you can make exact image of the device,byte by byte, with the 'dd' command, eg.
$ dd if=/dev/fd0 of=./floppy.img
and then make exact copy of the diskette
$ dd if=./floppy.img of=/de/fd0

Quote:
I think you can access any device listed in /dev using low-level routines such as dd. (Works for /dev/nvram)
Mounting relates to connecting a device to the filesystem tree to allow access with--eg--the file manager

I can read nvram with dd--piped to hexdump -C. I get 114 bytes--does that make sense?
As far as I know - it makes sence, the bytes count is correct. As for "dd" - it simply copies number of bytes from what you specified after if= to of= - you can realy use it on most devices, though not all - eg. the ALSA driver devices in /dev/snd can't be read this way. When you want just to read some data, you can often use 'cat' instead of 'dd', you can, for example:
$ cat /dev/dsp > file
speak into your microphone, hit Ctrl-C, then
$ cat file > /dev/dsp
 
Old 12-21-2006, 03:46 AM   #7
nilathinesh
Member
 
Registered: Nov 2006
Distribution: Fedora 7 & 9, Ubuntu
Posts: 41

Original Poster
Rep: Reputation: 15
Hello All...

Thanks allot for your great replies.. these things are making me to learn more on LINUX..

for sure i will be ... Need all your support always.. then..:-) thanks to LinuxQuestions.org also.

From alexander_bosakov
Quote:
"mount" is only for so called block devices, if they contain file system supported by the kernel. Eg. /dev/hda1 or /dev/fd0. "/dev/nvram" is a character device, like "/dev/tty", "/dev/null" or "/dev/dsp". I'm not certain how exactly it must be used, but it's not a file system. Character devices are accessible one byte at a time,
Does this mean we could not access EEPROM (the character based device) thru the File system..Is there any file system that could do the same, What else i should do to access EEPROM through programming..

I think i need to use basic lowlevel command for accessing the device


From Pixellany

Is the DD command can be used in C program to access the devices..

Here from your quote

Quote:
I can read nvram with dd--piped to hexdump -C. I get 114 bytes--does that make sense?
you mean to say you could read whole contents 114 bytes from the NVRAM, without knowing the lowlevel device codes...

Thanks to you all then...

Now i got a understanding with Mounting.. once again thanks to
alexander_bosakov for detail explaination...
 
Old 12-21-2006, 08:31 AM   #8
alexander_bosakov
Member
 
Registered: Mar 2006
Location: Plovdiv, Bulgaria
Distribution: OpenSuse 11.3
Posts: 55

Rep: Reputation: 15
Quote:
Does this mean we could not access EEPROM (the character based device) thru the File system..Is there any file system that could do the same, What else i should do to access EEPROM through programming..
Well, you can simply access it the way you access any other file - "open()", "read()/write()", "close()" the "/dev/nvram". This is what "dd" does. What I mean above, is simply that the data you get from the /dev/nvram is not a filesystem image. What mount does is to tell the kernel that the data from some source is filesystem data, and where in the directory tree it must be accessible. You can read as a regular file your hard disk device file, for example, and you'll get the drive image. You can also write to it, but should I explain why raw writing directly to disk is generaly a bad idea?. Exept the case you write an image, as I gave an example with the floppy drive in the previous post. A litlle clarification: speaking of "devices", I mean the visible to the user interface of the driver, not the hardware. The kernel developers decided to make a character device driver for accessing the CMOS data, called it nvram, and made the data visible in the /dev/nvram file, thats all. You can always make a driver to access this piece of hardware by other ways, but we are not speaking of nvram anymore.
 
Old 12-21-2006, 08:57 AM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by nilathinesh
From Pixellany
Is the DD command can be used in C program to access the devices..

you mean to say you could read whole contents 114 bytes from the NVRAM, without knowing the lowlevel device codes...
(I think) you can call shell commands from C--not sure how exactly. You can certainly put them in shell scripts....But, no matter: The C libraries and headers will have all the stuff you need to do the equivalent of DD.

Actually, if you look at the source code for DD, you might find everything you are looking for.

Not sure what you mean by "lowlevel device codes"---to bash, /dev/nvram is the low-level address
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read .chm file in fedora, can't mount ntfs file system ishti_du Linux - Newbie 12 03-06-2007 04:27 AM
Mounting file system in a file with mount Denes Programming 6 11-11-2005 01:04 PM
cannot mount the local file system egypt Red Hat 2 10-06-2004 12:02 PM
Cannot Mount File System slappycakes Linux - Hardware 18 10-13-2003 11:33 AM
mount the ntfs file system jdevanand Linux - General 3 01-22-2002 02:25 PM


All times are GMT -5. The time now is 11:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration