How to access and study linux source code in my linux Ubuntu distribution?

I have Linux laptop… It is running Ubuntu 18.04 LTS (64-bit). I’m new to Linux programming. I need to understand USB Host implementation in my Linux distribution installed in my laptop.

I want to open source code files in vim 8.0 editor. Is it possible I can step through code with gdb debugger while some USB device is connected to my laptop so I can understand the flow of code. I need to study how USB device driver gets installed, understand the driver code, how USB transactions are handled in the source code, etc.

I want to do all this so I can have knowledge to implement USB Host in the embedded platform, NXP MCIMX8QXP-CPU evaluation board.

I’ve read books on Linux systems programming. One of the better ones is Linux Device Driver Development by John Madieu. But it does not really matter which one you take, it just should be about Linux device driver development. This is a good starting point. Additionally, you could look at https://www.kernel.org/ to read the corresponding documentation of the Linux kernel, etc. Taking a look at https://github.com/torvalds/linux probably won’t hurt either. That being said, even for such specific topics there is always a YouTube video around explaining such stuff.

1 Like

this video seemed like it might be helpful:

1 Like