1

When a process is created by do_execve, I want to write some data somewhere (say 0x0100_0000) such that after the process is run it can access that address to retrieve the data? How to achieve this task?

Matthewxie
  • 141
  • 2
  • 10
  • You can create a section in binary (or use existing). On exec was, when sections are loaded into memory fill it with appropriate values – Alex Hoppus Mar 18 '16 at 04:59

1 Answers1

0

You can use VDSO. Example of using VDSO mechanism for own calls. The idea is to link userspace application and your code in kernel through special shared library. gettimeofday syscall is implemented in such way, what allows to reduce number of context switches.