Hi ...
Hi list,
Reading the kernel threads initialization code I see:
int kernel_thread(...) {
struct pt_regs regs;
memset(®s, 0, sizeof(regs));
[...]
** regs.xds = __USER_DS;
** regs.xes = __USER_DS;
I was checking those codes too and I think that is just for satisfying
the requirement of filling struct regs. I guess it is filled with
USER_DS just to pretend the way do_fork is usually called via clone/fork
syscall, that is to create normal user thread. So, IMHO it is not really
related to what the kernel threads will do with user data segment. In
reality, kernel threads operate within kernel mode, so its effective
ss/ds/cs is kernel mode ones too, for instance KERNEL_CS for cs register.
regards,
Mulyadi
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ