Home made MBR doesn't load windows

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
madanra
Member
Member
Posts: 149
Joined: Mon Sep 07, 2009 12:01 pm

Re: Home made MBR doesn't load windows

Post by madanra »

I just tried my MBR, which only stores the pointer in ds:si, and it boots Windows 7 fine. So that's not the issue - at least, it's not the only issue.

Edit: I've tried various things to break my MBR now:
  • Setting si and bp to point at junk
  • Relocating the MBR to a non-standard place
  • Setting the stack to just above the VBR so there's not much stack space
  • Jumping to 0x07c0:0x0000 instead of 0x0000:0x7c00
  • Changing the in-memory copy of the disk signature
None of which made any difference to Windows - it still booted fine. So oddly enough, it looks like it doesn't even look at the partition data you give it - maybe it re-reads in the MBR and looks for an active partition?

Changing dl to an incorrect value did result in a failed boot, but earlier than the problem Dren is having. So I'm stumped...
Dren
Posts: 9
Joined: Mon Nov 10, 2014 5:01 am

Re: Home made MBR doesn't load windows

Post by Dren »

madanra wrote:I just tried my MBR, which only stores the pointer in ds:si, and it boots Windows 7 fine. So that's not the issue - at least, it's not the only issue.

Changing dl to an incorrect value did result in a failed boot, but earlier than the problem Dren is having. So I'm stumped...
This is a good news, can I ask you to assemble my mbr (using the code in my second post) and try to boot your windows 7 with it?
It is written for nasm
madanra
Member
Member
Posts: 149
Joined: Mon Sep 07, 2009 12:01 pm

Re: Home made MBR doesn't load windows

Post by madanra »

Dren wrote:This is a good news, can I ask you to assemble my mbr (using the code in my second post) and try to boot your windows 7 with it?
It is written for nasm
Sure - I won't have a chance today, but should do tomorrow.
Dren
Posts: 9
Joined: Mon Nov 10, 2014 5:01 am

Re: Home made MBR doesn't load windows

Post by Dren »

madanra wrote:Sure - I won't have a chance today, but should do tomorrow.
No problem, thank you very much!
madanra
Member
Member
Posts: 149
Joined: Mon Sep 07, 2009 12:01 pm

Re: Home made MBR doesn't load windows

Post by madanra »

When I ran your MBR, it tried to do an LBA read with a 64-bit address, which VirtualBox doesn't support (see screenshot), because

Code: Select all

PUSH 0x00000000
is still a 16-bit push, not a 32-bit push, and nasm doesn't complain because 0 fits in 16 bits. I changed it to

Code: Select all

PUSH 0x0000
PUSH 0x0000
and then it booted Windows 7 fine. Have you checked that your copy of Windows boots correctly when a normal MBR is used?
Attachments
Dren.png
Dren
Posts: 9
Joined: Mon Nov 10, 2014 5:01 am

Re: Home made MBR doesn't load windows

Post by Dren »

I was probably using a bad installation of windows, with original mbr after some seconds of boot it crashed with a blue screen (lol), but didn't show Windows Boot Manager, i could see windows boot logo (flag) and then the blue screen
Tomorrw i'll try with windows vista

Thank you very much for confirm that by mbr works with windows 7
Post Reply