-2

Suppose I want to create a portable OS, that needs a USB flash drive only to work. and i wrote my boatloader in the first sector to be loaded by the BIOS, from here on, what can I do to load my OS kernel, which is located somewhere in a USB drive?

1 Answers1

0

You can make BIOS calls from your loaded bootloader. I don't think the BIOS knows about file systems, so you'd have to provide code (i.e. write a file system reader) for that in terms of reading sectors, depending on how your bootloader is intended to find your OS kernel code. You would probably use 02h Read Sectors, or maybe 42h Extended Read Sectors BIOS calls.

Check out BIOS calls.


You might also check out UEFI, which is much more modern, as BIOS is being superseded with that. Even if you don't use UEFI, there's some good discussion about BIOS and its limitations there.

Erik Eidt
  • 33,282
  • 5
  • 57
  • 91
  • thank's that's the answer i was looking for, so it's up to the BIOS to handle the USB transactions and do all the stuff, in my side it doesn't matter whether my OS is in a flash drive or hard drive, or a floppy disk, as far as I'm using the BIOS. – HumbleUser Oct 04 '16 at 22:22
  • 1
    I think that the BIOS may handle drives over USB, but I don't know for sure. If it does handle USB, it probably still won't support ports having USB 3.0, though, even at the lower speeds of USB <=2.0, because it's different hardware. – Erik Eidt Oct 04 '16 at 22:44