Subject: Fix for ksyms in multiboot
To: tech-kern <tech-kern@netbsd.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-kern
Date: 11/05/2006 23:40:32
------=_Part_39329_20435119.1162766432706
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hello,
/dev/ksyms currently does not work when using multiboot because it
does not initialize the ELF header passed to userland when adding the
symbol table (it does not call ksyms_hdr_init).
I've attached a fix. Can you think of a cleaner way of addressing
this? (I was considering keeping the code all together in
kern_ksyms.c as MI, but I don't know if that'd be possible given that
the ELF header contains details about the platform.)
Thanks.
--
Julio M. Merino Vidal <jmmv84@gmail.com>
The Julipedia - http://julipedia.blogspot.com/
------=_Part_39329_20435119.1162766432706
Content-Type: text/plain; name=patch.diff; charset=ANSI_X3.4-1968
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="patch.diff"
PyBhcmNoL2kzODYvaTM4Ni8ubXVsdGlib290LmMuc3dwCkluZGV4OiBzeXMva3N5bXMuaAo9PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09ClJDUyBmaWxlOiAvY3Zzcm9vdC9zcmMvc3lzL3N5cy9rc3ltcy5oLHYKcmV0cmlldmlu
ZyByZXZpc2lvbiAxLjEyCmRpZmYgLXUgLXAgLXIxLjEyIGtzeW1zLmgKLS0tIHN5cy9rc3ltcy5o
CTI1IE9jdCAyMDA2IDEzOjQ2OjM2IC0wMDAwCTEuMTIKKysrIHN5cy9rc3ltcy5oCTUgTm92IDIw
MDYgMjI6MzY6NDkgLTAwMDAKQEAgLTY1LDcgKzY1LDcgQEAgaW50IGtzeW1zX2FkZHN5bXRhYihj
b25zdCBjaGFyICosIHZvaWQgKgogaW50IGtzeW1zX2RlbHN5bXRhYihjb25zdCBjaGFyICopOwog
aW50IGtzeW1zX3JlbnN5bXRhYihjb25zdCBjaGFyICosIGNvbnN0IGNoYXIqK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