title: BIOS Interrupt 13 read sector not working
body: <p>I have gotten into assembly operating system development and I am setting up a two-stage bootloader at the moment. I have set up the first stage, but when I  reset the disk and read the second sector, i get a bunch of giberish on screen. When I try to call the code that should have been loaded at <code>0x1000</code>, nothing happens (as far as I am aware). I have tried to find solutions, but none of them that I have found seem to work, and I am running out of luck. Here is my full code:</p>
  <pre><code>    BITS 16
  
  start:
      mov ax, 07C0h
      add ax, 288
      mov ss, ax
      mov sp, 4096
      
      mov ax, 07C0h
      mov ds, ax
      
      call reset
      call read_sector
      
      jmp sector
      
      text_string db &quot;hello, world!&quot;, 0
      sector equ 1000h
  
  reset:
      mov ah, 00h
      mov dl, 00h
      int 13h
  
  read_sector:
      ; 1000h (used to be 07E0h, but changed as I realized that I probably needed to accomodate more space for the bootloader)
      mov ax, sector
      mov es, ax
      mov ah, 02h
      mov al, 01h
      mov ch, 00h
      mov cl, 02h
      mov dh, 00h
      mov dl, 00h
      int 13h
      jc reset
  
  printf:
      mov ah, 0Eh
      lodsb
      cmp al, 0
      je done
      int 10h
      jmp printf
  
  jump_print:
      call printf
      ret
  
  done:
      ret
      
  times 510-($-$$) db 0
  dw 0xAA55
  ; sector 2
  
  message db 'now there is a different message!', 0
  mov si, message
  call printf
  
  jmp $
  
  times 1024-($-$$) db 0
  </code></pre>
  <p>Any assistance would be great. For reference, I am on windows and I am compiling using nasm. I am testing through VirtualBox (which probably isn't the best tool, I know, but it works as I have seen so far).</p>