Boot area question of 7C00

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.
Post Reply
User avatar
~
Member
Member
Posts: 1228
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Boot area question of 7C00

Post by ~ »

Is there some instance in which there could be more space used by boot than just 512 bytes in the area 7C00-7DFF?

What about booting from CD, which has 2048-byte sectors? Maybe it doesn't account since the El Torito specification says that even in "non emulation" mode one is able to choose in which segment to boot from? But such sector still would take up to 7C00-83FF.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Boot area question of 7C00

Post by Brendan »

Hi,
~ wrote:Is there some instance in which there could be more space used by boot than just 512 bytes in the area 7C00-7DFF?
For "no emulation" El Torito, you choose which segment and how many (2048-bytes) sectors; so the maximum boot loader size would probably be 318 sectors (e.g. 636 KiB from 0x00000800 to 0x0009F7FF).

The other alternative is PXE (used for booting from network). In this case the boot loader can be any size, but it always begins at 0x00007C00 and the network card might be using RAM at 0x00080000, so you can only safely use 481 KiB (although you might get away with a larger boot loader on some computers).

However, just because the BIOS only loads 512 bytes doesn't mean that those 512 bytes can't be used to load the remainder of the boot loader, and the boot loader could also relocate itself above 0x000100000 (to avoid the area reserved for EBDA, video display memory, ROMs, etc, which is what limits the boot loader size for both "no emulation" El Torito and PXE); therefore the maximum size for a floppy or hard disk boot loader is much much larger (the maximum boot loader size is probably over 3 GiB for some computers).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
~
Member
Member
Posts: 1228
Joined: Tue Mar 06, 2007 11:17 am
Libera.chat IRC: ArcheFire

Re: Boot area question of 7C00

Post by ~ »

Brendan wrote:The other alternative is PXE (used for booting from network). In this case the boot loader can be any size, but it always begins at 0x00007C00 and the network card might be using RAM at 0x00080000, so you can only safely use 481 KiB (although you might get away with a larger boot loader on some computers).

From here (http://download.intel.com/design/archiv ... xespec.pdf). You mean this?:
3.1.3 Protected mode (Scanning base memory)
The !PXE structure must be placed on a paragraph boundary in the UNDI code segment. Scan base
memory between the top of free base memory (FBM) and 0A0000h (640 Kbytes). If the top of FBM
cannot be determined, start scanning paragraph boundaries from the top of base memory, 0A0000h
(640K), down to 10000h (64K). Base-code runtime and UNDI drivers will almost always end up
between 80000h (512K) and 0A0000h (640K).
So, maybe it would mean that the area 80000h and above isn't quite "free for use"? Knowing that really makes possible to avoid using that memory for a boot program that could conflict with other code.
Post Reply