* Christian Sühs chris@suehsi.de [060511 14:51]:
Ok, There are a few questions for me exspecially for the cr0 register.
as I say default is 60000010h
for that default the CPU is in real Mode. If I understand that right, it is a 16bit machine ?!
yes, the x86 architecture is a drilled 16bit architecture with 32bit and nowadays 64bit plugged on top. When the CPU is powered on, it still comes up in 16bit mode.
One of the many delicacies of LinuxBIOS is that it enters protected mode (32bit mode) after only 17(!) CPU instructions.
mainboardint cpu/x86/fpu/enable_fpu.inc
This enables the FPU so the romcc generated code can use the FPU registers for spilling.
that file does something on register cr0, but for the GX1 in cr0 is nothing about fpu?!
I would assume it is there anyways, or the FPU is always enabled for the GX1?
andl $~(1<<2), %eax /* found in enable_fpu.inc */
this clears bit 1.
1<<2 is the value with only bit 2 set. The decimal value is 4
$~(x) inverts the value of x, so the result is a value with all bits set except bit 2.
the and operator sets all bits in eax that are - already set in eax - set in the value you provide so since only 1 bit is cleared in the value, the expression clears that one bit in eax.
can anybody explain this in easy words ;) which bits are set in that case.
in easy words: none. bit 2 is cleared though.
To set bits you would OR/ORL them into a value. Rather simple bitwise arithmetics.
set bit 5:
orl $(1<<5), %eax
NOTE: bits are counted from 0 here. So bit 2 is the third least significant bit.
Hoe this helps..
Stefan