正在加载图片...
Linux Kernel Internals 6.The BIOS Bootstrap Loader function is invoked via int Ox19 with %dl containing the boot device 'drive number'.This loads track 0,sector I at physical address Ox7C00(0x07C0:0000). 1.4 Booting:bootsector and setup The bootsector used to boot Linux kernel could be either: .Linux bootsector,arch/i386/boot/bootsectS ·LLO(or other boo tloader's)bootsector .No bootsector(loadlin etc) Lin detal The first few used for segment values =0x07c0 33 SYSSEG 34 SYSSIZE system size:f of l6-byte define DEF SETUPSEG 0×9020 tdefine DEF_SYSSIZE 0x7E00 Now.let us consider the actual code of bootsectS: movw B00TSB6,a× 657686960 movw SINITSEG,ax 256, 1.4 Booting:bootsector and setup 6. The BIOS Bootstrap Loader function is invoked via int 0x19 with %dl containing the boot device 'drive number'. This loads track 0, sector 1 at physical address 0x7C00 (0x07C0:0000). 1.4 Booting: bootsector and setup The bootsector used to boot Linux kernel could be either: • Linux bootsector, arch/i386/boot/bootsect.S • LILO (or other bootloader's) bootsector • No bootsector (loadlin etc) We consider here the Linux bootsector in detail. The first few lines initialize the convenience macros to be used for segment values: 29 SETUPSECS = 4 /* default nr of setup−sectors */ 30 BOOTSEG = 0x07C0 /* original address of boot−sector */ 31 INITSEG = DEF_INITSEG /* we move boot here − out of the way */ 32 SETUPSEG = DEF_SETUPSEG /* setup starts here */ 33 SYSSEG = DEF_SYSSEG /* system loaded at 0x10000 (65536) */ 34 SYSSIZE = DEF_SYSSIZE /* system size: # of 16−byte clicks */ (the numbers on the left are the line numbers of bootsect.S file) The values of DEF_INITSEG, DEF_SETUPSEG, DEF_SYSSEG, DEF_SYSSIZE are taken from include/asm/boot.h: /* Don't touch these, unless you really know what you're doing. */ #define DEF_INITSEG 0x9000 #define DEF_SYSSEG 0x1000 #define DEF_SETUPSEG 0x9020 #define DEF_SYSSIZE 0x7F00 Now, let us consider the actual code of bootsect.S: 54 movw $BOOTSEG, %ax 55 movw %ax, %ds 56 movw $INITSEG, %ax 57 movw %ax, %es 58 movw $256, %cx 59 subw %si, %si 60 subw %di, %di Linux Kernel Internals 1.4 Booting: bootsector and setup 4
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有