summaryrefslogtreecommitdiff
path: root/syscall.c
diff options
context:
space:
mode:
authorkaashoek <kaashoek>2006-07-10 19:06:48 +0000
committerkaashoek <kaashoek>2006-07-10 19:06:48 +0000
commit7ea6c9d19747c84ede9b056475cd9046c89a4d33 (patch)
tree447e7a317e09f79b8ab89663822f37f81afd3052 /syscall.c
parent084f21430c152eeaeaf8534fab41eca91a5fe7a9 (diff)
downloadxv6-labs-7ea6c9d19747c84ede9b056475cd9046c89a4d33.tar.gz
xv6-labs-7ea6c9d19747c84ede9b056475cd9046c89a4d33.tar.bz2
xv6-labs-7ea6c9d19747c84ede9b056475cd9046c89a4d33.zip
queue with disk requests
Diffstat (limited to 'syscall.c')
-rw-r--r--syscall.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/syscall.c b/syscall.c
index c7627ea..787eb64 100644
--- a/syscall.c
+++ b/syscall.c
@@ -229,15 +229,16 @@ sys_block(void)
{
char buf[512];
int i, j;
+ void *c;
cprintf("%d: call sys_block\n", cpu());
for (i = 0; i < 100; i++) {
- if (ide_start_read(i, buf, 1)) {
+ if ((c = ide_start_read(i, buf, 1)) == 0) {
panic("couldn't start read\n");
}
cprintf("call sleep\n");
- sleep (&disk_channel);
- if (ide_read(i, buf, 1)) {
+ sleep (c);
+ if (ide_finish_read(c)) {
panic("couldn't do read\n");
}
cprintf("sector %d: ", i);