public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] data access fron an interrupt handler
@ 2011-07-16 10:27 Pierre-Marie Boyer
  2011-07-16 18:21 ` Stanislav Meduna
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre-Marie Boyer @ 2011-07-16 10:27 UTC (permalink / raw)
  To: ecos-discuss

Hi,

I plane to work with eCos : Install eCos kernel on a card with a LPC2106 uC
from a PC linux station, and make some tests.

But before this, I would like to know how interrupts handlers work exactly
in case of multitasking software :

 

My problem is about the globals variables access from within an interrupt
function of a particular task.

So, if the system work with several tasks. If in a task we have installed an
interrupt handler (ex:harware interrupt).

When the software is running, if this interrupt is launched by the hardware
while another task is running, what happen if in this interrupt we want
accessing (read or write) a global data of his task while this is not the
same task suspended by the interrupt ? 

Because in this case the task context is not the same, and I think that no
changing context is performed by the OS before running the interrupt.

I think this can be a problem when we are in virtual memory system (uC with
MMU ).

Could you give me some information? 

(I know this is not a specific question of eCos, but I have not found were
to ask this question. sory, and thank you in advance)
 



-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] data access fron an interrupt handler
  2011-07-16 10:27 [ECOS] data access fron an interrupt handler Pierre-Marie Boyer
@ 2011-07-16 18:21 ` Stanislav Meduna
  0 siblings, 0 replies; 2+ messages in thread
From: Stanislav Meduna @ 2011-07-16 18:21 UTC (permalink / raw)
  To: Pierre-Marie Boyer; +Cc: ecos-discuss

On 16.07.2011 12:27, Pierre-Marie Boyer wrote:

> Because in this case the task context is not the same, and I think that no
> changing context is performed by the OS before running the interrupt.
> 
> I think this can be a problem when we are in virtual memory system (uC with
> MMU ).
> 
> Could you give me some information? 
> 
> (I know this is not a specific question of eCos, but I have not found were
> to ask this question. sory, and thank you in advance)

eCos does not use MMU (or at least not in this way), so this
is really wrong forum to ask.


Directly accessing user data from kernel space is no trivial
task. The address translation is one thing, but on a system
with real virtual memory the data are maybe not her
at all - they can be swapped out.

The other way round is much easier - the kernel just
allocates you a virtual memory pointing into kernel space
(on unix-like systems see mmap()).


What exactly are you trying to accomplish? I'd recommend
to get a good book describing the linux kernel and study
kernel space - user space interfacing there (copy_to/from_user,
ideas behind the mmap() call etc).

-- 
                                         Stano

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-16 18:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-16 10:27 [ECOS] data access fron an interrupt handler Pierre-Marie Boyer
2011-07-16 18:21 ` Stanislav Meduna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).