I have modified FFS filesystem code to put the disk inode at the beginning
of a file, i.e, the logical block #0 of each file begins with 128 bytes of
its disk inode and the rest of it are file data.
Everything seems to be working. But I am stuck with an ELF executable
file stored in this layout - I can not run it. The kernel uses memory map
to read the ELF file and assumes that the file data begins at offset 0. I
have looked at the files kern_exec.c and imgact_elf.c trying to adjust the
header pointers by an offset of 128 bytes to at least let the kernel
recognize that it is an ELF file. But still I got messages like "too few
PT_LOAD segments". Obviously, I need to modify the kernel files
elsewhere, perhaps those under directory contrib/rtld-elf/*, which I have
never read before.
My questions are:
(1) What consequences will my file layout affect the load and execution of
an ELF file? Do I have to adjust the virtual addresses in the ELF object
file as well?
(2) If I modify any files under contrib/rtld-elf, how to make the
modifications take effect. Is that as simple as "make" and followed by
"make install".
I am new to these kernel stuff. Any help or hints are very appreciated.
-Zhihui
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message