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?
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?
Please refer to the following
The Linux Kernel Module Programming Guide
Linux Kernel Module Programming: Hello World Program - GeeksforGeeks
this is amazing ! Thanks Yiping