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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

832 Views
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?

Labels (2)
4 Replies

740 Views
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 Kudos

740 Views
yipingwang
NXP TechSupport
NXP TechSupport
0 Kudos

740 Views
jiye
Contributor V

this is amazing ! Thanks Yiping

0 Kudos