0

USB bootloader doesn't work correctly in physical computer. When I use QEMU it works, but I think it's because QEMU read it as a floppy. I don't know if have to format USB in format FAT16 or FAT32, or if I have to change something in the code; or if I have to use in some different way the command DD

The program calls another program using int 13h, but in physical computers it only shows the prints of stage1

The code is very similar from the answer of this URL: Enable the boot loader to load the second sector of a USB

Community
  • 1
  • 1
AlphaWind
  • 1
  • 2
  • Please show us your bootloader code. – Michael Petch Mar 04 '17 at 17:51
  • The code is very similar from the answer of this URL: http://stackoverflow.com/questions/36044706/enable-the-boot-loader-to-load-the-second-sector-of-a-usb/36052385 – AlphaWind Mar 04 '17 at 18:06
  • Very similar and what code you are using are two different things. If it isn't exact we need to know exactly what you are using. – Michael Petch Mar 04 '17 at 18:07
  • Is almost the same I only changed the messages and some comments and I used the same dd commands, but I am in Linux that's the difference – AlphaWind Mar 04 '17 at 18:10
  • If you want your USB to act like a floppy for boot purposes you will have to enter the BIOS and change it to USB Floppy emulation. You will then need to ensure you have a _BPB_ (BIOS parameter block) to start your bootloader as many BIOSes are finicky about detecting its presence. – Michael Petch Mar 04 '17 at 18:12
  • An example bootloader with a BPB can be found here: http://stackoverflow.com/a/41919719/3857942 . It is written in AT&T syntax but can easily be converted to NASM . that code is incomplete as you still need to add a BIOS boot signature at the end (the word 0xaa55 in the last 2 bytes of the first 512 byte sector). The _BPB_ in that answer is everything before the `_main` label. – Michael Petch Mar 04 '17 at 18:14

0 Answers0