Loading My Custom OS from USB flash drive

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?

2

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.

2

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *