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

Re: Mach context switch



Hello,

Vasily Sartakov, le Thu 26 Nov 2009 19:08:22 +0300, a écrit :
>  I try to port a Mach microkernel on arm9 architecture.

Wow :)

>  1. when thread_call in bootstrap.c called, context switch acquire. and
>  im looked on x86 sources, and dont see when CPU should switch in
>  different mode for correct context switching. any help?

Note that usually one doesn't explicitly switch to user mode, but do as
if one returns to user mode. In bootstrap.c, see the “Exit to user
thread” comment above thread_bootstrap_return, implemented in entry.S:
“Called as a function, makes the current thread return from the kernel
as if from an exception.”, i.e. build_args_and_stack()/set_user_regs()
have prepared the context of a stack looking just like the first thing
the processus has done was to take a trap.

Samuel


Reply to: