LTR is a privileged instruction and acts in a manner similar to other segment register loads.
The task register has two parts: a portion visible and accessible by the programmer and an invisible one that is automatically loaded from the TSS descriptor.
Note that some modern operating systems such as Windows and Linux[1] do not use these fields in the TSS as they implement software task switching.
This bitmap, usually set up by the operating system when a task is started, specifies individual ports to which the program should have access.
The hardware will then check the I/O permissions bitmap in the TSS to see if that program can access the specific port(s) in the IN or OUT instruction.
This feature allows operating systems to grant selective port access to user programs.
The TSS contains 6 fields for specifying the new stack pointer when a privilege level change happens.
When an interrupt happens in protected (32-bit) mode, the x86 CPU will look in the TSS for SS0 and ESP0 and load their values into SS and ESP respectively.
The original register values were saved in the TSS current at the time the interrupt or exception occurred.
If the task register holds a bad TSS selector, a #TS fault will be generated.