From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Fri, 1 Oct 2010 16:24:21 -0400 To: 9fans@9fans.net Message-ID: In-Reply-To: <10bf630b13fbac21955790c6827f1ab4@quintile.net> References: <10bf630b13fbac21955790c6827f1ab4@quintile.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] stupid kernel question Topicbox-Message-UUID: 5c0b1ebe-ead6-11e9-9d60-3106f5b1d025 On Fri Oct 1 15:25:16 EDT 2010, steve@quintile.net wrote: > how does kernel code call plan9 system calls, does it perform a > trap from kernel back into kernel space and make the request just > like a user process or is there a more direct, subtle route? the short answer is that it doesn't. but read/write/open/close/stat are done via channels, and often with Blocks. for example (hopefully without typos) c = namec("/sys/src/9/pc/mkfile", Aopen, OREAD, 0); /* can call error */ b = devtab[c->type]->bread(c, 64*1024, 0); /* b->wp points to data if successful BLEN(b) is the length */ - erik