From fceec7b5bbbf745b9e9559d2b8dcc571cbe5db7a Mon Sep 17 00:00:00 2001 From: acevest Date: Sat, 11 May 2024 19:07:24 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8Ddisk=5Frequest=5Ft.bb=E5=AD=97?= =?utf8?q?=E6=AE=B5=E6=9C=AA=E5=88=9D=E5=A7=8B=E5=8C=96=E7=9A=84=E9=97=AE?= =?utf8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- drivers/ata.c | 2 +- kernel/semaphore.c | 1 + kernel/task_root.c | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/ata.c b/drivers/ata.c index 8feb182..a751cd9 100644 --- a/drivers/ata.c +++ b/drivers/ata.c @@ -226,7 +226,7 @@ void tmp_ide_disk_read(dev_t dev, uint32_t sect_nr, uint32_t count, char *buf) { // mbr_ext_offset: 在MBR中的扩展分区记录里的偏移地址 // lba_partition_table: 扩展分区的真实偏移地址 void read_partition_table(ide_drive_t *drv, uint32_t mbr_ext_offset, uint32_t lba_partition_table, int depth) { - disk_request_t r; + // disk_request_t r; char *sect = kmalloc(SECT_SIZE, 0); #if 1 diff --git a/kernel/semaphore.c b/kernel/semaphore.c index 6000451..19b08b5 100644 --- a/kernel/semaphore.c +++ b/kernel/semaphore.c @@ -58,6 +58,7 @@ volatile void up(semaphore_t *s) { s->cnt++; } else { semaphore_waiter_t *waiter = list_first_entry(&s->wait_list, semaphore_waiter_t, list); + assert(waiter != 0); list_del(&waiter->list); task_t *task = waiter->task; diff --git a/kernel/task_root.c b/kernel/task_root.c index 528f3a9..c7eeead 100644 --- a/kernel/task_root.c +++ b/kernel/task_root.c @@ -112,6 +112,8 @@ void taskA_entry() { r.pos = sect_nr; r.count = 1; r.buf = disk_buf1; + r.bb = 0; + send_disk_request(&r); // verify_hd_data(sect_nr, disk_buf1, current->name); @@ -135,8 +137,10 @@ void taskB_entry() { r.pos = sect_nr; r.count = 1; r.buf = disk_buf2; + r.bb = 0; + send_disk_request(&r); - // verify_hd_data(sect_nr, disk_buf2, current->name); + // verify_hd_data(sect_nr, disk_buf2, current->name); for (int i = 0; i < 1; i++) { asm("hlt;"); -- 2.44.0