I am able to get the execution of system calls invocation and it's processing in Kernel. But few things are not yet clear to me. Upon entering the swi routine, the Kernel saves the User mode registers on stack. The question is-
Who's stack is it? (As swi handling and the corresponding system call routine needs the stack frame to work upon)
If it is Kernel's own stack, from where will get the stack allocated..? Will it start using the current's stack? If yes, then current can be any process that might be executing at that moment in kernel. Does this not exhaust current's stack?
If it uses the currently executing User process's stack in swi handler, then this will be User address space which kernel will now be accessing. Is this possible? As the kernel addressable memory is within 1GB (if 1:3 Kernel-to-User address space ratio is used in a 4GB RAM memory system).