开发者

boot OS(XV6) from USB port

开发者 https://www.devze.com 2023-01-23 20:56 出处:网络
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

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开发者_StackOverflow中文版 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?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消