flat assembler
Message board for the users of flat assembler.

Index > OS Construction > how a bootloader works?

Author
Thread Post new topic Reply to topic
solar



Joined: 20 Jul 2003
Posts: 2
solar
i have read a few bootloaders' source code. all the bootloaders seem to handle different devices with exactly the same codes. that is, the same codes handle booting from floppy, hard disk and cd rom. for example,grub uses the same stage1 and stage2 binary code to boot from hard disk and floppy. and i found there's no difference in source code to handle diffenent boot media. how can this work?
Post 21 Oct 2003, 07:06
View user's profile Send private message Reply with quote
eet_1024



Joined: 22 Jul 2003
Posts: 59
eet_1024
They all use BIOS interrupts.

Harddrive controllers actually add code to int 13H via chaining the interrupt.
Bootable USB devices must have BIOS support. Since the USB standard provide for generic classes, BIOS support usually will handle any USB bootable device (like HD's, Floppys, etc). Thats also why keyboards and mice work in the BIOS setup without the need for an OS to run. You may need to enable 'Legacy USB' support.

That covers the hardware.

The bootloader must know where to load the OS from. This can either be a known sector, or it must know where to find this information.

On HD's, the MBR contains a generic bootload that loads an OS specific bootload from the first active partition.

Linux installs it's own MBR with LILO, which can provide a menu for choosing which OS to load. Recent versions of LILO also let the OS loader be located past cylinder #1024.
Post 30 Oct 2003, 22:26
View user's profile Send private message Reply with quote
Sivadas



Joined: 15 May 2007
Posts: 1
Sivadas
To get a detailed information about a boot loaders working please visit the site below

http://www.os-forum.com/minix/boot/index.php

This will give a generic idea and code(not in FASM). Very Happy
Post 15 May 2007, 11:20
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.