Kernel compatibility : uname(2)
RFC 2/11 Kernel compatibility : uname(2)
Now, I would like to discuss syscalls.
As my kernel is binarily compatible with Linux, it implements the same syscalls on the same vector (0x80, I've not yet implemented sysenter-like things, and as mentionned earlier, it currently only runs on x86/32). Of course, not all of them have been reimplemented (keyctl(8), for example, proudly returns -ENOSYS), but the implemented ones are faithfully following the Linux specification.
Well, nearly. That is, besides potential bugs (and unimplemented features), I have done one notable modification, to the uname(2) syscall.
When I initially wrote my kernel, I ran into some trouble with the glibc : it kept telling me that my kernel was too old. That's because, in its Linux version, it checks that the kernel version number is at least 2.2.5 - without checking that the OS's *name* is actually "Linux". Thus, when I answered "Manux, version 0.0.0", I never got anything working.
Of course, I could have proposed a patch to the glibc, but :
- This would have done nothing for statically-linked programs;
- In addition, it's highly likely other programs are doing similar checks, and would have failed for a similar reason.
Thus, I decided to fake a Linux-like answer on this syscall, and implement another syscall where I could put what I wanted. In practice, I currently identify myself as "Linux 2.6.35" through uname(2), but "Manux 0.0.5" through my uname_vect(2) syscall.
Is it okay to do this? Do you have any objections or remarks?
Thank you,
Emmanuel
Quoted 6 lines
Thus, I decided to fake a Linux-like answer on this syscall, and implement another syscall where I could put what I wanted. In practice, I currently identify myself as "Linux 2.6.35" through uname(2), but "Manux 0.0.5" through my
uname_vect(2)syscall.Is it okay to do this? Do you have any objections or remarks?
If you are trying to be ABI compatible then replying with a "Linux" version that it is compatible with might actually be extraordinarily sensible.
Alan