Making the Linux Kernel better (without coding)

Video in TIB AV-Portal: Making the Linux Kernel better (without coding)

Formal Metadata

Making the Linux Kernel better (without coding)
Title of Series
CC Attribution 2.0 Belgium:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor.
Release Date

Content Metadata

Subject Area
In this presentation, I want to show little-known mechanisms to add hardware support to the kernel at runtime, i.e. without recompiling. After this presentation, the Linux kernel will have gained support for a previously unsupported USB device (without having to write any code). Not everyone is interested in becoming a kernel developer or being able to write device drivers from scratch. Yet, there are a number of people who would like to help the kernel development "just a little bit". Yay, this is easily done! I aim to enable people to improve the kernel by adding support for previously unsupported hardware. How? Consumer hardware often shares a common core which is then simply re-branded by the actual vendor. This branding often includes changing the USB-ID or PCI-ID. A kernel developer can make a driver for that core, but will not be able to know all the incarnations of that device, i.e. all the IDs. This is where the community comes in. Having all kinds of hardware, people can add missing pieces to the puzzle. In this presentation, I want to show some little-known mechanisms to add hardware support to the kernel at run-time, i.e. without recompiling. For that, I will also present ways to effectively obtain the required information about hardware to be added. Finally, information is given how to report the findings. Intended audience: Everyone who is interested in kernel hacking is invited. Basic shell knowledge (sudo, echo) and ability to send e-mail are enough
Kernel (computing) Computer animation Mereology Code
Open source Multiplication sign Software maintenance Computer Code Word Kernel (computing) Computer animation Software Hacker (term) Computer hardware Video game Cuboid Physical system
Installation art Message passing Information Lecture/Conference Device driver Execution unit Survival analysis Digital library Form (programming)
Type theory Identifiability Computer animation Personal digital assistant Device driver Device driver Similarity (geometry) Process capability index Mereology Error message Row (database)
Web 2.0 Computer animation Information Helix Patch (Unix) Website Product (business) Form (programming)
Radical (chemistry) Addition Numbering scheme Computer animation Information Search engine (computing) String (computer science) Computer hardware Ideal (ethics) Bit Bookmark (World Wide Web)
Web page Distribution (mathematics) Information Computer file 1 (number) Device driver Inference Uniform resource locator Kernel (computing) Computer animation Internet forum Personal digital assistant Forest Device driver Computer hardware Resultant Window
Slide rule Numbering scheme Theory of relativity Information 1 (number) Device driver Line (geometry) Price index Mereology Computer animation Personal digital assistant Device driver Quicksort Window
Information Device driver Similarity (geometry) Database Bit Line (geometry) Revision control Web service Computer animation Different (Kate Ryan album) Term (mathematics) Search engine (computing) Device driver
Module (mathematics) Computer animation Information Forcing (mathematics) Device driver Order (biology) Generic programming Database Endliche Modelltheorie
Run time (program lifecycle phase) Computer file Inheritance (object-oriented programming) Multiplication sign Electronic mailing list Device driver Plastikkarte Process capability index Fluid statics Computer animation Device driver Bus (computing) Software testing Endliche Modelltheorie Physical system Asynchronous Transfer Mode
Computer animation Device driver Bit
Kernel (computing) Computer animation Open source Software Generic programming Device driver Pattern language Parametrische Erregung
Dependent and independent variables Variety (linguistics) Patch (Unix) Line (geometry) Function (mathematics) Computer Subset Kernel (computing) Computer animation Computer hardware Device driver output Parametrische Erregung Window Address space Social class Exception handling
Computer animation Lecture/Conference Line (geometry) Computer programming
Email Open source Link (knot theory) Information Patch (Unix) Source code Device driver Database Computer programming 2 (number) Mechanism design CAN bus Kernel (computing) Computer animation Software Computer hardware Device driver Authorization Endliche Modelltheorie Physical system
Web page Scripting language Kernel (computing) Computer animation Link (knot theory) Hypermedia Device driver Source code Device driver Bit Quicksort Address space
Web page Scripting language Point (geometry) Email Stapeldatei Scaling (geometry) Patch (Unix) Multiplication sign Projective plane Electronic mailing list Set (mathematics) Software maintenance Rule of inference Wave packet Data management Kernel (computing) Pointer (computer programming) Process (computing) Computer animation Software Computer configuration Personal digital assistant Device driver Series (mathematics)
Computer virus Point (geometry) Slide rule Numbering scheme Computer file Multiplication sign Virtual machine ACID Combinational logic Coroutine Device driver Event horizon Code Product (business) Computer hardware Ideal (ethics) Monster group Associative property Address space Descriptive statistics Form (programming) Scripting language Addition Email Smoothing Information Mathematical analysis Line (geometry) Geometric quantization Kernel (computing) Computer animation Software Telecommunication Order (biology) Device driver output PRINCE2 Freeware Communications protocol Window Reading (process) Asynchronous Transfer Mode
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Type theory Text editor
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
Computer animation
I think that and what that come from the talk making the Linux kernel better without coding and I would ask you if you want to leave during the talk during the question and answer session following the talk please make certain to leave quietly so the others have a chance to listen to the talk part of the question and answers and especially if you leave it through the lower backdoors please make sure that all also stops after you because otherwise it's quite a lot in thank you and thank you was from OK right what thanks for coming to my
talk found yeah I will 1st things that were a few words about me the in the final Connell hacker the idea to make my living with that of besides that and also passionate attackers so I
also do in my free time like modifying the kernel I happen to be the current maintainer for the ice the subsystem which is the about which is needed inside computers and embedded systems and I take care about most of the rest and I do like to share my knowledge about what I find out when handling the kernel and I really like enabled to enable people to to participate in basically free and open source development but especially in the Linux kernel because I don't think it is that Howard's hack on the code letters always said to be it has some things you should know but other than that is also pick piece of software which is written in just see and so it is possible to to act the kernel and in this talk I want show some knowledge that where you can't even contribute to the common without knowing how to code at all 1 thing I noticed so far during this conference that I really do like you to devices during talks both as a speaker and as a listener so I'd really appreciate if you could about silence Uriah devices thank you very much so what this is about 1 it can happen when you set up a project and and maybe you want to monitor something with an old computer and then you grab onto your hardware box and from this old left-handed was cheap you don't even know where it came from but you just have a and you want to plug it in and see if it works and that's what we decided how long it should actually be doing this is a special talk for me because I will be showing quite something's life and so you have the extra thrill of things saying here with me on a park in the camera now I want to start
some cross camera sulfur hope to get a picture and they just get is very frustrating message that you should make the cameras connected digit obviously is form I can and I can assure you and make show that the current virus install and this is the problem we have found that survival from the camera for this cannot the good thing is it is it is it is it is a very cheap camera but there are other variants of it already out there so chances are pretty good that Linux has a driver for this camera it just does not know about this concrete instantiation of this camera and this is what
we're going to teach units you during this talk and how to get the necessary information on how we can so convinced Linux to support this camera so this is how it all started just
repeated the error message again for in just in case the back rows could not read it as well and we're going to fix that the 1st thing is
obviously on to to know more about the camera and names do not help very much we need a unique identifier which in case for use the devices is so use the ID PCI devices tends to have uh something similar and so you can just run these you probably know them commands to find out about the use the idea of PCI ideas and if that's the name connected to it if the output of of those tools give you a name that does not necessarily mean that a driver already for it are those who are databases of the looks drivers and the use the idealist our the couples kinds this is the 1st part of the 1st thing where you can take part and because the developers it is very very a useful to know which use B I D S which name so if you have a camera you type this command and see hated does not from my camera and there's a way for you to submit additional
information I have mentioned you to websites which have the 2 ways of contributing data you can log onto the website and uh enter web form submit additional data say hey I've noticed that use be helices be does model is my camera this use the ID with that a product ID has that name and it will be included somewhere later if you know how to generate catches you can also send a patch to a to meaning this I will show you the this is
an example of that does not produce this is basically the website it's not
very pretty but it's very effective them and you see that you can hear and ideas and
if pH and stuff like that not very complicated yet there is useful for developers because developers do not have a lot of camera so if you have a hardware which is not detected by Hellas use B but I would really encourage you to to go there and at that string this camera has that name and developers can benefit from that the the next step if you if you found out
the ideals of that camera obviously is phi uh using your 1st favorite search engine using that ID number maybe the name and and probably the terminal nodes and find for look for additional information the you will usually find out a bit internals of the camera that might be needed or not usually you get this the
result from distribution forest which may contain useful information but what I want to mention here is that you really have to watch out if the forum entries are like 2 or 3 years old sometimes they mention that you have to compile and out of the driver from this that's all sports page or so this is usually not the case anymore most most drivers are included in the mainland of kernel so it's not not so complicated as it sometimes look if you if you will around so try to get information but tried to to things that these information might be outdated it and what I find very
helpful when when adding this this is kind of hardware is get the information from from the Windows drivers which are use usually are supplied by some city or inference is still find them on the Web and besides the binary blobs which are totally uninteresting for this case but there's also in a white iron have file which is a text file describing the driver of course I was usually comes from some kind of package so you might need 1 of these classic ones on the gun shield to get rid of the packing headers I found out that in most cases I even had to use wine to really install the drivers to some somewhere it's in so sometimes it even fails to install the driver properly but still you can get the in files from that in the locations I wrote down there Webster most clearly coming from the and that's so there is still available and there's still this simple text files and we can pass and the
end they show that most of these camera drivers even also on the Windows side
pretty generic this 1 driver of handling all sorts of cameras and somehow these cameras are described in those files or at least relations ships relationships where you can get OK this camera must be similar to that 1 or even the same 1 just with a different case and there might be some other relevant inflows in there this 1 example from from another can where ones that and its support to the nose and you really don't know have to to understand the details of that that the 1st part of some kind of a name of the descriptors and the 2nd part is the registering the actual use DID which for the cover-up we want to support the nice thing about it is that it gives a relationship to the red numbers also on the next slide next uh the red number of the use B of the camera we want us support that's our target and the green number is the new information that that the camera we know must be somewhat similar to the camera will show you all fine but if and just that those that use the ideas are mentioned in 1 line gives a good indication that there there is the similar very similar this is a camera want to support and even in the Windows Driver the descriptor has this name and so we could go I bags and could add them support for this camera which was some Hewlett-Packard Cairo using using the information for that camera which was I don't know some cheat sheet I don't know could company probably Chinese don't want to say Chinese people do always to stuff but in that case it was really the case so with this camera
I would it's even a bit more luxury we have lots of lines and uh with lots of deities ideas and they the as a comment after that there was even written some some internal the 1st thing is the camera chip and the 2nd is a sensor so we can easily spot I do we have some see a similar what exactly the same entries with different use the idea so we we gain the same this is a camera we want to support this is the genius something and this is the camera where uh which is exactly similar exactly rebranded version of my camera which is some micro DO I don't so what we got as similarity we know the camera we have that we want to support and we will we have to come up with a camera which is similar now we need to find out is this you can you camera out of this new ID already supported by units and that we can use our handy web service the Linux kernel driver database or short LPG DB so if you enter the new idea
we've found out together with the search term al DDB into every search engine you will get the information if this is supported by which driver and some extra information about the driver and this is what I wanted to show so I'm open a new
chapter the I use Google inches literacy for 5 6 to force the otitis a lot during the last days OK KDD being J. we got
hits and this is from the database on the lots of generic information including listing all supported use the so you can tell us pretty generic driver you this is all different cameras which are already supported so it's not surprising that it probably supporting yet another unknown 1 of the key information at the top here for forces of the the driver name the module we need to those in order to uh at support in this model has striven with with our camera this is what is called the as PC-AS and 9 the debt 20 x now comes a neat trick
which is in the column for quite some
time but it's not very well known that you can at runtime added a new new user BID to driver and fuel will feel responsible for it every driver has a static list of drivers refuse responsible for it but we can extend this list at runtime so 1st we go into Super User mode so we can learn models from a module remember the drivers not loaded yet there there's no device it's feels responsible for it so we have to do this manually noting the model once we have the model loaded the driver will get an entry is system bus use the drivers it's long but it's kind logical to use PCA the driver and basically and there's this this file new idea this is regular file and you can echo use BID into it and the driver will start feeling responsible for that and making the best out of it this works for a USB PCI cards and if you still haven't PC NCAA cards on it is pretty good for for testing you out there was current drivers and this is also 1 thing I want to do like the 1st is
a readable in the back all rheological yes so
she's consume this not to be true 206 the the because used in drivers you can see in so we here we have found you ID
on all make it a little bit smaller hope
it's still readable but and you want to still OK OK thanks the so this is a new the idea of our camera here we found out which 1 should feel responsible for that and we echoed into their OK let's see something and I have another test of whether the follow-up messages as
being locked and we see OK resistors G is PCA is proving that is viewed which it it
failed the yeah you that was that was for this talk inspected with no that's a 1 nice thing all the of think of the Linux kernel it's free and open source software last I I have given this similar talk where where exactly this pattern was needed and support was added but we there is a problem with generic
drivers yeah we did that already generic drivers need parametres
are the camera chip is supported but if they support also a variety of sensors so we need stuff like which sensor do we have and went what address those that live in the doesn't have special flats and if the parametres does not match the driver will fail and this is what exactly happened here it works for me when it sided with the last time but with this can failed not that my computer still lives and I can assure you the Commerce to live so you can really try around things and their chances that you break some hardware is very close to 0 and as so just play around with that if you if you are trying to add hardware don't be too afraid so now I had the problem I had my talk except that I had the camera and those things did not work so what did I do I made it work as in some patches to the Linux kernel which are acceptance meanwhile they're already upstream so I'm running here in kernel which is like 3 days old or something and this introduces the concept of a reference ID remember we found out that there is a camera which is very very similar if not identical e identical except for the kids for the casing to this 1 so I can and should be able to say to the driver fear responsible for that use BID and user Parramatta set from that used the idea and that is what i implemented the 1st line here is of course if there's a new idea that's also remove likely to get rid of like your broken broken entries this is what we do through 1st we get rid of the broken entry and then we say to the driver of the responsible to that use the idea 0 well we could assign use the class we will needed here we ignore already the role and use the driver set for the camera found from the Windows driver let's try that so that could only in writing and calling introduction of for phone the the the it's check again I think this is correct OK there was a slight delay before the prompt return that gives some hope let's see the last
lines of of the outputs is probing again on as a census detector that sounds pretty well and also created an input devices that's button on top of the camera in the so this part of
the I'll just lost lines are needed this
line non-seasonal sorry OK in for so that that gives hope to start the
camera program again you will go
with camera
few so that was known as the knowledge and involved was echoed those who took a just a bit of
knowledge OK it's in the mother of his
knowledge in the but this is how people can can Edward Hopper to to the kernel because as a developer you you only just have a few
cans you can write the driver for that but you can never have a bunch of hardware which is out there and this is also some kind of of crowdsourcing people users have all kinds of hardware and so with such mechanisms you can get some make the Linux kernel support hardware even more popular than it already does that mean it's pretty good already but we can still be better the so now the camera works for me or for you but it would be free and open source software if you were keeping that for ourselves what to do with that knowledge this should not
intrude programming and creating patches it's
totally fine to write male similar like this yeah I found this out and so I don't really want to create a possible too complicated for me user knowledge can somebody do something with it that's perfectly fine all by the system seconds to read the key question here is an whom to send the mail to do so somebody is responsible and there's some some means the 1st and that's a compliment Mott info which will give you module authors who wrote the model you could have a look at that you could have a look at the at the beginning of the source Fire and the nice thing about felt he knows the Linux kernel driver database has links to the source so you don't even have to have the Linux kernel source
installed or just want to show that you see page again and if we go down down down on and on you see here it has a link drivers media use B and then we have a
link to summarize the prosody indexed source file and then you can probably find you some e-mail addresses as well and if you're interested in a little bit of coding you can just there also have a look how this driver works what it does what it maybe does not if the fix he's in it and just have a look how how such a driver looks like it's not rocket science the the if you have kernel sort installed
there's a nice scripts the subdirectories
scripts playing yeah it's called get maintainer it will give you a list of people print simply print a list of people who you you should have in Europe from the male uh I use it myself when I creating series is a good tool very useful when in doubt always use big big famous LKM ML mailing lists with which I wrote down there and to be very sure just me and I will try if somebody from the subsystem will pick it up and if not then I will just create the page because it's annoying food so today OK to say I don't want to do it but you could even try it's not say it's annoying food I would again obviously the camera will work for you to camera around work for the rest of the world someone when on everything went upstream and if everything went proper and there's a patch entering the Linux kernel you will credit it's like supported by and then you have your name In the year history did history of the Linux kernel for some some don't care for some gives of warm and cozy feeling so who decide so you could stop there or you could move on next that possible
steps that I don't want to talk in detail about your created the patch itself alone I a world more don't give any point for creating patches here there are lots and lots of them 1 common that I want to make is that you don't necessarily have to have used it if you want to create a give you a simple batch if you want to use collecting I really recommend learning get if you don't know it already but for such simple patches you can do like proved all about the more basic patch management software that's totally fine they're out to is how to work with that on the next will easily find them for kernel related stuff I have I added to pointers how the common development process works in general and what you should take care when submitting patches I think it's worth reading even if you're not deciding on continuing working on the linux-kernel but some of the rules a pretty good for I think most of them suffer projects it's not necessary that everyone every project should adopt the exact color means kernel rules but but it gives you an idea what should the proper what should be formalized to to be working on a large scale project like the Linux kernel and if you do codes that if you could then you could also try and playing around with a driver when I 1st got the camera I notice there's an LED does not work so I 1 idea would be to think why this is this is a simple thing you could check the check the driver while where the LED is controlled and what you could do about it and to be honest this problem was already solved when I travel to Brussels I have some free time on the train and I found out why so I'm sorry this is already taken and and all stuff like the camera can get pretty slow when when there's not enough light because it has a lot of automatic exposes settings and other cameras have options to enable and disable automatic exposure so you can disable it so the camera will be faster at the price of a light got pictures this camera doesn't have that it has always all to exposure so it tries to make the best of light but it can will slow so you could try to find out is a way to control that can I have a button for that 2nd set on and off that's how you could possibly get into driver is especially the case it's a cheap can you really don't have to be afraid of doing any greater damage really good good for playing around it yeah that was
basically it from I'd like to have enough time for questions so this is what the slides are questions right now I will be at fast until tomorrow noon probably so if you see just just
approach me and ask me questions or will come for a chapter on the wall that's my e-mail address you can right matter questions so there was this for now and virus thank you for quantization of them looking at what you are saying acidic would be very valuable to other scripts so so you select would be on device that could be so device on user-device you provide maybe the education fired from the Windows driver on the inside script making I made the analysis and to compare them addicted to 0 so that the base you show untried holds the automatically is a this is a trick to show until we have a new input device or maybe out people to get to bring you camera as you did did it was the windows or which is all the users provided with it because and the windows size cities much more because of the Linux 1 on the optimized also detection on to say OK society is the 1 where looking for the data suggesting a script which parses the Windows Driver and tries to combinations values the ideas and check if it gets something to work maybe passing identified which is given ways of number of the of the of the readings identify funding also possible association with the existing these revised that we already have the government about forms and make the tradition to try to hold occlusions that exists and it works on uh yeah I think the I ideas chat challenging and if you if you like to do that is to free 1 thing i'd like to mention is that Windows drivers still binary blobs so we can't look decide them and it might be that they have some extra code for some extra camera so I really love it when you use the ID is added to the kernel as a pet it should be tested on real hardware not on speculation that this is what I would suggest but it's really useful to come to have these uh files in mind and then look for potential cameras and you could like try to find people in the next you had problems with that camera and to ask them if they could uh try this line and then echo the idea to use the idea that's a new idea to what I did here and then you could check with someone who has a real hardware and then have the support of this the putting that totally automatically is not my preferred stock there that today I um I think dollar of you is the use of the device is uh Oliveira and known you is the ideas of uh and what about unknown the explicit additions uh and did people tried to serve as the inputs that using or or on the side of the road in news read did in order to see what they get back not that I know of happened but it has this is I don't I'm not really uh um and use the extra of I know that there's some some companies using use the i numbers with which a shouldn't but it's not it's just laziness and looks like a sloppiness or laziness or something in between what I do know monster that most there's still a number of years the idea missing descriptions like expensive cameras if you title is used the you just see the vendor but not the product names are really call again for crowdsourcing check check use the devices check if they have proper names and maybe submit them to the use the ideal is that would be really great if you buy a thank you for this kind of talk and inspires me to do something myself and I have a camera phone but the thing is I know already that this summer must camera must have some initialization routine to get that can notice on so what I need to do is I need to have some the out of the tracing also for the use the protocol to see of what is needed to get to come into this event mode of so for sure I would have to do this in the windows that the drivers of running is any tool that you can use suggests to do such you use the tracing and I I haven't done that myself but there are uh so there's is the smoothing software for Windows so they intercept the use the that can pretty print out what the has been sent back and forth I think it's called use these new will use these something like this that there is also a hardware in their their their mom why expenses that quite expensive but with very economy but quite expensive maybe I don't know of any free hardware but I'm you might need it might be just like the information here but there is what I know there is software for Windows which intersect the that use the 2nd Prince you of the communication between the CAM and the Windows holes and then you can be implemented and notes that sounds good OK so that so 1 point of order was 2 and you can also 1 of machine this and honored and to try right shot as he was the 1 and then you can draw the tracing of 3 to 1 of them on so thank you very much for them in American for few thank you very much and will continue the engine so I've 3 a lot with the unification
versus GB if and
the and
stop at that type of the
top top editor at the it the the the
the the the the the the topic by the end of
the day I I I I
I thank you bye the but the and
depending on the