News for hackers. Stuff that matters.
Re:Writing a Simple Linux Kernel Module by zeusk on Thursday November 30, 2017 @03:32PM (#15819241)
> mmap("/dev/mem")

but that would only work if some kernel module or the kernel itself hasn't mapped that IO space, right?

Re:Writing a Simple Linux Kernel Module by sly010 on Friday December 01, 2017 @11:41AM (#15824986)
I don't think mmap stops you from mapping the same memory twice, nor does linux. In my case I didn't even disable the system I2C driver. If course if I tried to use it I would get io errors and if I am not careful I can crash the kernel, but that's what you get for poking around. This was a raspberry pi.
Re:Writing a Simple Linux Kernel Module by zeusk on Friday December 01, 2017 @04:39PM (#15827786)
Yeah, that's what I meant since i2c is a serial protocol and most drivers assume mutual exclusion on device registers.