lkml.org 
[lkml]   [1996]   [May]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectAnimal patch, Version 1.02

Below is version 1.02 of the animal patch.

Features:
1. /proc/animal is now selectable via config scripts
2. /proc/version now displays kernel name:
Linux version 1.99.6 (root@blackhole.mordor) (gcc version 2.7.2)
#6-pre-2.0 Tue May 21 15:21:34 MDT 1996 <Greased Platypus on Warm Milk>


3. Help added for config selections
4. Kernel displays name durring boot:

Linux version 1.99.6 (root@blackhole.mordor) (gcc version 2.7.2)
#6-pre-2.0 Tue May 21 15:21:34 MDT 1996 <Greased Platypus on Warm Milk>

Expect /proc/animal support to go away. This seems kind of redundant now
that we have /proc/version support.

I *NEED* Beta testers <Grin>. Please send me info if you like this, don't
like this, etc! This patch ahs been tested with pre-2.0.6.

Joel Maslak
Lost in Wyoming!

Patch follows:

diff -ur --new-file linux-1.99.6.orig/Documentation/Configure.help linux/Documentation/Configure.help
--- linux-1.99.6.orig/Documentation/Configure.help Sun May 19 06:29:28 1996
+++ linux/Documentation/Configure.help Tue May 21 15:31:54 1996
@@ -2774,7 +2774,17 @@
source of trouble if two devices are mistakenly configured to use
the same IRQ). Several programs depend on this, so everyone should
say Y here.
-
+
+Kernel nick-name support
+CONFIG_PROC_ANIMAL
+ By saying Y here, you will install /proc/animal. This file is used
+ to determine the full name of the current release. For instance,
+ pre2.0.5's name was "Greased Platypus on Warm Milk". Nothing bad will
+ happen if you say N (yet!), but this driver takes less than 1K of RAM.
+ Thus, you should probably say Y, unless you are running Linux in an
+ embedded system. Note that saying N will NOT affect the /proc/version
+ file (which also lists animal name).
+
NFS filesystem support
CONFIG_NFS_FS
If you are connected to some other (usually local) Unix computer
diff -ur --new-file linux-1.99.6.orig/MAINTAINERS linux/MAINTAINERS
--- linux-1.99.6.orig/MAINTAINERS Sun May 12 12:33:00 1996
+++ linux/MAINTAINERS Tue May 21 10:26:10 1996
@@ -311,6 +311,11 @@
W: http://www.advansys.com/linux
S: Maintained

+KERNEL NAMING SYSTEM (/proc/animal) SUPPORT
+P: Joel Maslak
+M: Joel Maslak <j@pobox.com>
+S: Maintained
+
CREDITS FILE
P: John A. Martin
M: jam@acm.org
diff -ur --new-file linux-1.99.6.orig/fs/Config.in linux/fs/Config.in
--- linux-1.99.6.orig/fs/Config.in Sun May 19 06:22:19 1996
+++ linux/fs/Config.in Tue May 21 10:20:31 1996
@@ -18,6 +18,12 @@
dep_tristate 'umsdos: Unix like fs on top of std MSDOS FAT fs' CONFIG_UMSDOS_FS $CONFIG_MSDOS_FS

bool '/proc filesystem support' CONFIG_PROC_FS
+if [ "$CONFIG_PROC_FS" = "y" ]; then
+ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
+ bool ' Kernel nick-name support in /proc/animal' CONFIG_PROC_ANIMAL
+ fi
+fi
+
if [ "$CONFIG_INET" = "y" ]; then
tristate 'NFS filesystem support' CONFIG_NFS_FS
if [ "$CONFIG_NFS_FS" = "y" ]; then
diff -ur --new-file linux-1.99.6.orig/fs/proc/array.c linux/fs/proc/array.c
--- linux-1.99.6.orig/fs/proc/array.c Tue Apr 30 04:09:45 1996
+++ linux/fs/proc/array.c Tue May 21 15:17:43 1996
@@ -25,6 +25,9 @@
*
* Bruno Haible : remove 4K limit for the maps file
* <haible@ma2s2.mathematik.uni-karlsruhe.de>
+ *
+ * Joel Maslak : Added animal extension.
+ * <j@pobox.com>
*/

#include <linux/types.h>
@@ -43,6 +46,10 @@
#include <linux/mm.h>
#include <linux/pagemap.h>
#include <linux/swap.h>
+#ifdef CONFIG_PROC_ANIMAL
+# include <linux/version.h>
+# include <linux/animal.h>
+#endif

#include <asm/segment.h>
#include <asm/pgtable.h>
@@ -187,6 +194,27 @@
nr_running, nr_tasks, last_pid);
}

+#ifdef CONFIG_PROC_ANIMAL
+
+
+/*
+ * Animal Code
+ *
+ * Returns the name of the kernel
+ * 1.00 -- Initial Version, Joel C. Maslak <j@pobox.com>
+ * 1.01 -- Spelling and support for pre2.0, lilo <TaRDis@mail.utexas.edu>
+ * 1.02 -- Configuration choices, init.c code additions,
+ * Joel C. Maslak <j@pobox.com>
+ */
+
+static int get_animal(char * buffer)
+{
+ return sprintf(buffer, "%s %s %s %s\n", GET_ANIMAL_VERSION,
+ GET_ANIMAL_PATCHLEVEL, GET_ANIMAL_SUBLEVEL0,
+ GET_ANIMAL_SUBLEVEL1);
+}
+#endif
+
static int get_kstat(char * buffer)
{
int i, len;
@@ -1044,6 +1072,10 @@
#endif
case PROC_LOCKS:
return get_locks_status(page);
+#ifdef CONFIG_PROC_ANIMAL
+ case PROC_ANIMAL:
+ return get_animal(page);
+#endif
}
return -EBADF;
}
diff -ur --new-file linux-1.99.6.orig/fs/proc/root.c linux/fs/proc/root.c
--- linux-1.99.6.orig/fs/proc/root.c Tue Apr 30 04:09:45 1996
+++ linux/fs/proc/root.c Tue May 21 10:34:39 1996
@@ -293,6 +293,12 @@
S_IFLNK | S_IRUGO | S_IWUGO | S_IXUGO, 1, 0, 0,
64, &proc_self_inode_operations,
});
+#ifdef CONFIG_PROC_ANIMAL
+ proc_register(&proc_root, &(struct proc_dir_entry) {
+ PROC_ANIMAL, 6, "animal",
+ S_IFREG | S_IRUGO, 1, 0, 0,
+ });
+#endif
proc_register(&proc_root, &proc_net);
proc_register(&proc_root, &proc_scsi);
proc_register(&proc_root, &proc_sys_root);
diff -ur --new-file linux-1.99.6.orig/include/linux/animal.h linux/include/linux/animal.h
--- linux-1.99.6.orig/include/linux/animal.h Wed Dec 31 17:00:00 1969
+++ linux/include/linux/animal.h Sun May 19 11:07:10 1996
@@ -0,0 +1,135 @@
+/*
+ * /proc/animal header file
+ * Joel C. Maslak, 1996, j@pobox.com
+ *
+ * Idea from: Andrew Esh
+ */
+
+#define GET_ANIMAL_INTERNAL_1 ( LINUX_VERSION_CODE / 65536)
+#define GET_ANIMAL_INTERNAL_2 ((LINUX_VERSION_CODE % 65536) / 256)
+#define GET_ANIMAL_INTERNAL_3 ((LINUX_VERSION_CODE % 256) / 16)
+#define GET_ANIMAL_INTERNAL_4 ( LINUX_VERSION_CODE % 16)
+
+#if GET_ANIMAL_INTERNAL_1 == 1
+# define GET_ANIMAL_VERSION "Greased"
+#elif GET_ANIMAL_INTERNAL_1 == 2
+# define GET_ANIMAL_VERSION "Turbocharged"
+#elif GET_ANIMAL_INTERNAL_1 == 3
+# define GET_ANIMAL_VERSION "Supercharged"
+#elif GET_ANIMAL_INTERNAL_1 == 4
+# define GET_ANIMAL_VERSION "Stealthy"
+#elif GET_ANIMAL_INTERNAL_1 == 5
+# define GET_ANIMAL_VERSION "Electrified"
+#elif GET_ANIMAL_INTERNAL_1 == 6
+# define GET_ANIMAL_VERSION "Tired"
+#elif GET_ANIMAL_INTERNAL_1 == 7
+# define GET_ANIMAL_VERSION "Crazy"
+#elif GET_ANIMAL_INTERNAL_1 == 8
+# define GET_ANIMAL_VERSION "Dyslexic"
+#elif GET_ANIMAL_INTERNAL_1 == 9
+# define GET_ANIMAL_VERSION "Unbeatable"
+#else
+# define GET_ANIMAL_VERSION "Unknown"
+#endif
+
+
+#if GET_ANIMAL_INTERNAL_2 == 0
+# define GET_ANIMAL_PATCHLEVEL "Chicken"
+#elif GET_ANIMAL_INTERNAL_2 == 1
+# define GET_ANIMAL_PATCHLEVEL "GroundHog"
+#elif GET_ANIMAL_INTERNAL_2 == 2
+# define GET_ANIMAL_PATCHLEVEL "Ostrich"
+#elif GET_ANIMAL_INTERNAL_2 == 3
+# define GET_ANIMAL_PATCHLEVEL "HedgeHog"
+#elif GET_ANIMAL_INTERNAL_2 == 4
+# define GET_ANIMAL_PATCHLEVEL "Penguin"
+#elif GET_ANIMAL_INTERNAL_2 == 5
+# define GET_ANIMAL_PATCHLEVEL "Kitten"
+#elif GET_ANIMAL_INTERNAL_2 == 6
+# define GET_ANIMAL_PATCHLEVEL "Owl"
+#elif GET_ANIMAL_INTERNAL_2 == 7
+# define GET_ANIMAL_PATCHLEVEL "Shrew"
+#elif GET_ANIMAL_INTERNAL_2 == 8
+# define GET_ANIMAL_PATCHLEVEL "Rabbit"
+#elif GET_ANIMAL_INTERNAL_2 == 9
+# define GET_ANIMAL_PATCHLEVEL "Hawk"
+#elif GET_ANIMAL_INTERNAL_2 == 99
+# define GET_ANIMAL_PATCHLEVEL "Platypus"
+#else
+# define GET_ANIMAL_PATCHLEVEL "Unknown"
+#endif
+
+
+#if GET_ANIMAL_INTERNAL_3 == 0
+# define GET_ANIMAL_SUBLEVEL0 "on"
+#elif GET_ANIMAL_INTERNAL_3 == 1
+# define GET_ANIMAL_SUBLEVEL0 "selling"
+#elif GET_ANIMAL_INTERNAL_3 == 2
+# define GET_ANIMAL_SUBLEVEL0 "feeling the effects of"
+#elif GET_ANIMAL_INTERNAL_3 == 3
+# define GET_ANIMAL_SUBLEVEL0 "spewing"
+#elif GET_ANIMAL_INTERNAL_3 == 4
+# define GET_ANIMAL_SUBLEVEL0 "needing"
+#elif GET_ANIMAL_INTERNAL_3 == 5
+# define GET_ANIMAL_SUBLEVEL0 "buying"
+#elif GET_ANIMAL_INTERNAL_3 == 6
+# define GET_ANIMAL_SUBLEVEL0 "handing out"
+#elif GET_ANIMAL_INTERNAL_3 == 7
+# define GET_ANIMAL_SUBLEVEL0 "whining for"
+#elif GET_ANIMAL_INTERNAL_3 == 8
+# define GET_ANIMAL_SUBLEVEL0 "looking for"
+#elif GET_ANIMAL_INTERNAL_3 == 9
+# define GET_ANIMAL_SUBLEVEL0 "making"
+#elif GET_ANIMAL_INTERNAL_3 == 10
+# define GET_ANIMAL_SUBLEVEL0 "abusing"
+#elif GET_ANIMAL_INTERNAL_3 == 11
+# define GET_ANIMAL_SUBLEVEL0 "missing"
+#elif GET_ANIMAL_INTERNAL_3 == 12
+# define GET_ANIMAL_SUBLEVEL0 "wanting"
+#elif GET_ANIMAL_INTERNAL_3 == 13
+# define GET_ANIMAL_SUBLEVEL0 "seeing"
+#elif GET_ANIMAL_INTERNAL_3 == 14
+# define GET_ANIMAL_SUBLEVEL0 "imagining"
+#elif GET_ANIMAL_INTERNAL_3 == 15
+# define GET_ANIMAL_SUBLEVEL0 "remembering"
+#else
+# define GET_ANIMAL_SUBLEVEL0 "Unknown"
+#endif
+
+
+#if GET_ANIMAL_INTERNAL_4 == 0
+# define GET_ANIMAL_SUBLEVEL1 "LSD"
+#elif GET_ANIMAL_INTERNAL_4 == 1
+# define GET_ANIMAL_SUBLEVEL1 "Quaaludes"
+#elif GET_ANIMAL_INTERNAL_4 == 2
+# define GET_ANIMAL_SUBLEVEL1 "Prozac"
+#elif GET_ANIMAL_INTERNAL_4 == 3
+# define GET_ANIMAL_SUBLEVEL1 "Pot"
+#elif GET_ANIMAL_INTERNAL_4 == 4
+# define GET_ANIMAL_SUBLEVEL1 "Whiskey"
+#elif GET_ANIMAL_INTERNAL_4 == 5
+# define GET_ANIMAL_SUBLEVEL1 "Steroids"
+#elif GET_ANIMAL_INTERNAL_4 == 6
+# define GET_ANIMAL_SUBLEVEL1 "Warm Milk"
+#elif GET_ANIMAL_INTERNAL_4 == 7
+# define GET_ANIMAL_SUBLEVEL1 "Hot Java"
+#elif GET_ANIMAL_INTERNAL_4 == 8
+# define GET_ANIMAL_SUBLEVEL1 "Mountain Dew"
+#elif GET_ANIMAL_INTERNAL_4 == 9
+# define GET_ANIMAL_SUBLEVEL1 "Jolt Cola"
+#elif GET_ANIMAL_INTERNAL_4 == 10
+# define GET_ANIMAL_SUBLEVEL1 "Cocaine"
+#elif GET_ANIMAL_INTERNAL_4 == 11
+# define GET_ANIMAL_SUBLEVEL1 "Dark Rum"
+#elif GET_ANIMAL_INTERNAL_4 == 12
+# define GET_ANIMAL_SUBLEVEL1 "Endorphins"
+#elif GET_ANIMAL_INTERNAL_4 == 13
+# define GET_ANIMAL_SUBLEVEL1 "Adrenaline"
+#elif GET_ANIMAL_INTERNAL_4 == 14
+# define GET_ANIMAL_SUBLEVEL1 "Vitamins"
+#elif GET_ANIMAL_INTERNAL_4 == 15
+# define GET_ANIMAL_SUBLEVEL1 "Nicotine"
+#else
+# define GET_ANIMAL_SUBLEVEL1 "Unknown"
+#endif
+
diff -ur --new-file linux-1.99.6.orig/include/linux/proc_fs.h linux/include/linux/proc_fs.h
--- linux-1.99.6.orig/include/linux/proc_fs.h Sun May 19 07:27:21 1996
+++ linux/include/linux/proc_fs.h Tue May 21 14:39:11 1996
@@ -43,7 +43,8 @@
PROC_MTAB,
PROC_MD,
PROC_RTC,
- PROC_LOCKS
+ PROC_LOCKS,
+ PROC_ANIMAL
};

enum pid_directory_inos {
diff -ur --new-file linux-1.99.6.orig/init/version.c linux/init/version.c
--- linux-1.99.6.orig/init/version.c Sun Nov 19 08:45:02 1995
+++ linux/init/version.c Tue May 21 15:21:32 1996
@@ -6,10 +6,17 @@
* May be freely distributed as part of Linux.
*/

+/*
+ * Changes:
+ * Joel Maslak : Added animal name to boot code
+ * <j@pobox.com> (animal 1.02)
+ */
+
#include <linux/config.h>
#include <linux/utsname.h>
#include <linux/version.h>
#include <linux/compile.h>
+#include <linux/animal.h>

/* make the "checkconfig" script happy: we really need to include config.h */
#ifdef CONFIG_BOGUS
@@ -27,4 +34,6 @@

const char *linux_banner =
"Linux version " UTS_RELEASE " (" LINUX_COMPILE_BY "@"
- LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION "\n";
+ LINUX_COMPILE_HOST ") (" LINUX_COMPILER ") " UTS_VERSION
+ " <" GET_ANIMAL_VERSION " " GET_ANIMAL_PATCHLEVEL " "
+ GET_ANIMAL_SUBLEVEL0 " " GET_ANIMAL_SUBLEVEL1 ">" "\n";


\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.047 / U:0.936 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site