u have to put the asm code in kernel module, and load it via "insmod" and when it execute, it will affect all the processes .....and btw, your version is dangerous....normally people will always query the latest value of Cr0, and then OR with the value they want to modify. below is one that worked:
http://stackoverflow.com/questions/3962950/how-to-set-control-register-0-cr0-bits-in-x86-64-using-gcc-assembly-on-linux On Mon, Jul 23, 2012 at 12:00 PM, Fan Yang <[email protected]> wrote: > hi all: > when I change the cr0 register I get a "Segmentation fault (core > dumped)". > my code is : > > > .data > .text > .global _start > _start: > movl %eax, %cr0 > > this code can work well in ubuntu system when I use root to run it. > So what can I do to work it in redhat system? > > thanks > > > _______________________________________________ > Kernelnewbies mailing list > [email protected] > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies > > -- Regards, Peter Teoh
_______________________________________________ Kernelnewbies mailing list [email protected] http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
