* added compilers lcc and bcc (linux86)
[mascara-docs.git] / compilers / linux86-0.16.17 / elksemu / Kernel_patch
blob20b6add9702a90e7081f9c839454f7ad467ec869
1 This kernel patch allows you to run Linux-8086 executables transparently
2 on a Linux-i386 (1.2.13) system.
3 It requires V0.0.2 or better of elksemu in the file "/lib/elksemu".
5 If you are using kernel 1.3.* or later try the module: binfmt_elks.o
6 If you are using 2.0.36, 2.1.43 or 2.2.0  and later use binfmt_misc.
8 --- orig-13/fs/exec.c   Sun Sep 24 13:22:37 1995
9 +++ linux/fs/exec.c     Sun Feb 11 20:11:47 1996
10 @@ -615,6 +615,12 @@
11         set_fs(old_fs);
12         if (retval < 0)
13                 goto exec_error2;
14 +#ifndef NO_ELKSEMU
15 +       /* What a horrible hack! :-) */
16 +       if ((bprm.buf[0] == 1)    && (bprm.buf[1] == 3) && 
17 +           (bprm.buf[2] == 0x20 || bprm.buf[2] == 0x10) && (bprm.buf[3] == 4))
18 +               memcpy(bprm.buf, "#!/lib/elksemu\n", 16);
19 +#endif
20         if ((bprm.buf[0] == '#') && (bprm.buf[1] == '!') && (!sh_bang)) {
21                 /*
22                  * This section does the #! interpretation.