从 USB 端口启动 OS(XV6)

发布于 2024-10-01 16:52:30 字数 180 浏览 0 评论 0原文

我正在 XV6 上做一些练习,这是一个用于教育的迷你操作系统。我想制作一些补丁来从 USB 端口启动操作系统。我应该把MBR放在U盘上吗?但据我所知,USB闪存盘的第一个扇区保存了一些有关坏块的信息。我应该做什么? :(

我知道 USB 核心是个大程序,如果我想从 USB 启动,BIOS 应该支持整个 USB 协议还是部分协议?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回眸一笑 2024-10-08 16:52:30

我觉得你有点想多了。

  1. 关于“USB 闪存盘上的第一个扇区被保留用于坏块信息”的全部内容 - 如果这是真的(并且它取决于磁盘本身) - 这将被隐藏起来用户。 (映射出用户可寻址空间)。因此,您可以访问的第一个块实际上是您的标准 MBR。

  2. 像对待任何其他磁盘一样对待 USB 闪存盘。

  3. 确保您的 BIOS 设置为进行 USB 引导 - 作为第一设备等。

  4. 通常,您' d 对磁盘进行分区,为您的操作系统创建一个分区,然后安装 GRUB 等引导加载程序 - 它将在 MBR 上启动。只需配置 GRUB 来引导您的操作系统。

  5. 如果 #4 难以处理 - 并且您的操作系统有一些功能来执行标准 MBR 安装 - 只需像处理任何其他普通磁盘一样进行即可。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文