Hi,
I am new to the linux kernel development area. I want to know what is the difference between kernel mode stack and user mode stack? Does each process has a user mode stack and a kernel mode stack?? Or Each process has a user mode stack and there is only one kernel mode stack that is shared by all processes in the kernel mode?
Hi,
Or Each process has a user mode stack and there is only one kernel mode stack that is shared by all processes in the kernel mode?
On Linux, every thread on your system has a corresponding kernel stack allocated in kernel memory. X86 Linux kernel stacks are generally 8192 bytes in size.
That means in Linux each process has a user mode stack and a corresponding Kernel mode stack? So, there is two stacks per process?
actually they are used on the separate [cpu processing] modes.
and in this state lets we split to as modes(user/kernel) for better understanding of its.
shortly,linux process can operates in two modes:
* in user_mode
any process which runs the in user mode refers to private(own) stack area that is used for holds local variables,parameters,frame pointer(very useful while detect relative addres of any func local variables after pushes,pops especially in debug processing[kernel oops]),temporary(as a cpy) values(like in c,c++,java),return address from funcs and automatic variables within functions.
* in kernel mode (after switching to kernel mode by [switch_to] ), portion of the process (code areas),its addresses and core kernel data, starts to use the kernel stack.
[as additonal infos; hardware context informations(like contents of all registers in user mode) also are saved in the kernel stack while the hardware context processing]
linux kernel has many complex structures like kernel control path that is sequence of instructions(* executed several kernel functions) executed by a kernel for an interrupt,system call or exception handling. so these instructions are belonging to different processes.therefore each kernel path must refers to its kernel stack(8k) [actually 8140 bytes 52 byte save for thread_info structure]
you can define the size of kernel stacks while compaling if you see the like this message
and user mode process can not know where is the address of own kernel stack memory area; (pointer) address, therefore cannot accessed to kernel stack area in the user mode.
while switching to kernel mode with mode switch,process will continue to work in the reentrance kernels.
so it is a reentrance kernel! user mode process executions can be resume in kernel mode and continues processing for new processes by kernel schedulers.[assisgns the another Cpu to the process with schedule()]
but on a single processor system,one process will be process in the Cpu and new processes blocked until the current process turn.
Hi Guys,
I'm trying to install Oracle Database on to Oracle Linux 7.6 but when
the database install package checks the OS set-up, it keeps on failing
on the soft limits for the stack. It's default value is 8192 but I'm trying
to set it to 10240.
This is what I added to... (2 Replies)
I have a multithreaded usermode program(actually a daemon) which is in hanged state.
To debug it I tried attaching the process to gdb, but the gdb hangs.
gstack also gets hanged.
I peeped into the proc file system and saw the process to be in sleeping state.
/proc/sysrq-trigger I guess... (1 Reply)
Hi everybody
My SCO 5.0.2 OpenServer got its kernel corruptions and network stack was accicentially deleted. I would like to know if we have any chance to rebuild its kernel and network stack.
Any help will be great thankfully appreciate
TN (1 Reply)
Hi all!
I've got a problem.
Primary: Sun Sparc V890, 64bit
Standby: HP-Proliant ML 350, 64bit
In the machine that I've got configured physical standby database, the alert_log_file point me one error:
Sat Feb 28 00:40:08 2009
ORA-00202: control file:... (5 Replies)