0

I am currently reading xv6 kernel source ported to 32bit x86. My question is regarding blocking io syscall, i.e., bread. I am expecting some trap handler in xv6 that sets its own process state to SLEEPING and calls yield(). However, I don't see any code fragment in xv6 kernel source. Please advise me if I missed the code fragment in the existing xv6 kernel source, or whether this is what students suppose to implement as a course project or not.

4
  • Can you give a link to the exact version of the source you are working with? Commented Aug 27 at 20:00
  • 1
    Reading from disk is typically not blocking in the usual sense. So maybe you should look for another example. For the RISC-V version, you can see here what wait() does when no children have exited: it calls sleep(), which does just what you suggested: p->state = SLEEPING; sched();. Commented Aug 27 at 20:03
  • I download the xv6-pub 2006 32bit x86. I just tried "git clone git://github.com/mit-pdos/xv6-public.git", but the link seems no longer accessible. As you pointed out, I see the wait() system call does in x86 version of xv6. However, not the I/O. I will inspect RISC-V version as you suggested. Thank you! Commented Sep 1 at 16:14
  • I understand how wait() works. I still don't see any mechanism to make a process that initiates I/0 from RUNNING to SLEEPING in xv6 (github.com/mit-pdos/xv6-public). Commented Sep 2 at 13:52

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.