Opened 8 years ago

Last modified 8 years ago

#45 new task

Write the physical CD/DVD/hdd/floppy capture code

Reported by: Valery V. Sedletski Owned by:
Priority: minor Milestone: Enhanced
Component: Common Tasks Keywords: physical cd dvd floppy hdd capture
Cc:

Description

At the moment we haven't a possibility to capture physical disks like floppies, CDs/DVDs, hard disks, flash disks. We can only mount an image file, not a physical device. So, need to implement this.

Attachments (3)

cdflop-avail-upd.diff (3.8 KB) - added by Valery V. Sedletski 8 years ago.
Enhanced floppy detection code
host-cdflop.diff (28.5 KB) - added by Valery V. Sedletski 8 years ago.
host CD/floppy attach code
host-cdflop-upd.diff (56.4 KB) - added by Valery V. Sedletski 8 years ago.
Added forgotten VBoxManage changes

Download all attachments as: .zip

Change History (7)

comment:1 Changed 8 years ago by Valery V. Sedletski

Summary: Write the physical CD/DVD capture codeWrite the physical CD/DVD/hdd/floppy capture code

Changed 8 years ago by Valery V. Sedletski

Attachment: cdflop-avail-upd.diff added

Enhanced floppy detection code

Changed 8 years ago by Valery V. Sedletski

Attachment: host-cdflop.diff added

host CD/floppy attach code

comment:2 Changed 8 years ago by Valery V. Sedletski

Added two (yet uncommitted) patches:
1) http://trac.netlabs.org/vbox/attachment/ticket/45/cdflop-avail-upd.diff, update to floppy-detection code, distinguishes between floppies and other media types. Known drawbacks: considers erased CDRW's to be floppies.
2) http://trac.netlabs.org/vbox/attachment/ticket/45/host-cdflop.diff, host CD/floppy attach code. Opens/writes/reads/ejects/locks/unlocks door on the CD/floppy on the host computer. Known bugs: a) floppy performance is poor, because it VBox asks for 1 sector at a time. Need to try reading by 1 track at a time b) it traps sometimes when floppy is inserted, on some VM's c) traps rarely in pmmerge, probably, because of stack corrupting d) erases CDRW successfully, but I still have got a trap when trying to write ISO to CDRW in Nero in guest winxp e) no way to read DVD's with CDFS filesystem, they are considered to be CD's, so incorrect "cooked" 2048 byte-sector offset inside "raw" 2352 byte-sector. Need to find the way to distinguish between CD and DVD.

Last edited 8 years ago by Valery V. Sedletski (previous) (diff)

comment:3 Changed 8 years ago by Valery V. Sedletski

Added the new version of Host CD/floppy/HDD capture patch: http://trac.netlabs.org/vbox/attachment/ticket/45/host-cdflop-upd.diff. Now Floppy and CD/DVD opens in guest OS-es. But 1) floppy performance is still poor and VBox gets trapped if ERROR_SECTOR_NOT_FOUND error occurs. Need to process such errors. 2) CD/DVD direct access ("Passthrough" checkbox in CD settings) partially works. At least, CD/DVD is seen by guest OS, but some SCSI commands fail. For example, you can start Nero Burning ROM in windows and try burning the CDRW. CDRW erase works fine, but write of an ISO image is kinda, working. I.e., it reports that progress is ok and CD burned successfully, but does nothing. CD writing just fails, but Nero does not check error codes. So this still needs to be worked out. 3) You can add the host harddisks to your VM's. For that, you need to create the raw VMDK file and add it to a VM configuration. To create it, use VBoxManage command:

VBoxManage internalcommands createrawvmdk -filename somefile.vmdk -rawdisk w:

It will add the disk with a drive letter w: to somefile.vmdk. You can also add the whole physical disk by its number, followed by colon:

VBoxManage internalcommands createrawvmdk -filename somefile.vmdk -rawdisk 2:

Also, you can use \\.\Physical_Disk# or \\.\w: to use raw filesystem option (disk is read via DosRead? instead of DosDevIOCtl and opened without OPEN_FLAGS_DASD). But this doesn't work with current os2dasd.dmd. It will just trap in os2dasd trying to open \\.\Physical_Disk# or give ERROR_LONGLOCK on DosRead? at some point if opening \\.\w:. IBM added this option without even checking if it works really. So, this needs os2dasd or others disk drivers to be repaired to be working. But this case is supported.

Also, in windows, there exist the possibility to open \\.\DiskNPartitionM, i.e., open partition by disk number and partition number, without assigned drive letter. We haven't such option on OS/2, so letting the VM to see a subset of a hard disk partitions (not a single partition and not all partitions) is currently impossible (If we will not try to convert M and N to a drive letter).

Last edited 8 years ago by Valery V. Sedletski (previous) (diff)

comment:4 Changed 8 years ago by Valery V. Sedletski

PS: Strange, but adding the raw .vmdk to a VM causes VM to fail if trying to start it from the command line ("no such VM"), but it starts successfully if VM is started from the selector window. This is a known problem.

Changed 8 years ago by Valery V. Sedletski

Attachment: host-cdflop-upd.diff added

Added forgotten VBoxManage changes

Note: See TracTickets for help on using tickets.