Subject: Re: Emulation extension
To: Frank van der Linden <firstname.lastname@example.org>
From: Chris G. Demetriou <email@example.com>
Date: 03/05/1997 14:47:17
> I propose the following:
> * Add a new field to the proc structure, p_emuldata, of type void *
> The name is inspired by v_data in the vnode structure, as it serves
> a similar purpose. This field will be NULL if the current emulation does
> not need any special data stored.
> * The following fields will be added to the emul structure (see sys/proc.h):
> - void *(*e_init(struct proc *p))
> This allocates and initializes the emulation-dependent data. Called
> at exec time.
Why have this return a void * (presumably to be stuffed into
p_emuldata), rather than stuffing it there itself? Since all of the
other functions (including exit) just take one or more struct proc *s
and return void, why not be consistent?
> On a related note, but it's something that can be dealt with at some other
> time: I'm not happy about the current emul structure, in the sense that they
> contain information on both the OS that is being emulated, as well as
> the binary type. These two are not really related, and should be seperated
> in my opinion. The fields dealing with the binary format (there are only
> 2) are inly used at exec time, and not needed afterwards. For an emulation
> like the Linux emulation, a check whether a process is an emulated Linux
> processes now involves checking whether p_emul is equal either to
> &emul_linux_elf or &emul_linux_aout. But the binary format is irrelevant
> at runtime. Any opinions on this?
This probably makes sense.