Chris Emerson wrote:

> On Sun, 9 Apr 2000, Ulrich Weigand wrote:
> 
> > I agree with using dynamically allocated numbers for now.  The patch
> > is applied to current CVS.
> 
> Ok, I'll hold off on applying for the number then.

With the following patch, you can also use static major number with module
option plex_major=63.

Hope this help.
-- 
Edouard G. Parmelan
http://egp.free.fr
Index: kernel/host-linux.c
===================================================================
RCS file: /cvsroot-freemware/plex86/kernel/host-linux.c,v
retrieving revision 1.6
diff -u -r1.6 host-linux.c
--- kernel/host-linux.c 2000/04/08 22:15:59     1.6
+++ kernel/host-linux.c 2000/04/17 10:59:25
@@ -94,6 +94,10 @@
 // Use dynamic major number allocation. (Set non-zero for static allocation)
 #define PLEX86_MAJOR 0
 static int plex_major = PLEX86_MAJOR;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,1,18)
+MODULE_PARM(plex_major, "i");
+MODULE_PARM_DESC(plex_major, "major number (default " __MODULE_STRING(PLEX86_MAJOR) 
+")");
+#endif
 
 // The kernel segment base
 #if LINUX_VERSION_CODE < VERSION_CODE(2,1,0)
@@ -175,13 +179,13 @@
     plex86_fops.release = plex86_release;
 
     // register the device with the kernel
-    result = register_chrdev(PLEX86_MAJOR, "plex86", &plex86_fops);
+    result = register_chrdev(plex_major, "plex86", &plex86_fops);
     if (result < 0) {
-        printk(KERN_WARNING "plex86: can't get major %d\n", PLEX86_MAJOR);
+        printk(KERN_WARNING "plex86: can't get major %d\n", plex_major);
         return(result);
     }
     // If this was a dynamic allocation, save the major for the release code
-    if(!PLEX86_MAJOR)
+    if(!plex_major)
       plex_major = result;
 
     // register the /proc entry

Reply via email to