ATAPI CD Burning ================ Overview -------- Ok. So you want to burn a CD in freeBSD with an ATAPI burner. In this document, I'll be discussing CD burning in freeBSD 4.0 only, as this has now changed wormcontrol, to a new program burncd, the only program to my knowledge that can write CDs via an ATAPI burner in 4.0. Also, if youve read docs for cdrecord, cdrdao, etc which say that they too work with atapi devices - they in fact dont. This requires linux and some crafy SCSI emulation that isn't possible under freeBSD. In my kernel, I have nothing special that allows me to burn CDs. All I have in regards to the atapi interface is: device ata device atadisk # ATA disk drives device atapicd # ATAPI CDROM drives You can add atapi support for LS-120 drives etc, too. Notice I haven't included 'ATA_ENABLE_ATAPI_DMA' as this can be problematic with my burner. Creating & Burning a data CD ---------------------------- For this part I'm going to assume you're making a new CD, and not copying one (otherwise see copying CDs). burncd itself doesnt actually create the filesystem, so you need to create that first. Assuming you have your directory of files which you want to write to the cd, you then need to use mkisofs (Make ISO filesystem) to create an image of these, and then pass that image to burncd to create. If you havent done so already, install mkisofs from /usr/ports/sysutils/mkisofs/. Create your image by typing: mkisofs -r -o image.iso files_to_write/ This creates the .iso image of the directory or files you want on the CD. To burn the cd, simply type: # burncd -f /dev/acd1c -s X data image.iso fixate where -f is your atapi cd writer, and where X is the speed of your burner. Copying another CD ------------------ Copying CD to CD is slightly different, and this only works for data cds - not audio. Instead of making an iso of the cd, where information like boot sectors (if applicable) could be lost, we need to dump the cd to a file. Now, after you've gained copyright permission to copy the disc, *heh heh* type: cat /dev/acd1c > /usr/tmp/mybig.dump Beware this can eat alot of space, depending on the size of the CD, so be prepared, and make sure you have enough space beforehand. This should have dumped the contents of the cd to a file, but how do we know if it works? o Testing your cd dump (you can skip this if you really want to) -------------------------------------------------------------- Ok, for this we weill need some more kernel options, that will let us mount a file as a device. Compile you kernel with this option: pseudo-device vn # allow mounting of files (eg .iso) after rebooting, you can test to see whether your file dump will make a cd that will work (in FreeBSD, at least), type: # vnconfig /dev/vn0a /usr/tmp/mybig.dump # mount_cd9660 /dev/vn0a /mnt That will mount your file dump as a file system. cd to the mount point, and test it out. If all is well, unmount the file system; # umount /mnt # vnconfig -u -v /dev/vn0a Ok, with this test proving the file works, burn it to cd; burncd -f /dev/acd1c -s X data /usr/tmp/mybig.dump fixate where -f is your atapi cd writer, and where X is the speed of your burner. Making an Audio CD ------------------ This is where things go pear-shaped. At the moment, there doesnt seem to be DAO support in burncd (the method that eliminated 2 second gaps between tracks) which is a set back. However, if you dont mind about this, extract your wav files (they must be 44,100KHz) with a grabber of your choice, and simply type: burncd -f /dev/acd1c -s X audio track1.wav track2.wav fixate where -f is your atapi cd writer, and where X is the speed of your burner. General CD burning hints: ------------------------- o burncd isnt perfect. It may not work with your recorder. It works with my HP 7200i. o creating iso's etc, will eat up disc space. You could need upto 1.3G free. o the dummy option didnt work for me, so I burn to cdrw if i need to test a write. o as usual, you need good system performance when writing to cd. don't do tasks that could jeopardise the completion of your cd. o there are other options, such as mixed mode, and cdrw blanking, which are pretty straightforward, and are explained in the man page. o burncd can't read from stdin like cdrecord can. This is a very basic introduction to get you started burning CDs in freeBSD, and is by no means exhaustive. At the moment, for those who can use burncd to write CDs, data production is fine, whereas audio CD creation is a little less flexible. Andrew Smith [ andy@tinnedfruit.org ]