Closed panicbit closed 9 years ago
How did you manage to link to core
and libc
(especially libc
) in a kernel module?
Turns out you actually didn't. For example, you can't use division, because it requires a panic
lang item, which is defined in core
, but you don't really link to it, so the resulting module can't be inserted into the kernel due to unresolved references. You can't define your own panic
either, because it conflicts with the core
definition.
So those patches just happen to work and fail horribly when you try to do something more than merely printing a string. You shouldn't link to anything in kernel code (e.g. no external crate
).