[Prev][Next][Index][Thread]

Re: sproc state information



Hi,

Sorry for the late reply, I've been pretty busy lately. 
I cc'ed to oskit-users mailing list.

With sproc implementation, thread state of a user-level process is
stored two times.  Firstly, when a thread issues fork(), it executes
INT instruction and it is captured by a trap gate.  The trap gate code
is in sproc_syscall_trap_inittab.S.  The very first thing the trap
code does is to push all registers which is not saved by the processor
into the stack.  Secondly, when the thread, which is now executing in
kernel mode, is rescheduled by the thread scheduler, the context
information is saved in somewhere (I guess it is saved in a thread
control block but I haven't checked the code).

If you want to duplicate a virtual memory space, like UNIX fork()
does, you might want to have uvmspace_fork() also wrapped.  Actually
it seemed work regarding address space duplication when I tested it
(long time ago) but I thought nobody would want that so I omitted it.

PS.  St.Patrick's Day release uses relatively old NetBSD-current's uvm
code.  NetBSD-1.5.2 based code is commited into the OSKit CVS, but it
is not released yet.

Regards,

Kota Abe
Media Center, Osaka City University


At Mon, 23 Sep 2002 19:28:50 +0800 (WST),
Voon-Li Chung wrote:
> 
> Hello - I was hoping your could help me with regards to your sproc 
> implementation. When a user-level process (as the result of scheduling) 
> re-enters the kernel as is subsequently "de-scheduled", is there somewhere 
> where the state of the user-level program (by which I mean processor 
> registers, things normally stored on a TSS) is stored? I'm hoping to 
> implement a simple fork() system call, which the simplifying assumption 
> that a user-level process cannot have any network connections or files 
> open (i.e. it is CPU bound).
> 
> -- 
> "Smile for the biometric database!"
>  ______________________________________________________________
> | Voon-Li Chung	           | PhD Student, Inline-Hockey Player |
> | vlchung@csse.uwa.edu.au  | http://www.cs.uwa.edu.au/~vlchung |
>  --------------------------------------------------------------

References: