title: Creating a bootable ISO image with custom bootloader
body: <p>I am trying to convert a bootloader I wrote in Assembly Language to an <em>ISO</em> image file. The following is the code from <a href="http://mikeos.sourceforge.net/write-your-own-os.html" rel="noreferrer">MikeOS</a> bootloader. Here is my bootloader code:</p>
  
  <pre><code>   BITS 16
  start:
      mov ax, 07C0h     ; Set up 4K stack space after this bootloader
      add ax, 288       ; (4096 + 512) / 16 bytes per paragraph
      mov ss, ax
      mov sp, 4096
  
      mov ax, 07C0h     ; Set data segment to where we're loaded
      mov ds, ax
  
      mov si, text_string   ; Put string position into SI
      call print_string ; Call our string-printing routine
  
      jmp $         ; Jump here - infinite loop!
      text_string db 'This is my cool new OS!', 0
  
      print_string:         ; Routine: output string in SI to screen
      mov ah, 0Eh       ; int 10h 'print char' function
  
  .repeat:
      lodsb         ; Get character from string
      cmp al, 0
      je .done      ; If char is zero, end of string
      int 10h           ; Otherwise, print it
      jmp .repeat
  .done:
      ret
  
      times 510-($-$$) db 0 ; Pad remainder of boot sector with 0s
      dw 0xAA55     ; The standard PC boot signature
  </code></pre>
  
  <p>I typed the following command:</p>
  
  <pre><code>nasm -f bin -o boot.bin boot.asm 
  </code></pre>
  
  <p>This command works fine and it gives a .bin output. Next I typed the following command: </p>
  
  <pre><code>dd if=boot.bin of=floppy.img count=1 bs=512 
  </code></pre>
  
  <p>This also worked fine and gave me the .img output file. When I type this command: </p>
  
  <pre><code>dd if=boot.bin of=floppy.img skip seek=1 count=1339
  </code></pre>
  
  <p>I get the following error: <code>dd: unrecognized operand ‘skip’</code>. I read in the <em>DD</em> documentation that the skip attribute must have a number assigned to it. Any ideas what number should I type with skip attribute (Ex. skip=1).</p>
  
  <p>Next I type the following command:</p>
  
  <pre><code>mkdosfs -C floppy.img 1440 
  </code></pre>
  
  <p>I get the following error: <code>mkdosfs: unable to create floppy.img</code>. How do I fix the problems I am encountering? Is there another easier way I could convert my bootloader .bin file to an <em>ISO</em> image? </p>