How all the drivers source code are getting called during boot up ls1021a

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How all the drivers source code are getting called during boot up ls1021a

2,249 次查看
jiye
Contributor V

Hi,

I have a really basic question want to ask here.

I know how the linux system starts from boot loader to the roofts work.

But how does those kernel source codes function get called for example in board.c, who is calling the functions during the boot up and how does the bootargs get passed to the kernel, there must be an array list of function calls or some other mechanism during boot up to do the job. Who is doing the job to call those fuctions (one good example is the printing information on the console during boot, those functions are called from the C code but who is calling them?

Can anyone explain?

标签 (2)
4 回复数

2,157 次查看
jiye
Contributor V

Hi Yiping,

How about the driver source code during boot up in the kernel, for example eth0 ? for example probe, 

static struct platform_driver random_driver = {
.probe = random_probe,
.remove = random_remove,
.driver = {
.owner = THIS_MODULE,
.name = CARDNAME,
.of_match_table = of_match_ptr(random),
},
};

How do these things get called when loading a module in the kernel. i am really wanting to understand as I want to build a module myself for my ethernet

Be more specific:

int (*probe) (struct pci_dev *dev, const struct pci_device_id *id);

this one that is passed to  struct pci_dev *dev, who is filling up this structure ( I think it should be the writer most likely but at which source code (Or calls) to fill up this information (etc. header files or .c file) then passed to the kernel core?

0 项奖励
回复

2,157 次查看
yipingwang
NXP TechSupport
NXP TechSupport
0 项奖励
回复

2,157 次查看
jiye
Contributor V

this is amazing ! Thanks Yiping

0 项奖励
回复