Jump to content











Photo
* * * * * 1 votes

Hack Bootmgr to boot Windows in BIOS to GPT

bios gpt bootmgr winload

  • Please log in to reply
374 replies to this topic

#126 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14912 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 19 April 2015 - 01:56 PM

Yep, but "the latest version in ubuntu" means nothing to me, in the sense that I am not going to download ubuntu to check which version is included in it.

 

The hint was that if you follow the given article (which is good), then at least at first try FOLLOW IT to the letter (i.e. using the EXACT SAME software, and NOT a different version/release/whatever), this is "generic advice", but specifically there were (and possibly still are) quite a lot of issues in Suslinux 5.x and 6.x (though as said not necessarily connected with your booting issues)

 

For the record:

Bootsect normally applies to the bootsector (or VBR or PBR) the appropriate boot CODE (and does NOTHING to the MBR) leaving the DATA untouched.

IF the /mbr switch is used than also the CODE of the MBR is updated (still the DATA in the MBR remains untouched).

The DATA in the bootsector (or VBR or PBR), in the case of NTFS represented also by the file $Boot,  is written by the FORMAT command.

The DATA in the MBR is written by Disk Manager (or diskpart).

 

What we don't know (until now) is WHAT is preventing the boot (at least until the BOOTMGR choices), possible culprits are:

  1. the way the .vhd has been partitioned/formatted
  2. the specific memdisk (or more generally syslinux) version
  3. something else

If you exclude #1 and #2 above, we may proceed to look for the "something else".

 

As a completely different approach, since your booting worked fine with Duet, why not giving Clover a try? :unsure:

http://sourceforge.n.../cloverefiboot/

 

:duff:

Wonko



#127 MsK`

MsK`
  • Members
  • 5 posts
  •  
    France

Posted 19 April 2015 - 02:21 PM

Well there's no need to yell, I did follow the article to the letter, but the article isn't that precise : doesn't eexplain how grub was installed, doesn't give any specific version of memdisk, syslinux, grub, diskpart, etc.

I'm going to try several versions of memdisk and try the vhd converted to raw with clonedisk. I'll give you a report once I'm done through it.

Edit:
http://packages.ubun...utopic/syslinux
It would seem that I installed syslinux 6.03. I'll then try with an older version.
 
Edit2:
I switched to memdisk 4.07 => same result
I added a boot.ini in the vhd => same result
I tried "memdisk floppy initrd=bootmgr" just => same result (as expected since it should still boot it has a hard drive since the file is 32MB big but I wanted to try anyway...)
 
Going to convert the .vhd to .raw now

Edit3:
This is what Clonedisk has to say about my vhd

Disk Type: FIXED
Features=2
Format=$10000
Data_offset=-1
Creator_Application=win
Creator_Version=$60001
Creator_Host_OS=Wi2k
Original_Size=33554432
Current_Size=33554432
Checksum=$3BE7FFFF
saved_state=0

It probably means more to you than to me...?

 

Edit4:

Same results with raw image converted with clone disk. I did it by loading the vhd and then using the "backup image" function. I once did it in RAW format and also with "RAW (DISK)" selected. Both yield the same result with no windows boot but still show a different image size (32768K in one case and 31xxx something in the other). I don't know if it's really important.

Trying now the hex edit thing about the cylinders...


Edited by MsK`, 19 April 2015 - 03:19 PM.


#128 MsK`

MsK`
  • Members
  • 5 posts
  •  
    France

Posted 19 April 2015 - 03:28 PM

bcdboot fails when the .vhd is modified as you suggested. It says it failed while copying boot files. (message is in french, I don't know the original message in english so this is my best translation, sorry...)

Also, the partition is now 23MB big instead of 32MB. Was that to be expected ?

 

Edit: reading the source code of memdisk, I noticed the EDD option. Don't really know what that enhanced thing is but I tried noedd. Now memdisk doesn't seem to crash (as I can reboot with ctrl+alt+del) but I have a "Missing operation system" message. I did not find that message yet in memdisk sourcecode, would this mean that the message comes from windows' boot loader ? bcd right ?

 

WOOOOOHOOOOOOOOOOOOOOOOOOOOOOOO

GOT IT WORK !

I added the "raw" parameter and it now boots fine :D

 

Recap edit :

Just used the exact method of wzyboy but with the extra "raw" parameter to memdisk.


Edited by MsK`, 19 April 2015 - 03:51 PM.


#129 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14912 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 19 April 2015 - 04:30 PM

Very good find. :thumbsup:

 

The added "raw" parameter is seemingly something that is needed on some specific motherboards while other ones work fine without it.

http://www.syslinux...._.2C_safeint.29

It is possible that your image works fine without those parameters on some PCs or virtual machines, but fail to boot on other PCs. In this situation, adding 'raw' will normally solve your problem.

 

which would explain nicely why you *need* it whilst Sacha Weaver did not.

 

:duff:

Wonko

 

I am attaching a (hopefully) properly partitioned/formatted around 32 Mb disk image, NTFS formatted active partition, that I manually created with Clonedisk, you should be able to attach/mount it and use bootsect/bcdboot on it without errors, just in case

Attached Files



#130 AnonVendetta

AnonVendetta

    Silver Member

  • Advanced user
  • 713 posts
  • Location:A new beginning.....
  • Interests:Self-development, computing

Posted 20 April 2015 - 01:40 PM

Hate to intrude on a topic in which I can offer nothing of use to further the discussion, but.......

 

@ MsK: I too noticed the DUET installer files (the one linked to in Rod Smith's webpage 'A BIOS to UEFI Transformation) are down/been removed. I still have a local copy, can Dropbox it and post a link if you need it.



#131 AnonVendetta

AnonVendetta

    Silver Member

  • Advanced user
  • 713 posts
  • Location:A new beginning.....
  • Interests:Self-development, computing

Posted 20 April 2015 - 02:44 PM

Something else I wanted to say (but couldnt edit my above post):

 

@ Wonko: There is no sense in trying to persuade milindsmart to not try to discover new methods, rather than simply being satisfied with what we already have. The whole of human history is based in large part due to the efforts of people who tried to do things not yet attempted, simply because they could and wanted to try. From building Egypt's pyramids to flying to landing men on the moon, and so on, none of that would have happened if people had bern content to simply use known methods instead of pushing into the unknown. This is something that even logic and reasoning and common sense etc cannot defy. I find that "because we can" is a perfectly valid reason to try.

 

Onward........


Edited by AnonVendetta, 20 April 2015 - 02:45 PM.


#132 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14912 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 20 April 2015 - 07:46 PM

Sure. :)

The advise is NOT AT ALL "do not waste your time to re-invent the wheel or hot water", it is only, "make sure that the wheel you invent runs and runs smoother and that your hot water is actually hot and possibly hotter than the one we already have", even more specifically the general advice is that (as said unless something is done for the fun of it, which by itself is an exceptionally good reason :thumbsup: ) one should consider how there are tens, hundreds or thousands of real, practical, unsolved problems, and that using resources to re-solve the already solved problems (and already solved in several slightly different ways) does not usually provide any practical advancement in anything, the effect is only (when a result is actually achieved) an exercise of style (which may be nice in itself, and as said fun, but not really "groundbreaking").

 

:duff:

Wonko



#133 AnonVendetta

AnonVendetta

    Silver Member

  • Advanced user
  • 713 posts
  • Location:A new beginning.....
  • Interests:Self-development, computing

Posted 20 April 2015 - 08:25 PM

One of the issues with "make sure that the wheel you invent runs and runs smoother and that your hot water is actually hot and possibly hotter than the one we already have" is oftentimes we cant be sure that whatever new approach we're trying will succeed, or be better than the old. The newly invented wheel may end up being not as smooth as the old and your water may well end up colder.

 

Failure is a big part of success, because even if you fail, you still learned something. The most successful people have typically failed many times before reaching success.

 

A big part of life for me is being spontaneous and stepping into the unknown, we do the latter every day in so many ways without thinking about it.

 

This is where logic and reasoning come into play, balancing the positives and negatives against the other when trying something new. As for solving currently existing problems as opposed to trying new things, that's fine, and I'll agree to an extent, but I'm more apt to spend my time tackling new issues and creating new problems (to see what might happen), instead of focusing on existing problems, since I prefer to do whatever I damn well please, without regards for what others think.


Edited by AnonVendetta, 20 April 2015 - 08:26 PM.


#134 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14912 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 21 April 2015 - 07:51 AM

Yep :), we already had an occasion to notice your abilities in creating non-existing problems in order to attempt to solve them, and as long as you have fun with that, it is perfectly fine. :thumbsup:

 

But I will risk nonetheless citing  Michail Kalashnikov, the guy that without a specific education designed what was (and to some extent still is) the best firearm in the 20th century, the AK-47:

http://en.wikipedia....ki/AK-47#Design

A lot of Russian Army soldiers ask me how one can become a constructor, and how new weaponry is designed. These are very difficult questions. Each designer seems to have his own paths, his own successes and failures. But one thing is clear: before attempting to create something new, it is vital to have a good appreciation of everything that already exists in this field. I myself have had many experiences confirming this to be so.

 

 

:duff:

Wonko



#135 AnonVendetta

AnonVendetta

    Silver Member

  • Advanced user
  • 713 posts
  • Location:A new beginning.....
  • Interests:Self-development, computing

Posted 21 April 2015 - 10:35 PM

I'm not a fan of guns, never shot one and can't own them (probably for good reason). Although I do live in a nation where most people can own them as long as they have no criminal felony convictions or certain other exclusions. I've heard, from friends, that most European nations have long since outlawed gun ownship by civilians.

 

The AK47, I've never researched it but I do believe it started as a Russian military weapon (too lazy to confirm/disconfirm). Too bad that today it's more commonly associated with gangs/rebels/terrorists. It's constantly depicted as the bad guys' gun of choice.



#136 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14912 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 April 2015 - 08:30 AM

The AK47, I've never researched it but I do believe it started as a Russian military weapon (too lazy to confirm/disconfirm).

That's EXACTLY the point. :whistling:

 

:duff:

Wonko



#137 AnonVendetta

AnonVendetta

    Silver Member

  • Advanced user
  • 713 posts
  • Location:A new beginning.....
  • Interests:Self-development, computing

Posted 06 May 2015 - 02:17 PM

@ Wonko: I think I see where you're going. You seem to dislike some parts regarding UEFI and Windows 8/8.1 in particular. That's fine by me, but I do believe you're implying that I need ro get more familiar with the old BIOS/MBR ways, in addition to UEFI. I'd much rather focus on current tech that will drive us into the future, but understanding the past is a critical part of avoiding future mistakes. As for guns, well, yes, I'm too lazy to research the AK because I have little interest in guns. We have a limited time on Earth, everyone dies someday, so might as well prioritize my life based on what is important and worth my time.


Edited by AnonVendetta, 06 May 2015 - 02:20 PM.


#138 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14912 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 06 May 2015 - 06:06 PM

... but understanding the past is a critical part of avoiding future mistakes. ...

 

Spot on :), particularly same mistakes.

 

But a distinction has to be made between Windows 8/8.1 and UEFI.

 

Windows 8/8.1 is nothing but a quickly passing meteor, very soon everyone will be fighting with Windows 8.2 rectius 10, which very likely will be (unexpectedly :unsure:) possibly much worse than 8/8.1 in a number of ways :frusty:, and anyway represents only a (currently small) part of the computing platforms. 

 

UEFI is (unfortunately) here to stay, but in itself - set aside a number of IMHO "wrong" technical choices that could have been taken more wisely - it is not that much bad as a "proposed industry standard", only it is unneededly complex (which again in itself is not much of an issue) but it has been implemented till now - only partly due to its complexity - in different, non-standard ways, not only by the good MS guys and by the good Linux guys (and by the good Mac guys), also by each and every motherboard manufacturer, to the point that the U in UEFI cannot be reasonably be considered meaning "Unified" but rather "Unorganized" or "Unarranged" or "Unmethodical".

 

On one hand this will give us no end of fun solving or working around the issues that the wrong or defective implementations of UEFI cause, but on the other, after so many years of attempting to solve or workaround the issues that the the wrong or defective implementations of BIOS cause, it is a bit tiring, particularly because it was announced and touted as bringing a definitive solution to those problems.

 

:duff:

Wonko



#139 MsK`

MsK`
  • Members
  • 5 posts
  •  
    France

Posted 10 May 2015 - 04:02 PM

Getting back onto topic: there is still a quirk, my computer won't go into sleep mode. When I try to, the screen fades to black and then lights up instantly again, like if nothing happened. I can't spot anything weird in system logs... I tried with the original USB stick boot method and the computer can go to sleep that way ! Any idea of what could prevent it to do so with the virtual disk method ?

#140 AnonVendetta

AnonVendetta

    Silver Member

  • Advanced user
  • 713 posts
  • Location:A new beginning.....
  • Interests:Self-development, computing

Posted 11 May 2015 - 10:37 PM

https://www.dropbox....ux-6.03.7z?dl=0

 

http://www.dropbox.c...staller.7z?dl=0

 

@ MsK: You never stated whether you need these files or not, so I figured I'd link to them anyway. Both are unmodified, except that they've been recompressed in 7z format. The syslinux file is latest version, although I have added a copy of gptmbr.bin to the /syslinux-6.03/mbr/, the DUET installer looks for it there, and it was missing. The script will fail without it. The DUET file is also missing its' pax_global_header from when it was in zip format, presumably only for decompression.

 

 

 

 



#141 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14912 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 12 May 2015 - 09:52 AM

Maybe related, maybe not, there is a difference when you boot from a "Vista floppy".

  • on a "normal" boot, the \boot\BCD is  integrated in the Registry and mounted as HKLM\BCD00000000 
  • on a "Vista boot floppy" it is not

(most probably the idea is that the floppy may be physically removed anytime after boot)

 

But as a matter of fact booting through memdisk mapped hard disk image is even worse, as - as soon as the "protected mode" part of the booting "kicks in" - the device vanishes to all effects.

 

If the mapping of the \boot\BCD to the Registry is connected to the sleep issue, you will need to setup your system using Firadisk or Winvblock in such a way that the hard disk image is also mapped in the booted system.

http://www.syslinux....isk.2FISO_image

 

:duff:

Wonko



#142 AnonVendetta

AnonVendetta

    Silver Member

  • Advanced user
  • 713 posts
  • Location:A new beginning.....
  • Interests:Self-development, computing

Posted 12 May 2015 - 11:14 AM

Potential issues with things like sleep/hibernation (not that I ever use them anyway) or whatever, is exactly why I never bothered to try milind's approaches to begin with. I just figured that too many issues could ensue. And it just didn't (and still doesn't) seem like a "proper"/traditional way to install/run Windows (interesting as it is), especially since MS doesn't support such a scenario. At least with UEFI, you have support. Not so much with DUET, but since you're at least tricking Windows into *believing* it's running on real UEFI, it's still *somewhat* supported (not DUET itself, of course, but you have the traditional disk/partition layout that comes with a normal UEFI install).

@ Wonko: Thanks for the insights on how Windows treats booting from a floppy/HDD image. My concern before (and still is) is that with the floppy and similar methods Windows won't be able to find or read from/write to its' boot files, which I believe is important, in the event that they ever need to be updated. It just makes sense to me that Windows needs (or at least *should*) know where its' boot files live at all times (so that it can locate a proper "boot" partition), and for updating purposes. On a normal Windows install Windows knows where its' boot files are, I don't think they should just be up and vanishing. Are you implying that something like FiraDisk or WinVBlock will make these things possible?

Edited by AnonVendetta, 12 May 2015 - 11:17 AM.


#143 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14912 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 12 May 2015 - 05:24 PM

Are you implying that something like FiraDisk or WinVBlock will make these things possible?

I am not implying anything.

 

I am plainly stating :smiling9: that a virtual disk temporarily mapped through memdisk, grub4dos or any other "real mode" loader/pre-boot environment will vanish as soon as "protected mode" is reached as any Windows NT OS will re-scan the system to load the available media through the HAL and related drivers, so if you want to have that virtual disk available also in the Windows NT OS you need to map it at boot time through an appropriate driver (which at the state of the art means either Firadisk or WinVblock, not because there are not other suitable drivers, but because these two provide mechanisms to "hook" Syslinux/memdisk or grub4dos mapped virtual disks).

 

Whether this will help in solve the "sleep" issue or not or if this will open another can of worms :w00t: is another thing.

 

:duff:

Wonko



#144 cdob

cdob

    Gold Member

  • Expert
  • 1438 posts

Posted 12 May 2015 - 06:15 PM

Getting back onto topic: there is still a quirk, my computer won't go into sleep mode. When I try to, the screen fades to black and then lights up instantly again, like if nothing happened. I can't spot anything weird in system logs... I tried with the original USB stick boot method and the computer can go to sleep that way ! Any idea of what could prevent it to do so with the virtual disk method ?

Bootin from a floppy to GPT hard disk:

A observation at Windows 8.1 (default settings with fast boot enabled):

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control]
"SystemBootDevice"="multi(0)disk(0)rdisk(0)partition(4)"
"FirmwareBootDevice"="multi(0)disk(0)fdisk(0)"

shutdown is not possible.


FirmwareBootDevice reconfigured to local hard disk, 100 mb partition:
"FirmwareBootDevice"="multi(0)disk(0)rdisk(0)partition(2)"

shutdown is possible.
The file \efi\microosft\boot\bcd is updated.

Worth to contiune?


Which FirmwareBootDevice do you get?
Does exist a dummy \efi\microosft\boot\bcd at FirmwareBootDevice ?


Basic idea, not tested:
use grub4dos
mount a floppy image with \bootmgr and a dummy \boot\bcd
dd (hd0,1)\efi\microosft\boot\bcd to (fd)\boot\bcd
chainload (fd)\bootmgr

#145 gyurman

gyurman
  • Members
  • 9 posts
  •  
    Hungary

Posted 24 May 2015 - 11:22 PM

Hello, I'm watching long time this discussions. But I couldn't understood, which is working well?

I did BCD  for VHD file. Put this file to the grub. and I can boot it well with

menuentry "bootmgr.vhd" {
 linux16 /boot/syslinux/memdisk harddisk
 initrd16 /boot/bootmgr.vhd
}

, but mine problem is. Not going to sleep the windows 8.1?

Why have you any idea? Thanks.



#146 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14912 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 25 May 2015 - 08:36 AM

Put this file to the grub. 

That is GRUB2 (just for the record).

 

Notwithstanding what the good Authors of the thingy call it :w00t: :ph34r:, here on reboot-pro we tend to be accurate and call:

  • GRUB=what is now called Grub Legacy
  • grub4dos=grub4dos
  • GRUB2=what is now senselessly called GRUB

to avoid possible misunderstandings :).

 

:duff:

Wonko



#147 gyurman

gyurman
  • Members
  • 9 posts
  •  
    Hungary

Posted 25 May 2015 - 11:30 AM

Dear Wonko the Sane, yes that is grub2. Exactly:

#! /bin/sh
exec tail -n +3 $0

menuentry "bootmgr.vhd" {
        savedefault
#        parttool  (hd2,msdos1) hidden+
    linux16 /boot/syslinux/memdisk harddisk
    initrd16 /boot/bootmgr.vhd
}

in /etc/grub.d/42_w8 file. Than

sudo grub-mkconfig -o /boot/grub/grub.cfg
 
But before I did bcdboot etc.
 
Than after mine windows Not going to sleep the windows 8.1?

Why have you any idea? Thanks.

 



#148 steve6375

steve6375

    Platinum Member

  • Developer
  • 7028 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films,guitars, www.easy2boot.com
  •  
    United Kingdom

Posted 25 May 2015 - 11:39 AM

What do you get if in Admin shell you type

powercfg /A

What type and size of disk are you booting from?

What is the size of the VHD and how much free space is there?



#149 gyurman

gyurman
  • Members
  • 9 posts
  •  
    Hungary

Posted 25 May 2015 - 02:00 PM

Thanks, I able to sleep

C:\Windows\system32>powercfg /A
The following sleep states are available on this system:
    Standby (S3)
    Hibernate
    Hybrid Sleep
    Fast Startup

The following sleep states are not available on this system:
    Standby (S1)
        The system firmware does not support this standby state.

    Standby (S2)
        The system firmware does not support this standby state.

    Standby (Connected)
        The system firmware does not support this standby state.

And I don't have issue in energy-report.html

I have free space 2 MB from 29.9. The vhd type is fixed.

 

What happening if we use the Comboot/chain.c32 from syslinux?

Have you any idea?



#150 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 14912 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 25 May 2015 - 02:24 PM

I don't know :(, but I wonder how can "cannot sleep when booted with GRUB2 a Windows 8.1 in "Native" mode from VHD" be connected to "boot with BIOS on GPT style disk"  :dubbio: (which is the topic of this thread).

 

:duff:

Wonko







Also tagged with one or more of these keywords: bios, gpt, bootmgr, winload

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users