printf doesn't work from kernel modules

Dmitry Krivenok krivenok.dmitry at gmail.com
Mon Nov 22 19:10:48 UTC 2010


Just tried dys_sysctl. It doesn't work as well.
Below are the results I got:

root at olimpico-freebsd 22:04:17 /usr/share/examples/kld/dyn_sysctl # [0] uname -a
FreeBSD olimpico-freebsd 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Nov
22 21:35:15 MSK 2010
root at olimpico-freebsd:/usr/obj/usr/src/sys/GENERIC  i386
root at olimpico-freebsd 22:04:20 /usr/share/examples/kld/dyn_sysctl # [0] kldstat
Id Refs Address    Size     Name
 1    1 0xc0400000 bb5504   kernel
root at olimpico-freebsd 22:04:24 /usr/share/examples/kld/dyn_sysctl #
[0] dmesg | tail -n 3
ums0: 3 buttons and [XYZ] coordinates ID=0
ugen2.2: <Broadcom Corp> at usbus2
em0: link state changed to UP
root at olimpico-freebsd 22:04:39 /usr/share/examples/kld/dyn_sysctl # [0
0] make load
/sbin/kldload -v /usr/share/examples/kld/dyn_sysctl/dyn_sysctl.ko
Loaded /usr/share/examples/kld/dyn_sysctl/dyn_sysctl.ko, id=2
root at olimpico-freebsd 22:04:49 /usr/share/examples/kld/dyn_sysctl # [0] kldstat
Id Refs Address    Size     Name
 1    2 0xc0400000 bb5504   kernel
 2    1 0xc855d000 3000     dyn_sysctl.ko
root at olimpico-freebsd 22:04:53 /usr/share/examples/kld/dyn_sysctl #
[0] dmesg | tail -n 3
ums0: 3 buttons and [XYZ] coordinates ID=0
ugen2.2: <Broadcom Corp> at usbus2
em0: link state changed to UP
root at olimpico-freebsd 22:04:57 /usr/share/examples/kld/dyn_sysctl # [0
0] make unload
/sbin/kldunload -v dyn_sysctl.ko
Unloading dyn_sysctl.ko, id=2
root at olimpico-freebsd 22:05:04 /usr/share/examples/kld/dyn_sysctl # [0] kldstat
Id Refs Address    Size     Name
 1    1 0xc0400000 bb5504   kernel
root at olimpico-freebsd 22:05:07 /usr/share/examples/kld/dyn_sysctl #
[0] dmesg | tail -n 3
ums0: 3 buttons and [XYZ] coordinates ID=0
ugen2.2: <Broadcom Corp> at usbus2
em0: link state changed to UP
root at olimpico-freebsd 22:05:09 /usr/share/examples/kld/dyn_sysctl # [0 0]

Please note that I run standard example on default 8.1 kernel (GENERIC).

Dmitry

>
> Which example did you try and run (it looks like the dyn_sysctl test
> would be a good one to try)?
> -Garrett


More information about the freebsd-hackers mailing list