• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Whats the most basic file a computer can execute?

I've always wondered how computers initially boot off a CD, HD or Diskette. Is there some sort of absolutely basic executable file that a compuer BIOS recognizes and can run?
 
Yeah, the MBR (master boot record) on x86 systems is located at a fixed location and has a maximum size. The BIOS knows this and accesses the MBR which will contains a boot loader that will boot the OS.
 
Ok. Here is how a system boots.
1. power supply powers up. The voltages aren't necessarily good, so the "power good" line on the ATX connector is not set. The motherboard keeps the CPU in the "reset" state... it doesn't execute instructions yet.
2. the power supply voltages stabilize (happens quickly), power good is set to "good". motherboard releases CPU from reset state
3. CPU jumps to location FFFF:FFF0, which the chipset has mapped to the last 16 bytes of the ROM BIOS. this is a jump instruction pointing to the rest of the code.
4. the CPU does a bunch of stuff to initialize ram, pci, agp, video, drives, etc (the main POST). all the instructions for this are located in the BIOS.
5. one of the last things the CPU does (still from the BIOS) is look at floppies, CDs, hard drives, (and network cards) for bootable device. lets say no floppy/cd. it finds the drive, and the CPU reads the MBR into memory and then jumps to that code.
6. at this point, the control is with the operating system.

all that ^^^ taken from here (the initial instruction location is different... i used the location "Peter" told me rather than what the site says... if you read that page, it says last 16 bytes, which is ffff:fff0, not ffff:0000, so they probably made a typo)
 


<< ... if you read that page, it says last 16 bytes, which is ffff:fff0, not ffff:0000, so they (probably made a typo) >>



No, FFFF:0000 is correct for 8086 addressing. This notation is able to designate more that 1 MB of memory. FFFF:FFF0 would be near the end of expanded memory, beyond the 1 MB boundary.

In this notation, the first part (FFFF) X 16 is added to the second part(0000) to get the sum (FFFF0), 16 short of the 1meg (20 bit) boundary.

In 32 bit address space, I assume it is mapped to FFFFFFF0. Notice, no colon. If it is a typo, it is the inclusion of the colon and is refering to a 32 bit address.
 
But what IS the bootloader? Is it sort of a straight binary file that the BIOS can execute, or what?

It's just a section machine code at a specific place so the BIOS can find it every time. A computer can't execute any file, the OS handles the opening of files, mapping them into memory and telling the CPU which part of memory to execute.
 
Ok, thanks for the explanations yall. It clarified things nicely.

I suppose I should have just guessed that the MBR just a piece of pure machine code. 🙂
 
Depends on the firmware in the BIOS and how extensive it is. Most Sun and Compaq Alpha boxes can boot off a network (usually RARP for IP, download kernel from tftp, boot the kernel then mount the root filesystem via NFS) but I don't think they can treat a SAN as if it was local.
 
On PCs all of the BIOS startup code is 16-bit. The OS has the responsibility of switching the x86 processor into 32-bit protected mode.
 
Folks, don't confuse the addressing notations. 386 and above start out after hardware reset at _linear_ address FFFF_FFF0.
Runtime BIOS reset vector lies at linear address 000F_FFF0, segment😱ffset notation F000:FFF0 or FFFF:0000 if you like that better.
regards, Peter
 
Back
Top