10:42:55 #startmeeting 10:43:22 #topic Kernel Modules 10:43:43 #topic Introduction to Kernel Modules 10:44:35 ok lets start 10:45:13 I am Balaji and this is gonna be an introductory session on Kernel Modules and writing a networking driver 10:45:52 oh.. 10:46:49 ok now how many of you people know about Kernel Modules here 10:47:54 i don't know 10:48:02 me neither 10:48:15 i also don't 10:48:21 G__81, me too don't know 10:48:27 me2 10:48:33 ok 10:48:50 tell us about it 10:49:37 yeah sure 10:51:39 kernel modules are modules which can be dynamically linked to the kernel 10:52:23 so when i say dynamically linked to the kernel means the kernel gets extra functionality on the fly without having a restart 10:52:42 oh.... 10:52:51 The drivers in Linux are the best examples. The drivers get loaded onto the system on fly and the kernel gets added functionality 10:53:18 Linux tries to mimic Micro Kernel in this way 10:53:23 example usb drivers? 10:53:28 yes 10:53:35 ethernet drivers etc 10:54:57 any questions till now 10:55:18 oh.... 10:55:29 yes. 10:56:26 what ? 10:58:10 i am not even sure whether we need this now 10:58:20 INITRD.gz has these type of drivers to startup the kernels? 10:58:33 no 10:58:39 oh. 10:59:10 ok. carry on 10:59:49 i am gonna make this session as crisp as possible because of very less people 11:00:29 ok 11:01:00 these are the advantages of the kernel modules so it gets dynamically linked to the kernel and you can load the module on fly and unload the module on fly 11:01:28 To load the module, you basically give the command insmod < module name> or modprobe < module name> 11:01:28 mmmm..... 11:01:48 mmm.... 11:01:52 and to unload the module you give rmmod < module name> 11:02:07 oh. 11:03:00 when you try to load a module which has already been loaded, you basically get an error saying that "File exists" which means the module exists in the kernel 11:03:08 but how does one find out whether the module is loaded ? 11:03:22 how? 11:03:25 to do that you basically give lsmod which lists the modules loaded 11:03:27 lspci 11:03:36 oh 11:03:45 no its lsmod 11:04:08 m 11:04:18 to specifically find out whether a module is loaded you could do lsmod | grep "Module Name" 11:05:23 please give example 11:05:29 hi this is arun 11:05:37 example of what ? 11:05:48 command 11:05:53 which command 11:05:56 how do I know the module name? 11:06:18 using "lsmod" 11:06:38 for example if you want to know if nvidia is loaded 11:06:41 you could give 11:06:48 /sbin/lsmod | grep nvidia 11:06:52 will show 11:07:04 nvidia 9534696 40 11:07:32 oh.... 11:07:50 but in my machine it is not showing anything 11:08:06 does it require root permission? 11:08:09 G__81: 9534**** is size, what is that 40? 11:08:14 yes 11:08:29 mssrpr: maybe you're using the noveau driver, try lsmod | grep noveau 11:08:41 what it means "9534696 40"? 11:09:07 when you do lsmod 11:09:21 nailuj24: it also doesn't return anything 11:09:25 you see last column with numbers 11:09:42 mssrpr: try lsmod | grep radeon 11:09:57 mssrpr: I don't know which graphics card you're using :) 11:10:21 ok.come to the topic 11:10:55 so first try "lspci" command find out your graphics card 11:11:02 thats basically the number of other modules this is being used with 11:11:10 nailuj24:I am using Nvidia - GeForce 7300 11:11:29 isn't the name "nouveau" instead of "noveau"? 11:11:41 SkyKnight, for example cfg80211 30604 2 iwl3945,mac80211 11:11:47 marcw: oh, may be 11:11:47 G_81: will you please differ lsmod from lspci? 11:11:47 lspci gives "01:00.0 VGA compatible controller: nVidia Corporation G70 [GeForce 7300 GT] (rev a1)" 11:12:15 lspci - list all PCI devices 11:12:18 lsmod lists all modules 11:12:22 loaded in the kernel 11:12:31 oh......... 11:12:56 I will find it later. We will continue 11:13:15 G_81: lsmod will be able to display the in-build kernel modules ??? 11:13:36 I found the following result for cdrom; cdrom 43168 1 sr_mod 11:13:53 mssrpr: try lsmod | grep nouveau , i think i mistyped it 11:14:44 nailuj24: that also didn't return anything. I am using the DVI port 11:14:53 G__81: but few modules displays the no. of modules used more than the module names coming next to it. what about that? 11:15:46 mssrpr: kernel modules are not related to display ports. maybe you'll figure it out later, it's weird you don't find anything 11:16:48 oops.. power cut :( 11:17:19 mssrpr: also here :-( 11:19:17 G__81: example: "ipv6 ******* 10" it dont have any module names after 10 11:20:35 but why? 11:22:26 ping G__81 11:22:45 possibly power cut 11:22:50 sherry151, yeah 11:22:51 G_81: are you there? 11:23:19 or maybe he is fed up with you people digressing from the topic. 11:23:27 yes 11:23:40 yeah tell me 11:23:50 SkyKnight, if there are no numbers left to it you can unload the module easily 11:24:24 G__81: you please continue, i think its better to clear it after this session 11:24:36 lets say you have 0 to it it means that you can unload that module but lets say if you have 4 next to it you cannot just unload this module because this module is in use by the other 4 modules so you would have to unload the other 4 modules and then unload this module 11:24:38 got it ? 11:24:44 G__81, please accept questions after the session 11:25:01 yes, got it 11:25:09 G__81, please ask others to stop chatting with each others during the session 11:25:21 G__81: ok. 11:25:23 +1 11:25:40 Every one please stop "oh..." kind of stuff when a session is in progress 11:25:56 m 11:26:44 if anyone has a question please raise your hand by typing "!" and speak only when asked by the chair. 11:26:53 we should continue the class 11:27:07 G__81: please return to the session. 11:27:12 yeah 11:27:14 yes 11:28:02 now the kernel modules are of different classes. Char driver, a Block Driver and a Network driver 11:28:29 classes means types 11:28:35 these are the classes of kernel modules. Linux Kernel provides different APIs to differentiate it from one type to an other 11:29:00 lets say you want to write an ethernet driver it means you are going to write a network driver 11:29:01 m 11:29:13 for example the bridge module in kernel is a networking driver 11:30:06 examples of each classes? 11:30:57 m 11:31:26 Padhu_1: Stop that please. 11:31:32 ok 11:31:39 Padhu_1: Let him finish, please note down your questions and ask it in the end or when the chair asks for questions. 11:32:09 ok skyKnight 11:32:21 G__81: I gues you are suffering some technical difficulties. If you are unable to continue the session please declre the meeing closed 11:32:45 there is a problem with network here 11:32:51 all of a sudden 11:33:08 ]noprob; we are here 11:33:32 ok so those are the classes of kernel modules 11:33:57 the char drivers are available in the /drivers/char directory 11:34:18 and the block drivers source code is available in the drivers/block directory 11:34:34 example of block driver is floppy drives 11:34:51 you could see the floppy.c in block driver directory 11:35:22 G__81, ! 11:35:25 char drivers are drivers where data is read as bytes (each byte) but in case of block drivers data is read as a big chunk 11:35:27 yes zer0c00l 11:35:42 G__81, do you mean drivers/char in kernel sources? 11:35:49 yes 11:35:56 11:36:10 the ttys are all examples of char 11:36:12 drivers 11:36:27 the terminals are char basically 11:36:31 is it clear till now ? 11:36:40 y 11:36:40 yes 11:36:46 yes 11:36:49 yes 11:36:52 yes 11:36:54 yes 11:36:57 yeah 11:37:00 yes 11:38:23 ok 11:38:24 now 11:38:56 these are some of the basics of kernel modules 11:39:15 i thought of taking the writing a driver today but i am not sure whether i could take it 11:39:21 probably next week should be ok i believe 11:39:51 any comments on this ? 11:40:02 no problems 11:40:02 G__81: I came here for that 11:40:17 ok. I will be here on that day 11:40:28 no problem 11:40:35 time? 11:40:42 i ll let you know the time 11:40:49 for sure on hand will discuss with nirik 11:40:57 Padhu_1, will be updated in wiki 11:41:06 ok. 11:41:13 because there was some mis communication from nirik on morning's session 11:41:22 so we ll take this next week 11:41:29 ok. 11:41:31 any questions on current topic ? 11:41:37 .fasinfo Padhu_1 11:41:37 thats what we discussed today ? 11:41:45 if not we can close this now 11:41:51 #end meeting 11:42:11 is it fine to close now ? 11:42:15 or you have some questions ? 11:42:20 i have one question 11:42:23 yes 11:42:44 i am searching for the kernel sources in my machine 11:42:52 is there any rpm i have to install? 11:42:56 kernel-devel 11:43:05 ok 11:43:11 any more questions ? 11:43:20 ya 11:43:25 mssrpr: or yum install --source kernel 11:43:36 what about udev? 11:43:45 what about means ? 11:43:52 how to list in-build kernel modules ?? 11:44:30 thangam_arun, you cannot do that basically its more on whats loaded currently 11:44:36 rather than on whats built 11:44:37 G__81:do you have any idea ?? 11:44:45 idea on what ? 11:44:57 udev is part of building of kernel module 11:45:00 you answered already.leave it 11:45:11 i guess we could close it now 11:45:20 is it fine ? 11:45:41 ok thanks for your time and support 11:45:43 go ahead 11:45:46 yes, thanks G__81 11:45:48 next session is scheduled in an hour? 11:45:57 #endmeeting