Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.23 KB

File metadata and controls

40 lines (27 loc) · 1.23 KB

Languages: English | 简体中文 | 繁體中文 | 日本語 | 한국어 | Français | Deutsch | Español | Italiano | Русский | العربية

← NeverC Examples

Android Kernel Multi-File Module

Demonstrates a multi-file NeverC kernel module. Key points:

  • Single bootstrap: NEVERC_KRT_BOOTSTRAP() only needs to be called once in module_init
  • Shared state: the compiler promotes all neverc_krt_* state to weak_odr linkage, so all .c files share the same resolver, cache, and subsystem state
  • Split architecture: main.c (init/exit), interposes.c (interpose logic), utils.c (helpers)

Build

cd examples/android-kernel-multifile
neverc make

Change KERNEL to 515, 601, 606, 612, or 618 for other kernel versions.

Deploy & Run

neverc make run

Or manually:

adb push nvk_multi.ko /data/local/tests/
adb shell su -c 'insmod /data/local/tests/nvk_multi.ko'
adb shell su -c 'dmesg | grep neverc_krt_multi'

Unload

neverc make rmmod