陶捷 TaoJie wrote:
> Dear all,
> 
> I read the function init_idt_common(gate_desc_t *idt), it 
> installs/registers 2 syscall handlers in kernel IDT table.
> They are:
>  /*
>   * install "int80" handler at, well, 0x80.
>   */
>  set_gatesegd(&idt0[T_INT80], &sys_int80, KCS_SEL, SDT_SYSIGT, SEL_UPL);
> 
>  /*
>   * System call handler.
>   */
> #if defined(__amd64)
>  set_gatesegd(&idt[T_SYSCALLINT], &sys_syscall_int, KCS_SEL, SDT_SYSIGT,
>      SEL_UPL);
> 
> #elif defined(__i386)
>  set_gatesegd(&idt[T_SYSCALLINT], &sys_call, KCS_SEL, SDT_SYSIGT,
>      SEL_UPL);
> #endif /* __i386 */
> 
> *Which one is the standard syscall handler in current opensolais ON?

Neither, really.  sys_int80 has a comment by it which, if you had used the 
source code browser to look at it, says:
/*
  * System call via an int80.  This entry point is only used by the Linux
  * application environment.  Unlike the sysenter path, there is no default
  * action to take if no callback is registered for this process.
  */

so, it handles system calls for Linux programs.

For a more-complete explanation of Solaris native system call entry 
conventions, 
see http://blogs.sun.com/tpm/entry/solaris_10_on_x64_processors.

> The first handler will be triggered by "int 0x80", then what instruction 
> will trigger the second handler?*

T_SYSCALLINT is defined (again, that source browser) as 0x91.  so, int 91h.

> And I find another piece of code in this function
> 
> /*
>   * Prepare interposing descriptors for the branded "int80"
>   * and syscall handlers and cache copies of the default
>   * descriptors.
>   */
>  brand_tbl[0].ih_inum = T_INT80;
>  brand_tbl[0].ih_default_desc = idt0[T_INT80];
>  set_gatesegd(&(brand_tbl[0].ih_interp_desc), &brand_sys_int80, KCS_SEL,
>      SDT_SYSIGT, SEL_UPL);
> 
>  brand_tbl[1].ih_inum = T_SYSCALLINT;
>  brand_tbl[1].ih_default_desc = idt0[T_SYSCALLINT];
> 
> #if defined(__amd64)
>  set_gatesegd(&(brand_tbl[1].ih_interp_desc), &brand_sys_syscall_int,
>      KCS_SEL, SDT_SYSIGT, SEL_UPL);
> #elif defined(__i386)
>  set_gatesegd(&(brand_tbl[1].ih_interp_desc), &brand_sys_call,
>      KCS_SEL, SDT_SYSIGT, SEL_UPL);
> #endif /* __i386 */
> 
>  brand_tbl[2].ih_inum = 0;
> 
> *Any new features about the branded "int $80" and syscall handlers?
> Do these 2 branded handlers put into use in opensolairs ON now?*
> 
> P.S.  I'm using and reading B74 now.
> 
> 
> Kind Regards,
> TJ
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> opensolaris-code mailing list
> [email protected]
> http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to