1. What is task?
A task is a unit of work that a processor can dispatch, execute, and suspend.
2. Task Structure.
A task is made up of two parts: a task execution space and a task-state segment
(TSS). The task execution space consists of a code segment(cs), a stack segment(ss), and
one or more data segments(ds).
The TSS specifies the segments that make up the task execution space and provides
3. Executing a task.
Software or the processor can dispatch a task for execution in one of the following
ways:
*A explicit call to a task with the CALL instruction.
*A explicit jump to a task with the JMP instruction.
*An implicit call (by the processor) to an interrupt-handler task.
*An implicit call to an exception-handler task.
*A return (initiated with an IRET instruction) when the NT flag in the EFLAGS
register is set.
4. Data structure for handling task-related activities:
a storage place for task state information. In multitasking systems, the TSS also
provides a mechanism for linking tasks.
Task-state segment (TSS). including all the general registers, segment selectors, iomap base address, espX...Similar as trap frame in jos.
Task-gate descriptor. -> A way to access TSS descriptor( final goal is still access a task), maybe in GDT, LDT or IDT.
TSS descriptor. -> it's stored only in GDT, not LDT or IDT
Task register. 2 parts, visible part point to TSS descriptor in GDT, invisible part cache the segment descriptor. Use STR/LDR to w/r visible part.
NT flag in the EFLAGS register.
5. What's in GDT?
Different Segment Descriptors: Kernel text, Kernel data, User text, User data, TSS descriptors for each CPU.
本文介绍了任务的概念、结构及其执行方式,并详细阐述了用于处理任务活动的数据结构,包括任务状态段(TSS)、任务门描述符等关键组件。此外,还讨论了全局描述符表(GDT)中不同类型的段描述符。
1649

被折叠的 条评论
为什么被折叠?



