Friday, May 16, 2008

Symbian OS Stacks

Symbian OS stacks are fixed in size. They are allocated during the creation of a thread and they do not grow. Once the stack is exhausted there is no dynamic capability for extension

Symbian OS stacks exist both User and Kernel side.

User-side stack:
They are used as temporary scratch storage inside functions or methods. The stack typically grows and shrinks wildly as the thread executes instructions.

Kernal-side Stack:

In EKA2, each thread also has a kernel-side stack, called the supervisor stack. This stack is used for:

a)executive calls

b)if a hardware interrupt occurs whilst the thread is running and the interrupt queues IDFCs and/or DFCs

c)rescheduling. A reschedule always occurs as a result of the current thread calling the scheduler. Inside the scheduler, the current thread’s register state is saved on its supervisor stack and the final stack pointer value is saved in the thread control block. Then the stack pointer is loaded using the new thread’s saved stack pointer value and its register state is restored from the stack (which is now the new thread’s supervisor stack).


Chunk Size:

The minimum amount of RAM required by a stack for a given thread is one page (4kb)

Currently, the default amount of RAM allocated for the thread’s stack is 8kb. Can be changed using EPOCSTACKSIZE keyword in mmp file

But the maximum size for a thread is 64 KB

And maximum size for a process is 2 MB

stacks are seperated using guard with in a chunck

0 comments:

 
Template design by Amanda @ Blogger Buster