I need memory region for my application before OS (Windows) was started, so i intercept BIOS function INT15h E820 and modify memory map:
Before modification memory map (only 1st segment):
1. 0x00000000:0x0009FC00, type 1 - free memory
After modification:
1. 0x00000000:0x00093000, type 1 - free memory
2. 0x00093000:0x0000C800, type 2 - reserved
3. 0x0009F800:0x00000400, type 1 - free memory
After such modifications Windows cannot boot (it crashes somewhere in kernel).
I found that problem is raised when windows starts using 3rd region in memory map.
Windows loader uses only INT15h E820 for obtaining memory map, it does not use BDA memory limit. So windows loader assume that segment 3 is free, and starts using it, and we get crash. Also i suppose that problem still exists without any modifications of memory map (future versions of boot loaders may use more memory).
I think that BIOS function INT15h E820 should be synchronized with BDA memory limit. For example it can generate following segments:
1. 0x00000000:<BDA_LIMIT>, type 1
2. <BDA_LIMIT>:(0x0009FC00 - <BDA_LIMIT>), type 2
3. 0x0009FC00:...