Page 1 of 1

Dump registry

Posted: Wed Apr 15, 2009 6:36 am
by spiner900
Het everybody, I have a question. T wrote a function to print my registry value when I'm under real mode 16 bits. When my function print the registry value in Bochs and VmWare, I got the same values, but if I print this when I boot with my PC, the values are not the same. Why ?

Re: Dump registry

Posted: Wed Apr 15, 2009 8:39 am
by Combuster
Because it feels like it?

Really, to give a sensible answer we must know what you see, and especially what you expect to see.

Re: Dump registry

Posted: Wed Apr 15, 2009 8:44 am
by Troy Martin
What the hell does the registry have to do with OS development? There's no Windows in kernel-land.

--Troy

Re: Dump registry

Posted: Wed Apr 15, 2009 8:52 am
by spiner900
I'm not under Window, I wrote a osLoader ..

Re: Dump registry

Posted: Wed Apr 15, 2009 9:37 am
by Creature
Troy Martin wrote:What the hell does the registry have to do with OS development? There's no Windows in kernel-land.

--Troy
I think he means register as in an Assembly register or something.

Re: Dump registry

Posted: Wed Apr 15, 2009 10:12 am
by salil_bhagurkar
I guess you mean CPU registers like ax, bx, cx etc.
If it is C that you are using, then the compiler does not use some registers (depending on the optimization). So the value they contain depends on the code that ran before your os booted. You could try initializing all the registers to a known value at the start of your os code in assembly. That should solve your problem.
Also, if your os uses some kind of architecture (processor, bios) detection code, then the code execution paths and states will be dependent on the different architectures on which the code runs.