Page 1 of 1

FPU vs Task Switch

Posted: Fri Apr 04, 2003 12:00 am
by Stefan
Ok... I understood that 386 processors do not save informations about FPU when switching a task. How does operating system handle this problem? Because it must be kept data integrity for fpu or mmx registers too.

RE:FPU vs Task Switch

Posted: Sun Apr 06, 2003 11:00 pm
by Anton
Well, an os can save it, when it handels task switch. I mean, that task switching can't bee done totaly on hardware, which means that you have some software task switcher(timer interrupt handler), which in turn uses the hardware instructions. Well, then this handler should save the FPU. Intel does provide some help(copy on write): you don't have to save the FPU, MMX, SIMD stuff, but when they are acessed, by some other task, you have an exeption.
Anton

RE:FPU vs Task Switch

Posted: Mon Apr 07, 2003 11:00 pm
by Stefan
Could you tell me what exception is thrown? Because I want to read about it.

RE:FPU vs Task Switch

Posted: Tue Apr 08, 2003 11:00 pm
by Anton
It generates device-not-available exception (#NM). Read chapter 10.4.1 "Using the TS Flag in Control Register CR0 to Control MMX™/FPU State Saving" in Intel Manual Volume 3.
Anton.

RE:FPU vs Task Switch

Posted: Wed Apr 16, 2003 11:00 pm
by heliosc
Read up on the fxstor instruction

RE:FPU vs Task Switch

Posted: Wed Apr 16, 2003 11:00 pm
by heliosc
Read up on the fxstor instruction