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

2007-06-22 Thread Rene Herman

On 06/23/2007 01:00 AM, Bodo Eggert wrote:


The real mode on i386+ can actually access the whole 4GB address range
due to a former-bug-now-feature in the i386+.


Generally called "unreal mode". Yes, sure. Just a hack though.

Rene.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-06-22 Thread Bodo Eggert
Rene Herman <[EMAIL PROTECTED]> wrote:

> The point was that real mode could only access the first 1M, not
> the first 16... :-)

The real mode on i386+ can actually access the whole 4GB address range due to
a former-bug-now-feature in the i386+. This "bug" causes the segment limit
to not be reset on return to real mode, but only on subsequent assigns to
the segment registers/selectors. Using a rarely used segment register like
GS, you could use extended memory in your program.

Obviously this needs 1) Entering and returning from protected mode, 2) all
programs to agree not to clobber GS and 3) not using v86 mode (EMM386.exe).
Therefore and because it was discovered in the late days of DOS it was not
in widespread use. Some DOS extenders were reported to use it ...

http://www.programmersheaven.com/mb/x86_asm/344953/344953/readmessage.aspx
-- 
The programmer's National Anthem is '' 

Friß, Spammer: [EMAIL PROTECTED]
 [EMAIL PROTECTED] [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-06-22 Thread Rene Herman

On 06/22/2007 03:46 AM, H. Peter Anvin wrote:


Rene Herman wrote:

On 04/19/2007 04:18 PM, Bart Trojanowski 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?

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.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-06-22 Thread Rene Herman

On 06/22/2007 03:46 AM, H. Peter Anvin wrote:


Rene Herman wrote:

On 04/19/2007 04:18 PM, Bart Trojanowski 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?

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.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-06-22 Thread Bodo Eggert
Rene Herman [EMAIL PROTECTED] wrote:

 The point was that real mode could only access the first 1M, not
 the first 16... :-)

The real mode on i386+ can actually access the whole 4GB address range due to
a former-bug-now-feature in the i386+. This bug causes the segment limit
to not be reset on return to real mode, but only on subsequent assigns to
the segment registers/selectors. Using a rarely used segment register like
GS, you could use extended memory in your program.

Obviously this needs 1) Entering and returning from protected mode, 2) all
programs to agree not to clobber GS and 3) not using v86 mode (EMM386.exe).
Therefore and because it was discovered in the late days of DOS it was not
in widespread use. Some DOS extenders were reported to use it ...

http://www.programmersheaven.com/mb/x86_asm/344953/344953/readmessage.aspx
-- 
The programmer's National Anthem is '' 

Friß, Spammer: [EMAIL PROTECTED]
 [EMAIL PROTECTED] [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-06-22 Thread Rene Herman

On 06/23/2007 01:00 AM, Bodo Eggert wrote:


The real mode on i386+ can actually access the whole 4GB address range
due to a former-bug-now-feature in the i386+.


Generally called unreal mode. Yes, sure. Just a hack though.

Rene.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-06-21 Thread H. Peter Anvin
Rene Herman wrote:
> On 04/19/2007 04:18 PM, Bart Trojanowski 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?
> 
> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-06-21 Thread H. Peter Anvin
Rene Herman wrote:
 On 04/19/2007 04:18 PM, Bart Trojanowski 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?
 
 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
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-04-20 Thread Bodo Eggert
Rene Herman <[EMAIL PROTECTED]> wrote:
> On 04/19/2007 04:18 PM, Bart Trojanowski 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?
> 
> 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  assuming A20 is
> enabled and x > 1 in x86...

Interrupt 15h, function 87h allows copying from/to extended memory.
You might like to look into Ralph Brown's interrupt list for more details.

You could also cpio-gzip the data and append it to the initramfs.
-- 
Fun things to slip into your budget
Does that line item say 'Personal Massage System' Oops, it's supposed to be
'Message'. Go ahead and sign the authorization, Boss; I'll correct it later.
(Iike Hell I will)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-04-20 Thread Rene Herman

On 04/19/2007 04:18 PM, Bart Trojanowski 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?


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  assuming A20 is 
enabled and x > 1 in x86...


Rene.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-04-20 Thread Rene Herman

On 04/19/2007 04:18 PM, Bart Trojanowski 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?


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  assuming A20 is 
enabled and x  1 in x86...


Rene.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-04-20 Thread Bodo Eggert
Rene Herman [EMAIL PROTECTED] wrote:
 On 04/19/2007 04:18 PM, Bart Trojanowski 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?
 
 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  assuming A20 is
 enabled and x  1 in x86...

Interrupt 15h, function 87h allows copying from/to extended memory.
You might like to look into Ralph Brown's interrupt list for more details.

You could also cpio-gzip the data and append it to the initramfs.
-- 
Fun things to slip into your budget
Does that line item say 'Personal Massage System' Oops, it's supposed to be
'Message'. Go ahead and sign the authorization, Boss; I'll correct it later.
(Iike Hell I will)
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-04-19 Thread Paolo Ornati
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

-- 
Paolo Ornati
Linux 2.6.21-rc7-CFS-v3-g6262cd9f on x86_64
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-04-19 Thread 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?

Cheers,
-Bart
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-04-19 Thread 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?

Cheers,
-Bart
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


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

2007-04-19 Thread Paolo Ornati
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

-- 
Paolo Ornati
Linux 2.6.21-rc7-CFS-v3-g6262cd9f on x86_64
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/