1. If ur trying to write into an IO mapped device register from the kernel, then you may straight away write into the address or use readl/writel variants depending on ur arch.
2. If you are debugging something from the kernel, then you may use the address straight away by assigning to a variable.
3. If ur trying to fix something and following point 2, ur in trouble.
4. If ur in user land, then safe way is using mmap.
Start by typing "man kmem".
Start by typing "man kmem".
Use mmap to map 0xfa000000
Use mmap to map 0xfa000000 to low address using the file /dev/mem. It returns the ptr which u can use to write data.
OP specifically wants to
OP specifically wants to write to a kernel address, so must use /dev/kmem instead of /dev/mem.
/dev/kmem is read only by
/dev/kmem is read only by default in the .config, so you can never write to it.
How to write in kernel memory
1. If ur trying to write into an IO mapped device register from the kernel, then you may straight away write into the address or use readl/writel variants depending on ur arch.
2. If you are debugging something from the kernel, then you may use the address straight away by assigning to a variable.
3. If ur trying to fix something and following point 2, ur in trouble.
4. If ur in user land, then safe way is using mmap.