FPU state management in L4Fiasco.OC program

Adam Lackorzynski adam at os.inf.tu-dresden.de
Wed Apr 11 00:07:47 CEST 2012

On Sun Apr 08, 2012 at 17:22:21 -0500, Mai, Haohui wrote:
> I'm writing a new OS kernel atop of L4Fiasco.OC. I'm having some
> difficulties to let my OS support user-level processes that uses
> floating-point instruction.
> So far, My OS closely follows L4Linux, it creates a new task for each
> user-level process, and marks as all threads of the task as alien thread to
> capture all page faults and exceptions.
> My OS works fines with page fault and syscalls. However, I'm confused with
> what I should do with floating-point exception (exception #7), which is
> issued to my kernel at the first time it tries to perform floating-point
> arithmetic.
> I tried to return to the user-level process with an empty message (
> l4_msgtag_t tag = l4_msgtag(0, 0, 0, 0) ), or an empty message with
> L4_MSGTAG_TRANSFER_FPU (l4_msgtag_t tag = l4_msgtag(0, 0, 0,
> L4_MSGTAG_TRANSFER_FPU) ), but I had no luck.
> The user-level process immediately calls "int $0x3" and stops.
> I read through L4Linux's code and it seems it's doing similar thing, except
> that it did initialize the FPU state before asking L4 to transfer the FPU
> state to user-level process.

I do not see anything (obvious) wrong. Can you pinpoint where the int3

Adam                 adam at os.inf.tu-dresden.de
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/

More information about the l4-hackers mailing list