RedPill-TTG / redpill-lkm

Linux kernel module for RedPill
GNU General Public License v3.0
307 stars 174 forks source link

Shim RTC #5

Closed ttg-public closed 2 years ago

ttg-public commented 2 years ago

The mfgBIOS has methods for setting and getting system time, independent from the kernel's RTC. On 3615xs the kernel module itself just proxies the calls to hardware RTC. However, on 918+ the calls are instead attempted against (non-existent on a PC) I2C RTC chip.

In essence we should always shim mfgBIOS routines for RTC and direct them to the standard PC RTC. As an alternative it may be possible to just lookup addresses of bandon RTC in the original mfgBIOS module and just redirect it there without writing a custom implementation.

ttg-public commented 2 years ago

Implemented in https://github.com/RedPill-TTG/redpill-lkm/commit/76c36a43483562c3438dd491a58208bc92e04416

The implementation contains code which is only a minimal mock for alarms handling. They're not really implemented nor persisted in the physical RTC. The reason is they're rarely used (and often even completely broken on many systems) with wakeups being randomly not working.

If the community REALLY want it implemented we can do it. It's just not that easy nor useful in our opinion.