* Memory management while loading program in Linux
@ 2005-06-28 17:58 Sreeni
2005-06-29 4:20 ` Eric W. Biederman
0 siblings, 1 reply; 8+ messages in thread
From: Sreeni @ 2005-06-28 17:58 UTC (permalink / raw)
To: linux-kernel
Hello,
I have a query regarding memory management using Linux kernel.
In our system we have a secure physical memory starting and ending at
predefined addresses. We want to execute certain programs, which have
to be running secure in those address spaces only.
Is it possible to force the loader to load the "particular" program
(both the code and data segment) at that pre-defined secure physical
memory, without any major kernel changes?
Thanks,
Sreeni
(sreeni@nec-labs.com)
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Memory management while loading program in Linux
2005-06-28 17:58 Memory management while loading program in Linux Sreeni
@ 2005-06-29 4:20 ` Eric W. Biederman
2005-06-29 15:37 ` **** How to lock memory pages? Sreeni
0 siblings, 1 reply; 8+ messages in thread
From: Eric W. Biederman @ 2005-06-29 4:20 UTC (permalink / raw)
To: Sreeni; +Cc: linux-kernel
Sreeni <sreeni.pulichi@gmail.com> writes:
> Hello,
>
> I have a query regarding memory management using Linux kernel.
>
> In our system we have a secure physical memory starting and ending at
> predefined addresses. We want to execute certain programs, which have
> to be running secure in those address spaces only.
>
> Is it possible to force the loader to load the "particular" program
> (both the code and data segment) at that pre-defined secure physical
> memory, without any major kernel changes?
Sounds a little silly but in essence the loader is implemented
in user space so it shouldn't require any kernel changes.
Eric
^ permalink raw reply [flat|nested] 8+ messages in thread
* **** How to lock memory pages?
2005-06-29 4:20 ` Eric W. Biederman
@ 2005-06-29 15:37 ` Sreeni
2005-06-29 16:51 ` Richard B. Johnson
2005-06-29 18:52 ` **** How to lock memory pages? Frederik Deweerdt
0 siblings, 2 replies; 8+ messages in thread
From: Sreeni @ 2005-06-29 15:37 UTC (permalink / raw)
To: linux-kernel
Hi,
Is there a way to lock a particular portion of the memory pages during
kernel bootup? I want to re-use these pages when I load my
application. I *don't* wanna use the idea of reserving some physical
memory and using ioremap. I want something that kernel should be able
to manage this memory but I don't want any other application to use
this memory.
Thanks in advance
Sreeni
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: **** How to lock memory pages?
2005-06-29 15:37 ` **** How to lock memory pages? Sreeni
@ 2005-06-29 16:51 ` Richard B. Johnson
2005-06-29 20:02 ` John Stoffel
2005-06-29 18:52 ` **** How to lock memory pages? Frederik Deweerdt
1 sibling, 1 reply; 8+ messages in thread
From: Richard B. Johnson @ 2005-06-29 16:51 UTC (permalink / raw)
To: Sreeni; +Cc: linux-kernel
On Wed, 29 Jun 2005, Sreeni wrote:
> Hi,
>
> Is there a way to lock a particular portion of the memory pages during
> kernel bootup? I want to re-use these pages when I load my
> application. I *don't* wanna use the idea of reserving some physical
> memory and using ioremap. I want something that kernel should be able
> to manage this memory but I don't want any other application to use
> this memory.
>
> Thanks in advance
> Sreeni
> -
Wrong kind of kernel for this kind of use. The kernel dynamically
allocates/deallocates/pages of memory that it knows about. The only
way to do what you want, with a kernel designed for multi-tasking
multi-user applications use, is to reserve memory during boot.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: **** How to lock memory pages?
2005-06-29 16:51 ` Richard B. Johnson
@ 2005-06-29 20:02 ` John Stoffel
2005-06-29 20:27 ` Forcing loader to load a prog at a fixed memory location Sreeni
0 siblings, 1 reply; 8+ messages in thread
From: John Stoffel @ 2005-06-29 20:02 UTC (permalink / raw)
To: linux-os; +Cc: Sreeni, linux-kernel
>>>>> "Richard" == Richard B Johnson <linux-os@analogic.com> writes:
Richard> On Wed, 29 Jun 2005, Sreeni wrote:
>> Is there a way to lock a particular portion of the memory pages during
>> kernel bootup? I want to re-use these pages when I load my
>> application. I *don't* wanna use the idea of reserving some physical
>> memory and using ioremap. I want something that kernel should be able
>> to manage this memory but I don't want any other application to use
>> this memory.
Richard> Wrong kind of kernel for this kind of use. The kernel
Richard> dynamically allocates/deallocates/pages of memory that it
Richard> knows about. The only way to do what you want, with a kernel
Richard> designed for multi-tasking multi-user applications use, is to
Richard> reserve memory during boot.
Sreeni, you might want to look at the mlockall() interface, but it's
also hard to know what's right to do here if you don't explain what
you are trying to do. For example, why do you *care* which memory
address(es) your application gets?
John
^ permalink raw reply [flat|nested] 8+ messages in thread
* Forcing loader to load a prog at a fixed memory location
2005-06-29 20:02 ` John Stoffel
@ 2005-06-29 20:27 ` Sreeni
2005-06-29 20:50 ` Richard B. Johnson
0 siblings, 1 reply; 8+ messages in thread
From: Sreeni @ 2005-06-29 20:27 UTC (permalink / raw)
To: linux-os, linux-kernel
Hello,
May I know the possible ways of instrcuting the compiler/loader to
place a process's 'data segments (data, stack, heap bss etc)' at a
*fixed* physical/virtual addresses?
Thanks
Sreeni
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Forcing loader to load a prog at a fixed memory location
2005-06-29 20:27 ` Forcing loader to load a prog at a fixed memory location Sreeni
@ 2005-06-29 20:50 ` Richard B. Johnson
0 siblings, 0 replies; 8+ messages in thread
From: Richard B. Johnson @ 2005-06-29 20:50 UTC (permalink / raw)
To: Sreeni; +Cc: Linux kernel
On Wed, 29 Jun 2005, Sreeni wrote:
> Hello,
>
> May I know the possible ways of instrcuting the compiler/loader to
> place a process's 'data segments (data, stack, heap bss etc)' at a
> *fixed* physical/virtual addresses?
>
> Thanks
> Sreeni
>
.org ADDRESS
Starts code or data at the OFFSET specified. However, you would
need to know where `ld` put the beginning of that segment to
know what the offset referred to.
If the code is in the kernel, You can tell the linker set fixups
for some load address as the kernel does. Look at linux-`uname
-r`/arch/i386/boot/compressed/Makefile to see a possible syntax.
In user-space, you can check where the loader put label '_start' and
'_end' using. You can make code that is supposed to execute at
an offset from there. However, it will never be a physical location
that you can count on.
The way a user-mode program accesses physical memory is by using
mmap() MAP_FIXED.
Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: **** How to lock memory pages?
2005-06-29 15:37 ` **** How to lock memory pages? Sreeni
2005-06-29 16:51 ` Richard B. Johnson
@ 2005-06-29 18:52 ` Frederik Deweerdt
1 sibling, 0 replies; 8+ messages in thread
From: Frederik Deweerdt @ 2005-06-29 18:52 UTC (permalink / raw)
To: Sreeni; +Cc: linux-kernel
Le 29/06/05 11:37 -0400, Sreeni écrivit:
> Hi,
>
> Is there a way to lock a particular portion of the memory pages during
> kernel bootup? I want to re-use these pages when I load my
> application. I *don't* wanna use the idea of reserving some physical
> memory and using ioremap. I want something that kernel should be able
> to manage this memory but I don't want any other application to use
> this memory.
Please note that this is a newbie advice:
I'd have a look at how the kernel reserves pages DMA usage (below 1M)
Regards,
Frederik Deweerdt
--
o---------------------------------------------o
| http://open-news.net : l'info alternative |
| Tech - Sciences - Politique - International |
o---------------------------------------------o
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2005-06-29 20:55 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-28 17:58 Memory management while loading program in Linux Sreeni
2005-06-29 4:20 ` Eric W. Biederman
2005-06-29 15:37 ` **** How to lock memory pages? Sreeni
2005-06-29 16:51 ` Richard B. Johnson
2005-06-29 20:02 ` John Stoffel
2005-06-29 20:27 ` Forcing loader to load a prog at a fixed memory location Sreeni
2005-06-29 20:50 ` Richard B. Johnson
2005-06-29 18:52 ` **** How to lock memory pages? Frederik Deweerdt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox