[Info-vax] Android development Was Re: OT: Larry Ellison takes retirement as CEO of Oracle

Johnny Billquist bqt at softjar.se
Tue Sep 23 08:17:47 EDT 2014


On 2014-09-22 00:45, JF Mezei wrote:
> On 14-09-21 15:42, Johnny Billquist wrote:
>
>> You normally do not branch to a driver. You make a system call.
>
>  From an instruction flow at opcode level, when you ask to print "Hello
> World", there will be a branch/call instruction to a system service
> which will branch/call the driver which will perform whatever operations
> are necessary to do the job. right ?

No. There will be a system call. System calls are not branch or call 
instructions. On most systems they are implemented using an instruction 
that cause the processor do do a trap. An illegal instruction, or an 
instruction specifically designed to cause a processor trap.

When the processor performs a trap it switches to kernel mode, and jumps 
to a specific address, where the OS will do all the tasks related to the 
system call. That normally means reading out arguments the process set 
up before executing the trap. Those arguments will tell in detail what 
system call was requested, and the specific arguments related to that 
system call. The kernel then, based on all the information collected, 
will call whatever code needed to actually perform the action. And 
finally it will return back to the user program in user mode again, 
which will then continue with the instruction after the trap.

> Question: when a use mode process calls a routine in a shareable image
> that is installed with pivs,  what triggers the change in authorized
> privs for the process (and what triggers its removal ?)

I'm not sure exactly how VMS deals with this, but a guess would be that 
when your process performs a trap, the kernel will decide which 
privileges you have based on where that trap occurred. If it occured 
from within the memory allocated to the sharable image, you get the 
privileges that the shareable image have.

Remember, process privileges are totally irrelevant until you actually 
do a system call.

> Does the OS check privs whenever code branches to a different page ?

No.

> Also, must all privileges granted to a shareable image by INSTALL be
> specifically enabled by a routine, or are some granted/enabled by
> default as soon as code branches to it ?

Not sure how you mean this. Code normally do not "enable" privileges. 
Code tries to perform an operation by doing a system call, at which 
point the kernel verifies that the process have the right to do this, or 
else give an error back.
When code is installed with privileges, it has those privileges.

	Johnny




More information about the Info-vax mailing list