1

I would like to clean install embedded linux in ARM based smartphone. Inorder to do so i would need the device drivers such as flash memory, display etc. I was wondering if its is possible to extract the device drivers from the ROM'S supplied by these phone vendors?

1 Answer 1

2

No, this is not generally possible. One difficulty is due to linking. The drivers will call functions and infrastructure with-in Linux. For instance, even if kmalloc() is the same source, the location in address space maybe different. To extract the code, you would need to map the extracted Linux addresses to your target addresses. Also, it is common for drivers to inline features that might be called in another module like kfifo, etc which may have functional changes between the Linux versions. Even more common is that kfifo code will be inlined in the driver. If spinlock functionality changes between ARM Linux versions, you need to extract and replace this information from the driver with the new version. Finally, there are Linux features which aren't just deprecated, but completely removed and replaced by some other infrastructure.

You question is very similar to . From some of the above reasons and possibly more, you can see that it is very difficult or impossible to implement this. That is why people made the Linux kernel GPL. You should be able to ask for the source code and modify it in a much more efficient (and functionally correct) way.

4
  • This make so much sense. So if one cant obtain the source code from the vendor in the form of board support packages etc, then is there any way around or any hack possible?
    – gfdsal
    Nov 2, 2019 at 17:47
  • 1
    I think it would depend on the device. Certainly there are closed source OSes were Linux people try to reverse engineer the devices. Here, you generally try to snoop a bus and see what values are sent back and forth between the CPU and the device. Then you have to write the driver yourself. If the vendor has a datasheet (GPU/flash controller, etc), then it is just 'more simple' to write your own. Unfortunately the functional ROM isn't really worth too much. If you could extract a Linux module from the ROM, then it might be possible to configure your own Linux to use it fairly easily. Nov 2, 2019 at 18:10
  • Noted. I didnt quite get "Certainly there are closed source OSes were Linux people try to reverse engineer the devices" did you mean some thing like Hackintosh?
    – gfdsal
    Nov 2, 2019 at 18:27
  • 1
    Before vendors like nVidia decided to make Linux drivers, people would reverse engineer the windows drivers to figure out how to make Linux drivers. I believe nVidia is still only releasing binary kernel modules. See also mmiotrace.txt. Nov 2, 2019 at 21:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.