From: Sergey Vlasov <vsu@altlinux.ru>
To: ALT Linux Community <community@lists.altlinux.org>
Subject: Re: [Comm] Определить major, minor модуля
Date: Fri, 27 Oct 2006 16:09:18 +0400
Message-ID: <20061027120918.GC11118@master.mivlgu.local> (raw)
In-Reply-To: <4541F02D.2020601@smap.gov.ua>
[-- Attachment #1: Type: text/plain, Size: 1692 bytes --]
On Fri, Oct 27, 2006 at 02:40:29PM +0300, Valentin Lavrinenko wrote:
> Существует ли способ, не обращаясь к исходникам, определить,
> какие major, minor обслуживает тот или иной модуль ядра?
В общем случае нет. Иногда может помочь modinfo (если в модуле есть alias
вида char-major-* или block-major-*), но это не всегда работает по
следующим причинам:
- В некоторых модулях соответствующие alias могут быть просто не
прописаны разработчиком (они нужны только для автозагрузки модулей при
обращении к файлам на статическом /dev, всё остальное работает и без
них).
- Зачастую major/minor регистрирует общий модуль, не работающий
непосредственно с аппаратурой, а тот модуль, который обслуживает нужное
устройство, просто использует общие функции. Именно такая ситуация с
драйвером parport_serial - есть общий драйвер для последовательных
портов и отдельный модуль для поддержки комбинированных PCI-устройств,
имеющих как последовательные, так и параллельные порты.
- Наконец, в последнее время многие новые драйверы используют
динамический выбор major - конкретный номер выделяется только при
загрузке модуля. А minor почти всегда назначались динамически
(исключениями являются разве что IDE и ttyS* для ISA-устройств).
Вообще при использовании ядер 2.6.x и udev следить за конкретными номерами
major/minor уже не так нужно - вместо этого можно добавить правила udev
для обнаружения устройств с требуемыми характеристиками (PCI-устройства
можно различать, например, по положению на шине PCI, некоторые
USB-устройства имеют уникальные серийные номера, ...) и назначения им
требуемых имён, не зависящих от major/minor.
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2006-10-27 12:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-27 11:40 Valentin Lavrinenko
2006-10-27 12:09 ` Sergey Vlasov [this message]
2006-10-27 12:10 ` Valentin Lavrinenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061027120918.GC11118@master.mivlgu.local \
--to=vsu@altlinux.ru \
--cc=community@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git