开发者

working of wubi? [closed]

开发者 https://www.devze.com 2023-03-10 10:18 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. 开发者_如何学JAVA Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.
开发者_如何学JAVA

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

Please tell me the working if wubi installer.If we install ubuntu inside windows,in boot.ini file there is an entry for ubuntu loader.But how the kernel starts?How the root.disk file mount before loading kernel?


The Windows bootloader is capable of starting operating systems other than just Windows. I can't speak to Wubi specifically as I haven't looked at their code but I developed a similar solution a couple years ago that worked equivalently. Basically, you do the following:

Booting

  1. Put a copy of the kernel and a custom initrd in a file on the C:\ drive
  2. Place a file containing contents of the root file system (probably a SquashFS image file) on the C:\ drive as well
  3. Configure the windows bootloader to load the linux kernel as one of items on the boot menu using your custom initrd and passing in the location of the file system image file as a boot parameter (how this is done depends on the version of windows being used... big differences between XP and Vista)

Early Userspace in the Initrd

  1. Mount the windows C:\ drive using ntfs-3g
  2. Parse the command line arguments to determine where your root filesystem image is
  3. Loopback mount the image file to a subdirectory such as /read_only_root
  4. Configure a UnionFS or AUFS mount to provide a writeable overlay to the read-only root file system. You can use the posixovl filesystem to use a native windows directory or create a fixed-size ext3 filesystem inside a file on the windows C: drive
  5. Once all the mounting magic is completed and you have a directory that looks like a writeable root filesystem, use pivot_root to convert it into the new root directory
  6. exec /sbin/init
0

精彩评论

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