Need help with 4.1BSD kernel

dhb at rayssd.UUCP dhb at rayssd.UUCP
Thu Nov 10 05:07:42 AEST 1983


Does anyone know of a way to determine the end of the users
address space from within the kernel on 4.1BSD?  In particular,
we have a locally developed device driver which massages the
data being transmitted before sending it (the device on the
VAX end swaps bytes around but the device on the other end does
not).  Every once in a while a user will develop a new program
and inadvertently pass the driver an absurd number for the byte
count.  When this happens, the driver starts merrily swapping
bytes around to get ready for the transfer and eventually blows
the system out of the water.
	Putting restrictions on the size of transfers doesn't
work because we have legimate reasons to transfer 64K at a shot
and if the user specifies a buffer which is near the end of his
address space and gives a byte count of 64K it will still screw
up.
	What we need is a way to check if the sum of the start
of the buffer and the byte count go past the end of the users
address space.  I noticed entries in a couple of the "per process"
structures for the data size, stack size, and text size but it's
not clear how to get from there to where I want to be.

	If anyone out there can help me on this (maybe somebody at
UCB that worked on 4.1) I would greatly appreciate.  Some of our
users are starting to get annoyed (fortunately they aim their
discontent at the poor fellow who is writing the new user programs).

Please MAIL replies because I am three weeks behind in reading the
news and I need this info right away.
-- 
	Dave Brierley
	Raytheon Co.; Portsmouth RI; (401)-847-8000 x4073
	...!decvax!brunix!rayssd!dhb
	...!allegra!rayssd!dhb
	...!linus!rayssd!dhb



More information about the Comp.unix.wizards mailing list