document updated 14 years ago, on Mar 31, 2012
How does the first stage of LILO locate the second stage?
First stage
===========
It's located in the 446 bytes of the MBR.
Second stage
============
It's located in a file usually named /boot/boot.b.
How does the first stage find the second stage?
===============================================
The physical disk location of "boot.b" is stored in an embedded variable within the first stage.
There's something about a "map file" that is included in the MBR too... I don't understand this part.
Source code
===========
- first.S is stage 1, and second.S is stage 2
- first.S has these embedded variables:
raid: .long 0 ! raid sector offset
tstamp: .long 0 ! timestamp
map_serial_no: .long 0 ! volume S/N containing map file
prompt: .word 0 ! indicates whether to always enter prompt
! contains many other flags, too
d_dev: .byte 0x80 ! map file device code
d_flag: .byte 0 ! disk addressing flags
d_addr: .long 0 ! disk addr of second stage index sector
References
==========
http://giraffe-data.com/~bryanh/giraffehome/d/note/lilo
http://snow.nl/dist/xhtmlc/ch14s03.html
http://linux-sxs.org/administration/liloexpl2.html