Reputation: 131
I have some knowledge of the boot-loader but I have to know how bios code jumps to boot-loader and when does it initialize the I/O devices and what are the functionality does the bios does?
And is bios responsible for selecting the boot sector and how will it select the boot sector?
And also please inform me how the reset vector will directly point to bios region?
Upvotes: 2
Views: 879
Reputation: 2503
I am having some knowledge on boot-loader but i have to know how bios code jumps to boot-loader
When booting from a hard disk, the BIOS reads the boot loader from the Master Boot Record off of the first sector of the hard disk and loads it into memory at 0000:7C00 (or possibly 07C0:0000 -- in real mode, these refer to the same address).
and when does it initialize the I/O devices and what are the functionality does the bios does ?
The Minimal Intel Architecture Boot Loader gives a concise outline of the basic functions that the BIOS performs as it initializes the system. The major bullet points in the recommended order of initialization are as follows:
Power-Up (Reset Vector) Handling
Mode Selection
Preparation for Memory Initialization
Memory Initialization
Post Memory Initialization
Miscellaneous Platform Enabling
Interrupt Enabling
Processor Interrupt Modes
Interrupt Vector Table (IVT)
Interrupt Descriptor Table (IDT)
Timers
Memory Caching Control
Processor Discovery and Initialization
I/O Devices
PCI Device Discovery
Booting a Legacy OS
Memory Map
Non-Volatile (NV) Storage
Note: The Memory Map and Non-Volatile Storage sections are listed in the outline after the Booting a Legacy OS section, but as stated in the document, and as you would expect, mapping system memory occurs before handing over to the boot loader and booting the OS. Additionally, some accesses to non-volatile memory will also occur during BIOS initialization. (For example, the BIOS may read settings stored in the CMOS to determine the primary boot device)
and is bios responsible for selecting the boot sector and how will it select the boot sector?
The BIOS locates the boot sector based on the type of the device.
In most circumstances (except for CDs/DVDs) the bootsector will be LBA 0 of the device (or equivalently, CHS 0,0,1) -- see the specs of the particular device to find out what addressing mode it uses. For CDs/DVDs, the bootsector is LBA 17.
For more information, see the quoted article on OSDev.
and also please inform me how the reset vector will directly point to bios region ?
The CPU is designed that way. Upon assertion of the reset signal, the CPU sets its registers, including the instruction pointer to known values. For example, on most x86 systems, this is FFFFFFF0h, and this address maps into the BIOS ROM. This answer provides a more thorough explanation.
Upvotes: 2