Physical memory access during kernel image boot
I am trying to teach my kernel (188.8.131.52) to read/write from/to a certain spot in physical memory. Each time I boot a new kernel image, the system core dumps.
Abstracting away from the my implementation, how can I access the CPU's internal memory from the Linux context?
I can see/tweak the memory during the first stage bootloader and in U-Boot, but once Linux takes over I cannot access the physical memory without having the system crash, saying it cannot handle the paging request.
What is the right way, using C and in the Linux kernel context, to directly read/write to physical memory?
I purposely haven't included my code because it is obviously wrong. I'd prefer to learn the right way, and then change my code to reflect the accepted coding practices.
Thank you to all.