Then you should use SYSENTER or SYSCALL when available...rdos wrote:Except for exceptions, it is more or less the only way on 64-bit. However, I don't target 64-bit, rather 386+ processors (IA32) only, and I have no plans to switch to 64-bit. There is no need for 64-bit code on embedded platforms.JamesM wrote:IIRC the fastest way to do a syscall on 64-bit x86 is SYSCALL/SYSRET, as they've been specially optimised for this case.rdos wrote:I think the fastest way to do syscalls on x86 is to allocate a callgate with every entrypoint. This will leave all CPU-registers available (no need to use & copy the stack in most (all) cases). It doesn't need to setup function numbers on entry, and it doesn't need decoding functions in the kernel, and eventually to do a call / jmp to the real entrypoint. The only drawback is that GDT selectors are a limited resource.
Kernel requests via page faults
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: Kernel requests via page faults
Re: Kernel requests via page faults
But SYSENTER/SYSEXIT does not fit into my architecture where all parameters are passed in registers. I have no spare register for function numbers, and would need to push context on user stack, validate & access original context from user stack in kernel in order to keep the interface intact. All this will not be faster than a call-gate.Owen wrote:Then you should use SYSENTER or SYSCALL when available...
Re: Kernel requests via page faults
There aren't many embedded intel chips either, compared to ARM, MIPS and PowerPCExcept for exceptions, it is more or less the only way on 64-bit. However, I don't target 64-bit, rather 386+ processors (IA32) only, and I have no plans to switch to 64-bit. There is no need for 64-bit code on embedded platforms.
Re: Kernel requests via page faults
Perhaps not, but there are lots of industrial computers with Intel/AMD/you-name-it chips that runs I32 operating systems. Very few of these are based on ARM, MIPS or PowerPCJamesM wrote:There aren't many embedded intel chips either, compared to ARM, MIPS and PowerPCExcept for exceptions, it is more or less the only way on 64-bit. However, I don't target 64-bit, rather 386+ processors (IA32) only, and I have no plans to switch to 64-bit. There is no need for 64-bit code on embedded platforms.
Also, there is an expanding market of Mini-PCs that starts to get interesting for such applications as well (typically with Intel Atom CPUs). My only problem here is the network chips from Atheros that seems to lack official documentation.
Re: Kernel requests via page faults
Those same industrial systems will be running an operating system that has been verified for a particular task - they generally do not upgrade and will almost certainly never change operating system!rdos wrote:Perhaps not, but there are lots of industrial computers with Intel/AMD/you-name-it chips that runs I32 operating systems. Very few of these are based on ARM, MIPS or PowerPCJamesM wrote:There aren't many embedded intel chips either, compared to ARM, MIPS and PowerPCExcept for exceptions, it is more or less the only way on 64-bit. However, I don't target 64-bit, rather 386+ processors (IA32) only, and I have no plans to switch to 64-bit. There is no need for 64-bit code on embedded platforms.
Also, there is an expanding market of Mini-PCs that starts to get interesting for such applications as well (typically with Intel Atom CPUs). My only problem here is the network chips from Atheros that seems to lack official documentation.
Personally I think that the mini-PC (netbook) market will be dominated by ARM based systems (for example the Cortex-A9 or the new Cortex-A15), but I might be being biased