<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Coding Friends &#187; modules</title>
	<atom:link href="http://www.codingfriends.com/index.php/tag/modules/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.codingfriends.com</link>
	<description>Coding Friends, place for developers.</description>
	<lastBuildDate>Sun, 04 Dec 2011 21:11:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>kernel &#8211; passing module parameters</title>
		<link>http://www.codingfriends.com/index.php/2010/02/27/kernel-passing-module-parameters/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=kernel-passing-module-parameters</link>
		<comments>http://www.codingfriends.com/index.php/2010/02/27/kernel-passing-module-parameters/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 16:19:22 +0000</pubDate>
		<dc:creator>genux</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux install and configurations]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[insmod]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[modinfo]]></category>
		<category><![CDATA[modules]]></category>
		<category><![CDATA[nvidia]]></category>

		<guid isPermaLink="false">http://www.codingfriends.com/?p=759</guid>
		<description><![CDATA[With normal programs that allow you pass parameters on there command line, for example printoutmyname genux where the program is called printoutmyname and the first parameter is genux (it is normal that the first parameter [0] is actually the program name and the second parameter [1] is the parameter that is passed) Well in Linux [...]]]></description>
			<content:encoded><![CDATA[<p>With normal programs that allow you pass parameters on there command line, for example</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">printoutmyname genux</pre></div></div>

<p>where the program is called printoutmyname and the first parameter is genux (it is normal that the first parameter [0] is actually the program name and the second parameter [1] is the parameter that is passed)</p>
<p>Well in <a href="http://www.kernel.org/">Linux kernel</a> (where here is a example on how to <a href="http://www.codingfriends.com/index.php/2010/01/07/compile-a-kubuntu-kernel/">compile</a> the kernel for a ubuntu based setup) you can pass parameters to the modules that are getting loaded.  One module would be your graphics card, in my case a nvidia graphics card. </p>
<p>To find out what parameters can be passed to the graphics card you will have to find the kernel module file (filename.ko, where the ko is the kernel object file), so to search for the nvidia.ko in my case I did</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">locate</span> nvidia.ko</pre></div></div>

<p>and then changed to that directory and did a module information on it</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span>2.6.31-<span style="color: #000000;">17</span>-generic<span style="color: #000000; font-weight: bold;">/</span>updates<span style="color: #000000; font-weight: bold;">/</span>dkms<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">ls</span>
nvidia.ko  vboxdrv.ko  vboxnetadp.ko  vboxnetflt.ko</pre></div></div>

<p>and doing a module information on it you call the <a href="http://linuxcommand.org/man_pages/modinfo8.html">modinfo</a> on the kernel object file as</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">modinfo nvidia.ko
<span style="color: #000000; font-weight: bold;">&lt;/</span>pre
&nbsp;
my output was
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;</span>pre <span style="color: #007800;">lang</span>=<span style="color: #ff0000;">&quot;bash&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
filename:       nvidia.ko
license:        NVIDIA
<span style="color: #7a0874; font-weight: bold;">alias</span>:          char-major-<span style="color: #000000;">195</span>-<span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #7a0874; font-weight: bold;">alias</span>:          pci:v000010DEd<span style="color: #000000; font-weight: bold;">*</span>sv<span style="color: #000000; font-weight: bold;">*</span>sd<span style="color: #000000; font-weight: bold;">*</span>bc03sc02i00<span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #7a0874; font-weight: bold;">alias</span>:          pci:v000010DEd<span style="color: #000000; font-weight: bold;">*</span>sv<span style="color: #000000; font-weight: bold;">*</span>sd<span style="color: #000000; font-weight: bold;">*</span>bc03sc00i00<span style="color: #000000; font-weight: bold;">*</span>
depends:
vermagic:       2.6.31-<span style="color: #000000;">17</span>-generic SMP mod_unload modversions
parm:           NVreg_EnableVia4x:int
parm:           NVreg_EnableALiAGP:int
parm:           NVreg_ReqAGPRate:int
parm:           NVreg_EnableAGPSBA:int
parm:           NVreg_EnableAGPFW:int
parm:           NVreg_Mobile:int
parm:           NVreg_ResmanDebugLevel:int
parm:           NVreg_RmLogonRC:int
parm:           NVreg_ModifyDeviceFiles:int
parm:           NVreg_DeviceFileUID:int
parm:           NVreg_DeviceFileGID:int
parm:           NVreg_DeviceFileMode:int
parm:           NVreg_RemapLimit:int
parm:           NVreg_UpdateMemoryTypes:int
parm:           NVreg_UseVBios:int
parm:           NVreg_RMEdgeIntrCheck:int
parm:           NVreg_UsePageAttributeTable:int
parm:           NVreg_EnableMSI:int
parm:           NVreg_MapRegistersEarly:int
parm:           NVreg_RmNvclkIdleGraphics:int
parm:           NVreg_RegistryDwords:charp
parm:           NVreg_NvAGP:int</pre></div></div>

<p>where the parm: is a parameter to pass to the module on load (insmod, or loaded via the kernel at boot time which you can force to load via the /etc/modules file and the parameters can be placed in the /etc/modprobe.d directory).</p>
<p>for example to load the nvidia module with a parameter NVreg_NvAGP you would do something like</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">insmod nvidia.ko <span style="color: #007800;">NVreg_NvAGP</span>=<span style="color: #000000;">1</span></pre></div></div>

<p>and the passing value is 1 to the NVreg_NvAGP parameter</p>
]]></content:encoded>
			<wfw:commentRss>http://www.codingfriends.com/index.php/2010/02/27/kernel-passing-module-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

