Messages in this thread | | | Date | Wed, 05 May 1999 01:08:03 +1000 | From | Martijn van Oosterhout <> | Subject | [RFC] Unifying kernel initialization |
| |
One of the things I've always found a little strange about drivers in the Linux kernel, was that the driver code was different depending on whether it was built into the kernel or not.
If it was built into the kernel, you'd have to add it to the mess in init/main.c or similar and add a call for it somewhere. If it's a module, some code needs to be added in the module surrounded by #ifdef's
This all seems terribly clumsy. I was thinking that a better way to do it would be to have a macro REGISTER_INIT_FUNC(function,priority), which would add the nessesary info to the object file. Then, the kernel would need only to loop over this list and all the kernel would be initialized in order.
This also means that you could control the order of loading of modules from the module source, without having to patch any other files.
You could also use ld -r to bundle modules together and everything would still load fine.
Also, how about reserving a certain amount of memory after the loaded kernel image for loading modules into so they don't use PTEs or TLBEs.
Ofcourse, I may be dreaming and there is some fundumental flaw with this idea.
Martijn van Oosterhout Australia
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |