FPU vs Task Switch

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Stefan

FPU vs Task Switch

Post 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.
Anton

RE:FPU vs Task Switch

Post 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
Stefan

RE:FPU vs Task Switch

Post by Stefan »

Could you tell me what exception is thrown? Because I want to read about it.
Anton

RE:FPU vs Task Switch

Post 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.
heliosc

RE:FPU vs Task Switch

Post by heliosc »

Read up on the fxstor instruction
heliosc

RE:FPU vs Task Switch

Post by heliosc »

Read up on the fxstor instruction
Post Reply