Author Topic: HowTo----Fix Win Vista 'winload.exe missing/Win 7 'boot selection failed' errors  (Read 4746 times)

0 Members and 1 Guest are viewing this topic.


  • Entrant
  • Posts: 4
When installing Chameleon to a hard drive with Windows Vista+ installed, people often experience problems with booting Windows, specifically, 'winload.exe..... is missing or corrupt' in Windows Vista, or 'The boot selection failed because a required device is inaccessible' in Windows 7.

to fix, simply change
Code: [Select]
fdisk -f boot0 -u -y /dev/rdisk0to
Code: [Select]
dd if=boot0 of=/dev/rdisk0 bs=438 count=1
What is basically happening is Vista is looking for a disk signature which allows a hard drive to be recognised even if it's been moved around in the hardware (so if you are planning on doing this, you might want to avoid this fix!). This disk signature is found towards the end of the bootloader, but since the boot0 file actually finishes earlier than where the disk signature is, you can simply copy the actual code, and ignore the null bytes at the end.

Note that since the boot0 code can change size depending on compiler, and whenever the source code is changed, you should make sure, using xxd boot0 from terminal that the file finishes before 1b6 (i.e.: everything after 1b6 is all zeros)

$ xxd boot0
0000000: fa31 c08e d0bc f0ff fb8e c08e d8be 007c  .1.............|
0000010: bf00 e0fc b900 01f2 a5ea 1ee0 0000 6631  ..............f1
0000020: c066 a300 e4b0 02bb 0010 e813 0172 06be  .f...........r..
0000030: be11 e809 00bf 9ce1 e839 01f4 ebfd 817c  .........9.....|
0000040: 4055 aa75 4a31 dbfe c7b9 0400 668b 4408  @U.uJ1......f.D.
0000050: 66a3 00e4 807c 0400 7424 807c 04ee 7505  f....|..t$.|..u.
0000060: c604 00b3 0180 ff01 750a 803c 8075 0f30  ........u..<.u.0
0000070: f6e9 0200 b601 e891 0075 03e9 8300 81c6  .........u......
0000080: 1000 e2c8 fecb 7408 fecf bebe 1174 bac3  ......t......t..
0000090: bf00 1266 813d 4546 4920 7564 6681 7d04  ...f.=EFI udf.}.
00000a0: 5041 5254 755a 89fe 668b 4448 66a3 00e4  PARTuZ..f.DHf...
00000b0: 8b4c 508b 5c54 53b0 20bb 0014 53e8 8000  .LP.\TS. ...S...
00000c0: 5e5b 0f82 6fff bfa2 e1e8 a800 668b 440c  ^[..o.......f.D.
00000d0: 663d 6543 ecac 7408 663d c93e c93b 751c  f=eC..t.f=.>.;u.
00000e0: 668b 4420 66a3 00e4 b601 e81d 0075 0dbe  f.D f........u..
00000f0: be11 6689 4408 c644 04af eb05 01de e2cc  ..f.D..D........
0000100: c3bf aee1 e86d 00e9 f69a 60b0 03bb 007c  .....m....`....|
0000110: e82d 000f 821e ff08 f674 1bbf a6e1 e853  .-.......t.....S
0000120: 00a1 0080 3d48 2b74 0d3d 4858 7408 a15a  ....=H+t.=HXt..Z
0000130: 7c3d 424f 7508 89df 81bd fe01 55aa 61c3  |=BOu.......U.a.
0000140: 51b9 0500 e806 0073 02e2 f959 c366 6089  Q......s...Y.f`.
0000150: e51e 1e66 8b0e 00e4 6651 0653 30e4 5068  ...f....fQ.S0.Ph
0000160: 1000 89e6 b442 cd13 7305 31c0 cd13 f989  .....B..s.1.....
0000170: ec66 61c3 6057 be92 e1e8 0600 5ee8 0200  .fa.`W......^...
0000180: 61c3 bb01 00fc ac3c 0074 06b4 0ecd 10eb  a......<.t......
0000190: f5c3 0a0d 626f 6f74 303a 2000 6572 726f  ....boot0: .erro
00001a0: 7200 4750 5400 7465 7374 696e 6700 646f
00001b0: 6e65 0000 0000 0000 0000 0000 0000 0000  ne..............
00001c0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001d0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001e0: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00001f0: 0000 0000 0000 0000 0000 0000 0000 55aa  ..............U.

The blue bytes should all be zeros, the red bytes are where the Vista disk signature is found, and the last 2 green bytes do not matter as they are just the MBR signature. If the boot code does finish after the blue bytes, then this will not work.

REMEMBER!: Bytes 446 onwards represent the partition table, and if this is altered or corrupted then you will lose all your data on your drive, always make a backup of your full MBR with
Code: [Select]
dd if=/dev/rdisk0 of=mbrbackup bs=512 count=1here /dev/rdisk0 is the drive you are installing onto. Then to restore, simply do
Code: [Select]
dd if=mbrbackup of=/dev/rdisk0 bs=512 count=1
Make sure when doing the command above to install boot0 to type
438, and no other number!!!


  • Forum Moderator
  • Posts: 1150
Hi nuiluidwde

The fdisk supplied in Chameleon's /i386 folder has already been modified to only write to the first 440bytes of the MBR. So it's recommended everyone use that and not Apple's fdisk that's shipped with OS X.

To save confusion between the two fdisk's, the amended file has now been renamed fdisk440.
You can find the sources here in the svn and you can read more about it and a new stage0 alternative booter named boot0hfs, in this previous post.
« Last Edit: May 15, 2010, 10:19:49 PM by Blackosx »
10.10.5 / 10.11 GM1 | Asus Maximum IV Gene-Z | i7-2600 3.40GHz | 4GB | Radeon 5770 1GB


  • Entrant
  • Posts: 4
Oh, ok! Sorry, didn't realise that, I always used the normal fdisk, should this be moved to the black hole, or left up then?


  • Global Moderator
  • Posts: 233
  • Root Down
^ That's a really good question nuiluidwde

I'll move it to Patches BlackHole and tag it as Implemented, since we fixed this some time ago. Make yourself familiar w/ the Repo and feel free to patch or fix things on our To Do list

Thanks for your efforts :)

[Darn max. characters limit in title thread! Title stayed the same. This is implemented, check Blackosx's post for the relevant links]
« Last Edit: May 18, 2010, 09:15:26 PM by rocksteady »
Stop bitching, start coding or documenting or both..

P5Q-EM : Q6600 : 8GB RAM : 8800GT : SATA Drives