*BSD News Article 28610


Return to BSD News archive

Xref: sserve comp.os.386bsd.development:1939 comp.os.386bsd.questions:9380
Path: sserve!newshost.anu.edu.au!munnari.oz.au!comp.vuw.ac.nz!newshost.wcc.govt.nz!newshost.wcc.govt.nz!not-for-mail
From: zheng@golem.wcc.govt.nz (Chuck Zheng)
Newsgroups: comp.os.386bsd.development,comp.os.386bsd.questions
Subject: [Q] NetBSD syscall, how does it work?
Date: 24 Mar 1994 23:10:45 +1200
Organization: Wellington City Council
Lines: 29
Message-ID: <2mrsfl$sk4@golem.wcc.govt.nz>
NNTP-Posting-Host: golem.wcc.govt.nz
Keywords: 386, call gate, LCALL, NetBSD

Hello, netters

I am not sure this is the right place to ask following question, but I
do it anyway:

I am trying to understand how does system call works on NetBSD-0.9. With
some help from friends, I can fine locore.s use LCALL(0x7,0x0) to enter
into kernel.  I found out LCALL is a macro. and LCALL(0x7,0x0) can
translate to call (inter-segment?) via gate: descriptor 0 of LDT (0x7 =
00000111B bit 0-1 means privilige=3, why? and bit 2 means current LDT?).
How do I find out how is the current LDT set up? and what's the magic
about this descriptor 0?  LCALL(0x7, 0x0) also has displacement 0 (0x0).

I was pointed to /usr/src/lib/libc/i386/sys and see brk.s uses
LCALL(7,0). 

I remember "_" (underscore) prefix has special meaning to the system.
But cannot remember what special. Can somebody tell me how is it
gerenated, and how special?

How is syscall implemented via libc? What should I read?

Thanks in advance.


cheers
chuck