System, kernel, and driver hacking for school experiment - SunOS 4.1.1

System, kernel, and driver hacking for school experiment - SunOS 4.1.1

Post by Christopher Ran » Mon, 01 Jun 1992 07:46:41



Hi Y'all,

I'm working on a school project (Santa Clara Univ, not Novell), and need
the guidance of a unix guru who knows the source code for Sun SparcStations.
I believe I have the source code to SunOS4.1.1.

What I want to do is modify the system interface, kernel, and inetd.  What I
need is to take timestamps of a block of data being sent down write()
to an open TCP socket stream, to IP and to the ethernet driver.  So,
I would like to create a new system call (so the c compiler will know what
to do with it) that is a duplicate of write, that will take an extra
parameter (pointer to my timestamp structure).  Then I want to similarly
expand the write -> tcp_output interface to do the same, then ip_output,
then the same to the ethernet driver.  In each case I'll duplicate the code,
rename it, expand the interface, add timestamp code.  At least this is what
seems appropriate to me.

Any sparc source code gurus willing to give some quick advice?  Please?!

First thing, where is the source to write?  I've heard it's in sysgeneric.c,
but I did not get that file in the source code distribution.

Thanks in advance,

Chris Ranch
---
Chris Ranch
Internetworking Products Division
Novell, Inc.  San Jose, CA

 
 
 

System, kernel, and driver hacking for school experiment - SunOS 4.1.1

Post by Christopher Ran » Mon, 01 Jun 1992 07:51:54


Hi Y'all,

I'm working on a school project (Santa Clara Univ, not Novell), and need
the guidance of a unix guru who knows the source code for Sun SparcStations.
I believe I have the source code to SunOS4.1.1.

What I want to do is modify the system interface, kernel, and inetd.  What I
need is to take timestamps of a block of data being sent down write()
to an open TCP socket stream, to IP and to the ethernet driver.  So,
I would like to create a new system call (so the c compiler will know what
to do with it) that is a duplicate of write, that will take an extra
parameter (pointer to my timestamp structure).  Then I want to similarly
expand the write -> tcp_output interface to do the same, then ip_output,
then the same to the ethernet driver.  In each case I'll duplicate the code,
rename it, expand the interface, add timestamp code.  At least this is what
seems appropriate to me.

Any sparc source code gurus willing to give some quick advice?  Please?!

First thing, where is the source to write?  I've heard it's in sysgeneric.c,
but I did not get that file in the source code distribution.

Thanks in advance,

Chris Ranch
---
Chris Ranch
Internetworking Products Division
Novell, Inc.  San Jose, CA


 
 
 

System, kernel, and driver hacking for school experiment - SunOS 4.1.1

Post by Valdis Kletnie » Tue, 02 Jun 1992 14:45:35



>What I want to do is modify the system interface, kernel, and inetd.  What I
>need is to take timestamps of a block of data being sent down write()

(1) Why do you need to modify inetd?  If you *do* need to, I suggest
you look at the replacement one provided in the tcp_wrapper package.

(2) Why do you need to modify the kernel?  I recommend you look at the
source for the 'ntp' package to see how to deal with timestamps in
user code...

Rule 1 of making kernel mods:  First, make DAMNED sure that you can't
do the function easily in user mode - if you put it in the kernel,
you have a lot more wreckage to clean if it doesn't work (i.e.
contrast time difference between the shell printing out
'Bus error - core dumped' and how fast your machine does an 'fsck' ;)

                                Valdis Kletnieks
                                Computer Systems Engineer
                                *ia Tech