Skip to contentSkip to conversation

how to tell linux (on x86) to ignore 1M or memory

DISCUSSION Bart Trojanowski 4 participants 5 messages Apr 19, 2007 – Jun 22, 2007

lore
Share & tools
lore
#0 lore raw

I need to preserve some state from the bios before entering protected mode. For now I want to copy it into some ram accessible by real-mode, say the last megabyte visible in real-mode.

What's the easiest way to have linux ignore the megabyte starting at 15M?

Cheers,
-Bart

#1 lore raw
Quoted 6 lines · On Thu, 19 Apr 2007 10:18:04 -0400 Bart Trojanowski <[email protected]> wrote:

I need to preserve some state from the bios before entering protected mode. For now I want to copy it into some ram accessible by real-mode, say the last megabyte visible in real-mode.

What's the easiest way to have linux ignore the megabyte starting at 15M?

Documentation/kernel-parameters.txt:

memmap=nn[KMG]$ss[KMG]
[KNL,ACPI] Mark specific memory as reserved. Region of memory to be used, from ss to ss+nn.

So adding this to kernel boot parameters should do the trick:

	memmap=15M$1M
Signature · 2 lines
	Paolo Ornati
	Linux 2.6.21-rc7-CFS-v3-g6262cd9f on x86_64
#2 lore raw
In reply to Bart Trojanowski
Quoted 3 lines · Bart Trojanowski

I need to preserve some state from the bios before entering protected mode. For now I want to copy it into some ram accessible by real-mode, say the last megabyte visible in real-mode.

What's the easiest way to have linux ignore the megabyte starting at 15M?

Note that real-mode can only access the first megabyte (*) and not the first 16. 16MB is the 16-bit protected mode (286) limit.

(*) well, the first 1M + 64K - 16 bytes using segment FFFF assuming A20 is enabled and x > 1 in x86...

Rene.

#3 lore raw
Quoted 11 lines · Rene Herman
Quoted 5 lines · Bart Trojanowski

I need to preserve some state from the bios before entering protected mode. For now I want to copy it into some ram accessible by real-mode, say the last megabyte visible in real-mode.

What's the easiest way to have linux ignore the megabyte starting at 15M?

Note that real-mode can only access the first megabyte (*) and not the first 16. 16MB is the 16-bit protected mode (286) limit.

No, 16-bit protected mode (on 386+) is not limited to 16 MB.

The main reason there is a 16 MB limit in some current systems is that ISA, and the ISA DMA controller only had 24 address lines.

-hpa

#4 lore raw
Quoted 7 lines · H. Peter Anvin
Quoted 6 lines · Rene Herman
Quoted 4 lines · Bart Trojanowski

I need to preserve some state from the bios before entering protected mode. For now I want to copy it into some ram accessible by real-mode, say the last megabyte visible in real-mode.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

What's the easiest way to have linux ignore the megabyte starting at 15M?

Note that real-mode can only access the first megabyte (*) and not the first 16. 16MB is the 16-bit protected mode (286) limit.

No, 16-bit protected mode (on 386+) is not limited to 16 MB.

That all depends on one's definition of 16-bit protected mode. The "(286)" after mine meant I was talking about the definition in which descriptors have a 24-bit base (and 16-bit limit) field -- ie, real 286 and arguably, "real 16-bit protected mode".

Yes, I guess another valid definition is "code with a 16-bit address and operand size default" on a 386+ and sure, that's just flipping a bit away. In the context of Linux I agree it's also a sensible definition, so, well, whatever. The point was that real mode could only access the first 1M, not the first 16... :-)

Rene.