Re: How can I change cr0 register in redhat system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




--
Regards,
Peter Teoh
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux