예제 #1
0
파일: hd.c 프로젝트: jameszhan/foundation
static void write_intr(void)
{
	if (win_result()) {
		bad_rw_intr();
		return;
	}
	if (--CURRENT->nr_sectors) {
		CURRENT->sector++;
		CURRENT->buffer += 512;
		port_write(HD_DATA,CURRENT->buffer,256);
		return;
	}
	end_request(1);
	do_hd_request();
}
예제 #2
0
파일: hd.c 프로젝트: jameszhan/foundation
static void read_intr(void)
{
	if (win_result()) {
		bad_rw_intr();
		return;
	}
	port_read(HD_DATA,CURRENT->buffer,256);
	CURRENT->errors = 0;
	CURRENT->buffer += 512;
	CURRENT->sector++;
	if (--CURRENT->nr_sectors)
		return;
	end_request(1);
	do_hd_request();
}
예제 #3
0
파일: hd.c 프로젝트: trbhoang/Vinix
static void write_intr(void)
{
    if (win_result()) {
	bad_rw_intr();
	return;
    }
    if (--this_request->nsector) {
	port_write(HD_DATA, this_request->bh->b_data + 512, 256);
	return;
    }
    this_request->bh->b_uptodate = 1;
    this_request->bh->b_dirt = 0;
    wake_up(&wait_for_request);
    unlock_buffer(this_request->bh);
    this_request->hd = -1;
    this_request = this_request->next;
    do_request();
}
예제 #4
0
파일: hd.c 프로젝트: s894330/linux-0.11-lab
static void write_intr(void)
{
    if (win_result()) {
        bad_rw_intr();
        do_hd_request();
        return;
    }

    if (--CURRENT_REQ->nr_sectors) {
        CURRENT_REQ->start_sector++;
        CURRENT_REQ->buffer += 512;
        do_hd = &write_intr;
        port_write(HD_DATA, CURRENT_REQ->buffer, 256);
        return;
    }

    end_request(1);	    /* this time request done */
    do_hd_request();    /* do other hd request */
}
예제 #5
0
static void reset_hd(void)
{
	static int i;

repeat:
	if (reset) {
		reset = 0;
		i = -1;
		reset_controller();
	} else if (win_result()) {
		bad_rw_intr();
		if (reset)
			goto repeat;
	}
	i++;
	if (i < NR_HD) {
		hd_out(i,hd_info[i].sect,hd_info[i].sect,hd_info[i].head-1,
			hd_info[i].cyl,WIN_SPECIFY,&reset_hd);
	} else
		do_hd_request();
}
예제 #6
0
파일: hd.c 프로젝트: wanlizhi/lantern
/*
 * 这个函数由中断处理程序调用,用来命令hd controller把数据读取到指定内存
 */
static void read_intr(void)
{	
	if (win_result()) {
		printk("bad req"); while(1);
		do_hd_request();
		return;
	}
	
	
	port_read(HD_DATA,CURRENT->buffer,256);

	CURRENT->errors = 0;
	CURRENT->buffer += 512;
	CURRENT->sector++;
	

	
	if (--CURRENT->nr_sectors) {
		do_hd = &read_intr;
		return;
	}	
}
예제 #7
0
파일: hd.c 프로젝트: trbhoang/Vinix
static void read_intr(void)
{
    if (win_result()) {
	bad_rw_intr();
	return;
    }
    if (this_request->nsector == 2) {
	this_request->nsector--;
	port_read(HD_DATA, this_request->bh->b_data, 256);
    }
    else {
	port_read(HD_DATA, this_request->bh->b_data + 512, 256);
	return;
    }
    this_request->errors = 0;
    this_request->bh->b_uptodate = 1;
    this_request->bh->b_dirt = 0;
    wake_up(&wait_for_request);
    unlock_buffer(this_request->bh);
    this_request->hd = -1;
    this_request = this_request->next;
    do_request();
}
예제 #8
0
파일: hd.c 프로젝트: s894330/linux-0.11-lab
static void read_intr(void)
{
    /* check previous read command success or not */
    if (win_result()) {
        bad_rw_intr();
        do_hd_request();
        return;
    }

    /* read data from hard disk from data register */
    port_read(HD_DATA, CURRENT_REQ->buffer, 256);

    CURRENT_REQ->errors = 0;
    CURRENT_REQ->buffer += 512;
    CURRENT_REQ->start_sector++;

    if (--CURRENT_REQ->nr_sectors) {
        do_hd = &read_intr;
        return;
    }

    end_request(1);
    do_hd_request();
}
예제 #9
0
파일: hd.c 프로젝트: vignette2628/myos
void read_blk_test(void)
{
    char *abc = (char *)&aaaa[0];
    int i;
    struct partition *p;
    
    memset(abc, 0x23, 512);
    if( win_result()) {
            printk("over\n");
            return;
    }

    port_read(HD_DATA,abc,256);
    rmb();
    wmb();
    for(i=500;i<512;i++)
        printk("%x ", aaaa[i]);
    printk("\n");

    p = 0x1be + (void *)abc;
    for(i=1;i<5;i++, p++) {
        printk("i:%d, start_sect:%d, nr_sects:%d\n", i, p->start_sect, p->nr_sects);
    }
}
예제 #10
0
파일: hd.c 프로젝트: s894330/linux-0.11-lab
static void recal_intr(void)
{
    if (win_result())
        bad_rw_intr();
    do_hd_request();
}