OS Maintained Tables
The Process List is used in the system by the multitasking subsystem. The list contain all the processes running on the system.
Structure of the Process List
These fields are used in the Process List. One set of values for each process in the system. Each set of values take 32 bytes of memory. These are the fields:
Structure of the Process List
|Process ID||32 bits||A unique ID which identify the process.|
|Task State Segment||32 bits||The Task State Segment of the process.|
|Code Segment||32 bits||The code segment in the TSS for this process.|
|CS Pointer||32 bits||Instruction Pointer in the code segment.|
|Data Segment||32 bits||The primary data segment. Used with the distributed systems.|
|DS Pointer||32 bits||Data pointer in the data segment. Used with the distributed systems.|
|Priority||16 bits||How much priority this process has.|
|Privilege Level||16 bits||The process privileged level, this is initial given by the user.|
|Flags||32 bits||Only a distributed flag has been specified.|
A unique id in the system. The id is used in many of the other system tables, fx. the multitasking queues.
Task State Segment
The task states segment is were the system save a process' run-time enviroment, before swithing to another process. If hardware multitasking is used through the use of Intel TSS
segment, only the first 16 bits are actually used of this field and they would point to a descriptor in the GDT
. If software multitasking is used this field points to the linear address of the TSS
in memory - and both with and without paging this is the same as the physical address.
Code & Data Segments
These are segment selectors for the Code Segment (CS) and Data Segment (DS) that the process is using. The reason for providing a DS field is when distributing the process, then the system would know which data segment to transfer. The CS value may not be used in some implementations. Again only the first 16 bits are used when using hardware multitasking, and 32 bits are used in software multitasking.
Code & Data Segment Pointers
The pointer to the code segment, is the same as the EIP
. The pointer to the data segment, is used when the system is distributing a process.
The priority defines how often the process has the potential of being executed. The value here decides which suspended queue the process will be moved to when it needs to be executed. Look at the algorithm
used to decide which suspended queue to fetch the next process from. A process will be fetched from queue 1 every 2. time the Process Dispatcher is run (as a result of an IRQ0 signal). Processes are fetched from queue 2 every 4th. time, from queue 3 every 8th time and queue 4 every 16th time. With every queue the amount of processing time is cut in half.
This is a security feature. The way security works in the system looks much like the security features in protected mode of the Intel x86 architechture. But to put it in short:
- An application started by the user can by default only run with the privilege level the user has. Lowest denominator.
- An application can not get a higher privilege level than its max_privilege_level (as set by a superuser). Lowest denominator.
- But through certain channels a lower privileged user may start higher privileged applications.
These 32 flags will be used to store easy access information on what the system may do with a process. An example could be the flag which inform the system that the process may be distributed.
If the D flag is set the process may be micro-level distributed to other systems.