Hi.
I would like to be able to easily find out what exactly is hidden behind the current value of the registers.
For example, just copy the current EFLAGS from qemu (using info registers) and immediately decrypt it, or do the same with CRx registers.
Now I have to translate the value from 16 to 2 number system and manually examine the bits by checking the documentation.
Maybe there are some convenient online tools or something?
How easy is it to understand the meaning of the register val
Re: How easy is it to understand the meaning of the register
Pretty trivial to write such tools for yourself, I would have thought.
Re: How easy is it to understand the meaning of the register
I was thinking of writing this for myself.iansjack wrote:Pretty trivial to write such tools for yourself, I would have thought.
But suddenly someone did it before me, in this case it is more convenient to use something ready-made.
Re: How easy is it to understand the meaning of the register
Well, if you are doing that, you are already doing something wrong (unless I misunderstood you). You see, each hex digit is a shorthand for four bits. This makes it both easy to identify what bits a given hex digit stands for (as it is always the same thing), and to locate the bit in the documentation.mrjbom wrote:Now I have to translate the value from 16 to 2 number system and manually examine the bits by checking the documentation.
For example, I'm defining the GDT as just an array of 64-bit numbers. So I have the assignment
Code: Select all
gdt[KCODE_DESC] = 0x00af9a000000ffff;
Doesn't always work that way, but then you just get as close as possible with hex digits. And so there is never really a reason to translate the number back to binary. One thing I particularly never understood is the insistence of some members of this community to use binary for full thirty-two bit numbers (or even sixty-four bit numbers). How do you even see anything in that long mess?
Carpe diem!
Re: How easy is it to understand the meaning of the register
Wow, I've never noticed this, although even with this it's not particularly convenient to manually check the documentation every time.nullplan wrote:Well, if you are doing that, you are already doing something wrong (unless I misunderstood you). You see, each hex digit is a shorthand for four bits. This makes it both easy to identify what bits a given hex digit stands for (as it is always the same thing), and to locate the bit in the documentation.mrjbom wrote:Now I have to translate the value from 16 to 2 number system and manually examine the bits by checking the documentation.
It's hard to see something there, so it was cool for some utility to see it for menullplan wrote:How do you even see anything in that long mess?
Re: How easy is it to understand the meaning of the register
Unfortunately, I've found that symbolic constants don't help a lot, because the concepts are often too arcane, so you need to read the code with the documentation in hand anyway. And particularly in places where you only need the constants once, like in the GDT and IDT code (which I initialize once and then never touch again), I just use magic numbers and then put the whole issue to bed.mrjbom wrote:Wow, I've never noticed this, although even with this it's not particularly convenient to manually check the documentation every time.
Carpe diem!