rookie1010

Senior member
Mar 7, 2004
984
0
0
Hello

can you guys tell me what is the first instruction that is executed by a desktop,

i guess that the program counter of the processor points to 0x0, what instructio nwould be present at 0x0 in the memory bank?
 

rookie1010

Senior member
Mar 7, 2004
984
0
0
yes, the very first thing the box does when it is first powered on

i think it is something to do with setting up the interrupt handlers

you know what instruction resides at 0x0?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
AFAIK nothing resides at 0x0, the BIOS CPU starts by executing the instruction at a hardwired address, usually FFFF:0000h, and that jmps into the BIOS code.
 

jlbenedict

Banned
Jul 10, 2005
3,724
0
0
Boot sequence on standard PC (IBM-PC compatible)

Upon starting, a personal computer's x86 CPU runs the instruction located at the memory location F000:FF00 (on 286s and 386SXs, the base of the code segment is actually 0xFF0000 and on 386s it is 0xFFFF0000) of the BIOS. This memory location is close to the end of system memory. It contains a jump instruction that transfers execution to the location of the BIOS start-up program. This program runs a Power-On Self Test (POST) to check that devices the computer will rely on are functioning; it also initializes these devices. Then, the BIOS goes through a preconfigured list of devices until it finds one that is bootable. If it finds no such device, an error is given and the boot process stops. If the BIOS finds a bootable device, it loads and executes its boot sector. In the case of a hard drive, this is referred to as the master boot record (MBR) and is often not operating system specific. Usually, the MBR code checks the partition table for an active partition. If one is found, the MBR code loads that partition's boot sector and executes it. The boot sector is often operating system specific, however in most operating systems its main function is to load and execute a kernel, which continues startup. If there is no active partition or the active partition's boot sector is invalid, the MBR may load a secondary boot loader and pass control to it and this secondary boot loader will select a partition (often via user input) and load its boot sector, which usually loads the corresponding operating system Kernel.

 

Smilin

Diamond Member
Mar 4, 2002
7,357
0
0
Originally posted by: rookie1010
thanks for the replies

i read some place that the reset vector resides at 0x0

This is from a very dusty section of my memory but yes I think you might have interrupt vectors stored in the pre 0x100 memory space for MS/PC-DOS.

Doesn't apply to Windows, Linux or other modern OSs.