Drew Northup <[EMAIL PROTECTED]> wrote:
> In the following quote Ramon made a very interesting
> point--has anyone been assigning dates to their code
> comments? If not, how should this be done?
If you need to know the date when any change was introduced,
look at the CVS logs -- that's what they are for! (They are
guaranteed to be correct, which you can't say about any
convention as to when to add comments :-/)
Furthermore, knowing the date when code was added doesn't
help all that much to decide whether the code is (still) valid ;-)
> > /*
> > * We don't allow to modify segment registers
> > for now;
> > * we don't want user mode to be able to crash
> > the kernel ...
> > */
> >
> > I don't see any reason for this. Is this still
> > applicable ?
To answer the question: Yes, this is of course still
applicable. The reasons are simple:
- some selectors must not be loaded while guest code ist
running (this applies to the ring-0 monitor selectors)
- guest "ring-0" selectors will need to have their RPL
adjusted to 3
- when modifying the CS register, various monitor-internal
structures need to be changed (the descriptor needs to
be "activated", the guest CPL value needs to be adjusted)
This means that you can't simply copy the segment registers.
Instead, you'll have to implement a mechanism that "carefully"
changes the segment values, using algorithms similar to the
ones used by the monitor for emulating 'mov Xs, ...' and
lcall/ljmp/ret/iret.
Bye,
Ulrich