Hi I was wondering if it's possible for the MBR to read data from the USB port?
I'm wanting it to load windows or linux depending on the value it's read from the usb port
Hi I was wondering if it's possible for the MBR to read data from the USB port?
I'm wanting it to load windows or linux depending on the value it's read from the usb port
You should start with / customise GRUB. As it stands, in the MBR you have very little device support so you'll either have to code your own or try and build on your BIOS's USB device support if that's exposed as an API.
GRUB has built-in OHCI and UHCI USB drivers http://grub.enbug.org/USBSupport . I doubt it'll do exactly what you want out-of-the-box but it'll be easier to customise that rather than start from scratch.
It's highly doubtful that you can fit it into the 512-byte MBR itself, but there's no technical reason it can't be done otherwise - you just need to bootstrap a mini-OS which can read the value, and then act as a chain loader to start the boot loader of the right OS: both GRUB and the Vista bootloader is capable of chain loading to the other, so there's no reason you couldn't do the same.
Having said that, writing said mini-OS could very well prove to be more trouble than it's worth. Customizing an existing bootloader like GRUB is probably your best bet.