PCB y PSW

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Antonio Feregrino Bolaños 2TV4

PCB
A Process Control Block (PCB, also called Task Controlling Block or Task Struct) is a data
structure in the operating system kernel containing the information needed to manage a particular
process. The PCB is "the manifestation of a process in an operating system".

Included information

Implementations differ, but in general a PCB will include, directly or indirectly:

The identifier of the process (a process identifier, or PID)

Register values for the process including, notably, the program counter and stack pointer values for
the process.

The address space for the process

Priority (in which higher priority process gets first preference. eg., nice value on Unix operating
systems)

Process accounting information, such as when the process was last run, how much CPU time it has
accumulated, etc.

Pointer to the next PCB i.e. pointer to the PCB of the next process to run

I/O Information (i.e. I/O devices allocated to this process, list of opened files, etc)

During context switch, the running process is stopped and another process is given a chance to run.
The kernel must stop the execution of the running process, copy out the values in hardware
registers to its PCB, and update the hardware registers with the values from the PCB of the new
process.

Location of the PCB


Since PCB contains the critical information for the process, it must be kept in an area of memory
protected from normal user access. In some operating systems the PCB is placed in the beginning
of the kernel stack of the process since that is a convenient protected location.

PSW

In computers, the Program Status Word (PSW) is an area of memory or a hardware register which


contains information about program state used by the operating system and the underlying
hardware. It will normally include a pointer (address) to the next instruction to be executed. The
program status word typically contains an error status field and condition codes such as
the interrupt enable/disable bit and a supervisor / user mode bit.

The program status word (PSW) is, typically, 32 bits in length and contains the information required
for proper program execution. The PSW includes the instruction address, condition code, and other

Programación avanzada 31/01/2011


Antonio Feregrino Bolaños 2TV4

fields. In general, the PSW is used to control instruction sequencing and to hold and indicate the
status of the system in relation to the program currently being executed. The active or controlling
PSW is called the current PSW. By storing the current PSW during an interruption, the status of the
CPU can be preserved for subsequent inspection. By loading a new PSW or part of a PSW, the
state of the CPU can be initialized or changed.

Bibliography
Wikipedia. (n.d.). Retrieved 01 31, 2011, from en.wikipedia.org:
http://en.wikipedia.org/wiki/Program_status_word

Wikipedia. (n.d.). Retrieved 01 31, 2011, from en.wikipedia.org:


http://en.wikipedia.org/wiki/Process_control_block

Programación avanzada 31/01/2011


Antonio Feregrino Bolaños 2TV4

Programación avanzada 31/01/2011

You might also like