Subject: Processes with multiple segments
To: None <,>
From: Martin Girard <>
List: tech-kern
Date: 10/03/2001 03:18:02

I found out something strange investigating whether a process could use multiple segments on the ppc with NetBSD 1.5.1. In trap.c, the copyin() and copyout() routines allow to copy kernelspace <==> userspace and allow a process to use multiple segments by using as many bcopy()'s as necessary and modifying the segment register of the user process in between.

However, in trap(), a process is assumed to be in userspace if the DAR's segment is USER_SR (13). Worse, than that, the only other fixed segment register is KERNEL_SR... (14, immediately after). Unless I miss something, the trap mechanism assumes a userspace process can only use one segment ; since in user mode one cannot change the segment register value, the only way to use multiple segments is to use multiple segment registers.

For now my hypothesis is that the implementation, for some obscure reason, is only partial. But I'd like to know if it's really the case and if the obvious workaround I just mentioned above would be compatible with the rest of memory management as currently implemented.


Get your free email from 

Powered by Outblaze