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%