# HOWTO: FreeBSD 9.1-RELEASE on Asus Eee PC 1018P



## cpm@ (May 20, 2013)

*Index*

Hardware
ACPI Video Extensions
Bluetooth
CPU's Temperature
Ethernet
Hotkeys
Sound
SD card reader
Graphics
Suspend/resume
Wireless
Webcam
Tuning Power Consumption

*1. Hardware*


Intel(R) Atom(TM) CPU N455 @ 1.66GHz (1662.54-MHz 686-class CPU)
acpi_asus(4)
acpi_video(4)
alc(4): Atheros AR8132 PCIe Fast Ethernet
cuse4bsd(3): USB2.0 UVC VGA WebCam Azurewave
intel(4): Intel Pineview (M) SVGA Controller
ndis(4): BCM4313 802.11b/g/n Wireless LAN controller
ng_ubt(4)
sdhci(4)
snd_hda(4): Realtek ALC269
250GB HDD (Seagate)

More about all hardware specifications, here.


*2. ACPI Video Extensions*

To control display switching and backlight brightness is necessary add in loader.con(5) the following line:

```
acpi_video_load="YES"
```


*3. Bluetooth*

To enable bluetooth USB device, load the module from /boot/loader.conf

```
ng_ubt_load="YES"
```

Add the following lines in rc.conf(5) file:

```
hcsecd_enable="YES"
sdpd_enable="YES"
```

Then copy /etc/defaults/bluetooth.device.conf to /etc/bluetooth directory:
`# cp /etc/defaults/bluetooth.device.conf /etc/bluetooth/ubt0.conf`

Uncomment those options as default in ubt0.conf

```
authentication_enable="NO"
connectable="YES"
discoverable="YES"
role_switch="YES"
```

Read 32.4 Bluetooth section as reference to configure properly the bluetooth device.

To transfer objects (images, movies, address book items) from phone to PC, install comms/obexapp and start the obexapp server:

```
# mkdir /home/user/bluetooth
# obexapp -s -S -C 10 -u user -r /home/user/bluetooth
```

Then, when initiate transfer it will send automatically to that directory in our PC.

Moreover, to transfer from PC to phone, just run obexapp as client as follow:
`# obexapp -a BD_ADDR -C opush -n put file_to_send`

See obexapp(1) for help.


*4. CPU's Temperature*

To monitoring of the CPU temperature load the coretemp(4) module:
`# kldload coretemp`

You can check your CPU's temperature, just running:

```
[CMD]% sysctl -a | grep temperature[/CMD]
hw.acpi.thermal.tz0.temperature: 59.0C
dev.cpu.0.temperature: 54.0C
dev.cpu.1.temperature: 54.0C
```

You should add this line to /boot/loader.conf to load module during boot-time:

```
coretemp_load="YES"
```


*5. Ethernet*

Add this line in /etc/rc.conf

```
ifconfig_alc0="DHCP media 100baseTX"
```


*6. Hotkeys*

The acpi_asus driver provides support for the extra ACPI-controlled gadgets (hotkeys and leds).

Not tested.


*7. Sound*

To check the sound card via the /dev/sndstat file:

```
[CMD]% cat /dev/sndstat[/CMD]
FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:
pcm0: <Realtek ALC269 (Analog 2.0+HP/2.0)> (play/rec) default
pcm1: <Realtek ALC269 (Right Analog Mic)> (rec)
```

Mixer values. More details can be found in the mixer(8) man page.

```
[CMD]% mixer[/CMD]
Mixer vol      is currently set to  98:98
Mixer pcm      is currently set to  98:98
Mixer speaker  is currently set to  64:64
Mixer rec      is currently set to  71:71
Mixer igain    is currently set to  70:70
Mixer ogain    is currently set to  70:70
Mixer monitor  is currently set to  94:94
Recording source: monitor
```

For more information, read 8.2 Setting Up the Sound Card.


*8. SD card reader*

Need adding the following drivers in /boot/loader.conf

```
mmc_load="YES"
mmcsd_load="YES"
sdhci_load="YES"
```


----------



## cpm@ (May 20, 2013)

*9. Graphics*

To get working Intel Pineview (M) video card just follow instructions described in Intel_GPU.

Summarizing the steps:

Add those variables in /etc/make.conf

```
WITH_KMS=yes
WITH_NEW_XORG=yes
```

Update your ports tree with portsnap(8) and perform an upgrade for the next ports:

> graphics/libdrm
> graphics/dri
> graphics/libGL
> graphics/libGLU
> x11-servers/xorg-server

Finally rebuild all xorg-* related ports, including x11-drivers/xf86-video-intel.

Check results:

```
[CMD]# grep drmn /var/log/dmesg.today[/CMD]
drmn0: <Intel Pineview (M)> on vgapci0
drmn0: taking over the fictitious range 0xd0000000-0xe0000000

[CMD]# grep info /var/log/dmesg.today[/CMD]
info: [drm] MSI enabled 1 message(s)
info: [drm] AGP at 0xd0000000 256MB
info: [drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
info: [drm] Driver supports precise vblank timestamp query.
[drm:KMS:pid1928:parse_sdvo_device_mapping] No SDVO device info is found in VBT
info: [drm] initialized overlay support
info: [drm] Initialized i915 1.6.0 20080730
```

Here is the glxinfo output.


*10. Suspend/resume*

Only works suspend to RAM from text mode, press Fn+F1 or run `# acpiconf -s 3` to put on S3 state. To resume, press <*any*> button to wake up the machine.

Read Suspend/Resume for more information.


*11. Wireless*

Install converters/libiconv port.


```
# cd /tmp/
# fetch http://gugus69.free.fr/freebsd/Broadcom_BCM43xx_5.100.235.19_win5x.tgz
# tar xzvf Broadcom_BCM43xx_5.100.235.19_win5x.tgz
# cd Broadcom_BCM43xx_5.100.235.19_win5x/
# cp bcmwl5.inf bcm43xx.cat bcmwl5.sys bcmwlcoi.dll /usr/src/sys/modules/if_ndis
# cd /usr/src/sys/modules/if_ndis
```

Create the *.ko modules:

```
# ndisgen bcmwl5.inf bcm43xx.cat bcmwl5.sys bcmwlcoi.dll
# ls
bcm43xx.cat bcmwl5_sys.ko Makefile bcm43xx.cat.ko bcmwl5.inf bcmwlcoi.dll bcmwl5.sys bcmwlcoi.dll.ko
# cp bcmwlcoi.dll.ko bcm43xx.cat.ko bcmwl5_sys.ko /boot/modules
```
Load the modules:

```
# kldload ndis
# kldload bcmwl5_sys
# kldload bcm43xx.cat
# kldload bcmwlcoi.dll
```

Check the condition:
`# ifconfig wlan0`

Create the device as follow:
`# ifconfig wlan0 create wlandev ndis0`

Don't add ndis(4) in /boot/loader.conf because the Windows NDIS driver wants functions that are not currently implemented in the FreeBSD NDIS driver and causes kernel panic at boot.

Add this lines to /etc/rc.conf

```
wlans_ndis0="wlan0"
ifconfig_wlan0="WPA DHCP"
wpa_supplicant_enable="YES"
```

Create an startup script named /etc/wifi_up

```
#!/bin/sh

kldload bcm43xx.cat bcmwl5_sys bcmwlcoi.dll
ifconfig wlan0 create wlandev ndis0
ifconfig wlan0 up
wpa_supplicant -D ndis -i wlan0 -c /etc/wpa_supplicant.conf & dhclient wlan0
```

`# chmod 1555 /etc/wifi_up`

Edit /etc/wpa_supplicant.conf

```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
        ssid="YOUR-SSID-NAME"
        key_mgmt=NONE
        wep_key0=YOUR-WEPKEY
        wep_tx_keyidx=0
}

network={
        ssid="YOUR-SSID-NAME"
        key_mgmt=WPA-PSK
        psk="WPA-YOUR-KEY"
}

network={
        ssid="YOUR-SSID-NAME"
        proto=WPA RSN
        key_mgmt=WPA-PSK
        psk="WPA-YOUR-KEY"
}
```

See wpa_supplicant.conf(5) man page for more options.

If you have problems to connect, just do the following to re/connect:

```
# dhclient wlan0
dhclient already running, pid: 42012.
exiting.
# kill 42012
# ifconfig wlan0 down
# ifconfig wlan0 up
# dhclient wlan0
```


----------



## cpm@ (May 20, 2013)

*12. Webcam*

Install multimedia/webcamd port.

Add this line in /boot/loader.conf

```
cuse4bsd_load="YES"
```

Also need to add this line in /etc/rc.conf

```
webcamd_enable="YES"
```

Configure webcam device as follow:

```
# kldload cuse4bsd
# dmesg | grep ugen
# webcamd -d ugen4.2 -i 0 -v 0
```

Quoted from /usr/ports/UPDATING dated entry 20110421:

```
20110421:
  AFFECTS: users of multimedia/webcamd
  AUTHOR: kwm@FreeBSD.org

  Webcamd now creates device nodes with 0660 permission and webcamd:webcamd
  ownership. To get access to the webcamd devices just add yourself to the
  webcamd group.
```

Add user to the webcamd group:
`# pw group mod webcamd -m user`

To test if works, install multimedia/pwcview and run:

```
[CMD]% pwcview[/CMD]
Webcam set to: 320x240 (sif) at 5 fps
```

See the pwcview(1) man page for details.


*13. Tuning Power Consumption*

Some hints to obtain better performance:

Add in /boot/loader.conf

```
# Disable throttling control
hint.p4tcc.0.disabled=1
hint.acpi_throttle.0.disabled=1

# Number of clock ticks per second
kern.hz=100
```

Edit /etc/rc.conf

```
powerd_enable="YES"
powerd_flags="-a adaptive -b adaptive -n adaptive"
performance_cx_lowest="C2"
economy_cx_lowest="C2"
```

Checking ACPI battery to see the improvements:

```
[CMD]# acpiconf -i0[/CMD]
Design capacity:        6000 mAh
Last full capacity:     5479 mAh
Technology:             secondary (rechargeable)
Design voltage:         7400 mV
Capacity (warn):        548 mAh
Capacity (low):         274 mAh
Low/warn granularity:   60 mAh
Warn/full granularity:  60 mAh
Model number:           1018P
Serial number:          
Type:                   LION
OEM info:               ASUS
State:                  discharging
Remaining capacity:     100%
Remaining time:         4:27
Present rate:           1231 mA (10187 mW)
Present voltage:        8276 mV
```

Read Tuning Power Consumption for details.

Also see https://wiki.freebsd.org/AsusEee for other ASUS Eee family models.

P.S. This HOWTO is subject to future updates, please, any suggestion or correction is welcome


----------

