possibly OT, Bootmgr memory usage

My question probably doesn’t belong to NTDEV but I just couldn’t think of a
better place for it so here is goes.

While developing my bootrom to boot Windows 2k8R2 in non-efi mode, bootmgr
displays *“No physical memory is available at the location required for the
windows boot manager”* in text mode then system halted in real mode. Of
course I found the problems in my code that has confused the real mode part
of bootmgr. So I’m not asking how to fix this.
**
**
It’s quite interesting (to me) that the non-efi bootmgr assume certain
memory region is always usable and load its protected mode part and
Winload.exe to some of the well known address. And those address better not
used by anyone else.

Is there any written document stating the contract of how bootmgr may
allocate and use system memory in non-efi mode? The technical of Windows
MBR, VBR, bootmgr, Winload/winresume are almost non-exist and they are very
sophisticate (a better way to say complex). Am I not googling correctly?

Thanks,
Calvin Guan

I would think that it’s safer to carve the physical memory from the top, if you can use VM mapping, that is.

I think this topic DEFINITELY belongs on NTDEV.

And, I think your Googling just fine… I am not aware of any Windows documentation that describes how the boot manager allocates memory. It’s somewhere between ancient established practice and black art, to the best of my knowledge.

Every time we’ve done this sort of thing here at OSR (develop a “boot rom” or our own boot loader or boot hook) it’s been exactly the way you did: Google, trial and error, and some luck.

Some day we’ll only have to worry about UEFI… so all our problems will be solved! Of course, that day is something like 20,000 years away. But, never mind.

Peter
OSR

Glad to hear that I’m not alone…

Actually, working in this area is quite fun as long as I have an Arium with
me when I desperately need it. Although not nearly as powerful as kd it’s
definitely a life saver. I guess one could get too spoiled by WinDbg or
debugging tools in general.

cheers!
Calvin

On Mon, Oct 1, 2012 at 1:32 PM, wrote:

> I think this topic DEFINITELY belongs on NTDEV.
>
> And, I think your Googling just fine… I am not aware of any Windows
> documentation that describes how the boot manager allocates memory. It’s
> somewhere between ancient established practice and black art, to the best
> of my knowledge.
>
> Every time we’ve done this sort of thing here at OSR (develop a “boot rom”
> or our own boot loader or boot hook) it’s been exactly the way you did:
> Google, trial and error, and some luck.
>
> Some day we’ll only have to worry about UEFI… so all our problems will
> be solved! Of course, that day is something like 20,000 years away. But,
> never mind.
>
> Peter
> OSR
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

“Calvin Guan (news)” wrote in message
news:xxxxx@ntdev…
>The technical of Windows
> MBR, VBR, bootmgr, Winload/winresume are almost non-exist and they are
> very
> sophisticate (a better way to say complex).

Probably, so that boot malware writers have a quality time hacking that.
– pa

MSFT is definitely making it harder for malware hackers. In UEFI+Win8,
there is a feature called “Secure Boot”, that requires my EFI driver being
signed by Microsoft before burning it to the NVRAM.

Calvin

On Mon, Oct 1, 2012 at 2:37 PM, Pavel A. wrote:

> “Calvin Guan (news)” wrote in message
> news:xxxxx@ntdev…
>
> The technical of Windows
>> MBR, VBR, bootmgr, Winload/winresume are almost non-exist and they are
>> very
>> sophisticate (a better way to say complex).
>>
>
> Probably, so that boot malware writers have a quality time hacking that.
> – pa
>
>
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.**cfm?name=ListServerhttp:
></http:>

SO true.

Oh, wait… one MORE thing is necessary: A mainboard with the appropriate CONNECTOR for the Arium. In my world, that’s often the hardest part to get. And don’t even get me started on interposers.

If I could just find a ready supply of motherboards with XDP/ITP/HDT connectors, I’d be a happy man.

We had several threads on this topic a few years ago, culminating in “Ordinary people can’t buy motherboards with JTAG connectors, but if you have a surface-mount rework station you MIGHT be able to add a connector yourself to motherobards designed by various lazy companies.”

I was pleased to discover various US Government agencies have the same problems getting these boards that we do.

But, I digress…

Peter
OSR

For the systems with ITP, we usually got them from OEM during platform
development as they use our chips. It’s their interest to get our stuff
going.

My nightmare is that my stuff works “great” on the development system but
freeze on a production system that has no JTAG. It’s a real bummer…

Calvin

On Mon, Oct 1, 2012 at 2:53 PM, wrote:

>


>
> SO true.
>
> Oh, wait… one MORE thing is necessary: A mainboard with the appropriate
> CONNECTOR for the Arium. In my world, that’s often the hardest part to
> get. And don’t even get me started on interposers.
>
> If I could just find a ready supply of motherboards with XDP/ITP/HDT
> connectors, I’d be a happy man.
>
> We had several threads on this topic a few years ago, culminating in
> “Ordinary people can’t buy motherboards with JTAG connectors, but if you
> have a surface-mount rework station you MIGHT be able to add a connector
> yourself to motherobards designed by various lazy companies.”
>
> I was pleased to discover various US Government agencies have the same
> problems getting these boards that we do.
>
> But, I digress…
>
> Peter
> OSR
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Unfortunately, UEFI OS loaders use predefined memory region also. I believe it starts from lowest 3G.
If UEFI stuff, for some reasons, use a lot of memory an OS loader may not allocate enough memory to work. I hope, UEFI memory allocation stuff would be more flexible in the future.

Igor Sharovar