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