# Aspire One no built-in keyboard with ACPI enabled



## yipidee (Dec 11, 2011)

I've only recently started to play around with FreeBSD, I bought a used Aspire One D225E and installed FreeBSD 9.0. I got wireless working through ndis, and have been using xfce as my desktop environment. I do however have one major sticking point, when I boot with ACPI enabled I have to attach a usb keyboard as the built-in one stops working after boot. This didn't happen in 8.2 but I experienced regular random system freezes using it so changed to 9.0.

With ACPI enabled

```
??????# dmesg -a | grep kbd
kbd1 at kbdmux0
ukbd0: <Logitech Logitech USB Keyboard, class 0/0, rev 1.10/28.00, addr 2> on usbus1
kbd2 at ukbd0
```

With ACPI disabled

```
??????# dmesg -a | grep kbd
kbd1 at kbdmux0
ukbd0: <Logitech Logitech USB Keyboard, class 0/0, rev 1.10/28.00, addr 2> on usbus1
kbd2 at ukbd0
kbd1 at kbdmux0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
ukbd0: <Logitech Logitech USB Keyboard, class 0/0, rev 1.10/28.00, addr 2> on usbus1
kbd2 at ukbd0
```

"Why not just disable ACPI by default?" I hear you say, I kind of just want to get it to work, and I experience shutdown and usb driver problems with ACPI disabled.

Any help greatly appreciated.


----------



## yipidee (Dec 23, 2011)

Apologies for the wanton bumping, but no advice with this?

Can I load atkbdc and atkbd manually after boot?

Yipidee


----------



## aragon (Dec 25, 2011)

Sounds like your BIOS has an ACPI bug.  Check for BIOS updates...


----------



## yipidee (Dec 25, 2011)

Thanks aragon, but this problem didn't exist in 8.2 as far as I'm aware, must be due to a change between then and 9.0. (I checked for BIOS updates, not luck unfortunately)


----------



## yipidee (Dec 30, 2011)

While trying to solve this problem I came across this thread showing a similar sounding problem with various Linux flavours. It features the below code which a lot of posters claim fixed the problem.


```
#include <unistd.h>
#include <sys/io.h>

#define I8042_COMMAND_REG 0x64

int main(int argc, char *argv[]) {
   char data = 0xae; // enable keyboard

  ioperm(I8042_COMMAND_REG, 1, 1);

  if (argc == 2 && argv[1][0] == '0')
     data = 0xad; // disable keyboard
   outb(data, I8042_COMMAND_REG);
   return 0;
}
```

Though I know very little about C, or low level I/O interfacing, but I decided to try and get this to run in FreeBSD by editing the code to look like this.


```
#include <unistd.h>
#include <machine/cpufunc.h>
#include <machine/sysarch.h>

#define I8042_COMMAND_REG 0x64

int main(int argc, char *argv[]) {
  char data = 0xae; // enable keyboard

  i386_set_ioperm(I8042_COMMAND_REG, 1, 1);

  if (argc == 2 && argv[1][0] == '0')
    data = 0xad; // disable keyboard
  outb(I8042_COMMAND_REG, data);
  
  return 0;
}
```

I named the program kbd_unix.c and ran the following as root

`# gcc kbd_unix.c -o kbd_unix`
`# ./kbd_unix 0`

When acpi is disabled I can use this program to start and stop the keyboard, however it has no effect when acpi is enabled. Anyone any ideas why?


----------

