Re: __init and __exit vs module_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think the __init is telling kernel that this function is executed once and
never come back . but module_init is to initialize the module when it is
being insmod.

----- Original Message -----
From: "Dan Erickson" <coldoneknight@rogers.com>
To: <kernelnewbies@nl.linux.org>
Sent: Thursday, April 11, 2002 11:57 PM
Subject: __init and __exit vs module_init()


>
> Howdy,
>
> What I am wondering is, is __init equal to module_init()?
> Basicly... I was confussed as to what happens if you want to
> compile a driver directly into the kernel. Then I discovered __init.
> There needs to be some way the kernel knows what the entry point
> of the driver is, and if you have module_init() everything is all well and
> good, the kernel is happy as it knows what the entry point is, but what if
> you dont compile as a module? Then all of a suddenly the kernel doesnt
> know what the entry point is because all you have given it is the entry
> point "IF" it was compiled as a module. Is the purpose of __init to tell
> the kernel the entry point in the event that the driver is compiled
> directly into the kernel?
> The best answer I could get would be from "Linux Device Drivers"
> by Oreilly. Though I found there explanation cryptic.
>
> Thanks for the help
>
> -Dan Erickson-
> -ColdOneKnight@rogers.com-
>
> --
> Kernelnewbies: Help each other learn about the Linux kernel.
> Archive:       http://mail.nl.linux.org/kernelnewbies/
> FAQ:           http://kernelnewbies.org/faq/
>

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux