[Top][All Lists]

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

Re: GSOC - valgrind-hurd queries

From: Subhashish Pradhan
Subject: Re: GSOC - valgrind-hurd queries
Date: Sat, 28 Jun 2014 01:53:15 +0530

On Saturday 28 June 2014 01:41 AM, Subhashish wrote:

On Wednesday 25 June 2014 04:24 PM, Samuel Thibault wrote:

Subhashish, le Wed 25 Jun 2014 15:58:11 +0530, a écrit :
The host system traps plus the syscalls( like __NR_rename are to be
encapsulated within an rpc generated via mig - my guess)
are to be listed there.
No. This file should just enumerate traps, not RPCs.  The situation is
different from other OSes.  Let me sum the situation up:

In Linux:

- system calls have a __NR_foo number
- m_syswrap/syswrap-* provide the wrapping implementation for each and
every system call.
- m_libcfile.c calls __NR_foo system calls to implement what valgrind
needs for its own use

In Hurd/Mach:
- traps have a trap number
- RPC have an RPC number
- RPC are done by calling the mach_msg trap.
- m_syswrap/syswrap-* will provide wrapping implementations for each and
every *trap*. There is no need to distinguish RPCs there, it will all be
handled by implementing the wrapper for the mach_msg trap.
- m_libcfile.c will make RPCs to implement what valgrind needs for its
own use.

I assume the generated *.h and *.c files will have to be included into the
vki-scnums-gnu.h file and then manipulate them into a trap-ped syscall.
No. The generated .c file will make the mach_msg trap for you. As a
caller of the functions generated by mig, you will not need to know
anything about the RPCs, but just call the functions from m_libcfile.c.
The .h file will contain the prototype for the function, e.g. for the
read() function, the .h file contains the RPC equivalent, __io_read

kern_return_t __io_read
    io_t io_object,
    data_t *data,
    mach_msg_type_number_t *dataCnt,
    loff_t offset,
    vm_size_t amount

that's what you will call from m_libcfile.c, just passing the FD as
io_object, a data buffer, the data count, offset, and amount to be
transfered. No need for an RPC id here.


I did implement the trap declarations in vki-scnums-x86-gnu.h file.
Then these __NR_syscalls (not the __NR_traps) - where do I declare them if not in vki-scnums-x86-gnu.h file?
You mentioned that these will probably be the ones from glibc - like the __io_read() rpc and if not then these will be generated by MIG right?
So I'll have to find a way to use the glibc ones without referring them directly as in #include stuff.

And of the MIG-generated .h and .c files, I'll have to #include the .h files in m_libcfile.c and call them from there. So they get their declarations(prototype).

Sorry for not replying earlier - we had our first thunderstorms of the monsoon season and electricity went out for the day.

Also, FAQ recommends talking to organizations about how they handle evaluations and their disclosure to students. How do we do it? Would I get to know anything about it or would I know about it afterwards?

Um, this just got in - I did pass the Midterm Evaluations - It asked me to contact you to discuss results of evaluation and plan goals and development plan for the rest of the program.

reply via email to

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