I am building an 32 bit OS in assembly.
I have setup the IDT and I am handling program interruptus through int
instruction.
How can I enable the syscall
and sysenter
instructions and how do I handle them/return?
Is true that syscall
instruction isn't supported in 32 bit by Intel processors so I can't use it?
Is true that sysret
instruction isn't safe?
Do somewhere exist a tutorial for that?
EDIT: My main question is how to enable the syscall
and sysenter
instructions! (No duplication)
At least Wikipedia says this.
And more important: syscall seems not even to be supported by any 32-bit CPU (even not AMD) but only in 32-bit mode of 64-bit AMD CPUs.
So why do you want to use syscall or sysenter?
Nearly all 32-bit x86 OSs use either interrupts (e.g. Linux) or call gates (e.g. Solaris) to enter the kernel...