Reading boot sector of PC under Linux

Frank Heckenbach frank at
Tue May 15 16:16:14 CEST 2001

Martin Liddle wrote:

> In article <200105151140.NAA09220 at>, Frank Heckenbach
> <frank at> writes
> >Martin Liddle wrote:
> >
> >> Does anybody have a code fragment to read the boot sector of a PC
> >> running Linux (Red Hat 6.2 if it matters)?
> >
> >Linux by itself does not use a boot sector. It can be loaded by
> >various boot loaders like LILO, grub or loadlin. While the latter
> >one is a Dos executable, the former two contain their own boot
> >sectors. You may want to look into their source code (C, of course)
> >to find out more.
> >
> I think my terminology may be faulty.  What I am after is the Master
> Boot Record (MBR) which I think will be present on a PC, almost
> irrespective of the operating system.  I have downloaded the source for
> grub but there is a lot to plough through.  I just hoped somebody had
> done it before.

Yep, on a Linux system, usually lilo or grub is stored in the MBR
(though they can also be stored elsewhere).


Frank Heckenbach, frank at,
GPC To-Do list, latest features, fixed bugs:

More information about the Gpc mailing list