operation sequence of ioctl's

"Anton Wöllert" MethoD.EaglE at gmx.net
Sun Jan 23 04:26:54 PST 2005


Hello,

my question is how a ioctl is called when i use int ioctl(fd ....) from
userland. i think first, a trap is generated through the handler in
exeption.S, that calls the routine for system-calls, and that calls via the
syscall-vector-table the function sys_ioctl (? i think). by the way, where
is this vector-table initialized? sys_ioctl handles then the copying of args
etc. and calls then some kind of fd->some_what->ioctl(foo, bar, bla). so i
think the function which is called, depends of the filedescriptor that is
passed via ioctl. so am i right with the assumption that for example the
kbd-driver adds via what? the /dev/kdb file-descriptor and if i want to
control something from the keyboard, i have to do ioctl(open("/dev/kbd"),
TURN_LED_ON, 0) (just as an meta-code example). but what is with the stdin,
stdout and stderr file-descriptors. what type do they have and where are
they initialized? so and last question, where is the function|macro
VOP_IOCTL defined?

thanks in advance

-- 
Sparen beginnt mit GMX DSL: http://www.gmx.net/de/go/dsl


More information about the freebsd-hackers mailing list