Proc directory on CompactFlash - Embedded

This is a discussion on Proc directory on CompactFlash - Embedded ; Hi, I want to build a small RTLinux system on a CompactFlash, but don't know what to do with the /proc directory. I think I'm supposed to put the /tmp directory on a TMPFS in ram to avoid wearing out ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Proc directory on CompactFlash

  1. Proc directory on CompactFlash

    Hi,

    I want to build a small RTLinux system on a CompactFlash, but don't know
    what to do with the /proc directory.

    I think I'm supposed to put the /tmp directory on a TMPFS in ram to avoid
    wearing out the flash device too quickly.

    I've heard of the contents of /proc being referred to as 'virtual'. Does
    that mean they are not actually stored on disk and can then be forgotten
    about? Otherwise, if the contents of /proc really are files stored on a
    disk, then do I do the same thing with the /proc directory as the /tmp
    directory?

    Regards,
    Murray R. Van Luyn.



  2. Re: Proc directory on CompactFlash

    Murray R. Van Luyn schrieb:

    > I want to build a small RTLinux system on a CompactFlash, but don't know
    > what to do with the /proc directory.
    >
    > I think I'm supposed to put the /tmp directory on a TMPFS in ram to avoid
    > wearing out the flash device too quickly.
    >
    > I've heard of the contents of /proc being referred to as 'virtual'. Does
    > that mean they are not actually stored on disk and can then be forgotten
    > about? Otherwise, if the contents of /proc really are files stored on a
    > disk, then do I do the same thing with the /proc directory as the /tmp
    > directory?



    Only the /proc directory itself should exist (empty) on your root drive.
    Then say "mount -t proc proc /proc" somewhere in your startup or put the
    equivalent line in /etc/fstab if you have that.

    The *contents* of /proc are created directly by the kernel whenever it's
    accessed - reading a file in proc really connects your user space
    program directly to some kernel function that produces its content
    on-the-fly. Same for writing - your process gets connected to some
    kernel function that takes the data from your application and does
    something with it.

    So except for the top /proc directory itself, nothing in /proc exists on
    any disk.

    --
    Linards Ticmanis

  3. Re: Proc directory on CompactFlash

    Thanks Linards. That explains everything nicely.

    Regards,
    Murray R. Van Luyn.

    "Linards Ticmanis" wrote in message
    news:44a5a339$0$29136$9b4e6d93@newsread4.arcor-online.net...
    > Murray R. Van Luyn schrieb:
    >
    >> I want to build a small RTLinux system on a CompactFlash, but don't know
    >> what to do with the /proc directory.
    >>
    >> I think I'm supposed to put the /tmp directory on a TMPFS in ram to avoid
    >> wearing out the flash device too quickly.
    >>
    >> I've heard of the contents of /proc being referred to as 'virtual'. Does
    >> that mean they are not actually stored on disk and can then be forgotten
    >> about? Otherwise, if the contents of /proc really are files stored on a
    >> disk, then do I do the same thing with the /proc directory as the /tmp
    >> directory?

    >
    >
    > Only the /proc directory itself should exist (empty) on your root drive.
    > Then say "mount -t proc proc /proc" somewhere in your startup or put the
    > equivalent line in /etc/fstab if you have that.
    >
    > The *contents* of /proc are created directly by the kernel whenever it's
    > accessed - reading a file in proc really connects your user space
    > program directly to some kernel function that produces its content
    > on-the-fly. Same for writing - your process gets connected to some
    > kernel function that takes the data from your application and does
    > something with it.
    >
    > So except for the top /proc directory itself, nothing in /proc exists on
    > any disk.
    >
    > --
    > Linards Ticmanis




  4. Re: Proc directory on CompactFlash

    Murray R. Van Luyn wrote:

    > I want to build a small RTLinux system on a CompactFlash, but don't know
    > what to do with the /proc directory.
    >
    > I think I'm supposed to put the /tmp directory on a TMPFS in ram to avoid
    > wearing out the flash device too quickly.
    >
    > I've heard of the contents of /proc being referred to as 'virtual'. Does
    > that mean they are not actually stored on disk and can then be forgotten
    > about? Otherwise, if the contents of /proc really are files stored on a
    > disk, then do I do the same thing with the /proc directory as the /tmp
    > directory?
    >


    May be all root (/) system put in RAM or only / and /usr leave on CF

    This my example:

    #mount -t ext2 /dev/hdc /mnt/cflash

    #cd /mnt/cflash
    #ls

    boot/
    usr/
    var/

    #cd boot/ && ls

    grub/
    vmlinuz
    initrd.gz

    boot/ - kernel, initrd image - root system include /proc, /sys, /tmp
    /bin, /sbin, /lib, /dev
    usr/ - all users application
    var/ - variable data


    ------------------------
    Ex. 2

    mount -t tmpfs none /tmp -o rw
    mkdir -p /tmp/proc
    mount -t proc none /tmp/proc -o rw
    ln -s /tmp/proc /proc

+ Reply to Thread