help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing external code or data from the 'console' kernel module: Ca


From: Luc Van Rompaey
Subject: Re: Accessing external code or data from the 'console' kernel module: Can it be done?
Date: Thu, 25 Jun 2015 14:20:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 24/06/15 08:37, Andrei Borzenkov wrote:
On Tue, Jun 23, 2015 at 8:35 PM, Luc Van Rompaey
<address@hidden> wrote:
Make console driver export pointer to a table. This will make it
possible for console driver to work without your module but provides
access to this table if needed.

Of course console driver will need to cope with NULL pointer (or
initialize table to something meaningful).

Hmmm... I think this is the one thing that I have not yet tried.
If I understand correctly, I would then have to create a an EXPORT_VAR
pointer variable in the console module, and let my 'setkey' module store the
appropriate value into it.
The function to remap an input key, according to the contents of the table,
would then be a part of the console driver.
It can also be a function pointer. So code in console driver would reduce to

if (grub_setkey_xlat)
 grub_setkey_xlat(...)
Ah! Function pointers... I had completely forgotten about these.
It's been a while since I last did any coding in C, so my competence is getting a bit rusty.
It clearly was high time to pick it up again...

reply via email to

[Prev in Thread] Current Thread [Next in Thread]