(no subject)

Stefan Reinauer (stepan@freiburg.linux.de)
Tue, 9 Dec 1997 09:20:19 +0100


Rogier Wolff wrote:

> linux kernel account wrote:
> >
> > Might we want to make the binfmt_java config option help screen say why
> > the binfmt java is obsolete, insted of not mentioning binfmt_misc and
> > hoping the user will see it?
> >
> >
> >
>
> Why don't you submit a patch then?
>
[..]

You submitted a patch to tell Java Binary format is obsolete. Shouldn´t
it be taken out completely then, as it should be our goal to keep obsolete
and unnecessary stuff out of the kernel?

At the moment, many people are discussing wether to take such a useful thing
like Plug´n´Play support into 2.2 or not. The cons are mainly to keep the
kernel simple. Why not throw this out before we have to cope with why it
doesn´t work with linux 3.5 anymore :-)=

Stefan

---------------------------------------- 8< ---------------------------

diff -urN linux-old/Documentation/Configure.help linux-new/Documentation/Configure.help
--- linux-old/Documentation/Configure.help Tue Dec 9 09:09:19 1997
+++ linux-new/Documentation/Configure.help Tue Dec 9 09:10:50 1997
@@ -873,34 +873,6 @@
because some crucial programs on your system might still be in A.OUT
format.

-Kernel support for JAVA binaries
-CONFIG_BINFMT_JAVA
- JAVA(tm) is an object oriented programming language developed by
- SUN; JAVA programs are compiled into "JAVA bytecode" binaries which
- can then be interpreted by run time systems on many different
- operating systems. These JAVA binaries are becoming a universal
- executable format. If you want to execute JAVA binaries, read the
- Java on Linux HOWTO, available via ftp (user: anonymous) at
- sunsite.unc.edu:/pub/Linux/docs/HOWTO. You will then need to install
- the run time system contained in the Java Developers Kit (JDK) as
- described in the HOWTO. This is completely independent of the Linux
- kernel and you do NOT need to say Y here for this to work.
- Saying Y here allows you to execute a JAVA bytecode binary just like
- any other Linux program: by simply typing in its name. (You also
- need to have the JDK installed for this to work). As more and more
- Java programs become available, the use for this will gradually
- increase. You can even execute HTML files containing JAVA applets (=
- JAVA binaries) if those files start with the string
- "<!--applet-->". If you want to use this, say Y here and read
- Documentation/java.txt. If you disable this option it will reduce
- your kernel by about 4kB. This is not much and by itself does not
- warrant removing support. However its removal is a good idea if you
- do not have the JDK installed. You may answer M for module support
- and later load the module when you install the JDK or find an
- interesting Java program that you can't live without. The module
- will be called binfmt_java.o. If you don't know what to answer at
- this point then answer Y.
-
Kernel support for Linux/Intel ELF binaries
CONFIG_BINFMT_EM86
Say Y here if you want to be able to execute Linux/Intel ELF
diff -urN linux-old/arch/i386/config.in linux-new/arch/i386/config.in
--- linux-old/arch/i386/config.in Tue Dec 9 09:09:19 1997
+++ linux-new/arch/i386/config.in Tue Dec 9 09:11:12 1997
@@ -37,9 +37,6 @@
tristate 'Kernel support for a.out binaries' CONFIG_BINFMT_AOUT
tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF
tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC
-if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
- tristate 'Kernel support for JAVA binaries (obsolete)' CONFIG_BINFMT_JAVA
-fi

choice 'Processor type' \
"386 CONFIG_M386 \
diff -urN linux-old/fs/Makefile linux-new/fs/Makefile
--- linux-old/fs/Makefile Tue Dec 9 09:09:19 1997
+++ linux-new/fs/Makefile Tue Dec 9 09:10:07 1997
@@ -218,14 +218,6 @@
endif
endif

-ifeq ($(CONFIG_BINFMT_JAVA),y)
-BINFMTS += binfmt_java.o
-else
- ifeq ($(CONFIG_BINFMT_JAVA),m)
- M_OBJS += binfmt_java.o
- endif
-endif
-
ifeq ($(CONFIG_BINFMT_EM86),y)
BINFMTS += binfmt_em86.o
else
diff -urN linux-old/fs/binfmt_java.c linux-new/fs/binfmt_java.c
--- linux-old/fs/binfmt_java.c Tue Dec 9 09:09:19 1997
+++ linux-new/fs/binfmt_java.c Thu Jan 1 01:00:00 1970
@@ -1,193 +0,0 @@
-/*
- * linux/fs/binfmt_java.c
- *
- * Copyright (C) 1996 Brian A. Lantz
- * derived from binfmt_script.c
- *
- * Simplified and modified to support binary java interpreters
- * by Tom May <ftom@netcom.com>.
- */
-
-#include <linux/module.h>
-#include <linux/string.h>
-#include <linux/stat.h>
-#include <linux/malloc.h>
-#include <linux/binfmts.h>
-#include <linux/init.h>
-
-#define _PATH_JAVA "/usr/bin/java"
-#define _PATH_APPLET "/usr/bin/appletviewer"
-
-/* These paths can be modified with sysctl(). */
-
-char binfmt_java_interpreter[65] = _PATH_JAVA;
-char binfmt_java_appletviewer[65] = _PATH_APPLET;
-
-static int do_load_java(struct linux_binprm *bprm,struct pt_regs *regs)
-{
- char *i_name;
- int len;
- int retval;
- struct dentry * dentry;
- unsigned char *ucp = (unsigned char *) bprm->buf;
-
- if ((ucp[0] != 0xca) || (ucp[1] != 0xfe) || (ucp[2] != 0xba) || (ucp[3] != 0xbe))
- return -ENOEXEC;
-
- /*
- * Fail if we're called recursively, e.g., the Java interpreter
- * is a java binary.
- */
-
- if (bprm->java)
- return -ENOEXEC;
-
- bprm->java = 1;
-
- dput(bprm->dentry);
- bprm->dentry = NULL;
-
- /*
- * Set args: [0] the name of the java interpreter
- * [1] name of java class to execute, which is the
- * filename without the path and without trailing
- * ".class". Note that the interpreter will use
- * its own way to found the class file (typically using
- * environment variable CLASSPATH), and may in fact
- * execute a different file from the one we want.
- *
- * This is done in reverse order, because of how the
- * user environment and arguments are stored.
- */
- remove_arg_zero(bprm);
- len = strlen (bprm->filename);
- if (len >= 6 && !strcmp (bprm->filename + len - 6, ".class"))
- bprm->filename[len - 6] = 0;
- if ((i_name = strrchr (bprm->filename, '/')) != NULL)
- i_name++;
- else
- i_name = bprm->filename;
- bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
- bprm->argc++;
-
- i_name = binfmt_java_interpreter;
- bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
- bprm->argc++;
-
- if (!bprm->p)
- return -E2BIG;
- /*
- * OK, now restart the process with the interpreter's dentry.
- */
- bprm->filename = binfmt_java_interpreter;
- dentry = open_namei(binfmt_java_interpreter, 0, 0);
- retval = PTR_ERR(dentry);
- if (IS_ERR(dentry))
- return retval;
-
- bprm->dentry = dentry;
- retval = prepare_binprm(bprm);
- if (retval < 0)
- return retval;
-
- return search_binary_handler(bprm,regs);
-}
-
-static int do_load_applet(struct linux_binprm *bprm,struct pt_regs *regs)
-{
- char *i_name;
- struct dentry * dentry;
- int retval;
-
- if (strncmp (bprm->buf, "<!--applet", 10))
- return -ENOEXEC;
-
- dput(bprm->dentry);
- bprm->dentry = NULL;
-
- /*
- * Set args: [0] the name of the appletviewer
- * [1] filename of html file
- *
- * This is done in reverse order, because of how the
- * user environment and arguments are stored.
- */
- remove_arg_zero(bprm);
- i_name = bprm->filename;
- bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
- bprm->argc++;
-
- i_name = binfmt_java_appletviewer;
- bprm->p = copy_strings(1, &i_name, bprm->page, bprm->p, 2);
- bprm->argc++;
-
- if (!bprm->p)
- return -E2BIG;
- /*
- * OK, now restart the process with the interpreter's dentry.
- */
- bprm->filename = binfmt_java_appletviewer;
- dentry = open_namei(binfmt_java_appletviewer, 0, 0);
- retval = PTR_ERR(dentry);
- if (IS_ERR(dentry))
- return retval;
-
- bprm->dentry = dentry;
- retval = prepare_binprm(bprm);
- if (retval < 0)
- return retval;
-
- return search_binary_handler(bprm,regs);
-}
-
-static int load_java(struct linux_binprm *bprm,struct pt_regs *regs)
-{
- int retval;
- MOD_INC_USE_COUNT;
- retval = do_load_java(bprm,regs);
- MOD_DEC_USE_COUNT;
- return retval;
-}
-
-static struct linux_binfmt java_format = {
-#ifndef MODULE
- NULL, 0, load_java, NULL, NULL
-#else
- NULL, &__this_module, load_java, NULL, NULL
-#endif
-};
-
-static int load_applet(struct linux_binprm *bprm,struct pt_regs *regs)
-{
- int retval;
- MOD_INC_USE_COUNT;
- retval = do_load_applet(bprm,regs);
- MOD_DEC_USE_COUNT;
- return retval;
-}
-
-static struct linux_binfmt applet_format = {
-#ifndef MODULE
- NULL, 0, load_applet, NULL, NULL
-#else
- NULL, &__this_module, load_applet, NULL, NULL
-#endif
-};
-
-__initfunc(int init_java_binfmt(void))
-{
- register_binfmt(&java_format);
- return register_binfmt(&applet_format);
-}
-
-#ifdef MODULE
-int init_module(void)
-{
- return init_java_binfmt();
-}
-
-void cleanup_module( void) {
- unregister_binfmt(&java_format);
- unregister_binfmt(&applet_format);
-}
-#endif