The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Clevo fan control code & Linux utility

    Discussion in 'Sager and Clevo' started by aqd, Jan 30, 2016.

  1. aqd

    aqd Notebook Enthusiast

    Reputations:
    9
    Messages:
    30
    Likes Received:
    9
    Trophy Points:
    16
    Some of you have used the ECView leaked somewhere or my ClevoECView without knowing how it works actually, now I finally decoded the code and commands sent to EC for fan query and control, for using Linux on my laptop.

    If you're on Linux, fanctrl.c is an utility to query and control the CPU fan speed (no auto option; auto is broken anyway), based on some fan-control program for MSI laptop. I'll make an Ubuntu indicator later and maybe write a new auto-control algorithm.

    If you're interested in the code/commands, see ec-trace.txt, which contains the information I gathered by disassembling ecview.dll. If you want to do it itself, the functions in ecview.dll are just doing write/read to io ports, code 80h is READ, 66h is EC_SC (send command) and 62h is EC_DATA (send parameters or read back). There isn't much more left to decode though as ecview.dll provides only a small part of functionality to the official ECView program, the rest is in WMI drivers.

    On Linux you could read EC registers by loading ec_sys module and then read debug information on filesystem, like:
    Code:
    od -Ax -t x1 /sys/kernel/debug/ec/ec0/io
    The D0 D1 are exactly the the same D0/D1 representing fan speed in fanctrl.c. Writing also works with write_support=1 option to ec_sys but seems to have no effect.
     
    rwx, Exec360 and i_pk_pjers_i like this.
  2. aqd

    aqd Notebook Enthusiast

    Reputations:
    9
    Messages:
    30
    Likes Received:
    9
    Trophy Points:
    16
    The control indicator for Ubuntu is completed! See github.
     
    rwx, Dennismungai, Exec360 and 3 others like this.