Rashmi Balasubramanyam wrote:
Hi.. I am currently doing a project on Virtual tape device along with a couple of my friends at Sun Microsystems. We are trying to simulate the tape device systems which is used in companies to take data backups. The idea is that we should be able to use hard drives/flash drives and make them behave as a tape device. For this we are writing a pseudo tape device driver and using the LDI (Layered Driver Interface) to communicate with the hard disk/ flash disk. The media which we use is abstracted from the pseudo device driver by the LDI interface. We are writing a header which keeps track of the current read and write head and several other data. We should make changes in the header after every read/write/ioctl operation. For this we should perform 'seek' operations on the read/write head of the hard disk to move from the data back up area and the header. Since this is in the kernel level fseek functions will not be of any use. Can anyone kindly help me by suggesting any solu
ti
on to our problem? Thank you in advance, Rashmi Campus Ambassador, BMSCE, Bangalore.
I would strongly recommend *not* writing to the disk in kernel mode.
The way I would handle this is with a userland daemon handling the actual data files. Then you don't have to use LDI at all.
LDI is not really intended for writes to the filesystem... its for layering on top of low level drivers. I don't know for sure that LDI actually works properly for writing through the filesystem.
But again, if you use a userland daemon, you won't have that problem. Plus, you can do some other tricky things. Like have the destination file located on an NFS or iSCSI filesystem or somesuch. I doubt such would work right through LDI.
-- Garrett _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code