How can I change cr0 register in redhat system

Peter Teoh htmldeveloper at gmail.com
Mon Jul 23 22:05:09 EDT 2012


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 <lljyangfan at gmail.com> 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
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>


-- 
Regards,
Peter Teoh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120724/052c5102/attachment.html 


More information about the Kernelnewbies mailing list