does anyone have c code for making a ramdisk?

does anyone have c code for making a ramdisk?

Post by Bill Deriscavag » Sat, 21 Jun 1997 04:00:00



HI folks:

 I have an application that passes information via files. I need to speed
up this communication mechanism and still retain a file transfer
interface. One way to do this is via a ramdisk but I don't have the
foggiest idea of how to create one, assign a file name, format,erase,etc.
In other words i need do all the things you do to disks.

1) does anyone know how to make a ramdisk and assign files to it?
2) does anyone have c code to make a ramdisk?

Can someone point me in the "write" direction?

Bill D.

 
 
 

does anyone have c code for making a ramdisk?

Post by Brian McCaule » Tue, 24 Jun 1997 04:00:00



>  I have an application that passes information via files. I need to speed
> up this communication mechanism and still retain a file transfer
> interface. One way to do this is via a ramdisk

Ramdisks don't generally speed things up.  Ramdisks reduce the ammount
of memory available so slow your system down.  Real disks are cached
so just about are as fast as ramdisks for temporary files.

Quote:> 1) does anyone know how to make a ramdisk and assign files to it?

Yes, but I don't think you want to.

Quote:> 2) does anyone have c code to make a ramdisk?

As I recall on Linux you just write zeros to it.

--

 .  _\\__[oo       from       | Phones: +44 121 471 3789 (home)

.  l___\\    /~~) /~~[  /   [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
 # ll  l\\  ~~~~ ~   ~ ~    ~ | http://wcl-l.bham.ac.uk/~bam/


 
 
 

does anyone have c code for making a ramdisk?

Post by James Youngma » Tue, 24 Jun 1997 04:00:00



> 1) does anyone know how to make a ramdisk and assign files to it?

# Make ramdisk
mke2fs /dev/ram1
mkdir /mnt/ramdisk
mount /dev/ram1 -t ext2 /mnt/ramdisk    

# Use ramdisk.
cp foo /mnt/ramdisk

Quote:> 2) does anyone have c code to make a ramdisk?

Not I.
 
 
 

1. Exit code / Error code when making ports

When trying to make a port I get the following:

imake -DUseInstalled -I/usr/X11R6/lib/X11/config
Imakefile.c:3: Imake.tmpl: No such file or directory
imake:  Exit code 33. Stop.
*** Error code 1

Then it quits.

This happens on all the ports I try to make.  I tried it with xsol,
xtetris, xmj  and it's the same everytime.

Anyone have any ideas where I have make my mistake?

Thanks

Bill

2. do_try_to_free_pages failed

3. m$ "lost" the source code for W95, DOS, Q-DOS ?

4. APM on IBM Thinkpad 600

5. Problem upgrading kernel and making initial ramdisk & kernel.

6. telnet

7. making /tmp a ramdisk?

8. How do I get LinuxPPC and Linux Live 4 to reconize my 3d card?

9. Problems making ramdisk boot floppy

10. Making boot-floppy w/ ramdisk as root

11. Seg fault with custom made ramdisk

12. RAMDISK like in DOS?

13. Having trouble making kernel 2.4.2 on a RH6.2 system. . .