Page 1 of 1
Default x86 register values
Posted: Mon Jun 09, 2014 4:23 am
by watermirror
hi, how could i know the default value of all the registers's default value on power on of intel's x86 cpu?
i can only find the idtr, gdtr on the manaual.
i aslo want to know cs,ds...
Re: the default value of intel x86 register.
Posted: Mon Jun 09, 2014 4:31 am
by embryo
watermirror wrote:hi, how could i know the default value of all the registers's default value on power on of intel's x86 cpu?
i can only find the idtr, gdtr on the manaual.
i aslo want to know cs,ds...
You should read CHAPTER 9 PROCESSOR MANAGEMENT AND INITIALIZATION from Intel® 64 and IA-32 Architectures
Software Developer’s Manual Volume 3.
Re: Default x86 register values
Posted: Mon Jun 09, 2014 1:47 pm
by sortie
You don't care what the default x86 values are - just after boot - because you are not the firmware. I suspect all the registers will be zeroed or something, at best, or perhaps just be trash. What you actually want do know is whether the registers are initialized when you get control. If you write a MBR boot sector, you'll want to know what the BIOS does (it does use some of the registers for particular purposes). If you are writing a multiboot kernel you'll want to read the multiboot specification.
My point is that you should look at the specification or documentation for whatever boots you. What boots your code?
Re: Default x86 register values
Posted: Mon Jun 09, 2014 2:58 pm
by Gigasoft
sortie wrote:You don't care what the default x86 values are - just after boot - because you are not the firmware. I suspect all the registers will be zeroed or something, at best, or perhaps just be trash. What you actually want do know is whether the registers are initialized when you get control. If you write a MBR boot sector, you'll want to know what the BIOS does (it does use some of the registers for particular purposes).
Now you are assuming a whole bunch of things that the OP didn't state. Assuming facts that directly contradict the very question that was asked seldom produces a meaningful conclusion. One would have to suppose that if someone didn't care about something, they wouldn't be asking about it.
And yes, most registers have well defined values on reset. EDX will identify the processor model, EAX will be zero if the BIST succeeded, and most other registers are zeroed. CS is F000h with a base of FFFF0000h, all other segment register values and bases are 0, all limits are FFFFh, all segment flags are present, r/w, accessed.
Re: Default x86 register values
Posted: Tue Jun 10, 2014 4:35 am
by dlarudgus20
Just one - why do you want to know? Is there any case which requires this knowledge, or just curiosity?
Re: Default x86 register values
Posted: Tue Jun 10, 2014 4:39 am
by dlarudgus20
Gigasoft wrote:
And yes, most registers have well defined values on reset. EDX will identify the processor model, EAX will be zero if the BIST succeeded, and most other registers are zeroed. CS is F000h with a base of FFFF0000h, all other segment register values and bases are 0, all limits are FFFFh, all segment flags are present, r/w, accessed.
Wow, it's surprising...
Btw, "segment flags"? Is there anything like that in
real mode, in which processor starts up?
Re: Default x86 register values
Posted: Tue Jun 10, 2014 8:46 am
by Combuster
dlarudgus20 wrote:Btw, "segment flags"? Is there anything like that in real mode
Certainly. See the
Descriptor Cache
Re: Default x86 register values
Posted: Wed Jun 11, 2014 3:57 am
by dlarudgus20
Combuster wrote:dlarudgus20 wrote:Btw, "segment flags"? Is there anything like that in real mode
Certainly. See the
Descriptor Cache
Wow..