Page 1 of 1
How can I set CPL=0 for WBINVD in NASM (Linux)
Posted: Thu Jul 08, 2010 6:20 pm
by yousafsajjad
Hi,
I just started working on nasm 2 weeks ago and I am stuck at something (of course). Can anyone please tell me how can I set CPL=0 so that I can use WBINVD
Re: How can I set CPL=0 for WBINVD in NASM (Linux)
Posted: Thu Jul 08, 2010 8:16 pm
by Brendan
Hi,
yousafsajjad wrote:I just started working on nasm 2 weeks ago and I am stuck at something (of course). Can anyone please tell me how can I set CPL=0 so that I can use WBINVD
You can't, unless you're writing kernel code or a device driver (which runs as part of the kernel as a kernel module).
This basically means that normal processes can't screw everything up when the programmer makes the mistake of thinking that they want to use something like WBINVD...
Note: the CLFLUSH instruction may be what you actually want...
Cheers,
Brendan
Re: How can I set CPL=0 for WBINVD in NASM (Linux)
Posted: Fri Jul 09, 2010 12:43 pm
by yousafsajjad
Yeah it seems like it would work but in this description it says something like "Invalidates the cache line that contains the linear address specified with the source operand from all levels of the processor cache hierarchy". I am not much sure what that suppose to mean
Re: How can I set CPL=0 for WBINVD in NASM (Linux)
Posted: Fri Jul 09, 2010 4:07 pm
by Combuster
The linear address is the address passed into the paging system. It's the same as the virtual address unless you use segmentation (which most people don't).