Hi, I am trying to integrate binfmt_xout.c into kernel 2.4 as part of the linux-abi project (formerly known as iBCS). For old Xenix 286 binaries the lcall7 gate needs to part of the LDT. In kernels 2.0 sys_modify_ldt(0,...) used to return the default_ldt (with lcall7 gate) if there were no segments set up. This behaviour changed in kernels 2.2 . As a result of a discussion with Linus, David Bruce wrote a patch for binfmt_xout.c tweaking with gdt and current->tss.ldt to get the address of default_ldt. This patch does not work any more with kernels 2.4 as tss vanished from task_struct. I do see 4 ways to cope with this problem: a) extend sys_modify_ldt with a function to retrieve the default_ldt. I did this for testing (see attached diff for arch/i386/kernel/ldt.c ). b) do some work an Davids patch but this is kind of magic for me :-) (see attached default_ldt patch) c) loose the option to compile binfmt_xout (and the rest of linux-abi) as module and simply use the symbol default_ldt. I dint't try that. d) Forget about those old fashioned 286 binaries. This option will make some linux users feel sad, as they run these progs for their daily business. Joerg -- ------------------------------------------------------------------------------ Joerg Ahrens _/ Koenigsberger Strasse 32 _/_/ 31226 Peine _/ _/ Tel.: 05171/57308 _/ _/_/_/_/ e-mail: joerg@hydrops.han.de _/_/_/_/ _/ ------------------------------------------------------------------------------