Linux Kernel – How to obtain a particular version (right upto SUBLEVEL)

kernel.org has a public (read-only) git repository that you can clone. It has also tags for every kernel version, so you can checkout a specific version: # Clone the kernel to your local machine $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git $ cd linux-stable # Find the tag for the version you want $ git tag -l | … Read more

What does request_mem_region() actually do and when it is needed?

request_mem_region tells the kernel that your driver is going to use this range of I/O addresses, which will prevent other drivers to make any overlapping call to the same region through request_mem_region. This mechanism does not do any kind of mapping, it’s a pure reservation mechanism, which relies on the fact that all kernel device … Read more

redirect QEMU window output to terminal running qemu

remove -serial stdio parameter add -nographic parameter and change the kernel parameter terminal = ttyS0 to console=ttyS0. This should do the trick. qemu -nographic -kernel ./bzImage -hda ./image.hda -append root=/dev/sda console=ttyS0 You may want to check the script I use for kernel development: https://github.com/arapov/wrap-qemukvm (it’s not very “production”, but you can find useful qemu cli … Read more

How does schedule()+switch_to() functions from linux kernel actually work?

After calling switch_to(), the kernel stack is switched to that of the task named in next. Changing the address space, etc, is handled in eg context_switch(). schedule() cannot be called in atomic context, including from an interrupt (see the check in schedule_debug()). If a reschedule is needed, the TIF_NEED_RESCHED task flag is set, which is … Read more

How to set a global nofile limit to avoid “many open files” error?

Fixed this issue by setting the limits for all users in the file : $ cat /etc/security/limits.d/custom.conf * hard nofile 550000 * soft nofile 550000 REBOOT THE SERVER after setting the limits. VERY IMPORTANT: The /etc/security/limits.d/ folder contains user specific limits. In my case hadoop 2 (cloudera) related limits. These user specific limits would override … Read more

How to create a defconfig file from a .config?

I think you have to do just one command and use the created file as you want to. % make savedefconfig % cp defconfig arch/arm/configs/my_cool_defconfig (Pay attention to the filename template that is used for defconfig) To get all possible targets just run % make help As noted by Adam Miller followed by Jeremy, users … Read more

Tool to visualize the device tree file (dtb) used by the Linux kernel? [closed]

dtc -O dts sudo apt-get install device-tree-compiler dtc -I dtb -O dts -o a.dts a.dtb gives a well indented textual representation of the device tree a.dtb, which is easy to understand with a text editor. Or dump it to stdout with: dtc -I dtb -O dts -o – a.dtb The source code for dtc is … Read more

techhipbettruvabetnorabahisbahis forumueduseduedueduseduseduseduedueduedu