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

What is the difference between module_init and subsys_initcall while initializing the driver?

The difference relates to timing, or more precisely, order of execution. That is, the procedure declared as subsys_initcall is guaranteed to be executed before the procedure declared as module_init. This ordering ensures that subsystem and platform drivers are initialized before device drivers try to utilize the former’s functionality (e.g. a device driver registers as a … Read more

module_init() vs. core_initcall() vs. early_initcall()

They determine the initialization order of built-in modules. Drivers will use device_initcall (or module_init; see below) most of the time. Early initialization (early_initcall) is normally used by architecture-specific code to initialize hardware subsystems (power management, DMAs, etc.) before any real driver gets initialized. Technical stuff for understanding below Look at init/main.c. After a few architecture-specific … Read more

Adding new driver code to linux source code

To cross compile your own driver in the arm architecture you have to follow some steps as mentioned below. Create a directory like my_drvr inside drivers(which is in the Linux source code) for your driver and put your driver (my_driver.c) file inside this directory. It will looks like /linux_source_code/drivers/my_drvr/my_driver.c Create one Makefile inside your driver … Read more

Difference between physical/logical/virtual memory address

My answer is true for Intel CPUs running on a modern Linux system, and I am speaking about user-level processes, not kernel code. Still, I think it’ll give you some insight enough to think about the other possibilities Address Types Regarding question 3: I have come across discussion that virtual and logical addresses/address space are … Read more

What is the difference between the kernel space and the user space?

The really simplified answer is that the kernel runs in kernel space, and normal programs run in user space. User space is basically a form of sand-boxing — it restricts user programs so they can’t mess with memory (and other resources) owned by other programs or by the OS kernel. This limits (but usually doesn’t … Read more