Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But still, Linux syscalls are different on each architecture.


Indeed, stupidly different. Different syscall numbers, different argument orders, different values for constants, different struct layouts, ... Some architectures, like MIPS, are particularly bad, with nods to Irix compatibility thrown in.

The BSDs are all exactly the same for every architecture, sane.


This dates back to how Linus did the first non-x86 port of Linux to the DEC Alpha. Rather than copying the x86 linux syscall conventions, he used the DEC OSF/1 syscall conventions to ease bootstrapping. This is a perfectly sane approach. But he probably should have reverted to a native syscall numbering rather than leaving this bootstrapping hack in place.


Different platforms have different sets of registers and alignment requirements. You want to pass things in registers if possible. If you want to avoid inefficiency, you need platform differences. And this is all hidden from users and even developers anyway.


Does that mean you can run Irix binaries on MIPS Linux?


...which is why he used the SYS_ #defines.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: