📄 lilo.h
字号:
#define STAGE_FLAG_MENU 0x0200 /* boot loader supports menu interface */#define STAGE_FLAG_BMP4 0x0400 /* boot loader supports 640x480x4 bitmaps */#define SETUPSECS 4 /* nr of setup sectors */#define VSS_NUM 497 /* address where variable setup size is stored */#define VGA_SET 506 /* address of initial kernel VGA mode */#define MAX_SETUPSECS 31 /* maximum number of sectors in kernel setup code (+ bootsect) */#define MAX_KERNEL_SECS 1024 /* absolute maximum kernel size */#define SPECIAL_SECTORS 2 /* special sectors (don't compact) at beginning of map sections */#define SPECIAL_BOOTSECT 1 /* INITSEG bootsect.S bootloader at beginning of all kernels, ahead of SETUPSECS */#define LINEAR_FLAG 0x40 /* mark linear address */#define LBA32_FLAG 0x20 /* mark lba 32-bit address */#define LBA32_NOCOUNT 0x40 /* mark address with count absent */#define RAID_REL_FLAG 0x10 /* mark address raid-relocatable *//* * FLAG Description * * 0x00 pure geometric addressing (C:H:S) * 0x40 Linear address (24-bits) converted to CHS at boot-time * 0x60 LBA32 address (32-bits), count=1, sets the high nibble!! * 0x20 LBA32 address (24-bits) + (8-bit) high nibble (implied) **/#define DEV_MASK_EXP 0x80+MAX_BIOS_DEVICES-1#define DEV_MASK (DEV_MASK_EXP)#define EX_OFF SETUP_STACKSIZE-8+SSDIFF /* external parameter block */#define EX_DL_MAG 0xfe /* magic number in DL */#define EX_MAG_L 0x494c /* magic number at ES:SI, "LI" */#define EX_MAG_H 0x4f4c /* magic number at ES:SI+2, "LO" */#define EX_MAG_HL 0x4f4c494c /* "LILO" */#define EX_MAG_STRING "LILO" /* magic signature string as as string */#define BIOS_MAX_DEVS 2 /* BIOS devices (2 fd, 2 hd) */#define BIOS_MAX_HEADS 256 /* 8 bits head number; really 255 */ /* but must account for oddball BIOS's that allow 256 */#define BIOS_MAX_CYLS 1024 /* 10 bits cylinder number */#define BIOS_MAX_SECS 63 /* 6 bits sector number (no, it's not 64) *//* these are the boot record flags in the "prompt" variable */#define FLAG_PROMPT 1 /* always issue boot: prompt */#define FLAG_RAID 2 /* one boot record of many */#define FLAG_RAID_DEFEAT 4 /* defeat finding this RAID boot record */#if 0#define FLAG_RAID_NOWRITE 8 /* defeat RAID writeback of command line */#endif#define FLAG_NOBD 16 /* defeat BIOS data collection at boot time */#define FLAG_LARGEMEM 32 /* BIOS has MoveExtMemBlk support for 386 */#define FLAG_MAP_ON_BOOT 64 /* map file is on the boot device */#define FLAG_BD_OKAY 128 /* BIOS data collection known to work */#ifdef FLAG_RAID_NOWRITE#define FLAG_SAVE (~(FLAG_RAID|FLAG_RAID_DEFEAT|FLAG_RAID_NOWRITE)) /* All but raid flags */#else#define FLAG_SAVE (~(FLAG_RAID|FLAG_RAID_DEFEAT)) /* All but raid flags */#endif/* these are the second-stage specific flags */#define FLAG2_EL_TORITO 2 /* El Torito format bootable CD */#define FLAG2_UNATTENDED 4 /* Unattended booting option *//* these are the descriptor flags */#define FLAG_VGA 1 /* override VGA mode */#define FLAG_RESTR 2 /* restrict additional parameters */#define FLAG_LOCK 4 /* lock on target */#define FLAG_MODKRN 8 /* modern kernel with high memory support */#define FLAG_KERNEL 16 /* image is a kernel */#define FLAG_TOOBIG 32 /* initrd so big, kernel may overwrite */#define FLAG_FALLBACK 64 /* fallback command line exists */#define FLAG_PASSWORD 128 /* this image requires a password */#define FLAG_LOADHI 256 /* this kernel loads high (>=1Mb) */#ifdef LCF_VIRTUAL#define FLAG_VMDISABLE 512 /* unable to boot if virtual */#define FLAG_VMWARN 1024 /* warn on virtual boot */#define FLAG_VMDEFAULT 2048 /* this is the default vitual load */#endif#define FLAG_SINGLE 4096 /* single key activation */#define FLAG_RETAIN 0x2000 /* retain BMP screen on boot */#define VGA_NOCOVR 0x8000 /* VGA setting not overridden on command line */#define SER_DFL_PRM 0xa3 /* default serial parameters: 2400n8 */#define DC_MAGIC 0xf4f2 /* magic number of default cmd. line sector */#define DC_MGOFF 0x6b6d /* magic number for disabled line */#define MAX_MESSAGE 65535 /* maximum message length */#define MAX_MENU_TITLE 37 /* maximum MENU title length */#define NEW_HDR_SIG "HdrS" /* setup header signature */#define NEW_HDR_VERSION 0x200 /* header version number */#define NEW2_HDR_VERSION 0x202 /* new cmdline protocol */#define NEW3_HDR_VERSION 0X203 /* defines CL_RAMDISK_MAX */#define LOADER_VERSION 0x02 /* loader version, for SETUP_HDR.loader */#define LFLAG_HIGH 1 /* SETUP_HDR.flags */#define LFLAG_USE_HEAP 0x80#define PRTMAP_SIZE 32 /* number of partition type mappings */#define DRVMAP_SIZE 24 /* number of drive mappings */#define CRC_POLY1 0x04c11db7#define CRC_POLY2 0x23a55379#define CRC_POLY3 0x049f21c7#define CRC_POLY4 0x1c632927#define CRC_POLY5 0xA3139383#define PROBE_SIGNATURE "LiLo" /* signature placed in low memory */#define PROBESEG 0x60 /* must be in first 4k page in memory */#define EDD_LTH 30 /* length of the EDD return structure (max) */#define EDD_PACKET 01 /* packet calls are supported */#define EDD_LOCK 02 /* removable media may be locked */#define EDD_SUBSET 04 /* EDD call supported */#ifdef LILO_ASMBOOTSEG = 0x07C0 ! original address of boot-sectorPARTS_LOAD= 0x0600 ! partition sector load addressPARTS_SCR = 0x0800 ! ditto, for non-boot partitionsPART_TABLE= 0x07BE ! partition tableINITSEG = DEF_INITSEG ! we move boot here - out of the waySETUPSEG = DEF_SETUPSEG ! setup starts hereSYSSEG = DEF_SYSSEG ! system loaded at 0x10000 (65536).MAX_DESCR_SECS_asm = MAX_DESCR_SECS ! **MAX_DESCR_SECTORS_asm = MAX_DESCR_SECTORS ! **MAX_IMAGE_NAME_asm = MAX_IMAGE_NAME ! **MAX_PW_CRC_asm = MAX_PW_CRC ! **SECTOR_SIZE_asm = SECTOR_SIZE ! **MAX_MENU_TITLE_asm = MAX_MENU_TITLE ! **MAX_BIOS_DEVICES_asm = MAX_BIOS_DEVICES ! **MAX_RAID_DEVICES_asm = MAX_RAID_DEVICES ! **DEV_MASK_asm = DEV_MASK_EXP ! **STACKSEG = 0x9000 ! MUST == INITSEG for kernel 2.0.36 (and others?)SETUP_STACKSIZE = 2048 ! stacksize for kernel setup.S#else#define BOOTSEG 0x07c0 /* for probe.c */#endif#define FIRSTSEG BOOTSEG#ifdef LILO_ASMSTACK = 2048 ! amount of stack space to reserveSSDIFF = 0BOOTSECT = 0x200 ! kernel bootsect.S#define SETUP_STACK_DYN PARMLINE#define SLA_SIZE_DYN SETUP_STACK_DYN-SETUP_STACKSIZE-BOOTSECTKBBEG = 0x41A ! beginning of keyboard bufferKBEND = 0x41C ! end of keyboard bufferKBLOW = 0x1eKBHIGH = 0x3e!! Memory layout!! 0x007BE-0x007FD 64 B partition table! 0x07C00-0x07DFF 0.5 kB HD/FD boot load address! 0x10000-0x8FFFF 512.0 kB kernel (zImage)! 0x90000-0x901FF 0.5 kB kernel floppy boot sector (bootsect.S)! 0x90200-0x967FF 25.5 kB kernel setup code (setup.S) and heap! 0x96800-0x969FF 0.5 kB LILO stack! 0x96A00-0x96BFF 0.5 kB LILO first stage loader! 0x96C00-0x985FF 6.5 kB LILO second stage loader! 0x98600-0x987FF 0.5 kB file map load area! 0x98800-0x98BFF 1 kB descriptor table load area! 0x98C00-0x98DFF 0.5 kB default command line load area! 0x98E00-0x98FFF 0.5 kB keyboard translation table load area! 0x99000-0x991FF 0.5 kB parameter line construction area! 0x99200-0x9FFFF 27.5 kB Extended BIOS Data Area! when LILO has loaded the kernel, and control is transfered to! the kernel setup.S code at 0x9020:0000!! 0x007BE-0x007FD 64 B partition table! 0x07C00-0x07DFF 0.5 kB HD/FD boot load address! 0x10000-0x8FFFF 512.0 kB kernel (zImage)! 0x90000-0x901FF 0.5 kB kernel floppy boot sector (bootsect.S)! 0x90200-0x967FF 25.5 kB kernel setup code (setup.S) and heap! 0x96800-0x987FF 8.0 kB additional heap space! 0x98800-0x98FFF 2.0 kB stack created for (setup.S)! 0x99000-0x991FF 0.5 kB parameter line for kernel! 0x99200-0x9FFFF 27.5 kB Extended BIOS Data AreaCL_MAGIC_ADDR = 0x20 ! command line magic numberCL_MAGIC = 0xa33f ! very unusual command sequenceCL_OFFSET = 0x22 ! command line offsetCL_LENGTH = COMMAND_LINE_SIZE ! maximum length = 256-1! 0x90020-0x90021 2 by command line magic number! 0x90022-0x90023 2 by command line offsetCL_HEADER_ID = 0x202 ! "HdrS"CL_HDRS_VERSION = 0x206 ! 0x0201=old; 0x0202=newNEW_VERSION = NEW2_HDR_VERSION ! 0x0202 for new cmdline protocolCL_POINTER = 0x228 ! new pointer is dword addressCL_RAMDISK_MAX = CL_POINTER+4 ! ramdisk_max; header version 0x0203#endif/* Bug fix needed for some S-ATA controllers with the Silicon Image 3112 or 3114 chipsets. Early versions of the SI BIOS do not properly update the low memory size in the BIOS Data Area at 40h:13h when they allocate space in the Extended BIOS Data Area (EBDA).*/#ifdef LCF_BUG_SI_EBDA# define EBDA_EXTRA LCF_BUG_SI_EBDA#else# define EBDA_EXTRA 0#endif/* the following configuration variable are now required don't compile without them ... */#ifndef LCF_UNIFY# define LCF_UNIFY#endif#ifndef LCF_BUILTIN# define LCF_BUILTIN#endif#ifndef LCF_FIRST6# define LCF_FIRST6#endif#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -