Re: Just to know: system calls on windows...
- From: Skarmander <spamtrap@xxxxxxxxxx>
- Date: Sat, 11 Nov 2006 18:19:18 +0100
João Jerónimo wrote:
If I want to do ASM programming in Linux, I just have to use it's form of the POSIX standard (passing the system calls to the kernel in the registers)... (not consedering the C library)You're surely confused. POSIX and the kernel are on separate levels. Calling POSIX functions has nothing to do with the kernel, and vice versa.
Those POSIX functions will ultimately be implemented by kernel services, that's true. But as a userland program you shouldn't see or care.
But recently, I've read that the Windows' kernel's ABIs are secret,
Define "secret". Windows is not open source, so you cannot just peek in the code to see what functions the kernel exports. Because Microsoft is the only maintainer of the Windows kernel, they don't need to give anyone else access, so the kernel is fairly self-contained.
That said, drivers of course need to use the documented facilities of the kernel, and those are not "secret". Anyone with a copy of the Windows DDK can develop against the kernel.
so one has to use the user land libraries when accessing kernel functions... is it true?
Not exactly. The mechanisms for accessing the kernel depend on the processor (Windows is available for multiple architectures), but it's typically an INT or SYSENTER instruction with the registers appropriately filled.
However, it is true that you cannot depend on this interface. Only NTDLL.DLL (which implements the native API) is supposed to do this, and that's maintained along with the kernel. You are not supposed to call NTDLL.DLL from your code either, but instead one of the subsystems (like Win32).
OTOH, I know that many people do what they aren't supposed to do (such as doing direct Windows' syscalls), but this doesn't count!
What do you mean? What's wrong with just calling the Win32 functions? If you're writing a driver, you should use the functions supplied in the DDK, which include a well-defined subset of the kernel functions.
If you're a userland program, you have no business going directly to the kernel. Use the Win32 API, that's what it's there for.
Besides, there is ReactOS, which has an open system call interface... ButThat's exactly why there are multiple levels separating Win32 programs from the Windows kernel.
it can be different from from Windows' while still presenving binary compatibility, given that the applications are dynamically linked against
the libs...
S.
.
- Prev by Date: Re: Convert 8 bytes to 8 bits?
- Next by Date: Re: Convert 8 bytes to 8 bits?
- Previous by thread: CPU speed without rdtsc
- Next by thread: Help: ASM to ASM calls
- Index(es):
Relevant Pages
|