Как стать автором
Обновить

Комментарии 5

Посмотреть код и понять что делает…
Забыл упомянуть: объём кода > 4 Гб.
Надо оперативно отсортировать только драйвера.
К слову, printk() сейчас использовать не рекомендуется, есть pr_debug(), pr_warn():
CodingStyle
There are a number of driver model diagnostic macros in <linux/device.h>
which you should use to make sure messages are matched to the right device
and driver, and are tagged with the right level: dev_err(), dev_warn(),
dev_info(), and so forth. For messages that aren't associated with a
particular device, <linux/printk.h> defines pr_notice(), pr_info(),
pr_warn(), pr_err(), etc.

Coming up with good debugging messages can be quite a challenge; and once
you have them, they can be a huge help for remote troubleshooting. However
debug message printing is handled differently than printing other non-debug
messages. While the other pr_XXX() functions print unconditionally,
pr_debug() does not; it is compiled out by default, unless either DEBUG is
defined or CONFIG_DYNAMIC_DEBUG is set. That is true for dev_dbg() also,
and a related convention uses VERBOSE_DEBUG to add dev_vdbg() messages to
the ones already enabled by DEBUG.

Many subsystems have Kconfig debug options to turn on -DDEBUG in the
corresponding Makefile; in other cases specific files #define DEBUG. And
when a debug message should be unconditionally printed, such as if it is
already inside a debug-related #ifdef secton, printk(KERN_DEBUG ...) can be
used.

Но printk() всё ещё присутствует, конечно же.

Пользуясь случаем, порекомендую своеобразный «курс» по ядру Linux. Всё приближено к реальности: общаетесь через email, отправляете патчи и исправляете их. Последнее из 20 заданий — отправка патча в mainline. The Eudyptula Challenge.
Насчёт отличий в исходниках: если модуль использует kbuild (теоретически, все современные модули должны его использовать), то в Makefile должны быть строки вида
obj-m += hello.o
obj-y += list.o
Зарегистрируйтесь на Хабре, чтобы оставить комментарий

Публикации

Истории