1. Linux ramdisk for temporary files
I created a 140M ramdisk on my Slackware 3.4 box (2.0.3 Kernel) with
Loadlin 1.6 serveral month
ago. The RamDisk is supposed to hold the video data for broadcasting (
write/read frequently ),
but I switch to mmap after the test for some other reasons. Here are
some of my notes.
1. Set the size(K) of RamDisk in Config.sys for Loadlin. (I am using
Multi-boot for 95/NT/Linux.)
[linux]
shell=c:\loadlin\loadlin.exe c:\loadlin\zimage root=/dev/hda3 ro
mem=192M ramdisk_size=150000
/*
If you use LILO, I think you can set the same kernel command line
parameters in /etc/lilo.conf
In linux kernel image file, 2 bytes (ox01F8, ox01F9) are used to
represent the size of RAMDISK,
so there is a 64M limit for "rdev -r image_file ram_disk_size".
I checked init/main.c, devices/rd.c and LoadLin source code. Size of
Ramdisk is passed as char *
without length limit, and it's eventually converted to int. Until now
I do not find any limit for
using ramdisk_size with loadlin.
*/
2. Reboot, if you are asked for a linux kernel image floppy, press
enter to skip.
3. Zero out ramdisk
pc1849:~# more /proc/meminfo
pc1849:~# dd if=/dev/zero of=/dev/ram0 bs=1k count=140000
140000+0 records in
140000+0 records out
4. Write inode tables, superblocks and filesystem accounting
information in ramdisk.
pc1849:~# mke2fs -m 0 /dev/ram0
5. Mount the RamDisk
pc1849:~# mount -t ext2 /dev/ram0 /mnt/ram1
6. Check it
pc1849:~# df
Filesystem 1024-blocks Used Available Capacity Mounted on
/dev/hda3 517145 281654 208779 57% /
/dev/hda1 717472 558160 159312 78% /nt
/dev/ram0 145230 13 145217 0% /mnt/ram1
pc1849:~# cp Giant /mnt/ram1/
Because I tried it on an old machine with 64M limit of L2cache
cacheable,
I did not run a performance test. But I think it should be much better
than
mmap( ... MAP_SHARED ... ).
Happy Hacking.
Junyi Sun
Computer Science & Engineering Dept.
Arizona State University
2. Atlanta Sun Job 62K to 124K
3. To use temporary files or not to use temporary files?
4. fix IKCONFIG compile in 2.5.10-dj1 for non-modular kernels
5. Adding text to the top of a file without using temporary files
6. Problem: Matrox G200 AGP 2X (from Vectra PIII vei8) onboard | Xfree 3.3.6 | RedHat 6.2 | HP Monitor 15' D8895A
7. IE's Temporary Internet Files: rescue or converting to Linux?
8. Trouble with Apache2.0.43 on FreeBSD4.3
9. ramdisk for linux: mount /ramdisk
10. secure temporary file creation/usage
11. Temporary files?
12. Temporary Password File
13. qpopper: "Can't open temporary file, do you own it?"