Dump registry

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
spiner900
Member
Member
Posts: 26
Joined: Mon Mar 09, 2009 10:47 am

Dump registry

Post 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 ?
User avatar
Combuster
Member
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: Dump registry

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Dump registry

Post by Troy Martin »

What the hell does the registry have to do with OS development? There's no Windows in kernel-land.

--Troy
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
spiner900
Member
Member
Posts: 26
Joined: Mon Mar 09, 2009 10:47 am

Re: Dump registry

Post by spiner900 »

I'm not under Window, I wrote a osLoader ..
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: Dump registry

Post 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.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
User avatar
salil_bhagurkar
Member
Member
Posts: 261
Joined: Mon Feb 19, 2007 10:40 am
Location: India

Re: Dump registry

Post 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.
Post Reply