Add CD-ROM emulation to CTL
Student : Neeraj Rawat
Mentor : Edward Tomasz Napierala
CTL is the FreeBSD SCSI target layer. SCSI is a storage protocol. There are various SCSI commands, but it's usually used for block-level access. This projects focuses on making CTL capable of emulating CD/DVD ROM, which means following three things : 1) Implementing virtual CD-ROM. 2) Implementing virtual tape. These two includes storing CD/DVD or tape content. In SCSI, the initiator stack is called as CAM in FreeBSD. The target stack is called as CTL in FreeBSD. Initiator passes commands(iSCSI) command to target where it gets executed.
Approach to solving the problem
CTL target layer is implemented for Disk and processor emulation. It needs to get extended so that it could emulate cd rom also. If require ctl.conf will also be extended so that ctld could parse disk lun and cd lun differently, for this ctld package has to be extended too. Just like Disk emulation is represented by T_DIRECT "lun type" in ctl code. It requires a code for T_CDROM lun type to be added in ctl package. SCSI cd code is already there. Only ctl needs modification so that lun in it could represent itself as cd lun.
Deliverables are as following:
Deliverable-1 : Implementing virtual CD/DVD emulation on CTL, this part includes making CTL capable of reading from and storing content to virtual disk.
Deliverable-2 : Implementing virtual tape emulation on CTL, this part includes making CTL I capable of reading from and storing content to virtual tape
25 May - 15 June : Getting familiar with the CTL code, SCSI commands, going through document. Implementing SCSI commands, required to read data from DVDs and identify the virtual device as DVD
15 June - 26 June : extend CTL backend API to make it possible to access multiple data streams on DVD through CTL backend
26 June - 3 July : Mid Term Evaluation
3 July - 13 July : add CTL backend, capable of storing multiple data streams per LUN
13 July - 20 July : implementing SCSI commands, required to read data from tapes and identify the virtual device as tapes
20 July - 2 August : extend CTL backend API to make it possible to access multiple data streams on tape through CTL backend
2 August – 17 August : add CTL backend, capable of storing multiple data streams per LUN for tape
17 August - 21 August : Scrub code, documentation
Code Repository https://github.com/neerajrawat/freebsd
1. CTLD code is modified so that it could take disk lun and cd lun.
in ctl.conf , one more field is added in lun specification. "device-type <device>" . This field tells what type of device lun is storing. eg, device-type "disk"/"cd"/"tape" b. kernel.c of CTLD will read the parsed values of lun, and accordingly send the lun request to kernel (CTL) c. In CTL, code for device type T_CDROM has been added along with T_DIRECT device type.
2. READ_TOC code has been added in ctl_cmd_table.c , ctl.c, ctl_private.h and scsi_all.h to support reading the table of content of the CDROM . This is done specially for windows platform. Because without this windows initiator is not able to recognize the file format of the virtual cd drive.
3. Virtual CD ROM working perfectly in freebsd initiator and linux initiator without READ_TOC function also.