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 pass parameters to Linux kernel code

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article introduces the Linux kernel code, pass parameters, the content is very detailed, interested friends can refer to, hope to be helpful to you.

1. Source code

1.1 temp_main.c

# include # define LOG_INFO (fmt,args...) Printk (KERN_INFO fmt, # # args) static int int_var = 0 position static const char * str_var = "default"; static int int_arr [6]; int narr;module_param (int_var, int, 0644); MODULE_PARM_DESC (int_var, "An integer variable"); module_param (str_var, charp, 0644); MODULE_PARM_DESC (str_var, "A string variable"); module_param_array (int_arr, int, & narr, 0644) MODULE_PARM_DESC (int_arr, "An integer array"); static int init_marker (void) {int I; LOG_INFO ("int_var:% d.\ n", int_var); LOG_INFO ("str_var:% s.\ n", str_var); for (iTuno; I)

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