News for hackers. Stuff that matters.
Re:Ways of Implementing a System Call by anaisbetts on Friday January 17, 2020 @01:42AM (#22072417)
One of the ways that many operating systems (I'm fairly certain that Windows did this at one point) implemented syscalls long ago was to execute an illegal instruction, because this was the fastest way at the time to transition to kernel mode. x86 even has a specific opcode that is guaranteed to never be used aka always be an illegal instruction
Re:Ways of Implementing a System Call by amluto on Friday January 17, 2020 @03:18AM (#22072843)
x86 has two: UD1 and UD2. Sadly, no one can agree on the length of UD1, even though everyone agrees that it’s illegal. UD2 is well behaved.
Re:Ways of Implementing a System Call by monocasa on Friday January 17, 2020 @07:55AM (#22074178)
It was to transition out of vm86 mode IIRC.