设为首页 友情链接
在线留言 发表文章
加入收藏 广告联系

刺猬首页

| 专案技术 | 网络技术 | 图形图象 | 网络编程 | 网页设计 | 操作系统 | 服务器 | 技术白皮书 | 在线实验室 | 刺猬论坛 |
  | 数据库 | 设计赏析 | 存储频道 | 网络安全 | 私服架设 |  Solaris | 网站评估 | PC维护技巧 | 下载中心 | 博 客 |
专题: | Linux | java | cisco | 防病毒 | 刀片 | SOA | iscsi | ASP.NET | SQL | Oracle |
您现在的位置: IT公社 IT community >> 操作系统 >> FreeBSD平台 >> 教程正文 用户登录 新用户注册
专 题 栏 目
最 新 热 门
最 新 推 荐
相 关 文 章
使用FreeBSD的原因
FreeBSD操作系统的引导
FreeBSD的boot0阶段介绍
FreeBSD操作系统的boot2…
FreeBSD系统内核对象
FreeBSD中的SYSINIT框架
调整FreeBSD的虚拟内存系…
FreeBSD 5.0硬盘安装指南
FreeBSD的Loader和内核初…
FreeBSD 5.0的强制访问控…
  FreeBSD启动扇区代码分析(ver5.2.1)         ★★★★★
FreeBSD启动扇区代码分析(ver5.2.1)
 

movw $crlf,%si # Leave some callw puts # space popw %si # Restore 打印“回车”和“换行”。 jmp *%bx # Invoke bootstrap 跳转到我们选择的引导扇区去执行。整个Boot Manager代码到此执行完毕。 # # Display routines # putkey: movb $'F',%al # Display callw putchr # 'F' movb $'1',%al # Prepare addb %dl,%al # digit jmp putstr.1 # Display the rest “putkey”函数在屏幕上打印“F1”、“F2”或“F3”等。如果dl为0则打印“F1”, 如果dl为1则打印“F2”,如果dl为3则打印“F3”。和调用“putstr”在屏幕上打印 es:si指向的以最高位置1为结束字符的字符串。 # # Display the option and note that it is a valid option. # That last point is a bit tricky.. # putx: #首先,把_MNUOPT(%bp)的第dx位(bit)置1,表示此菜单选项被显示。然后在 屏幕上打印空格和es:di指向的以最高位置1为结束字符的字符串。 btsw %dx,_MNUOPT(%bp) # Enable menu option movw $item,%si # Display callw putkey # key movw %di,%si # Display the rest puts: #调用“putstr”在屏幕上打印es:si指向的以最高位置1为结束字符的字符串。 callw putstr # Display string putn: #“putn”打印“回车/换行”后在屏幕上打印es:si指向的以最高位置1为结束字符的字符串。 movw $crlf,%si # To next line putstr: #“putstr”在屏幕上打印es:si指向的以最高位置1为结束字符的字符串。 lodsb # Get byte testb $0x80,%al # End of string? jnz putstr.2 # Yes putstr.1: callw putchr # Display char jmp putstr # Continue putstr.2: andb $~0x80,%al # Clear MSB putchr: pushw %bx # Save movw $0x7,%bx # Page:attribute movb $0xe,%ah # BIOS: Display int $0x10 # character popw %bx # Restore retw # To caller “putchr”在屏幕上显示“al”中的字符。 # One-sector disk I/O routine intx13: movb 0x1(%si),%dh # Load head movw 0x2(%si),%cx # Load cylinder:sector movb $0x1,%al # Sector count pushw %si # Save movw %sp,%di # Save testb $0x80,_FLAGS(%bp) # Use packet interface? jz intx13.1 # No pushl $0x0 # Set the pushl 0x8(%si) # LBA address pushw %es # Set the transfer pushw %bx # buffer address push $0x1 # Block count push $0x10 # Packet size movw %sp,%si # Packet pointer decw %ax # Verify off orb $0x40,%ah # Use disk packet intx13.1: int $0x13 # BIOS: Disk I/O movw %di,%sp # Restore popw %si # Restore retw # To caller # Menu strings item: .ascii " "; .byte ' '|0x80 prompt: .ascii "\nDefault:"; .byte ' '|0x80 crlf: .ascii "\r"; .byte '\n'|0x80 # Partition type tables tables: # # These entries identify invalid or NON BOOT types and partitions. # .byte 0x0, 0x5, 0xf # # These values indicate bootable types we know the names of # .byte 0x1, 0x4, 0x6, 0xb, 0xc, 0xe, 0x83 .byte 0x9f, 0xa5, 0xa6, 0xa9 # # These are offsets that match the known names above and point to the strings # that will be printed. # .byte os_misc-. # Unknown .byte os_dos-. # DOS .byte os_dos-. # DOS .byte os_dos-. # DOS .byte os_dos-. # Windows .byte os_dos-. # Windows .byte os_dos-. # Windows .byte os_linux-. # Linux .byte os_bsd-. # BSD/OS .byte os_freebsd-. # FreeBSD .byte o (完)

上一页  [1] [2] [3] 

频道声明:本频道的文章除部分特别声明禁止转载的专稿外,可以自由转载.但请务必注明出出处和原始作者 文章版权归本频道与文章作者所有.对于被频道转载文章的个人和网站,我们表示深深的谢意。

原始作者:佚名 录入时间:2006-10-10
信息来源:不详 投稿信箱:itqoo@126.com
教程录入:admin    责任编辑:admin 
  • 上一个教程:

  • 下一个教程:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    - 关于我们 - 合作伙伴 - 友情链接 - 广告刊登 - 投稿热线 - 在线留言版权声明联系方式 -
    IT公社版权所有 粤ICP备05127012号
    Copyrigh@2005-2006 itqoo.com.Inc All Rights Reserved  推荐分辨率 1024*768
    联系站长:E-Mail:itqoo@126.com     MSN:urchincc@hotmail.com    QQ:点击这里给我发消息
    特别感谢:亿太网络提供空间支持