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...
Default x86 register values
Re: the default value of intel x86 register.
You should read CHAPTER 9 PROCESSOR MANAGEMENT AND INITIALIZATION from Intel® 64 and IA-32 Architectureswatermirror 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...
Software Developer’s Manual Volume 3.
Re: Default x86 register values
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?
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
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.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).
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.
-
- Member
- Posts: 36
- Joined: Sat Oct 26, 2013 4:14 am
Re: Default x86 register values
Just one - why do you want to know? Is there any case which requires this knowledge, or just curiosity?
Last edited by dlarudgus20 on Tue Jun 10, 2014 4:40 am, edited 1 time in total.
-
- Member
- Posts: 36
- Joined: Sat Oct 26, 2013 4:14 am
Re: Default x86 register values
Wow, it's surprising...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.
Btw, "segment flags"? Is there anything like that in real mode, in which processor starts up?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Default x86 register values
Certainly. See the Descriptor Cachedlarudgus20 wrote:Btw, "segment flags"? Is there anything like that in real mode
-
- Member
- Posts: 36
- Joined: Sat Oct 26, 2013 4:14 am
Re: Default x86 register values
Wow..Combuster wrote:Certainly. See the Descriptor Cachedlarudgus20 wrote:Btw, "segment flags"? Is there anything like that in real mode