Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to call the Android/Linux system

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the relevant knowledge of how to call the Android/Linux system, the content is detailed and easy to understand, the operation is simple and fast, and has a certain reference value. I believe you will gain something after reading this article on how to call the Android/Linux system. Let's take a look at it.

When debugging Android device drivers, the application layer is always bound by various permissions. Here is one of the solutions.

One kernel layer modification

Drivers/input/fingerprint/zpx_fp_mtk_tee/zpx_fp_mtk_tee.c

# include static long zpx_method (long arg) {printk ("% s enter,arg=%ld\ n", _ _ func__, arg); read_all_reg_test (fp_global); return 0 } SYSCALL_DEFINE1 (zpx_method,long,arg) / / A formal parameter {return zpx_method (arg);}

Include/linux/syscalls.h

Asmlinkage long sys_zpx_method (long arg)

Include/uapi/asm-generic/unistd.h

_ _ SYSCALL (_ _ NR_zpx_method, sys_zpx_method)

Arch/arm/include/uapi/asm/unistd.h

# define _ _ NR_zpx_method (_ _ NR_SYSCALL_BASE+391)

Arch/arm/kernel/calls.S

CALL (sys_zpx_method) .rept syscalls_padding / / comments such as the empty function / * CALL (sys_ni_syscall) * / / * null func*/

Arch/arm/include/asm/unistd.h

# define _ NR_syscalls / / last call + 1

Application layer invocation

# include # define _ SYSCALL_zpx_ 391int main (int argc,char * * argv) {syscall (_ SYSCALL_zpx_,13); return 0;}

Three results

No permission is required

K39_bsp:/data/local/tmp $ls-ltotal 80-rwxrwxrwx 1 shell shell 78968 2020-07-20 09:28 driver_testk39_bsp:/data/local/tmp $. / driver_testk39_bsp:/data/local/tmp $

Kernel log

[100.325202] (2) [2506:driver_test] zpx_method enter Arg=13 [100.325234] (2) [2506:driver_test] [zpx] zpx_spi_clk_enable enter [100.325249] (2) [2506:driver_test] [zpx] zpx_spi_clk_enable finsish [100.325469] (2) [2506:driver_test] [zpx] [0] = FF [100.325483] (2) [2506:driver_test] [zpx] [1] = 0 [100.325490] (2) [2506: Driver_test] [zpx] [2] = 0 [100.325497] (2) [2506:driver_test] [zpx] [3] = 3F [100.325503] (2) [2506:driver_test] [zpx] [4] = 0 [100.325510] (2) [2506:driver_test] [zpx] [5] = 57 this is the end of the article on "how to call the Android/Linux system" Thank you for reading! I believe you all have a certain understanding of the knowledge of "how to call the Android/Linux system". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report