Introduction
Some electronic devices need to use CDR as storage media, and you have to append several files each time before the space is used out. In this case, UDF is a good solution, since for each writing, only 7 logic blocks of overhead are used. (Multisession CDs use several minutes for each session's leadout)
How to use the demo
(You need WNASPI32.dll to run the demo, which could be downloaded from Ahead.)
- Select the CDR drive you want to write to.
- Insert a blank disc, "Format" it.
- Browse to select files, and write to the disc. (Now you can view the files using DirectCD).
- You can list the content of the CDR, and restore files to hard disk
- Close Session, now any CD drive can read it..
How to use the source code
SCSI2 m_drive;
m_drive.SCSISelectDevice(m_HA,m_ID,m_LUN);
m_drive.FormatDisc("VOL1");
m_drive.WriteFiles("Test1.bmp");
m_drive.CloseSession();
Some useful functions
SCSIRead() WritePacket() ReadTrackInfo() ReadDiskInfo() TestUnitReady() LoadUnload() SetWriteParameters() SCSISetSpeed() ListFiles() SaveFileAs()
If you want to know more inside stuff
Things you need to have:
- SCSI command block structure (ANSI X3.131-1994)
- SCSI multimedia commands-2 (ANSI NCITS 333-2000)
- OSTA specs: ECMA-167, Universal Disk Format Specification, ECMA-119
Things you need to know:
- SCSI2 block command structure
- Use of ASPI
- Concepts about CDR: track, session, logical blocks, PMA, ATIP, TOC, write modes...
- UDF(Volume structure, file system)
More info at my website.
Revision History
- Ver 1.01
- More comments, some code clean up
- New function:
ListFiles()
- New function:
SaveFileAs()
- Ver 1.02
- Some changes on the demo application