I'm sending this RFC to see if I'm not missing any important detail. Most proposed changes here follow an approach similar to FreeBSD.
Changes: - create a compat/ directory to hold 32 bit specific implementations (syscall's signatures, 32 bit sysent vector, a specific syscalls.master). - enable loading of both types of binaries (32 and 64 bit). In FreeBSD there is a kern/imgact_elf.c which is included in kern/imgact_elf32.c and kern/imgact_elf64.c after a #define specifying the desired elf word size. - detect when loading a 32 bit binary (using a flag local to each process) and set the sysent vector accordingly, then execute the binary. Testing will be done by using a sysent vector with callback that will only trap the call to a syscall, to see if the detection and calling are done correctly. Then I'll start translating each syscall and testing them with syscall-specific tests and real programs. I will start coding with that, so please point any mistake or suggest any improvement. -- Ivan Sichmann Freitas GNU/Linux user #509059
pgpXKcR4pZTJe.pgp
Description: PGP signature