Kernel requests via page faults

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: Kernel requests via page faults

Post by Owen »

rdos wrote:
JamesM wrote:
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.
IIRC the fastest way to do a syscall on 64-bit x86 is SYSCALL/SYSRET, as they've been specially optimised for this case.
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.
Then you should use SYSENTER or SYSCALL when available...
rdos
Member
Member
Posts: 3286
Joined: Wed Oct 01, 2008 1:55 pm

Re: Kernel requests via page faults

Post by rdos »

Owen wrote:Then you should use SYSENTER or SYSCALL when available...
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.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: Kernel requests via page faults

Post by JamesM »

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.
There aren't many embedded intel chips either, compared to ARM, MIPS and PowerPC ;)
rdos
Member
Member
Posts: 3286
Joined: Wed Oct 01, 2008 1:55 pm

Re: Kernel requests via page faults

Post by rdos »

JamesM 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.
There aren't many embedded intel chips either, compared to ARM, MIPS and PowerPC ;)
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 PowerPC ;)

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.
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Re: Kernel requests via page faults

Post by JamesM »

rdos wrote:
JamesM 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.
There aren't many embedded intel chips either, compared to ARM, MIPS and PowerPC ;)
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 PowerPC ;)

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.
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! :)

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 ;)
Post Reply