<?xml version="1.0" encoding="utf-8" ?><transcript><text start="1.58" dur="6.16">okay this is a introductory programming</text><text start="4.799" dur="7.021">class this is technical stuff and</text><text start="7.74" dur="5.67">hopefully it will inspire some people</text><text start="11.82" dur="3.89">who may not have ever tried to write a</text><text start="13.41" dur="4.26">device driver to maybe actually try it</text><text start="15.71" dur="7.979">if they have something they want</text><text start="17.67" dur="6.019">supported or or whatever just for fun</text><text start="24.59" dur="6.509">okay let&amp;#39;s talk a little bit about the</text><text start="27.24" dur="3.859">way device driver is laid out</text><text start="31.969" dur="5.411">essentially you have two segments of</text><text start="34.8" dur="5.849">memory a data segment in a code segment</text><text start="37.38" dur="5.73">and a requirement of a device driver as</text><text start="40.649" dur="3.75">if there&amp;#39;s a header at the beginning of</text><text start="43.11" dur="5.219">your data segment and this header</text><text start="44.399" dur="7.291">contains information that informs the</text><text start="48.329" dur="7.53">kernel how to access your driver</text><text start="51.69" dur="7.829">there&amp;#39;s pointers into a strategy routine</text><text start="55.859" dur="5.54">and that is how the driver talks to how</text><text start="59.519" dur="5.43">the colonel talks to your driver a</text><text start="61.399" dur="6.341">32-bit driver will actually have another</text><text start="64.949" dur="4.591">segment of 32-bit code segments in</text><text start="67.74" dur="7.35">addition to the two segments that a</text><text start="69.54" dur="7.469">16-bit driver has the data segment also</text><text start="75.09" dur="3.75">has the header the same that header has</text><text start="77.009" dur="7.441">to be there because the kernel expects</text><text start="78.84" dur="7.44">it to be there and this is not the only</text><text start="84.45" dur="3.39">way to build a 32-bit driver this is</text><text start="86.28" dur="6.839">just how I have done it because this</text><text start="87.84" dur="7.05">makes things very easy okay</text><text start="93.119" dur="4.441">any questions feel free to ask questions</text><text start="94.89" dur="5.31">I&amp;#39;m gonna kind of move along because I&amp;#39;m</text><text start="97.56" dur="8.309">gonna get to an actual writing a device</text><text start="100.2" dur="10.38">driver in real life with real time okay</text><text start="105.869" dur="7.741">moving on the main thing that your</text><text start="110.58" dur="8.09">driver needs to have for communication</text><text start="113.61" dur="5.06">with the kernel is the strategy handler</text><text start="120.539" dur="6.911">the first time so when your driver gets</text><text start="124.299" dur="6.931">loaded via a device statement or a base</text><text start="127.45" dur="6.66">that statement in your in your config</text><text start="131.23" dur="4.229">dot sis the first thing that drive the</text><text start="134.11" dur="4.95">Colonel will do is load your driver into</text><text start="135.459" dur="5.67">memory set up the device header it&amp;#39;ll</text><text start="139.06" dur="4.95">read the the address out of the device</text><text start="141.129" dur="5.071">header so it knows what function to call</text><text start="144.01" dur="4.199">to initialize your driver and it also</text><text start="146.2" dur="5.55">will write the code segment and data</text><text start="148.209" dur="4.951">segment selectors into that header so</text><text start="151.75" dur="3.239">the first thing the kernel does is it</text><text start="153.16" dur="4.049">calls that strategy handler with an init</text><text start="154.989" dur="4.021">function and that allows your driver to</text><text start="157.209" dur="7.021">do whatever it needs to do to initialize</text><text start="159.01" dur="7.259">itself then later on after all of the</text><text start="164.23" dur="4.589">drivers are loaded the driver the kernel</text><text start="166.269" dur="5.55">will call your driver again with a</text><text start="168.819" dur="4.5">function called an it complete at this</text><text start="171.819" dur="3.631">point you&amp;#39;re guaranteed that all the</text><text start="173.319" dur="4.711">other drivers are loaded and this is the</text><text start="175.45" dur="4.14">time you would do things like connect to</text><text start="178.03" dur="4.14">other drivers for inter driver</text><text start="179.59" dur="4.229">communication for example if one driver</text><text start="182.17" dur="2.969">needs to talk to another driver this is</text><text start="183.819" dur="3.961">when they would connect to each other</text><text start="185.139" dur="4.021">the USB drivers do that a lot they do a</text><text start="187.78" dur="3.239">lot of talking between the different</text><text start="189.16" dur="5.15">drivers via this inter driver</text><text start="191.019" dur="7.041">communication mechanism there are other</text><text start="194.31" dur="8.73">functions that the strategy Handler can</text><text start="198.06" dur="7.98">implement such as open closed readwrite</text><text start="203.04" dur="4.71">save restore shut down various things</text><text start="206.04" dur="4.35">the open closed and read and write are</text><text start="207.75" dur="5.79">exactly mapped to when you would do a</text><text start="210.39" dur="5.37">open a file open in a program and a file</text><text start="213.54" dur="3.539">read and a flow right and that&amp;#39;s the</text><text start="215.76" dur="7.44">kind of example I&amp;#39;m going to show you</text><text start="217.079" dur="9.151">today to make writing device drivers</text><text start="223.2" dur="4.67">easy I&amp;#39;ve developed these two kits and I</text><text start="226.23" dur="3.24">mention these kids and they multi MEC</text><text start="227.87" dur="5.11">presentation but I&amp;#39;m going to talk a</text><text start="229.47" dur="8.129">little bit more about them now these two</text><text start="232.98" dur="11.069">kits essentially provide everything you</text><text start="237.599" dur="9.86">need to to build a device driver except</text><text start="244.049" dur="5.701">for the unique pieces that would be</text><text start="247.459" dur="3.61">applicable to whatever device you&amp;#39;re</text><text start="249.75" dur="3.169">trying to operate or whatever the</text><text start="251.069" dur="7.801">function you&amp;#39;re trying to accomplish</text><text start="252.919" dur="8.32">so in these kits you get essentially a</text><text start="258.87" dur="5.25">skeleton of a complete working driver</text><text start="261.239" dur="4.71">that does nothing that will load and do</text><text start="264.12" dur="5.039">nothing then all that&amp;#39;s required is to</text><text start="265.949" dur="4.861">add the unique pieces that you need to</text><text start="269.159" dur="4.281">do whatever it is you need to do if</text><text start="270.81" dur="6.9">you&amp;#39;re trying to write a driver to I</text><text start="273.44" dur="6.34">don&amp;#39;t know let&amp;#39;s say talk to a piece of</text><text start="277.71" dur="4.53">hardware and you have a simple piece of</text><text start="279.78" dur="4.319">hardware like a serial port for example</text><text start="282.24" dur="5.97">all you need to do is add the pieces</text><text start="284.099" dur="5.401">that talk to that piece of hardware to</text><text start="288.21" dur="4.98">the driver and everything else is</text><text start="289.5" dur="6.21">provided so a 16 bit driver I mentioned</text><text start="293.19" dur="4.469">last time there&amp;#39;s really no limitation</text><text start="295.71" dur="4.579">to 16 bit drivers because that&amp;#39;s the</text><text start="297.659" dur="5.82">driver model that os/2 supports already</text><text start="300.289" dur="4.85">so anything that you can do in a 16 bit</text><text start="303.479" dur="3.52">driver any written any</text><text start="305.139" dur="6.3">their way you can also do with the 16</text><text start="306.999" dur="7.051">bit driver kit this the thing that has</text><text start="311.439" dur="5.641">been difficult all along with os/2 is</text><text start="314.05" dur="5.729">writing 32 bit drivers now this 32 bit</text><text start="317.08" dur="4.739">driver kit is significantly more complex</text><text start="319.779" dur="5.16">than the 16 bit driver kit because it</text><text start="321.819" dur="7.65">provides all of the funking modules all</text><text start="324.939" dur="8.76">the thunking functions it essentially</text><text start="329.469" dur="7.92">makes all of the weird and crazy stuff</text><text start="333.699" dur="5.97">that&amp;#39;s required to implement a 32 bit</text><text start="337.389" dur="4.261">driver completely transparent to the</text><text start="339.669" dur="4.05">developer you don&amp;#39;t need to worry about</text><text start="341.65" dur="9.479">anything other than writing your own</text><text start="343.719" dur="9.991">code in a 32 bit C module okay so it</text><text start="351.129" dur="4.171">makes it really easy the the difference</text><text start="353.71" dur="5.009">it provides a lot of things it provides</text><text start="355.3" dur="5.339">a sealant all this all the C library</text><text start="358.719" dur="4.41">type functions that you are normally</text><text start="360.639" dur="4.14">used to using and C applications it</text><text start="363.129" dur="3.84">provides like I said all the thunking</text><text start="364.779" dur="5.581">modules it provides a heat manager all</text><text start="366.969" dur="4.801">of this stuff in 32 bits so that the</text><text start="370.36" dur="3.959">developer really doesn&amp;#39;t need to be</text><text start="371.77" dur="5.669">concerned about the peculiarities of a</text><text start="374.319" dur="5.1">32 bit driver the only thing that is a</text><text start="377.439" dur="5.22">little bit different are the limitations</text><text start="379.419" dur="7.31">and the primary limitations come in in</text><text start="382.659" dur="4.07">the initialization of your driver</text><text start="387.169" dur="6.371">IBM did a special thing for 16-bit</text><text start="390.66" dur="5.94">drivers that allow 16-bit drivers to</text><text start="393.54" dur="5.46">call a lot of the normal dose functions</text><text start="396.6" dur="5.34">at initialization time like DOS open das</text><text start="399" dur="4.949">closed us read various other things so</text><text start="401.94" dur="5.28">that you can do file IO or whatever you</text><text start="403.949" dur="5.491">need to do to initialize your driver now</text><text start="407.22" dur="4.77">you cannot do those things in a 32-bit</text><text start="409.44" dur="6.509">driver because those functions are not</text><text start="411.99" dur="6.36">available and the main reason is because</text><text start="415.949" dur="5.311">of a unique thing that IBM did when they</text><text start="418.35" dur="5.069">when they implemented the driver</text><text start="421.26" dur="6.21">interface is that the initialization</text><text start="423.419" dur="10.551">functions of a 16-bit driver run at ring</text><text start="427.47" dur="10.89">3 not ring 0 my did I lose anybody there</text><text start="433.97" dur="8.58">ok good now because of the way a 32-bit</text><text start="438.36" dur="4.19">driver has to run the initial</text><text start="449.099" dur="10.72">anybody not know thunking okay</text><text start="457.02" dur="7.81">essentially ring zero is the highest</text><text start="459.819" dur="7.081">privilege level thing there is a kernel</text><text start="464.83" dur="3.75">runs at ring zero all drive device</text><text start="466.9" dur="3.63">drivers run at rings Oh everything zero</text><text start="468.58" dur="3.54">you can do anything you want there&amp;#39;s no</text><text start="470.53" dur="4.379">restrictions there&amp;#39;s no privilege</text><text start="472.12" dur="4.949">restrictions ring three is the most</text><text start="474.909" dur="4.951">restricted privilege level it&amp;#39;s what all</text><text start="477.069" dur="5.07">applications run in applications run at</text><text start="479.86" dur="4.559">ring three and the reason there&amp;#39;s these</text><text start="482.139" dur="6.111">different privilege levels is because</text><text start="484.419" dur="7.71">it&amp;#39;s to prevent applications from doing</text><text start="488.25" dur="5.949">kernel type things like you cannot you</text><text start="492.129" dur="3.991">could ring three you can only access the</text><text start="494.199" dur="4.351">memory that&amp;#39;s given to your application</text><text start="496.12" dur="3.59">you can&amp;#39;t access memory outside of your</text><text start="498.55" dur="4.619">application that&amp;#39;s just one example</text><text start="499.71" dur="6.16">another example is you typically cannot</text><text start="503.169" dur="5.691">talk to the hardware at rating three any</text><text start="505.87" dur="6.87">i/o operations are blocked by the by the</text><text start="508.86" dur="5.08">CPU because the CPU certain instructions</text><text start="512.74" dur="4.08">have different privilege levels</text><text start="513.94" dur="4.92">associated with them and ring three can</text><text start="516.82" dur="3.93">do anything but ring three like if you</text><text start="518.86" dur="6.36">try and do an i/o operation in most</text><text start="520.75" dur="7.019">cases you&amp;#39;ll get a trap because the CPUs</text><text start="525.22" dur="3.989">knows that ring three things can&amp;#39;t do</text><text start="527.769" dur="4.471">i/o operations they&amp;#39;re not supposed to</text><text start="529.209" dur="4.411">be able to talk to the hardware now my</text><text start="532.24" dur="4.08">operations are kind of different because</text><text start="533.62" dur="4.89">you can assign iopa little to certain</text><text start="536.32" dur="5.459">applications and then they can but</text><text start="538.51" dur="4.47">that&amp;#39;s a kind of a limited case so</text><text start="541.779" dur="2.49">anyway that&amp;#39;s the difference between</text><text start="542.98" dur="3.03">there were different rings ring zero was</text><text start="544.269" dur="3.481">the kernel highest privilege level</text><text start="546.01" dur="3.54">device drivers typically operating zero</text><text start="547.75" dur="4.41">you can do anything you want a trained</text><text start="549.55" dur="5.76">zero now ring three you can do almost</text><text start="552.16" dur="5.97">nothing except talk to your own stone so</text><text start="555.31" dur="3.79">anyway the reason that this becomes an</text><text start="558.13" dur="4.51">issue</text><text start="559.1" dur="7.41">is a being implemented device driver in</text><text start="562.64" dur="5.28">it time at ring 3 so specifically so</text><text start="566.51" dur="6.57">that it can access some of the</text><text start="567.92" dur="7.02">application dos calls now when we</text><text start="573.08" dur="5.64">implemented ring I mean 32-bit</text><text start="574.94" dur="7.65">application ice drivers we have to go to</text><text start="578.72" dur="6.24">ring 0 in order to convert to 32-bit</text><text start="582.59" dur="7.08">mode which means that the initialization</text><text start="584.96" dur="6.8">time runs at ring zero which means you</text><text start="589.67" dur="4.77">cannot access any of the ring 3 code</text><text start="591.76" dur="5.77">that was previously available to other</text><text start="594.44" dur="7.29">drivers so you&amp;#39;re very limited there and</text><text start="597.53" dur="8.04">what you can do sometimes that&amp;#39;s a</text><text start="601.73" dur="6.84">problem sometimes it&amp;#39;s not so it all</text><text start="605.57" dur="5.07">depends what you need to do and that&amp;#39;s</text><text start="608.57" dur="5.45">really the the basis of the restriction</text><text start="610.64" dur="3.38">so let&amp;#39;s move on a little bit Oh</text><text start="616.25" dur="5.37">thunking thunking is the conversion</text><text start="618.02" dur="7.59">between 32-bit and 16-bit or 16-bit to</text><text start="621.62" dur="5.88">32-bit the kernel I mean the CPU</text><text start="625.61" dur="3.6">actually operates in 16-bit mode or</text><text start="627.5" dur="3.3">32-bit mode where the instructions are</text><text start="629.21" dur="3.99">actually interpreted as 16-bit</text><text start="630.8" dur="4.02">instructions or 32 instructions and the</text><text start="633.2" dur="3.78">data pointers are actually interpreted</text><text start="634.82" dur="4.68">as 16-bit pointers or 32-bit pointers</text><text start="636.98" dur="5.79">and the stack can be a 16-bit stack or a</text><text start="639.5" dur="5.85">32-bit stack so when you when your</text><text start="642.77" dur="4.68">driver gets called by the kernel it&amp;#39;s</text><text start="645.35" dur="4.17">always called at a 16-bit interface so</text><text start="647.45" dur="4.71">it&amp;#39;s called with a 16-bit code selector</text><text start="649.52" dur="4.89">and a 16-bit data selector so you need</text><text start="652.16" dur="4.73">to thunk that to a 32-bit code selector</text><text start="654.41" dur="5">in a 32-bit data selector</text><text start="656.89" dur="4.89">and is gonna convert from the 16-bit</text><text start="659.41" dur="3.9">stack to the 32-bit stack the driver</text><text start="661.78" dur="3.45">kits do that before you and you don&amp;#39;t</text><text start="663.31" dur="3.42">even have to think about that we&amp;#39;re</text><text start="665.23" dur="3.72">ordinarily you would have to think about</text><text start="666.73" dur="4.1">that and then when you return back to</text><text start="668.95" dur="5.54">the kernel it has to all be thumped back</text><text start="670.83" dur="6.23">so that&amp;#39;s what thunking is</text><text start="674.49" dur="2.57">so</text><text start="681.26" dur="9.5">there there is a ring too I am not aware</text><text start="684.47" dur="6.29">that there is a ring one it&amp;#39;s not used</text><text start="691.42" dur="6.81">ring 2 is used for some things like the</text><text start="694.58" dur="3.65">video driver runs it ring 2</text><text start="698.74" dur="8.98">yes yes that&amp;#39;s different that&amp;#39;s</text><text start="705.68" dur="7.17">different the device driver does run it</text><text start="707.72" dur="6.75">ring to bring one is not used and the</text><text start="712.85" dur="4.469">only thing I&amp;#39;m aware of that runs it</text><text start="714.47" dur="4.2">ring to is the video stuff applications</text><text start="717.319" dur="4.341">run it ring three device drivers</text><text start="718.67" dur="5.42">rendering zero kernel runs it ring zero</text><text start="721.66" dur="7.25">okay</text><text start="724.09" dur="4.82">it is all do you see</text><text start="734.62" dur="13.53">I&amp;#39;m sorry what when you build it yes</text><text start="742.11" dur="9.58">what&amp;#39;s the difference the difference the</text><text start="748.15" dur="6.75">difference primarily is when they&amp;#39;re</text><text start="751.69" dur="5.25">loaded base drivers are loaded very very</text><text start="754.9" dur="5.4">early in the boot process and provide</text><text start="756.94" dur="5.55">basic system functionality device</text><text start="760.3" dur="6">drivers are loaded in a second wave</text><text start="762.49" dur="6.24">after all the base devs devoted that&amp;#39;s</text><text start="766.3" dur="4.23">the primary difference there are other</text><text start="768.73" dur="3.63">there are other differences but that&amp;#39;s</text><text start="770.53" dur="4.68">the primary difference there is much</text><text start="772.36" dur="4.59">less system resources available to buy</text><text start="775.21" dur="4.13">space devs because they&amp;#39;re loaded so</text><text start="776.95" dur="2.39">early</text><text start="781.84" dur="5.43">that&amp;#39;s that&amp;#39;s part of it yes that&amp;#39;s part</text><text start="785.47" dur="4.38">of it very little of the system is</text><text start="787.27" dur="5.07">running when base that&amp;#39;s load very very</text><text start="789.85" dur="4.86">little there&amp;#39;s no file system available</text><text start="792.34" dur="4.53">at when base that&amp;#39;s load for example but</text><text start="794.71" dur="4.46">there is when drivers when devices are</text><text start="796.87" dur="2.3">loaded</text><text start="802.529" dur="4.761">they do they provide very very basic</text><text start="817.78" dur="3.73">then across this one driver like hpfs</text><text start="820.03" dur="6.28">pajamas go solo</text><text start="821.51" dur="6.389">and stuff like okay the main thing the</text><text start="826.31" dur="4.11">main difference is when they&amp;#39;re loaded</text><text start="827.899" dur="4.021">base devs are loaded very very early so</text><text start="830.42" dur="3.21">if you need something done if you need</text><text start="831.92" dur="3.479">to do something very very early in the</text><text start="833.63" dur="4.92">boot process you would write a base step</text><text start="835.399" dur="5.791">or if you weren&amp;#39;t just normal most</text><text start="838.55" dur="6.63">normal I Oh devices are normal device</text><text start="841.19" dur="5.91">drivers anyway</text><text start="845.18" dur="3.48">the driver kits make all of this stuff</text><text start="847.1" dur="4.56">they&amp;#39;ve been talking about very very</text><text start="848.66" dur="5.91">easy and we haven&amp;#39;t had this until very</text><text start="851.66" dur="6.21">recently like I said it implements all</text><text start="854.57" dur="6.09">the memory layout stuff the system</text><text start="857.87" dur="6.24">interface all the compiler setup stuff</text><text start="860.66" dur="5.1">is in these kits so really you don&amp;#39;t</text><text start="864.11" dur="4.67">need to go looking and digging for a lot</text><text start="865.76" dur="6.1">of information yes</text><text start="868.78" dur="3.08">open Wacom</text><text start="872.769" dur="4.47">it also provides memory management</text><text start="874.869" dur="4.111">functions it provides all the thunking</text><text start="877.239" dur="4.47">functions in case you need to do some</text><text start="878.98" dur="6.709">thunking on your own it provides a heat</text><text start="881.709" dur="10.5">manager memory allocation de-allocation</text><text start="885.689" dur="8.05">memory those type of things it</text><text start="892.209" dur="3.48">essentially exactly provides everything</text><text start="893.739" dur="3.96">you need except for this stuff that&amp;#39;s</text><text start="895.689" dur="4.231">unique to your own application your own</text><text start="897.699" dur="4.68">device whether it&amp;#39;s a device if it&amp;#39;s a</text><text start="899.92" dur="4.469">filter driver not alder not all drivers</text><text start="902.379" dur="4.231">talk to hardware some drivers just do</text><text start="904.389" dur="3.961">software things that things that need to</text><text start="906.61" dur="3.93">be done around zero that you can&amp;#39;t do in</text><text start="908.35" dur="6.029">an application like application helpers</text><text start="910.54" dur="5.459">this are very common so all you need to</text><text start="914.379" dur="7.441">do is worry about the code for your own</text><text start="915.999" dur="8.251">hardware Hey any questions</text><text start="921.82" dur="4.519">OOP there&amp;#39;s somebody here house c&amp;#39;mon</text><text start="924.25" dur="8.269">IRC can repeat</text><text start="926.339" dur="9.841">oh yeah yes so what&amp;#39;s actually in one of</text><text start="932.519" dur="4.98">these kids I know it&amp;#39;s kind of small</text><text start="936.18" dur="4.379">hopefully everybody can read this</text><text start="937.499" dur="5.041">there&amp;#39;s a kit directory which</text><text start="940.559" dur="7.07">essentially contains a library called</text><text start="942.54" dur="7.409">like drive 16 live there&amp;#39;s a header file</text><text start="947.629" dur="6.551">which contains the headers for all the</text><text start="949.949" dur="5.64">functions that are in the library and</text><text start="954.18" dur="3.389">there&amp;#39;s a couple there&amp;#39;s a few more</text><text start="955.589" dur="3.75">header files one of the things that is</text><text start="957.569" dur="4.32">implemented in the driver kits is the</text><text start="959.339" dur="5.73">end Asst and this modules because mainly</text><text start="961.889" dur="4.86">I wrote these to work on Ethernet</text><text start="965.069" dur="4.921">drivers network drivers so there&amp;#39;s an</text><text start="966.749" dur="6.9">Indus module and there&amp;#39;s a PCI module</text><text start="969.99" dur="5.94">for talking to the PCI bus for you so</text><text start="973.649" dur="5.671">all of that is handled as well sometimes</text><text start="975.93" dur="5.82">that&amp;#39;s a bit of work to do</text><text start="979.32" dur="4.74">then there&amp;#39;s two other drivers to other</text><text start="981.75" dur="6.72">directories there&amp;#39;s a required directory</text><text start="984.06" dur="7.47">which essentially is the bare minimum</text><text start="988.47" dur="7.32">required to build a driver and have it</text><text start="991.53" dur="6.75">load it&amp;#39;s got a driver dot C file and a</text><text start="995.79" dur="5.09">base dev dot C file and a make file that</text><text start="998.28" dur="5.25">builds things so these are essentially</text><text start="1000.88" dur="6.49">drivers that will build and will load</text><text start="1003.53" dur="5.46">and do nothing so if you wanted to start</text><text start="1007.37" dur="3.84">building a driver you would start with</text><text start="1008.99" dur="5.22">one of those and just start adding in</text><text start="1011.21" dur="4.59">the stuff you need in addition to that</text><text start="1014.21" dur="4.92">there&amp;#39;s a sample directory which</text><text start="1015.8" dur="5.46">contains a real live working driver it&amp;#39;s</text><text start="1019.13" dur="4.44">a very simple driver that talks to an</text><text start="1021.26" dur="5.1">i/o card it&amp;#39;s a plug-in card that has</text><text start="1023.57" dur="4.17">some IO ports that you would use for</text><text start="1026.36" dur="4.16">something like home automation or</text><text start="1027.74" dur="5.65">talking to whatever it&amp;#39;s just it&amp;#39;s just</text><text start="1030.52" dur="5.15">central aisle ports</text><text start="1033.39" dur="4.5">and it&amp;#39;s a real live working driver it</text><text start="1035.67" dur="4.529">also contains test C which is an</text><text start="1037.89" dur="5.73">application that talks to the driver</text><text start="1040.199" dur="5.281">through the ioctl interface so you can</text><text start="1043.62" dur="4.05">see a real working driver with real</text><text start="1045.48" dur="5.13">working dos dev ioctl</text><text start="1047.67" dur="4.98">calls and how those are implemented and</text><text start="1050.61" dur="5.22">you could take that one and modify it to</text><text start="1052.65" dur="6.24">whatever your own needs are so I thought</text><text start="1055.83" dur="7.07">what I would do next is actually do this</text><text start="1058.89" dur="8.58">I would take the the driver C file and</text><text start="1062.9" dur="7.83">modify it to a to perform a very simple</text><text start="1067.47" dur="6.9">function compile it load it in rent in</text><text start="1070.73" dur="5.819">real time so just to see how easy that</text><text start="1074.37" dur="2.179">is</text><text start="1077.82" dur="5.4">I actually I already talked about this</text><text start="1079.68" dur="6.75">those are the two two examples of the</text><text start="1083.22" dur="6.27">two drivers that are provided in the kit</text><text start="1086.43" dur="5.04">and next comes a live demonstration so</text><text start="1089.49" dur="5.6">here we go let&amp;#39;s see if this actually I</text><text start="1091.47" dur="3.62">can actually pull this off</text><text start="1099.65" dur="6.21">let&amp;#39;s see this will</text><text start="1102.5" dur="6.66">there we go so I have a directory here</text><text start="1105.86" dur="6.54">on my on my system that currently has</text><text start="1109.16" dur="6.78">the driver kit as you would download it</text><text start="1112.4" dur="6.11">from my website it&amp;#39;s the zip file and</text><text start="1115.94" dur="2.57">everybody see that</text><text start="1119.879" dur="2.6">yeah</text><text start="1124.299" dur="8.43">that&amp;#39;s as big as it gets I could do a</text><text start="1129.07" dur="6.979">full screen session okay let&amp;#39;s see if I</text><text start="1132.729" dur="3.32">can do a full screen session</text><text start="1139.28" dur="3">yeah</text><text start="1149.53" dur="7.4">yeah let me see if I can get it</text><text start="1152.06" dur="8.85">where can I where do I find these</text><text start="1156.93" dur="3.98">command I want a full screen prompts</text><text start="1160.94" dur="4.55">to director</text><text start="1162.44" dur="3.05">no it doesn&amp;#39;t</text><text start="1167.32" dur="6.14">oh yeah see your brain goes to mush when</text><text start="1170.74" dur="2.72">you&amp;#39;re in front of people</text><text start="1176.12" dur="10.22">full screen let&amp;#39;s see now the other</text><text start="1182.93" dur="3.41">projector has to test</text><text start="1189.44" dur="5.079">I have</text><text start="1191.47" dur="3.049">yeah there we go</text><text start="1198.59" dur="5.829">that easier to see</text><text start="1201.24" dur="5.179">so we have a 5/16 kit really once you</text><text start="1204.419" dur="7.74">after you download it all you have to do</text><text start="1206.419" dur="7.451">is unzip it and it will create there&amp;#39;s</text><text start="1212.159" dur="3.99">the directories that I just talked about</text><text start="1213.87" dur="4.5">it creates a kit directory with the</text><text start="1216.149" dur="4.38">headers in it requites required</text><text start="1218.37" dur="4.289">directory and it creates sample</text><text start="1220.529" dur="7.02">directory so let&amp;#39;s move into the</text><text start="1222.659" dur="7.321">required directory and there&amp;#39;s the three</text><text start="1227.549" dur="5.521">files that we talked about now this</text><text start="1229.98" dur="6.419">should just build if I type make what W</text><text start="1233.07" dur="5.9">make okay except it&amp;#39;s not going to</text><text start="1236.399" dur="2.571">because</text><text start="1240.25" dur="6.09">because I haven&amp;#39;t defined I&amp;#39;ve been told</text><text start="1243.73" dur="4.8">it where my kit is yet and what the way</text><text start="1246.34" dur="4.319">you do that there&amp;#39;s help there&amp;#39;s a</text><text start="1248.53" dur="5.42">readme that will describe all of this</text><text start="1250.659" dur="3.291">but what you all you really have to do</text><text start="1263.059" dur="2.6">but</text><text start="1265.72" dur="3.47">is that an environment variable</text><text start="1269.77" dur="7.11">and then the driver builds so now I have</text><text start="1275.02" dur="4.32">a driver I have two drivers I have the</text><text start="1276.88" dur="4.71">base dev driver that&amp;#39;s built you can see</text><text start="1279.34" dur="3.69">base dev that sis and I have driver</text><text start="1281.59" dur="3.78">that&amp;#39;s this now I could actually put</text><text start="1283.03" dur="7.4">those into my config Isis and reboot and</text><text start="1285.37" dur="7.35">they would load and do nothing so</text><text start="1290.43" dur="9.03">essentially just by downloading this kit</text><text start="1292.72" dur="10.41">you can build drivers anybody can okay</text><text start="1299.46" dur="7.14">it&amp;#39;s true it doesn&amp;#39;t do anything but you</text><text start="1303.13" dur="7.74">actually built the driver the whole load</text><text start="1306.6" dur="6.25">you do need the dvk yep</text><text start="1310.87" dur="6.93">you do need the DDK and that&amp;#39;s is one</text><text start="1312.85" dur="7.56">thing that I already have installed and</text><text start="1317.8" dur="4.32">I have the ddk already installed and I</text><text start="1320.41" dur="4.64">have an environment variable pointing to</text><text start="1322.12" dur="7.4">my D DK okay</text><text start="1325.05" dur="4.47">and you need open Wacom installs</text><text start="1332.6" dur="5.49">I also have Wacom installed Scott common</text><text start="1335.74" dur="4.36">Wacom and then all you need is the</text><text start="1338.09" dur="4.38">Whatcom equals wherever you&amp;#39;re welcome</text><text start="1340.1" dur="4.44">installation is and you can that&amp;#39;s</text><text start="1342.47" dur="6.29">freely available you can go to the Wacom</text><text start="1344.54" dur="4.22">and download it and install it</text><text start="1354.899" dur="7.89">temporarily I&amp;#39;m sure</text><text start="1357.97" dur="4.819">okay so let&amp;#39;s do something let&amp;#39;s</text><text start="1364.29" dur="4.82">let&amp;#39;s create our own driver let&amp;#39;s start</text><text start="1366.87" dur="2.24">with</text><text start="1385.7" dur="4.5">there&amp;#39;s a message open welcome</text><text start="1400.679" dur="5.73">this is one reason I didn&amp;#39;t want to go</text><text start="1403.049" dur="5.34">to fullscreen because okay this is the</text><text start="1406.409" dur="2.911">this is the driver dot C file that is</text><text start="1408.389" dur="2.941">shipped with the kid</text><text start="1409.32" dur="5.179">it has lots of comments in it to tell</text><text start="1411.33" dur="5.939">you how it works and what you need to do</text><text start="1414.499" dur="5.441">like for example it says you must have</text><text start="1417.269" dur="5.701">the strategy Handler and there is one in</text><text start="1419.94" dur="4.92">here and it it does basically nothing</text><text start="1422.97" dur="3.24">there&amp;#39;s remember I told you that the</text><text start="1424.86" dur="3.24">first thing the kernel does when it</text><text start="1426.21" dur="4.699">calls your driver it calls his strategy</text><text start="1428.1" dur="5.1">in it well here is your strategy in it</text><text start="1430.909" dur="4.061">and it says here it&amp;#39;s called by the</text><text start="1433.2" dur="6.63">kernel immediately after loading your</text><text start="1434.97" dur="8.25">driver and the kit gives you this</text><text start="1439.83" dur="4.949">strategy in it call which is later on in</text><text start="1443.22" dur="5.159">the file and what the strategy in it</text><text start="1444.779" dur="8.63">does is it sets the name of the driver</text><text start="1448.379" dur="8.311">here I assume you can see this yep and</text><text start="1453.409" dur="5.201">it calls the kit in it which is this</text><text start="1456.69" dur="4.79">function here is the drive 16 init which</text><text start="1458.61" dur="6.21">initializes the kit functions for you</text><text start="1461.48" dur="5.949">you have to tell the colonel the size of</text><text start="1464.82" dur="5.339">your data segment and text segment code</text><text start="1467.429" dur="6.35">segment and it output something to the</text><text start="1470.159" dur="3.62">screen and it&amp;#39;s done</text><text start="1474.84" dur="4.53">so basically that&amp;#39;s it so what we&amp;#39;re</text><text start="1477.57" dur="5.13">going to do is we&amp;#39;re going to add some</text><text start="1479.37" dur="6.509">code to this which will respond to a</text><text start="1482.7" dur="6.109">copy command which a copy will open the</text><text start="1485.879" dur="6.061">file read something from the driver and</text><text start="1488.809" dur="6.761">copy it to the file it&amp;#39;s really going to</text><text start="1491.94" dur="7.109">be pretty easy so what we&amp;#39;re gonna do is</text><text start="1495.57" dur="11.87">we&amp;#39;re gonna need to have an open</text><text start="1499.049" dur="8.391">function so let&amp;#39;s add something called</text><text start="1508.369" dur="6.64">strategy open and we&amp;#39;re gonna pass it</text><text start="1511.44" dur="5.88">the request packet when the driver calls</text><text start="1515.009" dur="4.92">us when this kernel calls a driver it</text><text start="1517.32" dur="4.29">passes a packet of information to the</text><text start="1519.929" dur="3.99">driver which basically says what I want</text><text start="1521.61" dur="4.83">what it wants to do and that&amp;#39;s called</text><text start="1523.919" dur="4.531">the request packet and it pointed to</text><text start="1526.44" dur="4.109">this request packet see when your</text><text start="1528.45" dur="4.41">strategy handler is called here it&amp;#39;s</text><text start="1530.549" dur="3.96">passes a pointer to the request packet</text><text start="1532.86" dur="4.669">so I&amp;#39;m going to I&amp;#39;m going to write a</text><text start="1534.509" dur="3.02">strategy open function</text><text start="1537.62" dur="5.04">and I realize I might be losing some</text><text start="1540.18" dur="2.48">people but</text><text start="1547.75" dur="5.34">but we&amp;#39;re going to write a strategy open</text><text start="1549.91" dur="6.68">and a strategy close and we&amp;#39;re also</text><text start="1553.09" dur="3.5">going to need a</text><text start="1560.5" dur="3.33">strategy read</text><text start="1574.59" dur="5.4">so what I&amp;#39;ve done there is I&amp;#39;ve just put</text><text start="1576.96" dur="6.209">a call to strategy open in the strategy</text><text start="1579.99" dur="4.98">open case of the case statement I put a</text><text start="1583.169" dur="3.6">strategy close in the strategy closed</text><text start="1584.97" dur="4.319">portion and I put a strategy read</text><text start="1586.769" dur="6.691">function in the strategy read okay so</text><text start="1589.289" dur="6.99">everybody understands that okay so now I</text><text start="1593.46" dur="5.449">have to go write those functions so</text><text start="1596.279" dur="2.63">let&amp;#39;s go</text><text start="1598.93" dur="8.84">and put those functions right before my</text><text start="1604.54" dur="3.23">strategy hand alert</text><text start="1611.62" dur="5.12">yeah let&amp;#39;s put it right yeah</text><text start="1617.87" dur="4.309">okay the first thing I need is some</text><text start="1623.85" dur="3.289">let&amp;#39;s define</text><text start="1628.54" dur="8.13">a buffer to stores the data in let&amp;#39;s</text><text start="1632.32" dur="8.93">just make it like 1 K and we&amp;#39;re going to</text><text start="1636.67" dur="4.58">need a flag like</text><text start="1644.49" dur="3.09">something to tell me whether to fight</text><text start="1646.11" dur="9.93">whether the driver has been opened or</text><text start="1647.58" dur="12.56">not and some some sizes so that I can</text><text start="1656.04" dur="4.1">keep track of how much</text><text start="1662.5" dur="3.919">my fingers on the right keys here</text><text start="1667.08" dur="7.349">so we can keep track track of how many</text><text start="1670.83" dur="7.189">bytes of data the application has read</text><text start="1674.429" dur="3.59">and then let&amp;#39;s start</text><text start="1690.43" dur="3.39">so I don&amp;#39;t know if that was a very good</text><text start="1692.26" dur="3.96">explanation it&amp;#39;s a pretty complex</text><text start="1693.82" dur="7.5">subject and I tried to just do it in 30</text><text start="1696.22" dur="6.99">seconds but when the colonel calls a</text><text start="1701.32" dur="4.65">strategy read routine it&amp;#39;s past the</text><text start="1703.21" dur="4.53">physical memory address so you need to</text><text start="1705.97" dur="4.86">convert that to something that that you</text><text start="1707.74" dur="5.58">can actually write to and that would be</text><text start="1710.83" dur="5.61">a virtual address and a 16-bit driver so</text><text start="1713.32" dur="5.64">I&amp;#39;m going to do that so what I&amp;#39;m going</text><text start="1716.44" dur="6.45">to do is first convert first calculate</text><text start="1718.96" dur="10.38">how much memory how many bytes is left</text><text start="1722.89" dur="12.96">to read which is how much memory how</text><text start="1729.34" dur="9.83">many we&amp;#39;ve already read - how many we</text><text start="1735.85" dur="3.32">need to still read</text><text start="1741.74" dur="4.52">get my fingers on the right keys here</text><text start="1762.01" dur="3.38">oh I did</text><text start="1767.98" dur="5.45">this should be read size</text><text start="1771.09" dur="4.68">this is the total size of the block of</text><text start="1773.43" dur="6.08">memory that can be read and the read</text><text start="1775.77" dur="3.74">count is how much I&amp;#39;ve already read</text><text start="1782.16" dur="2.66">so</text><text start="1811.21" dur="2.9">there we go</text><text start="1817.53" dur="5.1">what that statement does is I don&amp;#39;t want</text><text start="1820.83" dur="3.98">to ever return more bikes than was asked</text><text start="1822.63" dur="2.18">for</text><text start="1827.61" dur="3.23">if there&amp;#39;s still</text><text start="1851.42" dur="2.93">so far so good</text><text start="1863.15" dur="6.72">hey you&amp;#39;re catching all my compiler</text><text start="1865.59" dur="4.28">errors that would you man</text><text start="1871.93" dur="4.52">yeah that is exactly right</text><text start="1887.88" dur="2.75">that&amp;#39;s it</text><text start="1892.4" dur="4.29">so all I did here is calculate how much</text><text start="1894.71" dur="4.89">how many bytes I&amp;#39;m going to return copy</text><text start="1896.69" dur="5.13">it from my message buffer to the virtual</text><text start="1899.6" dur="5.64">address I just got oh I did forget</text><text start="1901.82" dur="5.34">something didn&amp;#39;t I I keep talking about</text><text start="1905.24" dur="5.27">converting this physical address to a</text><text start="1907.16" dur="3.35">virtual address but I didn&amp;#39;t do it</text><text start="1917.06" dur="5.09">those of you who have worked with the</text><text start="1918.77" dur="3.38">ddk know what that is</text><text start="1949.53" dur="3.42">that&amp;#39;s the dev help of one of the helper</text><text start="1951.63" dur="4.35">functions that&amp;#39;s implemented in the</text><text start="1952.95" dur="6.36">kernel to convert a physical address to</text><text start="1955.98" dur="6.86">a virtual address if that fails of</text><text start="1959.31" dur="3.53">course I want to return an error</text><text start="1979.389" dur="6.311">there</text><text start="1981.38" dur="6.929">now we have a complete driver hopefully</text><text start="1985.7" dur="6.2">it will compile and it should one any</text><text start="1988.309" dur="3.591">questions about what I&amp;#39;ve done so far</text><text start="2020.64" dur="3.05">one more thing</text><text start="2047.789" dur="4.13">everybody understand what that what I</text><text start="2049.5" dur="2.419">just did there</text><text start="2052.21" dur="6.26">I added my new driver to the list of</text><text start="2055.119" dur="3.351">things this make file will build</text><text start="2069.87" dur="4.59">the reason that happened is because I</text><text start="2072.24" dur="4.64">did this in the fullscreen session</text><text start="2074.46" dur="2.42">before</text><text start="2114.37" dur="2.72">all right</text><text start="2177.73" dur="4.16">fixing my compilation errors whoops</text><text start="2184.079" dur="3.5">this is exactly exactly</text><text start="2191.31" dur="4.19">I don&amp;#39;t see what&amp;#39;s wrong with that oh</text><text start="2193.64" dur="6.24">yes I do</text><text start="2195.5" dur="6.54">for some reason my - key</text><text start="2199.88" dur="5.96">it&amp;#39;s really having trouble on this</text><text start="2202.04" dur="3.8">computer since I used it last</text><text start="2208.04" dur="4.49">now what&amp;#39;s wrong what</text><text start="2217.369" dur="3.081">Oh Oh</text><text start="2223.82" dur="4.2">that&amp;#39;s what you were trying to tell me</text><text start="2225.9" dur="2.12">before</text><text start="2229.28" dur="5.76">there okay what I&amp;#39;m going to do is I&amp;#39;m</text><text start="2232.35" dur="2.69">going to copy it</text><text start="2237.74" dur="5.42">to the root of my boot disk</text><text start="2243.21" dur="4.52">just because it&amp;#39;s convenient place to</text><text start="2245.19" dur="2.54">put it</text><text start="2250.24" dur="4.22">I&amp;#39;m going to add a device statement</text><text start="2261.1" dur="5.27">as if I strike with more than 8</text><text start="2264.27" dur="5.22">yes</text><text start="2266.37" dur="3.12">we&amp;#39;re not</text><text start="2271" dur="4.52">I don&amp;#39;t think so we&amp;#39;ll find out</text><text start="2276.56" dur="9.03">one other thing that I want to show you</text><text start="2278.72" dur="9.29">in it before we is the name of this</text><text start="2285.59" dur="2.42">driver</text><text start="2291.99" dur="6.09">is right here this is the driver name</text><text start="2296.79" dur="1.74">that&amp;#39;s written into the header it&amp;#39;s</text><text start="2298.08" dur="4.23">called</text><text start="2298.53" dur="7.05">my DRV dollar you could make that</text><text start="2302.31" dur="6.09">anything you wanted the you have eight</text><text start="2305.58" dur="5.6">characters maximum for the driver name</text><text start="2308.4" dur="5.58">and it needs to be blank padded but the</text><text start="2311.18" dur="7.84">the driver kit function handles all that</text><text start="2313.98" dur="7.4">for you so anyway it&amp;#39;s there let&amp;#39;s</text><text start="2319.02" dur="2.36">reboot</text><text start="2329.53" dur="3.44">no it&amp;#39;s a regular driver</text><text start="2333.18" dur="4.31">that might but this is not a base step</text><text start="2353.94" dur="5.49">see the line right there driver my drive</text><text start="2356.64" dur="4.649">loaded successfully that was the string</text><text start="2359.43" dur="5.96">that you saw in the init:function</text><text start="2361.289" dur="6.721">strategy in it when the driver is loaded</text><text start="2365.39" dur="7.05">so apparently it loaded it the colonel</text><text start="2368.01" dur="4.43">liked it it loaded itself successfully</text><text start="2384.01" dur="2.63">so</text><text start="2387.299" dur="3.591">let&amp;#39;s try copy</text><text start="2397.1" dur="2.99">can you see that</text><text start="2400.9" dur="4.25">so I go go to a fullscreen session</text><text start="2416.01" dur="5.51">does that string look familiar that&amp;#39;s</text><text start="2417.93" dur="6.12">the press printf that was in my driver</text><text start="2421.52" dur="6.19">so what I&amp;#39;ve done is this copy command</text><text start="2424.05" dur="7.41">has opened my driver did a read to read</text><text start="2427.71" dur="6.29">the data from the driver and display it</text><text start="2431.46" dur="2.54">on the screen</text><text start="2442.02" dur="5.66">that&amp;#39;s something not too hard to do</text><text start="2445.849" dur="4.41">now if you need to talk to actual</text><text start="2447.68" dur="4.73">hardware your your code would look</text><text start="2450.259" dur="6.03">different than what I just wrote</text><text start="2452.41" dur="5.859">but you know it&amp;#39;s not not any more</text><text start="2456.289" dur="4.79">complicated you&amp;#39;d have to have knowledge</text><text start="2458.269" dur="8.31">of the hardware that you&amp;#39;re trying to</text><text start="2461.079" dur="8.02">operate but anybody who can read a</text><text start="2466.579" dur="5.821">datasheet and write C code should be</text><text start="2469.099" dur="4.98">able to write device drivers and like I</text><text start="2472.4" dur="5.969">said at the beginning the purpose of</text><text start="2474.079" dur="7.081">this presentation was that maybe show</text><text start="2478.369" dur="8.64">you that it&amp;#39;s not all that daunting to</text><text start="2481.16" dur="7.949">write that device driver anymore if you</text><text start="2487.009" dur="5.431">can write C code and you can run a</text><text start="2489.109" dur="5.25">compiler and you have the DD K and you</text><text start="2492.44" dur="3.899">can download this kit and you can get a</text><text start="2494.359" dur="6.531">datasheet for the hardware you want to</text><text start="2496.339" dur="4.551">run time</text><text start="2501.64" dur="7.02">this time just maybe it&amp;#39;ll inspire some</text><text start="2505.089" dur="5.131">people like if you have a an i/o card or</text><text start="2508.66" dur="4.859">something that you want to operate</text><text start="2510.22" dur="8.16">there&amp;#39;s no drivers for or somebody wants</text><text start="2513.519" dur="9.261">to write a Bluetooth driver or something</text><text start="2518.38" dur="8.44">like that you know give it a try</text><text start="2522.78" dur="4.04">we also going to mention something about</text><text start="2527.91" dur="5.91">wow what a SAP issues well</text><text start="2534.15" dur="5.95">device drivers</text><text start="2536.57" dur="3.53">as being issues there</text><text start="2540.859" dur="9.45">yeah SMP issues exists for everything</text><text start="2545.299" dur="7.591">not just drivers SMP issues come up when</text><text start="2550.309" dur="5.76">you have more than one CPU trying to run</text><text start="2552.89" dur="7.949">your code at the same time and you need</text><text start="2556.069" dur="12.17">to make sure that any resources that may</text><text start="2560.839" dur="10.64">be shared that need to be protected from</text><text start="2568.239" dur="6.76">access simultaneously by both processors</text><text start="2571.479" dur="6.671">like if you have a chunk of memory that</text><text start="2574.999" dur="4.53">has well like for example a good example</text><text start="2578.15" dur="2.579">would be if you do have a piece of</text><text start="2579.529" dur="6.141">hardware and you have a hardware</text><text start="2580.729" dur="9.36">register that you need to write to - I</text><text start="2585.67" dur="7.059">don&amp;#39;t know operate your device if one</text><text start="2590.089" dur="5.311">CPU is currently chunking out data to</text><text start="2592.729" dur="3.961">this port and another CPU comes in and</text><text start="2595.4" dur="3.48">wants to do it and wants to talk to the</text><text start="2596.69" dur="4.169">port at the same time obviously you&amp;#39;re</text><text start="2598.88" dur="4.05">going to have problems because what one</text><text start="2600.859" dur="3.9">CPU is trying to write to it may not be</text><text start="2602.93" dur="4.019">compatible with the other CPU trying to</text><text start="2604.759" dur="6.45">write to it so you use things like spin</text><text start="2606.949" dur="8.221">locks or or mutexes or something to to</text><text start="2611.209" dur="5.971">block access from one CPU so one CPU</text><text start="2615.17" dur="4.949">kiss complete access of this resource</text><text start="2617.18" dur="5.25">for the entire time it needs it so the</text><text start="2620.119" dur="4.95">other one will wait and won&amp;#39;t try and do</text><text start="2622.43" dur="4.289">it this is this is normal things for</text><text start="2625.069" dur="3.661">anybody who&amp;#39;s worked with multi CPU</text><text start="2626.719" dur="5.111">systems</text><text start="2628.73" dur="6.31">the problem that we have with old stuff</text><text start="2631.83" dur="6.09">is smoke SMP systems didn&amp;#39;t exist when a</text><text start="2635.04" dur="6.3">lot of our code was written so nobody</text><text start="2637.92" dur="6.39">thought about it in some cases or didn&amp;#39;t</text><text start="2641.34" dur="4.2">implement it properly but now it now we</text><text start="2644.31" dur="5.27">have lots of it&amp;#39;s at these systems</text><text start="2645.54" dur="4.04">they&amp;#39;re very common yeah</text><text start="2650.78" dur="2.63">yes</text><text start="2655.23" dur="8.369">yes yes because they&amp;#39;re processed in</text><text start="2659.88" dur="7.41">sequence they are processed in sequence</text><text start="2663.599" dur="5.581">so yeah if you put it in in between one</text><text start="2667.29" dur="3.45">driver and the other yeah it&amp;#39;ll yours</text><text start="2669.18" dur="4.14">will execute in sequence that they are</text><text start="2670.74" dur="6.02">in this in the config dices and however</text><text start="2673.32" dur="3.44">long it takes it takes</text><text start="2689.57" dur="4.13">there are there are drivers that already</text><text start="2691.52" dur="2.18">do that</text><text start="2699.67" dur="6.49">yeah there yeah I have a driver that</text><text start="2702.29" dur="6.78">does that the thing that you need to to</text><text start="2706.16" dur="5.85">be aware of is like I was talking about</text><text start="2709.07" dur="5.13">earlier bass deaths operate very very</text><text start="2712.01" dur="4.47">early in the boot sequence so there&amp;#39;s</text><text start="2714.2" dur="5.28">not very many resources available to you</text><text start="2716.48" dur="4.8">so any delay that you do you can&amp;#39;t like</text><text start="2719.48" dur="7.28">make system calls to do it you have to</text><text start="2721.28" dur="5.48">do right there in your own code yeah</text><text start="2726.799" dur="6.131">something like that yes there&amp;#39;s a</text><text start="2730.74" dur="6.569">questionnaire on the IRC channel and</text><text start="2732.93" dur="8.48">somebody asked to looked everywhere mr.</text><text start="2737.309" dur="4.101">ed mr. ed</text><text start="2742.309" dur="5.46">and any witness is asking why should I</text><text start="2744.92" dur="7.079">use the 32-bit driver instead of the 32</text><text start="2747.769" dur="7.2">16-bit bloody bondages and deviate that</text><text start="2751.999" dur="6.96">their officers that 14 32-bit drivers</text><text start="2754.969" dur="6.3">easier yeah typically if you&amp;#39;re gonna</text><text start="2758.959" dur="6.421">start writing an original driver then</text><text start="2761.269" dur="6.871">it&amp;#39;s a fairly simple thing to do the</text><text start="2765.38" dur="7.5">16-bit kit is the is the easier one to</text><text start="2768.14" dur="7.79">use if you&amp;#39;re gonna port a driver like</text><text start="2772.88" dur="7.229">from Linux or from somewhere else that&amp;#39;s</text><text start="2775.93" dur="5.98">written written as a 32-bit driver so</text><text start="2780.109" dur="5.22">your C module that you&amp;#39;re gonna pour it</text><text start="2781.91" dur="6.809">and try and recompile is is already a</text><text start="2785.329" dur="6.15">32-bit source code then you&amp;#39;re better</text><text start="2788.719" dur="4.681">off using the writing a 32-bit driver</text><text start="2791.479" dur="6.06">because you&amp;#39;ll have less problems in</text><text start="2793.4" dur="6.569">your C file your variable sizes in a</text><text start="2797.539" dur="6.66">16-bit driver at 16 bits the variable</text><text start="2799.969" dur="7.65">sizes in 32-bit driver 32 bits and that</text><text start="2804.199" dur="7.211">can be an issue sometimes unless the</text><text start="2807.619" dur="6.341">coder has thought about that so</text><text start="2811.41" dur="5.869">yeah for porting stuff the 32-bit is</text><text start="2813.96" dur="3.319">probably a better choice</text><text start="2819.81" dur="5.81">any other questions I have no moral</text><text start="2823.35" dur="2.27">higher</text><text start="2826.04" dur="6.69">that&amp;#39;s why when I in the multi Mac I</text><text start="2829.67" dur="5.28">went to the 32-bit stuff for the for all</text><text start="2832.73" dur="7.77">the stuff that I&amp;#39;m currently porting it</text><text start="2834.95" dur="9.3">just makes the porting job easier plus</text><text start="2840.5" dur="6.38">you have unlimited code size in 32-bit</text><text start="2844.25" dur="2.63">drivers</text><text start="2848.049" dur="4.23">you don&amp;#39;t have the unlimited data size</text><text start="2850.119" dur="4.35">you cannot you can always allocate as</text><text start="2852.279" dur="4.29">much data as you want by allocating it</text><text start="2854.469" dur="6.171">from the kernel but your data segment</text><text start="2856.569" dur="4.071">size is fixed at 64 K</text><text start="2863.37" dur="4.249">okay</text><text start="2864.74" dur="5.31">anything else well hopefully this was</text><text start="2867.619" dur="4.771">somewhat informative I kind of it was</text><text start="2870.05" dur="6.51">very simple and meant to be introductory</text><text start="2872.39" dur="6.21">and meant to not take very much time so</text><text start="2876.56" dur="5.34">I kind of skipped over a lot of detail</text><text start="2878.6" dur="6.9">but hopefully you see that how to use</text><text start="2881.9" dur="7.55">the kit and how easy it is to actually</text><text start="2885.5" dur="3.95">get drivers built these days</text><text start="2891.55" dur="6.87">well yeah that would have been nice and</text><text start="2896.71" dur="4.86">I don&amp;#39;t know why it wasn&amp;#39;t done already</text><text start="2898.42" dur="7.05">and there are tools like that like the</text><text start="2901.57" dur="7.17">DDK has has a lot of things that are</text><text start="2905.47" dur="5.87">common but it wasn&amp;#39;t organized as nicely</text><text start="2908.74" dur="2.6">as this</text><text start="2912.84" dur="5.4">and one of the things that the kit does</text><text start="2914.94" dur="9.72">for you is it gives you that the</text><text start="2918.24" dur="9.36">familiar C environment with your normal</text><text start="2924.66" dur="7.35">seat calls like mem copy string length s</text><text start="2927.6" dur="7.29">printf printf those sorts of things that</text><text start="2932.01" dur="6.27">you&amp;#39;re used to using all the time that</text><text start="2934.89" dur="8.24">are sorely lacking in the normal what</text><text start="2938.28" dur="4.85">past driver environments</text><text start="2943.18" dur="2.54">yeah</text><text start="2959.14" dur="8.399">I know there there were changes to the D</text><text start="2963.369" dur="7.7">D K so I honestly I can&amp;#39;t answer that</text><text start="2967.539" dur="3.53">question to what you&amp;#39;re gonna find</text><text start="2977.11" dur="5.97">it&amp;#39;s probably gonna be fine I know</text><text start="2981.1" dur="4.59">there&amp;#39;s a couple files that got updated</text><text start="2983.08" dur="5.13">to be compatible with the open watt comm</text><text start="2985.69" dur="5.18">stuff send me an email if you have</text><text start="2988.21" dur="2.66">trouble with that</text><text start="2993.3" dur="4.92">okay</text><text start="2995.12" dur="4.84">there&amp;#39;s another question here about</text><text start="2998.22" dur="4.56">that&amp;#39;s I think that&amp;#39;s beyond the scope</text><text start="2999.96" dur="6.23">of your presentation being that this</text><text start="3002.78" dur="11.18">house key here what about the PSD</text><text start="3006.19" dur="11.19">a PSD is a very very special device</text><text start="3013.96" dur="5.85">driver it&amp;#39;s well it&amp;#39;s it&amp;#39;s not really a</text><text start="3017.38" dur="6.15">driver in this in the sense of these</text><text start="3019.81" dur="5.25">drivers it&amp;#39;s it gets loaded via a</text><text start="3023.53" dur="3.54">different kernel interface it&amp;#39;s a</text><text start="3025.06" dur="4.5">totally different animal totally</text><text start="3027.07" dur="5.3">different and it&amp;#39;s not within the scope</text><text start="3029.56" dur="2.81">of this presentation</text><text start="3035.059" dur="7.581">we didn&amp;#39;t say that PSD villains</text><text start="3039.58" dur="5.46">very extensional it is I was just gonna</text><text start="3042.64" dur="5.55">say that a PSD is a kernel extension</text><text start="3045.04" dur="5.52">it&amp;#39;s a kernel plug-in it&amp;#39;s it&amp;#39;s not it&amp;#39;s</text><text start="3048.19" dur="4.56">yes you could think of device drivers as</text><text start="3050.56" dur="3.9">kernel plugins too but it&amp;#39;s a it&amp;#39;s a</text><text start="3052.75" dur="3.93">different interface it&amp;#39;s it&amp;#39;s a thing</text><text start="3054.46" dur="5.01">that the kernel nose has intimate</text><text start="3056.68" dur="5.1">knowledge about the interface of the PSD</text><text start="3059.47" dur="5.63">that PSD is a PSD stands for platform</text><text start="3061.78" dur="3.32">specific driver</text><text start="3067.43" dur="6.149">anyway if you do decide to try and write</text><text start="3072.14" dur="5.07">a driver there are other examples</text><text start="3073.579" dur="6.691">besides these in the kit the multi map</text><text start="3077.21" dur="6.18">drivers use the drive 16 and the drive</text><text start="3080.27" dur="4.95">30 to kiss you and those are open source</text><text start="3083.39" dur="6.719">you can go look at those and see how</text><text start="3085.22" dur="9.96">they were done as like I said yesterday</text><text start="3090.109" dur="8.25">envy ETF and II 1000e used drive 1681 69</text><text start="3095.18" dur="5.399">and e 1000 be used drive 32 so there are</text><text start="3098.359" dur="3.811">real life examples of real life working</text><text start="3100.579" dur="5.04">drivers that are in use and in</text><text start="3102.17" dur="5.85">production that use these kits and you</text><text start="3105.619" dur="6.091">can always take one of those as a</text><text start="3108.02" dur="5.37">starting point and and modify them to</text><text start="3111.71" dur="4.849">create whatever you want a Bluetooth</text><text start="3113.39" dur="3.169">driver for example</text><text start="3119.339" dur="4.2">you know or whatever</text><text start="3124.869" dur="7.611">you know whatever yeah so that&amp;#39;s the</text><text start="3130.299" dur="2.181">conclusion</text><text start="3133.63" dur="4.99">you&amp;#39;re very welcome</text><text start="3135.81" dur="2.81">no other questions</text></transcript>