<p>I'm working on a boot loader on an x86 machine.</p>

<p>When the BIOS copies the contents of the MBR to 0x7c00 and jumps to that address, is there a standard meaning to the contents of the registers? Do the registers have standard values?</p>

<p>I know that the segment registers are typically set to 0, but will sometimes be 0x7c0. What about the other hardware registers?</p>

[{'answer_id': 20343, 'author': 'BCS', 'author_id': 1343, 'author_profile': 'https://Stackoverflow.com/users/1343', 'pm_score': 1, 'selected': False, 'text': '<p>Best option would be to assume nothing. If they have meaning, you will find that from the other side when you need the information they provide.</p>\n'}, {'answer_id': 20344, 'author': 'wvdschel', 'author_id': 2018, 'author_profile': 'https://Stackoverflow.com/users/2018', 'pm_score': 1, 'selected': False, 'text': '<p>Undefined, I believe? I think it depends on the mainboard and CPU, and should be treated as random for your own good.</p>\n'}, {'answer_id': 20368, 'author': 'sparkes', 'author_id': 269, 'author_profile': 'https://Stackoverflow.com/users/269', 'pm_score': 4, 'selected': True, 'text': '<blockquote>\n  <p>This early execution environment is highly implementation defined, meaning the implementation of your particular BIOS. Never make any assumptions on the contents of registers. They might be initialized to 0, but they might contain a random value just as well. </p>\n</blockquote>\n\n<p>from the <a href="http://wiki.osdev.org/Boot_sequence" rel="nofollow noreferrer">OS dev Wiki</a>, which is where I get information when I\'m playing with my toy OS\'s</p>\n'}, {'answer_id': 20379, 'author': 'Mat Noguchi', 'author_id': 1799, 'author_profile': 'https://Stackoverflow.com/users/1799', 'pm_score': 1, 'selected': False, 'text': '<p>You can always initialize them yourself to start with a known state.</p>\n'}, {'answer_id': 20399, 'author': 'Bernard', 'author_id': 61, 'author_profile': 'https://Stackoverflow.com/users/61', 'pm_score': 1, 'selected': False, 'text': '<p>Safest bet is to assume undefined. </p>\n'}, {'answer_id': 20619, 'author': 'Nathan Fellman', 'author_id': 1084, 'author_profile': 'https://Stackoverflow.com/users/1084', 'pm_score': 1, 'selected': False, 'text': '<p>The only thing that I know to be well defined is the processor state immediately after reset.</p>\n\n<p>For the record you can find <em>that</em> in <a href="http://www.intel.com/products/processor/manuals/" rel="nofollow noreferrer">Intel\'s Software Developer\'s Manual</a> Vol 3 chapter 8: "PROCESSOR MANAGEMENT AND INITIALIZATION" in the table titled " IA-32 Processor States Following Power-up, Reset, or INIT"</p>\n'}, {'answer_id': 20635, 'author': 'engtech', 'author_id': 175, 'author_profile': 'https://Stackoverflow.com/users/175', 'pm_score': 1, 'selected': False, 'text': "<p>Always assume undefined, otherwise you'll hit bad problems if you ever try to port architectures.</p>\n\n<p>There is nothing quite like the pain of porting code that assumes everything uninitialized will be set to zero.</p>\n"}]
['https://Stackoverflow.com/questions/20336', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2171/']