I didn't name this "How to implement syscalls", because that could refer to an interrupt interface, or sysenter.
I recently got context switching working in my OS. As in, 10 minutes ago. And boy, it felt amazing. I broke a chair. My arms went chockful of adrenaline. IT was bliss.
So, I now know that my keyboard handler works, thus implying interrupts work. And it returns to ring 3 properly.
So now I feel the next step towards writing user code is syscalls. Then I can interface with the screen/keyboard.
I know that the syscall handler needs to be existent, and the address to it should be in the LSTAR MSR.
A) How do I read/write from the LSTAR MSR?
B) What other flags in various other registers do I need to set?
C) What structures may I need to set up?
D) Do I need to alter existing structures?
E) Are there specific things I need to do inside the syscall handler to run/return properly without faults?
How to implement the SYSCALL instruction
How to implement the SYSCALL instruction
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: How to implement the SYSCALL instruction
If only Intel would publish some sort of Programmer's Manual that detailed this sort of thing.
Re: How to implement the SYSCALL instruction
I always forget about those...iansjack wrote:If only Intel would publish some sort of Programmer's Manual that detailed this sort of thing.
Skylight: https://github.com/austanss/skylight
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
I make stupid mistakes and my vision is terrible. Not a good combination.
NOTE: Never respond to my posts with "it's too hard".
Re: How to implement the SYSCALL instruction
And what about this one:
https://wiki.osdev.org/Sysenter#AMD:_SYSCALL.2FSYSRET
https://wiki.osdev.org/Sysenter#AMD:_SYSCALL.2FSYSRET