23 July 2010

create a ramfs in VxWorks

In Linux:
# mkdir -p /mnt/tmp
# mount -t tmpfs -o size=20m tmpfs /mnt/tmp
# mount
tmpfs on /mnt/tmp type tmpfs (rw,size=20m)

# df -h
tmpfs 20M 0 20M 0% /mnt/tmp
# dd if=/dev/zero of=/mnt/tmp/file bs=1024 count=1024
# df -h
tmpfs 20M 1.1M 19M 6% /mnt/tmp
# mkfs -t ext3 -L "RamDisk 1" /dev/ram0

# mkdir -p /mnt/rd
# mount /dev/ram0 /mnt/rd -t ext3
# mount
/dev/ram0 on /mnt/rd type ext3 (rw)

# df -h
/dev/ram0 3.9M 1.1M 2.7M 29% /mnt/rd
# dd if=/dev/zero of=/mnt/rd/file bs=1024 count=1024
# df -h
/dev/ram0 3.9M 2.1M 1.7M 56% /mnt/rd

In VxWorks:
I hate VxWorks


Reference:
http://www.thegeekstuff.com/2008/11/overview-of-ramfs-and-tmpfs-on-linux
http://www.vanemery.com/Linux/Ramdisk/ramdisk.html

http://www.fys.uio.no/studier/kurs/fys4220/docs/vxworks/guide/index.html
http://www.fys.uio.no/studier/kurs/fys4220/docs/vxworks/guide/c-iosys7.html

No comments:

Post a Comment