Processes have to “remember” certain CPU registers.

Discussion in 'Operating System' started by Sage_sage, Feb 21, 2012.

  1. Sage_sage

    Sage_sage New Member

    Joined:
    Feb 21, 2012
    Messages:
    18
    Likes Received:
    0
    Trophy Points:
    0
    Processes have to “remember” certain CPU registers. :crazy:Why don’t we put them in
    a table just like memory or I/O information for OS to handle?:confused:
     
  2. _eb75_

    _eb75_ New Member

    Joined:
    Jun 18, 2012
    Messages:
    16
    Likes Received:
    6
    Trophy Points:
    0
    Location:
    www.isosika.net
    In fact we do! When a process is started a process owns all user level registers and changes their contents all the time.
    When the operating system changes a running process to an other (context switch), user registers are saved by operating system to a memory area controlled only by the operating system (as PCB, process control block). OS returns the values when we start the original process again.

    Some architectures support saving registers by HW to memory when a special instruction is executed (Intel 386 saved registers to TSS (Task State Segment), but this is not currently used (?) for ex. with new Linux kernel and Intel processor even newest processors are still capable to do that).

    If the question means that we give up registers and use only RAM, it is not good (fast) enough and possible. In fact some older processor architectures supported instructions "memory to memory" as
    "Move a memory location x contents to a memory location y".
    Even then we need some registers inside the processor as the instruction for ex. must be fetched to be executed.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice