i386 kernel_thread() questions

lars brinkhoff (lars@nocrew.org)
05 Nov 1999 16:28:34 +0100


If I understand the i386 kernel_thread() function, it does this (in
pseudo-code):

int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags)
{
eax = __NR_clone;
ebx = flags | CLONE_VM;
somereg1 = arg;
somereg2 = fn;
esi = esp;
int $0x80;
if (esp != esi)
{
eax = somereg1;
somereg2 (somereg1);
eax = __NR_exit;
int $0x80;
}

return eax;
}

Questions:

1. Why isn't ecx set to a stack pointer before the clone system call?

2. Why isn't ebx set to a status code before the exit system call?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/