Skip to contentSkip to conversation

SMM BIOS on Dell i8100

PATCH In review Stephane Jourdois 7 participants 20 messages Nov 5, 2001 – Nov 7, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 SMM BIOS on Dell i8100

Hello,

First, a very big thanx to Massimo for this great piece of code :-) I've been trying to catch those events with no sucess for weeks.

I've got a Dell Inspiron 8100, which seems to differ slightly from i8000. Here is a patch that fixes that. Please do not hesitate to ask me to test some new code or anything on my laptop.

You should also replace your printk("string") with printk(KERN_INFO "string")

PS : Massimo, which version of setmixer do you use ? mine doesn't support {+|-}val syntax... (debian sid, setmixer 27DEC94-4)

Thanks,

char/i8k.c renamed from home/kwisatz/i8kutils-1.1/i8k.c +1 -1
@@ -1,5 +1,5 @@
 /*
- * i8k.c -- Linux driver for accessing the SMM BIOS on Dell I8000 laptops
+ * i8k.c -- Linux driver for accessing the SMM BIOS on Dell I8x00 laptops
  *
  * Copyright (C) 2001  Massimo Dal Zotto <[email protected]>
  *
@@ -25,7 +25,7 @@
 #include <linux/i8k.h>

=20
#define I8K_VERSION "1.1 02/11/2001"
-#define I8K_BIOS_SIGNATURE "Dell System Inspiron 8000"
+#define I8K_BIOS_SIGNATURE "Dell System Inspiron 8"
#define I8K_BIOS_SIGNATURE_ADDR 0x000ec000
#define I8K_BIOS_VERSION_OFFSET 32
=20
@@ -40,10 +40,10 @@
#define I8K_FAN_MULT 30
#define I8K_MAX_TEMP 127
=20
-#define I8K_FN_NONE 0x08
-#define I8K_FN_UP 0x09
-#define I8K_FN_DOWN 0x0a
-#define I8K_FN_MUTE 0x0c
+#define I8K_FN_NONE 0x00
+#define I8K_FN_UP 0x01
+#define I8K_FN_DOWN 0x02
+#define I8K_FN_MUTE 0x04
=20
#define I8K_POWER_AC 0x05
#define I8K_POWER_BATTERY 0x01
@@ -56,10 +56,10 @@
int force =3D 0;
=20
MODULE_AUTHOR("Massimo Dal Zotto ([email protected])");
-MODULE_DESCRIPTION("Driver for accessing the SMM BIOS on Dell I8000 laptop= s");
+MODULE_DESCRIPTION("Driver for accessing the SMM BIOS on Dell I8x00 laptop= s");
MODULE_LICENSE("GPL");
MODULE_PARM(force, "i");
-MODULE_PARM_DESC(force, "Force loading without checking for an Inspiron 80= 00");
+MODULE_PARM_DESC(force, "Force loading without checking for an Inspiron 8x= 00");
=20
static ssize_t i8k_read(struct file *, char *, size_t, loff_t *); static int i8k_ioctl(struct inode *, struct file *, unsigned int,
@@ -157,7 +157,7 @@

 	return rc;
     }
=20
-    switch ((regs.eax & 0xff00) >> 8) {
+    switch ((regs.eax & 0x0700) >> 8) {
     case I8K_FN_UP:

return I8K_VOL_UP;
case I8K_FN_DOWN:
@@ -439,7 +439,7 @@
}
=20
/*
- * Probe for the presence of an Inspiron I8000.
+ * Probe for the presence of an Inspiron I8x00.
*/
static int i8k_probe(void)
{
@@ -458,8 +458,9 @@
printk("i8k: ioremap failed\n");
return -ENODEV;
}
- if (strncmp(buff,I8K_BIOS_SIGNATURE,sizeof(I8K_BIOS_SIGNATURE)) !=3D 0) {
- printk("i8k: Inspiron 8000 BIOS signature not found\n");
+ if (strncmp(buff,I8K_BIOS_SIGNATURE,sizeof(I8K_BIOS_SIGNATURE) - 1) !=3D =
0) {
+ // -1 because we don't wan't to check for \0 at the end
+ printk("i8k: Inspiron 8x00 BIOS signature not found\n");
iounmap(buff);
return -ENODEV;
}
@@ -475,7 +476,7 @@
}
for (p=3Dbuff; (p-buff)<(0x00100000-0x000c0000); p+=3D16) {
if (strncmp(p,I8K_BIOS_SIGNATURE,sizeof(I8K_BIOS_SIGNATURE))=3D=3D0) {
- printk("i8k: Inspiron 8000 BIOS signature found at %08x\n",
+ printk("i8k: Inspiron 8x00 BIOS signature found at %08x\n",
0x000c0000+(p-buff));
break;
}
@@ -518,7 +519,7 @@

 {
     struct proc_dir_entry *proc_i8k;
=20
-    /* Are we running on an Inspiron 8000 laptop? */
+    /* Are we running on an Inspiron 8x00 laptop? */
     if (i8k_probe() !=3D 0) {
 	return -ENODEV;
     }
@@ -532,7 +533,7 @@
     SET_MODULE_OWNER(proc_i8k);

=20
printk(KERN_INFO
- "Inspiron 8000 SMM driver v%s Massimo Dal Zotto ([email protected])\n",
+ "Inspiron 8x00 SMM driver v%s Massimo Dal Zotto ([email protected])\n",
I8K_VERSION);
=20

     return 0;
Signature · 4 lines
 ///  Stephane Jourdois        	/"\  ASCII RIBBON CAMPAIGN \\\
(((    Ing?nieur d?veloppement 	\ /    AGAINST HTML MAIL    )))
 \\\   6, av. de la Belle Image	 X                         ///
  \\\  94440 Marolles en Brie  	/ \    +33 6 8643 3085    ///
#1 lore raw
Quoted 11 lines · Stephane Jourdois

Hello,

First, a very big thanx to Massimo for this great piece of code :-) I've been trying to catch those events with no sucess for weeks.

I've got a Dell Inspiron 8100, which seems to differ slightly from i8000. Here is a patch that fixes that. Please do not hesitate to ask me to test some new code or anything on my laptop.

You should also replace your printk("string") with printk(KERN_INFO "string")

Has this been tested in I8000? You are changing a lot of magic numbers in the code, and noone but you/Massimo know whether that is ok or not...

Signature · 3 lines
Jeff Garzik      | Only so many songs can be sung
Building 1024    | with two lips, two lungs, and one tongue.
MandrakeSoft     |         - nomeansno
#2 lore raw
Quoted 7 lines · In article <[email protected]> you wrote:
Quoted 6 lines · Stephane Jourdois

Hello,

First, a very big thanx to Massimo for this great piece of code :-) I've been trying to catch those events with no sucess for weeks.

Quoted 8 lines
Quoted 5 lines

I've got a Dell Inspiron 8100, which seems to differ slightly from i8000. Here is a patch that fixes that. Please do not hesitate to ask me to test some new code or anything on my laptop.

You should also replace your printk("string") with printk(KERN_INFO "string")

Has this been tested in I8000? You are changing a lot of magic numbers in the code, and noone but you/Massimo know whether that is ok or not...

Actually, I just tried plain 2.4.14-pre8 and the i8k-module *didn't* work with my i8000, but with the patch from Stephane it *does* ;)

Happy happy, joy joy...

Juri

PS: BIOS verion A17 if that matters

Signature · 1 line
Juri Haberland  <[email protected]> 
#3 lore raw
Quoted 13 lines

Actually, I just tried plain 2.4.14-pre8 and the i8k-module *didn't* work with my i8000, but with the patch from Stephane it *does* ;)

Happy happy, joy joy...

Juri

PS: BIOS verion A17 if that matters

Signature · 1 line
Juri Haberland  <[email protected]> 

Hi,

I have released version 1.2 of the driver. It contains Stephane's patches for the I8100, a new i8kmon and some documentation. You can download from:

    http://www.debian.org/~dz/i8k/

Could you please explain what doesn't work with your I8000? Does the module load? Can you read /proc/i8k?

Signature · 9 lines
Massimo Dal Zotto

+----------------------------------------------------------------------+
|  Massimo Dal Zotto               email: [email protected]   |
|  Via Marconi, 141                phone: ++39-461534251               |
|  38057 Pergine Valsugana (TN)      www: http://www.cs.unitn.it/~dz/  |
|  Italy                                  http://www.debian.org/~dz/   |
|  gpg:   2DB65596  3CED BDC6 4F23 BEDA F489 2445 147F 1AEA 2DB6 5596  |
+----------------------------------------------------------------------+
#4 lore raw
Quoted 12 lines · In article <[email protected]> you wrote:
Quoted 9 lines

Actually, I just tried plain 2.4.14-pre8 and the i8k-module *didn't* work with my i8000, but with the patch from Stephane it *does* ;)

Happy happy, joy joy...

Juri

PS: BIOS verion A17 if that matters

Hi,

Quoted 7 lines

I have released version 1.2 of the driver. It contains Stephane's patches for the I8100, a new i8kmon and some documentation. You can download from:

    http://www.debian.org/~dz/i8k/

Could you please explain what doesn't work with your I8000? Does the module load? Can you read /proc/i8k?

Yes, sure, sorry. The module (from 2.4.14pre8) loaded perfectly and I could read /proc/i8k. Also controlling the fans worked. The only thing that didn't work was the key-thingy. Pressing any of the five keys (those two near the power button and the Fn-keys) didn't do anything with the i8kbuttons script.

Btw Thank You Very Much!

Juri

Signature · 1 line
Juri Haberland  <[email protected]> 
#5 lore raw
In reply to Juri Haberland

Massimo,
Here is a small patch to sort of implement autorepeat for the volume buttons. It just adds a -r | --repeat <count> option to i8kbuttons. With the default timeout and -r 1 I get a reasonable autorepeat function. The name/docs might not be optimal but I leave that to you if you choose to include the patch. It is agains i8kutils-1.2.

-Marcel

i8kbuttons.1 renamed from i8kbuttons.1.org +5 -0
@@ -36,6 +36,11 @@
 \fB\-t\fR, \fB\-\-timeout\fR <\fImilliseconds\fP>
 Specifies the interval in milliseconds at which the daemon checks the
 button status. Useful values are in the range of 50\-200. Default is 100.
+.TP 
+\fB\-r\fR, \fB\-\-repeat\fR <\fIcount\fP>
+Enables autorepeat (0 is off is default). While holding down one of the volume
+buttons, the volume is changed every count timeoutintervals. So with -t 100 -r 2
+it will change every 200 milliseconds.
 .LP 
 .SH "FILES"
 .LP 
i8kbuttons.c renamed from i8kbuttons.c.org +11 -1
@@ -89,6 +89,7 @@
     printf("	-d|--down <command>\n");
     printf("	-m|--mute <command>\n");
     printf("	-t|--timeout <milliseconds>\n");
+    printf("	-r|--repeat <count>\n");
     printf("\n");
 }
 
@@ -97,6 +98,8 @@
 {
     int fd, status;
     int timeout = POLL_TIMEOUT;
+    int repeat = 0;
+    int autorpt = 0;
     int last = 0;
     char *progname;
     struct timespec req;
@@ -137,6 +140,11 @@
 	    }
 	    continue;
 	}
+	if ((strcmp(argv[0],"-r")==0) || (strcmp(argv[0],"--repeat")==0)) {
+	    if (argc < 2) break;
+	    autorpt = atoi(argv[1]);
+	    continue;
+	}
 	break;
     }
     if (argc > 0) {
@@ -162,8 +170,10 @@
 	DPRINTF("%d\n", status);
 
 	if (status == last) {
-	    continue;
+	    if (!autorpt || (repeat++ < autorpt))
+	        continue;
 	}
+        repeat = 0;
 	last = status;
 
 	switch (status) {
Signature · 6 lines
     ======--------         Marcel J.E. Mol                MESA Consulting B.V.
    =======---------        ph. +31-(0)6-54724868          P.O. Box 112
    =======---------        [email protected]                 2630 AC  Nootdorp
__==== www.mesa.nl ---____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
 They couldn't think of a number,           Linux user 1148  --  counter.li.org
    so they gave me a name!  -- Rupert Hine  --  www.ruperthine.com
#6 lore raw
In reply to Juri Haberland
Quoted 3 lines · Massimo Dal Zotto

I have released version 1.2 of the driver. It contains Stephane's patches for the I8100, a new i8kmon and some documentation. You can download from:

    http://www.debian.org/~dz/i8k/

Hello,

Here is my patch to i8kutils-1.2 :

======

i8kbuttons.c Tue Nov 6 20:11:19 2001 renamed from i8kbuttons.c Tue Nov 6 20:07:27 2001 +1 -9
diff -u i8kutils-1.2.orig/i8kbuttons.c i8kutils-1.2/i8kbuttons.c
@@ -53,15 +53,7 @@
 
     DPRINTF("exec_cmd: %s\n", cmd);
 
-    if ((rc=fork()) < 0) {
-       perror("fork failed");
-       return;
-    }
-
-    if (rc == 0) {
-       execl("/bin/sh", "sh", "-c", cmd, NULL);
-       exit(0);
-    }
+    system(cmd);
 }
 
 static int

======

Without that, I get as much zombies processes as I have pressed the volume buttons :-) I know system() is not great, but as security is not a problem here...
I use debian/sid, and aumix as the mixer.

Now a fundamental question :
Does the load of the i8k module inhibits the fans start ? I can see my processor temp increasing (I saw 80�C ...) without the fans start. Then I started i8kmon to avoid an explosion. If the modules inhibits material protections, then if that can be modified, it would be great ; if not, i8kmon needs to get included in the kernel as a daemon. The i8kmon should be a funny tool, not a system critical tool.

Also, I couldn't understand why sometimes the left fan is printed on red color in i8kmon...

Thank you,

Stephane

Signature · 4 lines
 ///  Stephane Jourdois        	/"\  ASCII RIBBON CAMPAIGN \\\
(((    Ing�nieur d�veloppement 	\ /    AGAINST HTML MAIL    )))
 \\\   6, av. de la Belle Image	 X                         ///
  \\\  94440 Marolles en Brie  	/ \    +33 6 8643 3085    ///
#7 lore raw
Quoted 8 lines

Now a fundamental question :
Does the load of the i8k module inhibits the fans start ? I can see my processor temp increasing (I saw 80°C ...) without the fans start. Then I started i8kmon to avoid an explosion. If the modules inhibits material protections, then if that can be modified, it would be great ; if not, i8kmon needs to get included in the kernel as a daemon. The i8kmon should be a funny tool, not a system critical tool.

The i8k module itself doesn't interfere with the BIOS fan control. It just adds some ioctl to allow fan control from user-space. The real problem is that the BIOS fan control is broken, as everybody who own an I8K knows very well. If you run i8kmon with the --noauto option you will just see the temperature and fan status as managed by the BIOS. The i8kmon does the same job as the BIOS but uses lower thresholds. The only difference is is that my program works.

Quoted 2 lines

Also, I couldn't understand why sometimes the left fan is printed on red color in i8kmon...

If it becomes red for a short time it may be that the fan is slow at turning on. If the button stays red for long time it means that your fan is broken or stuck. Try starting it manually with a bent paper clip and see if the red disappears. This is explained in the i8kmon manpage.

Signature · 9 lines
Massimo Dal Zotto

+----------------------------------------------------------------------+
|  Massimo Dal Zotto               email: [email protected]   |
|  Via Marconi, 141                phone: ++39-461534251               |
|  38057 Pergine Valsugana (TN)      www: http://www.cs.unitn.it/~dz/  |
|  Italy                                  http://www.debian.org/~dz/   |
|  gpg:   2DB65596  3CED BDC6 4F23 BEDA F489 2445 147F 1AEA 2DB6 5596  |
+----------------------------------------------------------------------+
#9 lore raw
In reply to Juri Haberland

Maybe this is better:

i8kbuttons.c Tue Nov 6 20:11:19 2001 renamed from i8kbuttons.c Tue Nov 6 20:07:27 2001 +2 -0
diff -u i8kutils-1.2.orig/i8kbuttons.c i8kutils-1.2/i8kbuttons.c
@@ -53,15 +53,17 @@
 
     DPRINTF("exec_cmd: %s\n", cmd);
 
     if ((rc=fork()) < 0) {
        perror("fork failed");
        return;
     }
 
     if (rc == 0) {
        execl("/bin/sh", "sh", "-c", cmd, NULL);
        exit(0);
     }
+    else
+       wait(&rc);
 }
 

It get rid of the zombies and allows only one setmixer/auimix command to be active at a time...

Quoted 60 lines · Stephane Jourdois
Quoted 3 lines · Massimo Dal Zotto

I have released version 1.2 of the driver. It contains Stephane's patches for the I8100, a new i8kmon and some documentation. You can download from:

    http://www.debian.org/~dz/i8k/

Hello,

Here is my patch to i8kutils-1.2 :

======
diff -u i8kutils-1.2.orig/i8kbuttons.c i8kutils-1.2/i8kbuttons.c

i8kbuttons.c Tue Nov 6 20:11:19 2001 renamed from i8kbuttons.c Tue Nov 6 20:07:27 2001 +1 -9
@@ -53,15 +53,7 @@
 
     DPRINTF("exec_cmd: %s\n", cmd);
 
-    if ((rc=fork()) < 0) {
-       perror("fork failed");
-       return;
-    }
-
-    if (rc == 0) {
-       execl("/bin/sh", "sh", "-c", cmd, NULL);
-       exit(0);
-    }
+    system(cmd);
 }
 
 static int

======

Without that, I get as much zombies processes as I have pressed the volume buttons :-) I know system() is not great, but as security is not a problem here...
I use debian/sid, and aumix as the mixer.

Now a fundamental question :
Does the load of the i8k module inhibits the fans start ? I can see my processor temp increasing (I saw 80°C ...) without the fans start. Then I started i8kmon to avoid an explosion. If the modules inhibits material protections, then if that can be modified, it would be great ; if not, i8kmon needs to get included in the kernel as a daemon. The i8kmon should be a funny tool, not a system critical tool.

Also, I couldn't understand why sometimes the left fan is printed on red color in i8kmon...

Thank you,

Stephane

Signature · 4 lines
 ///  Stephane Jourdois        	/"\  ASCII RIBBON CAMPAIGN \\\
(((    Ingénieur développement 	\ /    AGAINST HTML MAIL    )))
 \\\   6, av. de la Belle Image	 X                         ///
  \\\  94440 Marolles en Brie  	/ \    +33 6 8643 3085    ///
Signature · 6 lines
     ======--------         Marcel J.E. Mol                MESA Consulting B.V.
    =======---------        ph. +31-(0)6-54724868          P.O. Box 112
    =======---------        [email protected]                 2630 AC  Nootdorp
__==== www.mesa.nl ---____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
 They couldn't think of a number,           Linux user 1148  --  counter.li.org
    so they gave me a name!  -- Rupert Hine  --  www.ruperthine.com
#10 lore raw
In reply to Juri Haberland
Quoted 22 lines · Marcel J.E. Mol

Maybe this is better:

diff -u i8kutils-1.2.orig/i8kbuttons.c i8kutils-1.2/i8kbuttons.c

i8kbuttons.c Tue Nov 6 20:11:19 2001 renamed from i8kbuttons.c Tue Nov 6 20:07:27 2001 +2 -0
@@ -53,15 +53,17 @@
 
     DPRINTF("exec_cmd: %s\n", cmd);
 
     if ((rc=fork()) < 0) {
        perror("fork failed");
        return;
     }
 
     if (rc == 0) {
        execl("/bin/sh", "sh", "-c", cmd, NULL);
        exit(0);
     }
+    else
+       wait(&rc);
 }
 
Quoted 2 lines

It get rid of the zombies and allows only one setmixer/auimix command to be active at a time...

Yup I did that on i8kutils-1.1, then reverted to system(), because I removed the anti-repeat system, and used a slow mixer application. Then the repeat was bad (sometimes slow, sometimes quick).
In fact, I don't really mind, as now I use aumix (and it is fast enought).

Massimo, choose one please :-)

Stephane

Signature · 4 lines
 ///  Stephane Jourdois        	/"\  ASCII RIBBON CAMPAIGN \\\
(((    Ing�nieur d�veloppement 	\ /    AGAINST HTML MAIL    )))
 \\\   6, av. de la Belle Image	 X                         ///
  \\\  94440 Marolles en Brie  	/ \    +33 6 8643 3085    ///
#11 lore raw
Quoted 11 lines

Yup I did that on i8kutils-1.1, then reverted to system(), because I removed the anti-repeat system, and used a slow mixer application. Then the repeat was bad (sometimes slow, sometimes quick).
In fact, I don't really mind, as now I use aumix (and it is fast enought).

Massimo, choose one please :-)

Stephane

I have released version 1.3 of the package. It includes the autorepeat feature and solves the zombie problem. You can download it from:

http://www.debian.org/~dz/i8k/

There is also a new smm-test script which can be used to test the SMM bios on Inspiron laptops. This command can be very dangerous, use with caution!

Signature · 9 lines
Massimo Dal Zotto

+----------------------------------------------------------------------+
|  Massimo Dal Zotto               email: [email protected]   |
|  Via Marconi, 141                phone: ++39-461534251               |
|  38057 Pergine Valsugana (TN)      www: http://www.cs.unitn.it/~dz/  |
|  Italy                                  http://www.debian.org/~dz/   |
|  gpg:   2DB65596  3CED BDC6 4F23 BEDA F489 2445 147F 1AEA 2DB6 5596  |
+----------------------------------------------------------------------+
#12 lore raw
In reply to Jeff Garzik
Quoted 11 lines · Juri Haberland
Quoted 6 lines · In article <[email protected]> you wrote:
Quoted 3 lines · Stephane Jourdois

I've got a Dell Inspiron 8100, which seems to differ slightly from i8000. Here is a patch that fixes that. Please do not hesitate to ask me to test some new code or anything on my laptop.

Has this been tested in I8000? You are changing a lot of magic numbers in the code, and noone but you/Massimo know whether that is ok or not...

Actually, I just tried plain 2.4.14-pre8 and the i8k-module *didn't* work with my i8000, but with the patch from Stephane it *does* ;)

PS: BIOS verion A17 if that matters

mmm I have a i8100 with A04 BIOS...

But that confirms that multiple versions of SMM BIOS exists, and that we have to test only 4 lighter bits, even on i8000.

Does anybody have a Dell Inspiron around there that still doesn't work ? i8x00 should work, but perhaps others Inspirons have quite the same SMM BIOS ?

Stephane.

Signature · 4 lines
 ///  Stephane Jourdois        	/"\  ASCII RIBBON CAMPAIGN \\\
(((    Ing�nieur d�veloppement 	\ /    AGAINST HTML MAIL    )))
 \\\   6, av. de la Belle Image	 X                         ///
  \\\  94440 Marolles en Brie  	/ \    +33 6 8643 3085    ///
#13 lore raw
In reply to Stephane Jourdois
Quoted 6 lines · Jeff Garzik
Quoted 3 lines · Stephane Jourdois

I've got a Dell Inspiron 8100, which seems to differ slightly from i8000. Here is a patch that fixes that. Please do not hesitate to ask me to test some new code or anything on my laptop.

Has this been tested in I8000? You are changing a lot of magic numbers in the code, and noone but you/Massimo know whether that is ok or not...

I presume it works.
Let me explain why while looking at parts of my patch :

-#define I8K_FN_NONE 0x08
-#define I8K_FN_UP 0x09
-#define I8K_FN_DOWN 0x0a
-#define I8K_FN_MUTE 0x0c
+#define I8K_FN_NONE 0x00
+#define I8K_FN_UP 0x01
+#define I8K_FN_DOWN 0x02
+#define I8K_FN_MUTE 0x04

In fact, i8100 returns respectively 1, 2 and 4. i8100 returns 0x09, 0x0a, and 0x0c (see Massimo's code).

Then we can take the 4 lighter bits, and test them without testing the 4 greater bits which value are 0x08 on i8000 and 0x00 on i8100.

hence :
- switch ((regs.eax & 0xff00) >> 8) {
+ switch ((regs.eax & 0x0700) >> 8) {

a different version (which I didn't choose), would be to keep Massimo's defines, and test (((regs.eax | 0x0800 ) & 0xff00) >> 8). But that's more operations, then not the better solution :-)

As the drivers disks provided by Dell (windows drivers of course) are the same which works on i8000 and i8100, I suppose that they test only the 4 lighter bits here

Of course, as Massismo's told me a few hours ago, this is a beta version of this code, and it supports at least Massimo's i8000 and now my i8100. We should wait a few days for feed-back from lklm readers, then Massimo's intents are to implement a more modular code. That's a good intent, isn't it ? :-)

Anyway, you'll agree with me that 2 laptops is better than one :-)

Thanks for your answer.
St�phane.

Signature · 4 lines
 ///  Stephane Jourdois        	/"\  ASCII RIBBON CAMPAIGN \\\
(((    Ing�nieur d�veloppement 	\ /    AGAINST HTML MAIL    )))
 \\\   6, av. de la Belle Image	 X                         ///
  \\\  94440 Marolles en Brie  	/ \    +33 6 8643 3085    ///
#14 lore raw
In reply to Stephane Jourdois
Quoted 3 lines · Marcel J.E. Mol

I have an i8000 too. I tried some info to use the 'multimedia' buttons next to the power button. Do you know if these are also managed through smm? Or are thre other ways/tools to access these buttons?

In fact, the two buttons next to the power button only are supported by the SMM BIOS. The 4 others buttons send e0 keyboard scancodes, and are fully supported by every kernel (Respectively e0 01, e0 02, e0 03, and e0 04, from left to right).
Here is a patch to prove what I'm saying :

char/pc_keyb.c Mon Nov 5 17:45:56 2001 renamed from char/pc_keyb.c.orig Mon Nov 5 17:41:54 2001 +9 -1
@@ -227,9 +227,18 @@
 #define E0_MSLW        125
 #define E0_MSRW        126
 #define E0_MSTM        127
+/*
+ * Multimedia Keys on Dell Inspiron i8x00
+ * (from left to right : play, stop, previous, next)
+ */
+#define E0_DELL_PLAY           120
+#define E0_DELL_STOP           121
+#define E0_DELL_PREVIOUS       122
+#define E0_DELL_NEXT           123
 
 static unsigned char e0_keys[128] = {
-  0, 0, 0, 0, 0, 0, 0, 0,                            /* 0x00-0x07 */
+  E0_DELL_PLAY, E0_DELL_STOP, E0_DELL_PREVIOUS, E0_DELL_NEXT, /*

0x00-0x03 */

+  0, 0, 0, 0,                                        /* 0x04-0x07 */
   0, 0, 0, 0, 0, 0, 0, 0,                            /* 0x08-0x0f */
   0, 0, 0, 0, 0, 0, 0, 0,                            /* 0x10-0x17 */
   0, 0, 0, 0, E0_KPENTER, E0_RCTRL, 0, 0,            /* 0x18-0x1f */

Then edit your /etc/console/bootime.kmap.gz (package console-common in debian) to add for example :
----
keycode 120 = F70 F71
keycode 121 = Last_Console
keycode 122 = Decr_Console
keycode 123 = Incr_Console
string F70 = "Hello World !"
string F71 = "Dell Inspiron Powah !"
----

then issue the command /etc/init.d/keymap.sh (or loadkeys if you do not use debian) *under console*, and you'll then believe me :-)

To support those keys under X, that's more complicated, because AFAIK we have to create X keysyms before assigning them to keycodes. but try that in your ~/.xmodmap :
----
keycode 129 = a b c d
keycode 130 = a b c d
keycode 131 = a b c d
keycode 132 = a b c d
----
then xmodmap ~/.xmodmap, and try <PLAY>, SHIFT-<PLAY>, ALT-<PLAY>, CTRL-<PLAY>, etc.
(In fact, I really don't remember why I used 129-132 here... try with 120-123 if it doesn't work :-) I think I used those values to test if keycodes are 8bits clean, they are not.)

Hope this helps, and if anybody knows how to implement keysyms, I'm interested... as long as I don't have to patch XFree86 !

Please do not hesitate to contact me if you have any other questions.

To finish, SMM BIOS implements supoprt for the two big buttons next to the power button (try to press them both at the same time to have mute ;-), and the three blue Fn-keys for sound (PgUp, PgDown, and End)

Stephane.

Signature · 4 lines
 ///  Stephane Jourdois        	/"\  ASCII RIBBON CAMPAIGN \\\
(((    Ing�nieur d�veloppement 	\ /    AGAINST HTML MAIL    )))
 \\\   6, av. de la Belle Image	 X                         ///
  \\\  94440 Marolles en Brie  	/ \    +33 6 8643 3085    ///
#15 lore raw
Quoted 2 lines · Stephane Jourdois

Hope this helps, and if anybody knows how to implement keysyms, I'm interested... as long as I don't have to patch XFree86 !

No need. Here's what I do with xmodmap:

!
! Dell 8000
! I have sawfish map these to
! xmms -u, -s, -r and -f respectively
!
keycode 129 = XF86AudioPlay
keycode 130 = XF86AudioStop
keycode 131 = XF86AudioPrev
keycode 132 = XF86AudioNext

#16 lore raw
In reply to Stephane Jourdois

Hi Stephane,

Thanks for the info. I really believe you :-)
The X keycodes are indeed 129-132. I checked them using xev. I checked /proc/i8k while pressing the buttons next to the power button and they work fine.
So what's left is to tie these buttons to some function so that I can control the soundvolume/dvd player wherever I am i X...

-Marcel

Quoted 86 lines · Stephane Jourdois
Quoted 3 lines · Marcel J.E. Mol

I have an i8000 too. I tried some info to use the 'multimedia' buttons next to the power button. Do you know if these are also managed through smm? Or are thre other ways/tools to access these buttons?

In fact, the two buttons next to the power button only are supported by the SMM BIOS. The 4 others buttons send e0 keyboard scancodes, and are fully supported by every kernel (Respectively e0 01, e0 02, e0 03, and e0 04, from left to right).
Here is a patch to prove what I'm saying :

char/pc_keyb.c Mon Nov 5 17:45:56 2001 renamed from char/pc_keyb.c.orig Mon Nov 5 17:41:54 2001 +9 -1
@@ -227,9 +227,18 @@
 #define E0_MSLW        125
 #define E0_MSRW        126
 #define E0_MSTM        127
+/*
+ * Multimedia Keys on Dell Inspiron i8x00
+ * (from left to right : play, stop, previous, next)
+ */
+#define E0_DELL_PLAY           120
+#define E0_DELL_STOP           121
+#define E0_DELL_PREVIOUS       122
+#define E0_DELL_NEXT           123
 
 static unsigned char e0_keys[128] = {
-  0, 0, 0, 0, 0, 0, 0, 0,                            /* 0x00-0x07 */
+  E0_DELL_PLAY, E0_DELL_STOP, E0_DELL_PREVIOUS, E0_DELL_NEXT, /*

0x00-0x03 */

+  0, 0, 0, 0,                                        /* 0x04-0x07 */
   0, 0, 0, 0, 0, 0, 0, 0,                            /* 0x08-0x0f */
   0, 0, 0, 0, 0, 0, 0, 0,                            /* 0x10-0x17 */
   0, 0, 0, 0, E0_KPENTER, E0_RCTRL, 0, 0,            /* 0x18-0x1f */

Then edit your /etc/console/bootime.kmap.gz (package console-common in debian) to add for example :
----
keycode 120 = F70 F71
keycode 121 = Last_Console
keycode 122 = Decr_Console
keycode 123 = Incr_Console
string F70 = "Hello World !"
string F71 = "Dell Inspiron Powah !"
----

then issue the command /etc/init.d/keymap.sh (or loadkeys if you do not use debian) *under console*, and you'll then believe me :-)

To support those keys under X, that's more complicated, because AFAIK we have to create X keysyms before assigning them to keycodes. but try that in your ~/.xmodmap :
----
keycode 129 = a b c d
keycode 130 = a b c d
keycode 131 = a b c d
keycode 132 = a b c d
----
then xmodmap ~/.xmodmap, and try <PLAY>, SHIFT-<PLAY>, ALT-<PLAY>, CTRL-<PLAY>, etc.
(In fact, I really don't remember why I used 129-132 here... try with 120-123 if it doesn't work :-) I think I used those values to test if keycodes are 8bits clean, they are not.)

Hope this helps, and if anybody knows how to implement keysyms, I'm interested... as long as I don't have to patch XFree86 !

Please do not hesitate to contact me if you have any other questions.

To finish, SMM BIOS implements supoprt for the two big buttons next to the power button (try to press them both at the same time to have mute ;-), and the three blue Fn-keys for sound (PgUp, PgDown, and End)

Stephane.

Signature · 4 lines
 ///  Stephane Jourdois        	/"\  ASCII RIBBON CAMPAIGN \\\
(((    Ingénieur développement 	\ /    AGAINST HTML MAIL    )))
 \\\   6, av. de la Belle Image	 X                         ///
  \\\  94440 Marolles en Brie  	/ \    +33 6 8643 3085    ///
Signature · 6 lines
     ======--------         Marcel J.E. Mol                MESA Consulting B.V.
    =======---------        ph. +31-(0)6-54724868          P.O. Box 112
    =======---------        [email protected]                 2630 AC  Nootdorp
__==== www.mesa.nl ---____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
 They couldn't think of a number,           Linux user 1148  --  counter.li.org
    so they gave me a name!  -- Rupert Hine  --  www.ruperthine.com
#17 lore raw
In reply to Stephane Jourdois
Quoted 2 lines · Marcel J.E. Mol

Thanks for the info. I really believe you :-)
The X keycodes are indeed 129-132. I checked them using xev.

Yep, I did that just after mutt quitting. If someone could tell me why those values... are e0 00-8f scancodes binded to 129-255 under XFree86 ? (Not important, but just to increase my poor knowledge)

Quoted 2 lines

I checked /proc/i8k while pressing the buttons next to the power button and they work fine.

Did you use my patch ? I think that Jeff Garzik would appreciate to have a proof that it still works on i8000 ;-)

Quoted 2 lines

So what's left is to tie these buttons to some function so that I can control the soundvolume/dvd player wherever I am i X...

Then now you should download i8kutils-1.1 from :

	http://people.debian.org/~dz/i8k/

Marcello's utils are just what you are looking for now. in fact, i8kbuttons.c will enable volume controll, i8kmon will display a very usefull fans status (and *YES* ! you can start them with a click :-)).

Just a little hint for i8kbuttons :
I suggest that you run :
./i8kbuttons --up "aumix -v +5" --down "aumix -v -5"

default bindings do not work, they are Massimo's aliases :-)

I use both tools since yesterday... and I watched a DVD just for that occasion (I hate * and / in mplayer ;-)

Finally, as I told Massimo this morning, I just *love* to start my fans just to here the little noise and see the proc temp decreasing. (try a cat /dev/zero to increase quickly your cpu temp and enjoy !)

I think you'll appreciate those tools...
I can imagine your joy, I'm just thinking to me yesterday evening ;-)

Stephane.

Signature · 4 lines
 ///  Stephane Jourdois        	/"\  ASCII RIBBON CAMPAIGN \\\
(((    Ing�nieur d�veloppement 	\ /    AGAINST HTML MAIL    )))
 \\\   6, av. de la Belle Image	 X                         ///
  \\\  94440 Marolles en Brie  	/ \    +33 6 8643 3085    ///
#18 lore raw
In reply to Stephane Jourdois
Quoted 5 lines · Stephane Jourdois
Quoted 2 lines · Marcel J.E. Mol

I checked /proc/i8k while pressing the buttons next to the power button and they work fine.

Did you use my patch ? I think that Jeff Garzik would appreciate to have a proof that it still works on i8000 ;-)

Yup, just did it. I see no difference in funtionality with your patch added.

Quoted 8 lines
Quoted 2 lines

So what's left is to tie these buttons to some function so that I can control the soundvolume/dvd player wherever I am i X...

Then now you should download i8kutils-1.1 from :

	http://people.debian.org/~dz/i8k/

Marcello's utils are just what you are looking for now. in fact, i8kbuttons.c will enable volume controll, i8kmon will display a very usefull fans status (and *YES* ! you can start them with a click :-)).

Arg... I already downloaded this and made the module from it as i did not want to compile the pre8 kernel yet. (I only had to run the i8kmon using 'wish i8kmon' as it complained about 'Tk'; this is latest Rawhide)

Quoted 3 lines

Just a little hint for i8kbuttons :
I suggest that you run :
./i8kbuttons --up "aumix -v +5" --down "aumix -v -5"

Great, Just add "--mute "aumix -v 0" to mute, but I do prefer the gmix way that restores original volume level when the mutebutton is pressed again but that probaly only works as gmix is running all the time... Getting OT but does anyone know if you can sent events to gmix to do volume control?

Quoted 5 lines

Finally, as I told Massimo this morning, I just *love* to start my fans just to here the little noise and see the proc temp decreasing. (try a cat /dev/zero to increase quickly your cpu temp and enjoy !) I think you'll appreciate those tools...
I can imagine your joy, I'm just thinking to me yesterday evening ;-)

I sure do! It is so nice to have a choice to do things quickly/easy with the keyboard or with the mouse...

-Marcel

Signature · 6 lines
     ======--------         Marcel J.E. Mol                MESA Consulting B.V.
    =======---------        ph. +31-(0)6-54724868          P.O. Box 112
    =======---------        [email protected]                 2630 AC  Nootdorp
__==== www.mesa.nl ---____U_n_i_x______I_n_t_e_r_n_e_t____ The Netherlands ____
 They couldn't think of a number,           Linux user 1148  --  counter.li.org
    so they gave me a name!  -- Rupert Hine  --  www.ruperthine.com
#19 lore raw
In reply to Stephane Jourdois
Quoted 6 lines · Georg Nikodym
Quoted 2 lines · Stephane Jourdois

Hope this helps, and if anybody knows how to implement keysyms, I'm interested... as long as I don't have to patch XFree86 !

No need. Here's what I do with xmodmap:

Quoted 9 lines

!
! Dell 8000
! I have sawfish map these to
! xmms -u, -s, -r and -f respectively
!
keycode 129 = XF86AudioPlay
keycode 130 = XF86AudioStop
keycode 131 = XF86AudioPrev
keycode 132 = XF86AudioNext

And that works indeed !

Try :

	[ `ps -C xmms | wc -l` = 7 ] && xmms --pause || xmms --play

instead of xmms -u. Then you really have Play/Pause...

For those who use enlightenment... here are the keybindings for it (in your .enlightenment/keybindings.cfg, that you copyied from /usr/share/enlightenment/config/) :

  __NEXT_ACTION
    __MODIFIER_KEY __NONE
    __KEY XF86AudioPlay
    __EVENT __KEY_PRESS
    __ACTION __A_EXEC /home/kwisatz/bin/xmms_play
  __NEXT_ACTION
    __MODIFIER_KEY __NONE
    __KEY XF86AudioStop
    __EVENT __KEY_PRESS
    __ACTION __A_EXEC xmms --stop
  __NEXT_ACTION
    __MODIFIER_KEY __NONE
    __KEY XF86AudioPrev
    __EVENT __KEY_PRESS
    __ACTION __A_EXEC xmms --rew
  __NEXT_ACTION
    __MODIFIER_KEY __NONE
    __KEY XF86AudioNext
    __EVENT __KEY_PRESS
    __ACTION __A_EXEC xmms --fwd

/home/kwisatz/bin/xmms_play is a onle-liner (Cf. above)

PS : I know this is OT, but as the only mean of those i8k buttons is multimedia, I think it's great to learn how to bind them :-)

Stephane

Signature · 4 lines
 ///  Stephane Jourdois        	/"\  ASCII RIBBON CAMPAIGN \\\
(((    Ing�nieur d�veloppement 	\ /    AGAINST HTML MAIL    )))
 \\\   6, av. de la Belle Image	 X                         ///
  \\\  94440 Marolles en Brie  	/ \    +33 6 8643 3085    ///