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 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

Difference between Kernel Virtual Address and Kernel Logical Address?

The Linux kernel maps most of the virtual address space that belongs to the kernel to perform 1:1 mapping with an offset of the first part of physical memory. (slightly less then for 1Gb for 32bit x86, can be different for other processors or configurations). For example, for kernel code on x86 address 0xc00000001 is … Read more

What restriction is perf_event_paranoid == 1 actually putting on x86 perf?

In this case CPU event refers to monitoring events per CPU rather than per task. For perf tools this restricts the usage of -C, –cpu= Count only on the list of CPUs provided. Multiple CPUs can be provided as a comma-separated list with no space: 0,1. Ranges of CPUs are specified with -: 0-2. In … Read more

Handling ARM TrustZones

http://infocenter.arm.com/help/topic/com.arm.doc.prd29-genc-009492c/index.html is a pretty good introductory document that gives an overview of something a little bit too complex to be satisfactorily explained by typing into a text box. But I’ll try to answer your direct questions below. It refers to an additional privilege option orthogonal to the execution modes. Secure world has the ability to … Read more

proc_create() example for kernel module

This example will create a proc entry which enables reading access. I think you can enable other kinds of access by changing the mode argument passed to the function. I haven’t passed a parent directory because there is no need to. The structure file_operations is where you setup your reading and writing callbacks. struct proc_dir_entry … Read more

Difference between ZRAM and ZSWAP

zram Status: Available in mainline kernel as of version 3.14 (March 2014) Implementation: compressed block device, memory is dynamically allocated as data is stored Usage: Configure zram block device as a swap device to eliminate need for physical swap defice or swap file Benefits: Eliminates need for physical swap device. This beame popular when netbooks … Read more

techhipbettruvabetnorabahisbahis forumu