Linux 內核源代碼
Linux 內核源代碼
實模式setup階段
setup用于體系結構相關的硬件初始化工作,在arch目錄中的各個系統結構的平臺相關都有類似功能的代碼。在32位的x86平臺中,setup的入口點是arch/x86/boot/header.S中的_start。
代碼片段 4.1. 節自arch/x86/boot/header.S
1 .code16 2 section ".bstext", "ax" 3 4 .global bootsect_start 5 bootsect_start: 6 7 # Normalize the start address 8 ljmp $BOOTSEG, $start2 9 10 start2: 11 movw %cs, %ax 12 movw %ax, %ds 13 movw %ax, %es 14 movw %ax, %ss 15 xorw %sp, %sp 16 sti 17 cld 18 19 movw $bugger_off_msg, %si 20 21 msg_loop: 22 lodsb 23 andb %al, %al 24 jz bs_die 25 movb $0xe, %ah 26 movw $7, %bx 27 int $0x10 28 jmp msg_loop 29 ....... 30 .section ".bsdata", "a" 31 bugger_off_msg: 32 .ascii "Direct booting from floppy is no longer supported\r\n" 33 .ascii "Please use a boot loader program instead.\r\n" 34 .ascii "\n" 35 .ascii "Remove disk and press any key to reboot . . .\r\n"
非常好我支持^.^
(0) 0%
不好我反對
(0) 0%