LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 894|回复: 3

一段代码,有些地方看不懂...

[复制链接]
发表于 2003-8-11 08:22:55 | 显示全部楼层 |阅读模式
以下是Linux2.4.18源代码中boot.S的一段代码,是检测每磁道扇区数的

movw        $disksizes, %si                # table of sizes to try
probe_loop:
        lodsb
        cbtw                                # extend to word
        movw        %ax, sectors
        cmpw        $disksizes+4, %si
        jae        got_sectors                # If all else fails, try 9

        xchgw        %cx, %ax                # %cx = track and sector
        xorw        %dx, %dx                # drive 0, head 0,标志位cf=0
        movw        $0x0200, %bx                # address = 512, in INITSEG (%es = %cs)
        movw        $0x0201, %ax        #ah=0x02,al=0x01,为什么只读一个扇区,应该读sectors个扇区才对
        int        $0x13
        jc        probe_loop                # 由于xor指令会令CF=0,该处总是不跳,怎么会这样?应该检测int 0x13是否正确返回决定跳转,可好像没有检测,怎样知道是否是正确的扇区数?

got_sectors:
。。。。
disksizes:        .byte 36, 18, 15, 9
发表于 2003-8-11 10:38:42 | 显示全部楼层

汇编?!昏,我只会看C

:(
发表于 2003-8-13 01:21:30 | 显示全部楼层
启动信息是只保存在一个扇区的

然后由这里进行跳转

以前看硬盘分区时看到的
现在记不太清楚了
建议上网找找看分区表资料
发表于 2003-8-17 23:51:55 | 显示全部楼层
movw
这是什么汇编啊。不认识。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表