You should know where your stack is, as it is defined within your code and placed at a known location. As for obtaining the actual value of ESP i would simply read it from the stack from within a function. You will know what offset to read into the stack based on how many parameters the function has.yoshi65 wrote:Thanks, that brings me to my next thing I found. When the TSS is installed there is a 0x0 for the esp0 entry. How can I get the stack for the kernel to put it in there? (That is assuming that is what I need to do anyway)
This esp can then be placed in the TSS entry, along with the correct GDT selector value.