[prog] Questions about SMP linux (2.4)

Vicky (Qian) Liu aeruru at gmail.com
Tue Mar 21 17:26:08 EST 2006


(I think this belongs in the linux list but from the aging archives, I
wasn't sure it was still active. Advanced apologies if this is in the
wrong list.)

I'm working a project where I am collecting information on the Linux
SMP 2.4.19 kernel by running it on an instrumented x86 emulator
(Bochs). One part of this project is determining when the OS is
handling an interrupt/exception. Although most interrupt to interrupt
return
sequences are straightforward, I'm finding that sometimes a page fault
exception will be invoked on one CPU and then migrate to another CPU.
Other times I find that an interrupt does not return to the
instruction pointer (EIP) it started at. I was wondering if anyone can
offer me reasons for why these two things happen.

A second problem is that I need to determine the ID of a kernel thread
or user proecess from the CPU. So far I've been doing ok using the CR3
(page directory register) to determine what user process is running.
I'm curious to know if there's a more reliable way to identify
processes and if there's anyway to determine what kernel thread is
running just from looking at the CPU state (and memory state, although
I would prefer to not have to resort to this).

I would appreciate any pointers to documentation that could help me
with these questions.

Thanks!
Vicky


More information about the Programming mailing list