Monday, 29 July 2013

Create a Bootable CD from Floppy image or from files

In this article we are going to see how to create a our own bootable CD. First thing we need following items
  • mkisofs
  • Source Floppy image to write to CD

For Windows user you can download it here ftp://ftp.berlios.de/pub/cdrecord/alpha/win32/ 

  • Go to the location where floppy image is located
         cd  ~/myos

  • Create a directory to store the contents of the CD
         mkdir  cddir

  • Copy the contents that are need to be added in the CD
         cp bootfiles/* cddir

  • Copy the floppy image inside the directory         
         cp  floppy.img cddir

          Here  
               -o        indicates output file
               -v        indicates label of the CD
               -b        floppy image
              cddir   where all files should be taken from.

  • Create a CD image from Floppy image
         mkisofs -o  osboot.iso -v myos -b floppy.img cddir

our_kernel  is the name of your kernel 

Command line to create a Bootable cd with out floppy image
   mkdir  -p  $ISO_DIR/boot/grub
   cp  $GRUB_BIN/stage2_eltorito $ISO_DIR/boot/grub
   cp menu.lst $ISO_DIR/boot/grub
   cp  our_kernel $ISO_DIR

         mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot-boot-load-size 4 -boot-info-table -o          bootcd.iso  $ISO_DIR

I Hope from this article you can learn how to create a bootable CD , by having the source as floppy image or files.