> 
> Hopefully, someone more expert can tell us both exactly what the new-style
> way of setting aside a RAMdisk is...?  And how it to address it to read and
> write to it.  

RAMDISKS are not set aside statically, that would be quite a waste, the RAMDISK
resides in buffer cache, the size you pass to the kernel ither during compilation or 
on the "commandline" is the maximum size the ramdisk can reach , but if you set up a 
filesystem on a ramdisk and don't populate it with files then it will only use a few 
bytes required for the super-block of the fs used .

durinc kernel compilation the ramdisk size can be set

->Block Devices
   -> RAM disk support
      -> Default RAM disk size (4096)

that is if you now boot the kernel and do a simple

mkfs.ext2 /dev/ram0
mkfs.ext2 /dev/ram1
mount -t ext2 /dev/ram0 /ramdisk1
mount -t ext2 /dev/ram1 /ramdisk2

then this filesystem will be 4096K minus the ext2 super-block (about 130K) 
and the lost+found (13K) but it will only take about 145K of physical memmory 
(allocated in buffer cache)

Filesystem           1k-blocks      Used Available Use% Mounted on
/dev/hda5              9770224   1771080   7502832  19% /
/dev/hda1                21929     10502     10295  50% /boot
/dev/ram0                 3963        13      3746   0% /ramdisk1
/dev/ram1                 3963        13      3746   0% /ramdisk2
(assuming a default RAMDISK size set in the kernel of 4096K)

to change the default size of the RAMDISK at system boot ither pass it as a 
commandline parameter at the boot prompt as "ramdisk_size=8192" or put it in
/etc/lilo.conf as

append="ramdisk_size=8192"  
(you are not required to use 2^n but its resonalbe since memory is organized 
in 2^n blocks)

if you initialize a filesystem on /dev/ram0 then you can't directly write to 
it, that is if you treat it as a raw-block device you will corupt any fs on
it. If you want to use it as a raw block-device, and directly write to 
/dev/ram0 then you naturally don't set up a filesystem on it, but I see
littl sense in using a RAMDISK for that, its probably simpler to use
the shared memory API for that (-> mbuff) 

hofrat
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to