I-Appliance BBS
The Official Source for Internet Appliance Upgrades and Mods
Amazon Honor System Click Here to Pay Learn More
BBS Main List | Sign In | Sign Up | Search | Help | Linux-Hacker.netReply to Thread | Printer |

Home / Other I-Appliances / MSN Companion
Found the IA-1 Led and Backlight control bits!
Finally discovered the bits that control the IA-1 Leds below the LCD and turn the backlight on/off

New MessageFound the IA-1 Led and Backlight control bits! (modified 1 times) neptune
Profile
After lurking here for while I thought i'd give something back:

With a bit hunting on the web (and hacking on my IA-1), I found the bits that control the Leds and the backlight. They are all in the same 32bit I/O port register:

I/O Port Address: 0xEE4C (Note This may vary if you use a bios other than the 3/1/00 compaq version)

Bit 0: Left Led (aka on/off) 1=Off, 0=On Bit 7: Backlight control 1=On, 0=Off
Bit 8: Center Led (aka email) 1=On, 0=Off
Bit 14: Right Led (aka internet) 1=On, 0=Off


I would not have found this without the pioneering work that Robert Rose did for the iopener hacking community - Thanks Robert!

The three clues that I needed were:

- Links to Robert's code and comments: http://fastolfe.net/misc/ihack-resources.html (and others)

- The Via VT82C686a Southbridge datasheet http://www.via.com.tw/pdf/productinfo/686a.pdf

- And finally a "cat /proc/pci" on the jailbait distro revealed:
Bus 0, device 7, function 4:
Bridge: VIA Technologies, Inc. VT82C686 [Apollo Super ACPI] (rev 32).

The following is a Q&D example of user space code (must run as root) to toggle the bits for a second:
(Compile with gcc -O -o ltoggle ltoggle.c)

#include  <asm/io.h>
main()
{
unsigned long i;

iopl(3); // Give Access to all ports

i = inl(0xEE4C);
i = i ^ 0x04181; // Toggle Leds and Backlight (Bits 0,7,8 and 14)
outl(i,0xEE4C);
sleep(1);
i = i ^ 0x04181; // Restore the bits
outl(i,0xEE4C);
}

I plan to post more complete user space code to http://www.ia1hacking.com after I clean it up.


- Enjoy!

03-02-2002 13:30:14

New MessageRE:Found the IA-1 Led and Backlight control bits! (modified 0 times) wildwildwes
Profile
Outstanding! This is great news.
03-02-2002 13:41:56

New MessageRE:Found the IA-1 Led and Backlight control bits! (modified 1 times) DGMage
Profile | Email
Wow, talk about killing a whole flock of birds with one stone! I'll take a look at the midori localhost webconf interface and see if there's a way we can work this in there to run as root so people can have a quick button to turn the LEDs/backlights on and off.

I just compiled and moved this onto my machine, it works GREAT! This is a BIG step!

Kyle

03-02-2002 17:42:26

New MessageRE:Found the IA-1 Led and Backlight control bits! (modified 0 times) wildwildwes
Profile
On my working copy I made it so that the power button toggles the backlight and alt-power button resets the machine. Great job neptune!
03-02-2002 17:54:47

New MessageRE:Found the IA-1 Led and Backlight control bits! (modified 0 times) DGMage
Profile | Email
Yeah, I just threw up a really quick demo on ia1hacking.com that cycles the lights... Just curious, do you have a URL to the key bindings handy? I need to throw that information up on the page too.
03-02-2002 18:09:12

New MessageRE:Found the IA-1 Led and Backlight control bits! (modified 0 times) DGMage
Profile | Email
Might wanna try building something like this into the next midori build:

\https://sourceforge.net/projects/hotkeys/

03-02-2002 18:16:56

New MessageRE:Found the IA-1 Led and Backlight control bits! (modified 0 times) wildwildwes
Profile
I'm not sure what hotkeys does since it's a little lean on documentation. However, I am going to put all the files for the special keys in the config directory. That way, you can specify commands for keys by editing the text files. It seems that's the general idea of that program.

Are those the files you want to put on the site? There's a file for the console, one for X windows and one for icewm. If so, I don't have a URL for them but I can email them to you.

03-02-2002 18:39:59

New MessageRE:Found the IA-1 Led and Backlight control bits! (modified 0 times) DGMage
Profile | Email
I'm working on a special hotkeys build for the IA-1 now, I'll have it up hopefully tomorrow.
03-02-2002 19:28:28

New MessageRE:Found the IA-1 Led and Backlight control bits! (modified 0 times) neptune
Profile
One more detail on how the port address was found:

The following is from Robert Rose based on his efforts to find the iopener LEDs (modified to match the IA-1 device number):
"The port address *should* be identical all the time, but just in case it's not: In PCI config space look at Bus 0, Device 7, Function 4 (Vendor=1106 Device=3057) dword register 48. This is the I/O port base for power management control (with bit 0 always OR'ed on). Add offset x'4C' to this value to get the correct base address."


The code to find the I/O port base offset is as follows:

#define PCI_CFG_ADDR  0xCF8
#define PCI_CFG_DATA  0xCFC
#define PCI_CMD(busn, devn, funcn, regn)   (0x80000000 | (busn << 16) | (devn << 11) | (funcn << 8) | (regn << 2))
// Get the Power Management I/O Base Add Offset (Reg Offset 48) outl(PCI_CMD(0x0,0x7,0x4,0x12),PCI_CFG_ADDR); i = inl(PCI_CFG_DATA) & 0x0FF80; // Clear bits 0-6 GPO_ADDR = i | 0x4C; // Set the General Purpose Output port address

Note that dword register 0x48 is coded as 0x12 (ie 0x48/4) in the outl() PCI command.

This step was critical in figuring out that while the iopener General Purpose Output Port I/O Address was 0x404C (Base offset=0x4000), the IA-1 bios sets the Base offset to 0xEE00 ie: GPO Port I/O address is 0xEE4C (for the 3/1/00 bios)

03-02-2002 21:03:23

New MessageRE:Found the IA-1 Led and Backlight control bits! (modified 0 times) DGMage
Profile | Email
Wes, yeah, email those files to me. I didn't get to work on hotkeys tonight (beer, friends, and the NES emu for my dreamcast got in the way. :) ), but if you've got the files already that will make it work, no reason in playing with Hotkeys unless people specifically want key status popups (BTW, that's what hotkeys does.. It specifically maps the keys to the buttons, then makes a little window popup every time they hit the button to display what they just did, such as volume up/down, etc... like the MS keyboard software). I'll keep playing with hotkeys just 'cause it's a neat idea and if I can compile it down static and small enough, it might be fun to have.

Kyle

03-03-2002 01:25:01

New MessageRE:Found the IA-1 Led and Backlight control bits! (modified 0 times) junkgui
Profile | Email
Is this something that should be added to the midori project? One of their key efforts is supporting power management--is power management in the kernal?
03-03-2002 13:19:58

New MessageRE:Found the IA-1 Led and Backlight control bits! (modified 0 times) GRISHNAKH
Profile
Is there any way to port this over to Windows?
I'd like my screen to turn off but it just goes blank with the backlight still on.
07-09-2002 19:50:02

Reply to Thread | Printer |
All times are PSTPowered by UltraBoard v1.62



Copyright © 2000, Netmake Inc. All Rights Reserved.
See Terms and Conditions for more information.




i-opener opener laptop notebook computer help drivers dll free windows dos repair fix linux mac macintosh 2000 95 98 nt pc configure hardware software sound video netscape explorer network networking lan wan software cmos fat bios printer card mouse modem ide scsi cd rom controllers scanner tape hard drive cgi scripts source code mp3