diff -uNr plex86/README plex86new/README
--- plex86/README	Sun Mar 26 19:17:48 2000
+++ plex86new/README	Wed Mar 29 15:37:17 2000
@@ -69,31 +69,24 @@
 
            user> make
 
-   3.  Make the device node /dev/plex86.  Plex86 needs this
-       device in order that the user-level VM monitor can communicate
-       with the kernel driver.  You only have to do this once.
+   3.  Load the kernel module into the system. This will also create the
+       device node /dev/plex86.  Plex86 needs this device in order that the
+       user-level VM monitor can communicate with the kernel driver.
        You will need to be root:
 
            user> su
-           root> mknod /dev/plex86 c 63 0
-           root> chmod a+rw /dev/plex86
-
-   4.  Install the plex86 kernel module on your system, and
-       exit the root shell:
-
-           root> /sbin/insmod kernel/plex86.o
+           root> ./misc/load_module.sh
            root> exit
 
        You need to have the kernel module installed in order to
-       use plex86.  You could load it in your rc.local, for
-       instance.
+       use plex86.
 
-   5.  Have a look through user/plex86.conf.  This configuration
+   4.  Have a look through user/plex86.conf.  This configuration
        file contains the configuration of the user-level
        VM monitor.  If you just want to test-run the VM,
        the default settings should be okay.
 
-   6.  If you do not have the VGA font installed, you will need
+   5.  If you do not have the VGA font installed, you will need
        to install it first (you can check this by skipping to
        point 7, and checking whether it gives an error message).
        You will only have to do this once.  The VGA font resides in
@@ -110,16 +103,16 @@
        font path.  On many linux systems, for instance, this path is
        /usr/X11R6/lib/X11/fonts
 
-   7.  You can now start up the VM by invoking the user program:
+   6.  You can now start up the VM by invoking the user program:
 
            user> cd user
            user> ./plex86
 
-   8.  Whenever you recompile the kernel stuff, or want to get
+   7.  Whenever you recompile the kernel stuff, or want to get
        rid of the kernel module, remove the old kernel module first.
        As root:
 
-           root> /sbin/rmmod plex86
+           root> <...>/plex86/misc/unload_module.sh
 
 
 Let us know whether it works for you !!!  The address of the
diff -uNr plex86/kernel/host-linux.c plex86new/kernel/host-linux.c
--- plex86/kernel/host-linux.c	Mon Mar 27 19:24:16 2000
+++ plex86new/kernel/host-linux.c	Wed Mar 29 13:57:26 2000
@@ -91,8 +91,9 @@
 /* Declarations                                                         */
 /************************************************************************/
 
-// Use this major # (experimental range) for now
-#define PLEX86_MAJOR 63
+// Use dynamic major number allocation. (Set non-zero for static allocation)
+#define PLEX86_MAJOR 0
+static int plex_major = PLEX86_MAJOR;
 
 // The kernel segment base
 #if LINUX_VERSION_CODE < VERSION_CODE(2,1,0)
@@ -179,6 +180,9 @@
         printk(KERN_WARNING "plex86: can't get major %d\n", PLEX86_MAJOR);
         return(result);
     }
+    // If this was a dynamic allocation, save the major for the release code
+    if(!PLEX86_MAJOR)
+      plex_major = result;
 
     // register the /proc entry
     #ifdef CONFIG_PROC_FS
@@ -208,7 +212,7 @@
     //printk(KERN_WARNING "plex86: cleaning up kernel module\n");
 
     // unregister device
-    unregister_chrdev(PLEX86_MAJOR, "plex86");
+    unregister_chrdev(plex_major, "plex86");
 
     // unregister /proc entry
     #ifdef CONFIG_PROC_FS
diff -uNr plex86/misc/load_module.sh plex86new/misc/load_module.sh
--- plex86/misc/load_module.sh	Thu Jan  1 01:00:00 1970
+++ plex86new/misc/load_module.sh	Wed Mar 29 15:33:19 2000
@@ -0,0 +1,53 @@
+#! /bin/bash
+#
+# A simple script to load up the kernel module and create the device nodes
+# for it.
+#
+# Note:
+# this must be run as root
+#
+
+# Work out where the module is
+kmodule="`dirname $0`/../kernel/plex86.o"
+
+# Check that root is executing us
+if [ "$EUID" != "0" ]; then
+    echo "Sorry, you need to be root for this script to work."
+    echo "use 'su -c $0' and enter the root password when prompted"
+    exit -1
+fi
+
+# Check if the module exists
+if [ ! -f "$kmodule" ]; then
+    echo "The kernel module ($kmodule) does not exist!"
+    exit -1
+fi
+
+# Check if the module is already loaded
+if [ "x`grep plex86 /proc/devices`" != "x" ]; then
+    echo "The kernel module is already loaded!"
+    exit -1
+fi
+
+# Remove any stale device nodes
+# (extend for any minor devices created in the future)
+rm -f /dev/plex86
+
+# Load up the module with insmod
+/sbin/insmod $kmodule
+
+# Check if the module loaded
+major=`grep plex86 /proc/devices | awk '/plex86/ {print $1;}'`
+if [ "x$major" = "x" ]; then
+    echo "The kernel module failed to load!"
+    exit -1
+fi
+
+# Create the device node and set its permissions
+# (extend for any minor devices created in the future)
+/bin/mknod /dev/plex86 c $major 0
+chmod a+rw /dev/plex86
+
+# Job done - Give a little positive feedback
+echo "The kernel module is sucessfully installed."
+exit 0
diff -uNr plex86/misc/unload_module.sh plex86new/misc/unload_module.sh
--- plex86/misc/unload_module.sh	Thu Jan  1 01:00:00 1970
+++ plex86new/misc/unload_module.sh	Wed Mar 29 15:33:35 2000
@@ -0,0 +1,34 @@
+#! /bin/bash
+#
+# A simple script to unload the kernel module and remove the old device nodes
+# for it.
+#
+# Note:
+# this must be run as root
+#
+
+# Check that root is executing us
+if [ "$EUID" != "0" ]; then
+    echo "Sorry, you need to be root for this script to work."
+    echo "use 'su -c $0' and enter the root password when prompted"
+    exit -1
+fi
+
+# Check if the module is already loaded
+if [ "x`grep plex86 /proc/devices`" != "x" ]; then
+    /sbin/rmmod plex86
+
+    # Check that it really went (OK - I'm paranoid)
+    if [ "x`grep plex86 /proc/devices`" != "x" ]; then
+	echo "The kernel module failed to unload!"
+	exit -1
+    fi
+fi
+
+# Remove any stale device nodes
+# (extend for any minor devices created in the future)
+rm -f /dev/plex86
+
+# Job done - Give a little positive feedback
+echo "The kernel module is no longer installed."
+exit 0
