Muli Ben-Yehuda's journal

January 7, 2004

Introduction to Writing Linux Device Drivers

Filed under: Uncategorized — Muli Ben-Yehuda @ 3:23 PM

I just agreed to give a talk on Writing Linux Device Drivers to students of the Technion’s CS faculty’s OS course. It will be on Wednesday, January 28th, 1030-1230, and you are all invited. If I have to give a talk, I must as well have a friendly audience πŸ˜‰

I’m not sure what exactly I’ll talk about, yet. My current thinking is to hack the trident sound driver live on stage. Break it in subtle but interesting ways before the talk, and then fix it on stage, explaining the concepts as I go along. Recommendations on which song to play when it finally works will be gladly entertained.

A few days before, on Sunday January 25th, 1430-1630, a guy from MS will give a talk on writing Windows device drivers. I’ll be there, mostly because I’m curious, and partly because I’m curious how he’ll sell writing drivers without access to the code.

20 Comments »

  1. i would love to see you hack trident driver but but but i can’t be there… maybe make your slides as verbose as possible ok?
    will reply your other post in a while.

    Comment by ideawerkz — January 7, 2004 @ 6:16 AM | Reply

  2. Yeah, great! I’m from Italy so I can’t listen your talk but you can count me as remote friendly audience πŸ™‚
    Is the talk about 2.4 or 2.6 drivers?

    Comment by sp0nge — January 7, 2004 @ 6:21 AM | Reply

    • 2.6. 2.4 is so yesterday πŸ™‚
      Thanks for the remote support!

      Comment by mulix — January 7, 2004 @ 6:23 AM | Reply

      • It sounds so interesting, damn 😦
        Any talk about LSM compliant module writing is scheduled? IMHO, a talk like this will be really useful πŸ™‚
        Ciao ciao

        Comment by sp0nge — January 7, 2004 @ 6:25 AM

      • Not that I know, but I agree it would be very interesting.

        Comment by mulix — January 7, 2004 @ 6:28 AM

      • think i saw some slides on lsm module writing. somewhere on my disk. will try to hunt it for you.

        Comment by ideawerkz — January 7, 2004 @ 6:41 AM

      • Thanks πŸ™‚
        Of course sources and grep are my friends but some helper docs is always appriciated.

        Comment by sp0nge — January 7, 2004 @ 6:43 AM

      • actually it is not difficult to write lsm modules. did you look at the sample lsm module provided?

        Comment by ideawerkz — January 7, 2004 @ 7:28 AM

      • Yes. Actually I’m working to make a module I wrote (www.sikurezza.org/angel) to be LSM compliant and the capability.c and root_plug.c sources are really useful. Just I was wondering how to stack more than one LSM module together and how is handled per module security policy.

        Comment by sp0nge — January 7, 2004 @ 7:34 AM

      • Hi sponge, nice to see you here. amnesia here πŸ™‚
        May I add you?

        Comment by ideawerkz — January 7, 2004 @ 10:40 PM

      • Hi idoru, very glad me too. Of course you may add me. Please note that I write entries in italian so if you will guess I’m writing about things you’re interested into, post a comment and I will translate πŸ™‚

        Comment by sp0nge — January 7, 2004 @ 11:51 PM

      • Thanks πŸ™‚

        Comment by ideawerkz — January 8, 2004 @ 12:44 AM

  3. As long as you don’t use those damn power point slides. What’s wrong with chalk ?
    And as for song recommendation, obviously My Way by Sid Vicious would be appropriate.
    πŸ™‚

    Comment by 77azkkr — January 7, 2004 @ 8:16 AM | Reply

    • Actually, I write my slides in LaTeX and view them with xpdf, but yeah, I know what you mean.
      As for the song, I’ll have to confess I’m not familiar with it. I will be as soon as I get home and fire up nap(1) πŸ˜‰
      Thanks for the comments!-

      Comment by mulix — January 8, 2004 @ 7:12 AM | Reply

      • If you do fire that song up, ignore the first 45 seconds. He’s making a punk rock joke. It gets going at the one minute mark.

        Comment by 77azkkr — January 8, 2004 @ 8:29 AM

      • okey. is searching for it on the p2p systems as we speak.

        Comment by mulix — January 9, 2004 @ 1:54 PM

  4. You don’t sell device drivers for windows
    I don’t think he’ll have to sell writing device drivers for windows.
    Writing device drivers without the source is not as fun as writing them with the source, especially since you must use undocumented APIs for many simple tasks. Thanks god some people took the trouble and documented some of the interesting bits, because otherwise life would be hell. But usefull things like syscall trackers are simply impossible.
    However many people are writing drivers for windows because:
    1) They feel comfortable working in an enviroment they know well
    2) There is a large market for windows device drivers
    3) They must work in windows for another reason, and writing the device driver is a good solution for some problem they encounter

    Comment by shapirac — January 7, 2004 @ 11:59 AM | Reply

  5. Good luck there
    I am pretty sure the MS will try to sell the layered driver architecture and the fact that you have a support and examples and everything from the MS.

    No access to the code is ultra annoying (judging from my very limited experience with the NT kernel and wider experience with large software dinosaurs with which I work now…)

    Instead of reading the intent and doing the right thing, you (under abovementioned assumptions )have to possess some reverse engineering skills and rely much ondisassembler output, books and articles.
    On the other hand, I assume that when you are writing driver to NT/2000, you are supposed to be either hardware vendor, or have the support of the vendor. Thus the fact that hardware is the real pain in the arse is supposed to be mitigated somehow.
    Of course, these observations are based on very limited experience with NT drivers.
    ——————–
    Your plan to hack the driver online sounds cute – espessially if you will arrange the subtle bugs you intend to plant to have audible effect. If you could tie the quality of driver to quality of music…

    Comment by omerm — January 8, 2004 @ 7:49 AM | Reply

    • Re: Good luck there
      > Good luck there
      Thanks!
      > I am pretty sure the MS will try to sell the layered driver architecture
      > and the fact that you have a support and examples and everything from
      > the MS.
      That shouldn’t be hard to counter.
      > No access to the code is ultra annoying (judging from my very limited
      > experience with the NT kernel and wider experience with large software
      > dinosaurs with which I work now…)
      There’s an implicit clause in my current contract that says that I do not work on operating systems which do not have source available. (this does not mean I don’t necessarily work on closed-source stuff, although I stongly prefer not to – it just means that even if it’s closed source, the source is available to ME).
      > Instead of reading the intent and doing the right thing, you (under
      > abovementioned assumptions )have to possess some reverse engineering
      > skills and rely much ondisassembler output, books and articles.
      In other words, program with your eyes half-blindfolded. Ugh.
      > On the other hand, I assume that when you are writing driver to NT/2000,
      > you are supposed to be either hardware vendor, or have the support of
      > the vendor. Thus the fact that hardware is the real pain in the arse is
      > supposed to be mitigated somehow.
      I think it’s more of a case of market dynamics. If you want most users to buy your device, you unfortunately have to support windows. I can tell you that in most of the projects I’ve been involved in, the driver developers choose to develop on LInux first, and then port the driver to windows, if applicable, because they have to.
      > Of course, these observations are based on very limited experience with
      > NT drivers.
      They’re appreciated!
      > Your plan to hack the driver online sounds cute – espessially if you
      > will arrange the subtle bugs you intend to plant to have audible effect.
      > If you could tie the quality of driver to quality of music…
      Hehe, I’m not sure it’s feasible, but I’ll certainly check it out. Don’t forget, I have to keep talking while also hacking… make-believe bugs are ok, real bugs aren’t πŸ™‚

      Comment by mulix — January 9, 2004 @ 2:01 PM | Reply

  6. Great post.

    Comment by Maurice Gutierrez — April 12, 2020 @ 11:34 AM | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply to mulix Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: