TSS
TSS
when the processor looks inside the TSS to get the values inside ss0 and esp0 and replaces the old values inside the ss and esp register, how does the processor put the old values onto the kernel stack? does the processor first copy the old values from ss and esp into some temporary registers before they are replaced with ss0 and esp0?
Re: TSS
because I am curious and I hate not knowing. When something doesn't make sense to me I want to find out why. It doesn't make sense that the ss and esp registers get replaced with the values in esp0 and ss0, switching to the kernel stack and then taking the old values of ss and esp and pushing them onto the kernel stack. The original values must be copied to somewhere before the cpu switches to the kernel stack.
Re: TSS
It doesn't matter. What you need to know is that this happens, this is what the CPU documentation will say. The pseudo-code you find in the CPU documentation will probably use a temporary value. You can think of the CPU as doing anything equivalent to that.
This has no correspondence to reality. The CPU can be implemented in any way. The interrupt instruction could be implemented as a high-level routine implemented by microcode which is different each on CPU model. It could be implemented as a C routine in an emulator. It could be implemented as a bored hardware developer on a beach executing an operating system with rocks representing state. Anything you think you know about the CPU is likely wrong, but it doesn't matter: The things that matter is what the instructions do, not how they do it.
This has no correspondence to reality. The CPU can be implemented in any way. The interrupt instruction could be implemented as a high-level routine implemented by microcode which is different each on CPU model. It could be implemented as a C routine in an emulator. It could be implemented as a bored hardware developer on a beach executing an operating system with rocks representing state. Anything you think you know about the CPU is likely wrong, but it doesn't matter: The things that matter is what the instructions do, not how they do it.
- CorruptedByCPU
- Member
- Posts: 78
- Joined: Tue Feb 11, 2014 4:59 pm
Re: TSS
when processor look inside TSS to get rsp0, first what he do is putting on stack (context stack (process) or kernel stack) variables like: rsp, ss, rip, cs and EFLAGS, then he replace rsp with rsp0
have a good day, sir
have a good day, sir
https://blackdev.org/ - system programming, my own 64 bit kernel and software.