您的位置:首页 > 运维架构 > Linux

linux-0.11调试教程,minix文件系统1.0上篇(01),硬盘基本参数hd_info

2013-01-16 19:22 681 查看
下面是在mount_root下断点。

地址0x191e4是hd_info[0]的结构地址,而0x90080是setup.s中设置的。



相关代码是:

for (drive=0 ; drive<2 ; drive++) {

        hd_info[drive].cyl = *(unsigned short *) BIOS;

        hd_info[drive].head = *(unsigned char *) (2+BIOS);

        hd_info[drive].wpcom = *(unsigned short *) (5+BIOS);

        hd_info[drive].ctl = *(unsigned char *) (8+BIOS);

        hd_info[drive].lzone = *(unsigned short *) (12+BIOS);

        hd_info[drive].sect = *(unsigned char *) (14+BIOS);

        BIOS += 16;

    }

和bochsrc-hd.bxrc文件中的内容是一致的。

ata0-master: type=disk, path="hdc-0.11.img", mode=flat, cylinders=121, heads=16, spt=63

hd_info结构定义:

struct hd_i_struct {

    int head,sect,cyl,wpcom,lzone,ctl;

    };

#ifdef HD_TYPE

struct hd_i_struct hd_info[] = { HD_TYPE };

#define NR_HD ((sizeof (hd_info))/(sizeof (struct hd_i_struct)))

#else

struct hd_i_struct hd_info[] = { {0,0,0,0,0,0},{0,0,0,0,0,0} };

static int NR_HD = 0;

#endif
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐