[FreeVMS] How to write PROBER and PROBEW for IA32?

wmrieker at nii.net wmrieker at nii.net
Sam 1 Oct 00:31:54 CEST 2005


Look in http://www.o3one.org/sources/oz_kernel_486.s

There's a routine oz_hw_probe that may be of interest.  It will only run
from kernel mode as it has to read the pagetables.  You will have to
adjust it to however you have your pagetables.  But the idea is you have
the probe routine check the pagetable entries as the x86 doesn't have
instruction to do this.  BTW, the VERR instruction just checks the segment
access, it does not check pagetable stuff.  Yes I agree, idiot CPUs.

Mike


>
> I recently wrote a routine to parse 32 bit and 64 bit item.  I was hoping
> to
> use this routine on FreeVMS and work on some of the sys$get*() system
> services.  It works on OpenVMS but doesn't on FreeVMS yet...
>
> The first think it needs is __PAL_PROBER(). I noticed that FreeVMS doesn't
> currently probe its args yet and we need to start doing that.  So, I
> decided
> it was time to write PROBER, and PROBEW for IA32.  I know VAX assembler
> and
> Alpha assembler (and I use to know Z80A and 8088 assembler many years
> ago),
> so how hard could that be?  I've been reading the I32 processor manuals
> for
> the last few days!!!  What a kludged-up / fucked-up CPU!!!  :-)
> (But I'm going to learn it if it kills me!)
>
> I'm getting a little closer, so here is where I am:
>
> 1.  After the jump to kernel mode (they call it supervisor), I think you
> read the callers CS selector from the stack into a register.  This will
> give
> you the caller's previous mode.
>
> 2.  Use the ARPL instruction to correct the D segment passed.
> 	(In case they are trying to trick you...)
>
> 3.  Use the VERR D segment instruction to verify read.
>
> Just wondering if I'm on the right track, or if anyone else has tried to
> write a PROBR type routine for IA32.
> Thanks,
> Roger
>
>
> _______________________________________________
> FreeVMS mailing list
> FreeVMS at systella.fr
> http://rayleigh.systella.fr/cgi-bin/mailman/listinfo/freevms
>




Plus d'informations sur la liste de diffusion FreeVMS