ecsimsw

What's the difference between user registers and kernel registers? 본문

What's the difference between user registers and kernel registers?

JinHwan Kim 2019. 4. 20. 20:22
  • stackexchange_ What's the difference between user registers and kernel registers?
    "Answer" It's simple - when each application program runs, it has access to its own set of registers. When you switch to other application, these register contents is saved to memory, and registers, saved from other application, loaded and this application continues its execution.
    Similarly, OS has its own register contents. Depending on CPU, it may even has its own, different register set. Moreover, some CPUs has two physical register sets - for apps and for OS, thus allowing fast switching from app to OS and back again (f.e. when app requests some service from OS).
    Now let's look at your citation. I'm not an OS specialist, but this text means that for each application, we have specific contents of OS registers. F.e. these registers may hold app-specific data which isn't available to app itself (such as security context of the app). So, when you switch from app to OS (usually by requesting some OS service), OS registers are immediately ready to use, making the call faster. OTOH, when you switch to other app, the entire set of kernel registers need to be saved and kernel registers for other app should be loaded instead.
    Since task switching is much less frequent operation, this makes the entire execution faster.

'Machine Learning > tf_source' 카테고리의 다른 글

TF_source ) 2019-04-25  (0) 2019.04.25
TF_source ) kernel_builder  (0) 2019.04.23
TF_source ) KernelRegistry  (0) 2019.04.20
TF_source) Opkernel  (0) 2019.04.12
TF_source) OpkernelConstruction  (0) 2019.04.12
Comments