Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 May 2000 16:28:56 +0530 (IST)
From:      "G.B.Naidu" <gbnaidu@sasi.com>
To:        Alfred Perlstein <bright@wintelcom.net>
Cc:        freebsd-net@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG
Subject:   Re: How do I time in kernel...
Message-ID:  <Pine.LNX.4.21.0005291619070.775-100000@pcd75.sasi.com>
In-Reply-To: <20000529020845.U28594@fw.wintelcom.net>

next in thread | previous in thread | raw e-mail | index | archive | help

Hi,

thanks a lot for the reply.

Please see my comments below:

On Mon, 29 May 2000, Alfred Perlstein wrote:

> * G.B.Naidu <gbnaidu@sasi.com> [000529 01:13] wrote:
> > 
> > Hi,
> > 
> > I would like to know how to get time of the day in side kernel. When I
> > used gettimeofday() in side kernel, it was giving panic on 3.3 FreeBSD
> > release. It didnt panic on 3.1-RELEASE. So what is the problem?
> > 
> > Can I use gettimeofday() inside kernel? if so why 3.3 is panicking? Ifnot
> > why 3.1 is not panicking?
> > 
> > Next question is how can I achieve the equal functionality of
> > gettimeofday() call in kernel? Is there anyway?
> > 
> > One more question: Is it wrong to call system call from kernel files?
> 
> It depends on how you call it, look at the sendfile implementation and
> see how it has to call writev(), userland_writev() != kernel_writev(),
> you need to munge with the arguements.
> 

The kernel_writev() calls requre a proc structure. Now my question is how
can I get a proc structure?

My requirement is as follows: I want to open a driver as
open("/dev/nic0"...), then I want to write() and read() from the driver. I
have two choices. Either to go for the kernel or user level. Kernel level
is to restrict the normal user from fiddling with the driver data. User
lever is for simplicity.

Now which choice should I make? 

If I want to go for kernel level, my question is how do I do open, write,
read and close. For the kernel versions of these system calls, I need proc
structure. How do I get it?

Next I read in the book : design of 4.4 BSD O/S that the user interface
for the system calls is thorugh library routines write(), open() etc. I
want to know where is the source code for these user land write(),
open() etc library calls. Where this implementation of interface between
library calls and system calls? How it is done?

Any help is appreciated.

thanks
--gb


-- 



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.21.0005291619070.775-100000>