All of lore.kernel.org
 help / color / mirror / Atom feed
* Interview question
@ 2011-07-11  8:00 Bond
  0 siblings, 0 replies; only message in thread
From: Bond @ 2011-07-11  8:00 UTC (permalink / raw)
  To: kernelnewbies

On Tue, Jul 5, 2011 at 9:33 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
> On Tue, Jul 5, 2011 at 9:43 AM, Mandeep Sandhu
> <mandeepsandhu.chd@gmail.com> wrote:
>>> Let me simplify the question.
>>
>> I'll attempt to answer your questions...for my own edification! :)
>>
>>>
>>> 1) What are the FIVE classic system calls for interfacing with a
>>> character device. ?(ie. If it did not exist in 1970, don't list it).
>>
>> open/close/read/write/seek?...and the infamous ioctl.
>
> You listed 6. ?Historically character devices don't seek. ?So drop
> that one to get to 5.
>
> (And yes, you can find char devices that implement seek, but ioctl is
> far more common. ?And when I learned UNIX 30 years ago, it was just
> the basic 5 I'm pretty sure that actually have matching driver code..)
>
> That is, drivers don't implement seek. ?seek() just sets a offset
> variable tracked in the kernel. ?The driver is not even woken up when
> the happens.
>
> That is if userspace did:
>
> open()
> seek(1)
> seek(2)
> seek(3)
> write()
>
> The driver would get invoked for open, and again for write.

The thing which he wanted to go in depth was why and how will the
drivers open() ,write() get invoked.
I tried my attempt that depending upon vendor and device id
register_chrdev will have registered etc.

My guess is he probably wanted to know the system call routine that
will get executed with these open and close
in kernel space. i.e. for example __NR_open() ,__NR_read() and the
system call numbers that would get involved in this process.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-11  8:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-11  8:00 Interview question Bond

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.