Question

I`m doing some exercise on XV6 that is mini OS for education. I want to make some patch to boot the OS from USB port. Should i put the MBR on the USB disk? But as i know , the first sector of USB disk flash is saving some information about bad block. Wat shoud i do? :(

I know the usb core is big program, if i want to boot from usb , should the BIOS support the whole USB protocol or a part of it?

Was it helpful?

Solution

I think you are overthinking it a bit.

  1. The whole thing about "The first sector on the USB flash disk being reserved for bad block information" - if this is true (and it's dependent on the disk itself) - this would be hidden from the user. (Mapped out of user-addressable space). So, your first block you can access, is really your standard MBR.

  2. Treat the USB flash disk like any other disk.

  3. Make sure your BIOS is set up to do USB boot - as first device, etc.

  4. Generally, you'd partition the disk, create a partiion for your OS, then install a bootloader like GRUB - which would start on the MBR. The just configure GRUB to boot your OS.

  5. If #4 is too much to deal with - and your OS has some facility to do standard MBR installation - just do that as you would with any other normal disk.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top