MP Unit 5 Oneshot
MP Unit 5 Oneshot
Hello Friend!
These notes are not free,
The FEES of these notes is that you should
PRAY for me.
Please remember me in your prayers
Apni Duaon Me Mujhe bhi yaad kar lena.
: Dr. Shameem Ahmad
(Sarcastic Teacher)
Micro Processor
Unit 5
1
03-02-2024
Multitasking
• Multitasking is the ability of a computer to run more than
one program or task at the same time.
• On a single processor actually multi-system multitasking
system or multiprocessors they do not run actually at the
same time.
• Instead the processor will switch among the processes that
are currently active at that time.
• It appears to the user as though the processor is executing
all of the task at once.
• Apart from the simple task switching the 80386 will support
two other task-management features:
• Interrupts and Exceptions
• Task Isolation
Multitasking
• The 80386 microprocessor has special registers and data
structures to support efficient and protected multitasking
system.
• Task State Segment
• Task State Segment Descriptor
• Task Registers
• Task Gate Descriptors
• With these registers and data structures the 80386 will
switches execution from one task to another, saving the
environment of the current task so that the task can be
restarted later.
2
03-02-2024
Task State
Segment
3
03-02-2024
4
03-02-2024
5
03-02-2024
TSS Descriptor
• The Descriptors for the TSS of each Task are present in the
GDT. The TSS Descriptor is of 8 bytes
• The ‘b’ bit in the type field indicate whether the the task is
busy. A code of 9 indicate a non-busy task. A code of 11(0Bh)
indicate a busy task.
• Base, Limit, G-bit and P-bit are same as general segment
descriptor.
• However, the limit of a 386 TSS must be greater than
103(0064h) otherwise exception will be occurred. (max 64GB)
Task Register
• Task Register is a 16 bit
register.
• It contains a selector,
which points to the TSS
Descriptor in the GDT.
• Every task in 80386 µP has
a TSS (Task State
Segment).
• As soon as we load a
selector in Task Switch
register, the corresponding
TSS Descriptor is copied This descriptor cache is
from the GDT into an on invisible to the program
chip TSS Descriptor cache.
6
03-02-2024
7
03-02-2024
8
03-02-2024
Busy bit
• A chain of back-links may grow to any length as interrupt tasks
interrupt other interrupt tasks or as called tasks call other tasks.
• The busy bit ensures that the CPU can detect any attempt to
create a loop.
• A loop would indicate an attempt to re-enter a task that is already
busy.
• The TSS is not a re-entrable resource.
1. When switching to a task, the processor automatically sets the busy bit
of the new task.
2. When switching from a task, the processor automatically clears the
busy bit of the old task if that task is not to be placed on the back-link
chain (i.e., the instruction causing the task switch is JMP or IRET). If
the task is placed on the back-link chain, its busy bit remains set.
3. When switching to a task, the processor signals an exception if the busy
bit of the new task is already set.
• By these actions, the processor prevents a task from switching to
itself or to any task that is on a back-link chain, thereby
preventing invalid re-entry into a task.
9
03-02-2024
10
03-02-2024
11
03-02-2024
12
03-02-2024
13
03-02-2024
14
03-02-2024
Pyq
• Multi tasking short note
• Register and data structures used in MT
• TSS
• Task register and its instruction
• Task gate descriptor
• Interrupt gate and trap gate descriptor, difference
• TSs and task gate descriptor difference
• Task linking
• V86 mode
• Linear add in v86 mode’entering and leaving v86mode
• Mem mapped i/o and i/o mapped i/o
• V86 and real mode diff
Thank You
Like Share & Subscribe to
SarcasticTeacher
@ShameemSir
15