xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* ELF Notes for kernel image
@ 2015-10-24 23:07 Carl Patenaude Poulin
  2015-10-25 18:45 ` Andrew Cooper
  0 siblings, 1 reply; 5+ messages in thread
From: Carl Patenaude Poulin @ 2015-10-24 23:07 UTC (permalink / raw)
  To: xen-devel

Hi all,

For my undergraduate project, I am developing a simple
paravirtualized x64 Xen unikernel. I've been hitting some issues
that I hope you can help me with!

I'm trying to figure out how to equip an ELF binary with an ELF note
that marks it as a valid Xen image. I've found the following
resources:

http://wiki.xenproject.org/wiki/X86_Paravirtualised_Memory_Management#Start_Of_Day
http://www.netbsd.org/docs/kernel/elf-notes.html#note-creation
http://xenbits.xen.org/docs/4.3-testing/hypercall/include,public,elfnote.h.html

Unfortunately, they are quite hard to decipher! I've tried to
summarize what little information I've extracted. Can you please
verify that the following is accurate, and maybe help me fill in the
blanks or point me to additional resources?

* A "PT_NOTE section" is any ELF header section which conforms to
the PT_NOTE specification. It is typically named ".note.*" and
marked allocatable.
* A PT_NOTE section is a series of "notes", or key-value pairs, each
formatted as `key_size: int32, value_size: int32, value_type: int32,
key: (int32|int64|asciz), value: (int32|int64|asciz)`.
* The Xen PT_NOTE section is named ".note.Xen", and its keys are
listen (in order) in $XEN_ROOT/xen/include/public/elfnote.h.

My questions:
* Every PT_NOTE entry contains a type field. What does it do, and
how do I decide what goes in it?
* In particular, what are the types of the various entries in the
Xen PT_NOTES (as seen in elfnote.h)?
* After all of this is done, how can I verify that my compiled
binary indeed has a valid PT_NOTE entry for Xen? Does `readelf` have
a switch that's particularly appropriate for this?

Thanks in advance,

Carl Patenaude Poulin
B Eng Software Engineering undergrad
McGill University

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-28  9:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-24 23:07 ELF Notes for kernel image Carl Patenaude Poulin
2015-10-25 18:45 ` Andrew Cooper
2015-10-27 16:03   ` Carl Patenaude Poulin
2015-10-27 16:17     ` Andrew Cooper
2015-10-28  9:11       ` Lars Kurth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).