There is a Linux terminal command called "mkisofs" with which you can turn a root filing system into an iso that can be burn into a CD or DVD.
Some simple steps of how to use it is available in Chapter 3.4 of Grub Manual for burning just one Grub file into a CD.
It may be relevant to read
this thread in which I burn DSL as one of the 7 distros into a rewritable DVD. The use mkisofs command is also provided in
Step 5 of this thread.
To boot a CD one must use a special boot loader that can read iso9660 file format (El Torito bootable CD standard) from a CD or a DVD. This can be either Isolinux or Grub. My example is based on Grub which has a devoted file called stage2_eltorito to do just that.
Just checked my installed DSL V3.4 on 2.4.34 kernel with Grub 0.91. It has no stage2_eltorito so you must source this file from another distro. Grub 0.91 is oldest Grub I have come across. It is persisted by DSL because it probably has the smallest footprint. Current Grub is 0.97 and not many distros still use 2.4 kernels, as kernel 2.6.22 is now stable.