HOW BIG MUST BE A STACK TO PASS PARAMETERS VIA A CALL GATE!!

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pepito

HOW BIG MUST BE A STACK TO PASS PARAMETERS VIA A CALL GATE!!

Post by pepito »

sorry...

pepito
mikeleany

RE:HOW BIG MUST BE A STACK TO PASS PARAMETERS VIA A CALL GAT

Post by mikeleany »

That really depends on the functions being called. You need enough space to store your old stack pointer and stack segment selector, all the parameters that you pass, the instruction pointer and code segment selector, any other registers you modify and any extra data your functions store on the stack. In addition, you will have to provide space for any other functions called by the functions referenced by your call gate. Also, you must allow space for any interrupts that could occur that aren't separate tasks. You could go through and figure out exactly what the worste case scenario is, but that would really be a waste of time. Just guess, and make sure you're guessing high rather than low (but don't guess so high that you use up all your memory). Personally, I'm using 4KB (at least for now).
pepito

RE:HOW BIG MUST BE A STACK TO PASS PARAMETERS VIA A CALL GAT

Post by pepito »

Thank you very much!

I really appreciate your response...

pepito
Post Reply