HDTenEightyP/NetNews huggingface dataset:
From: a74k110@titan.ucc.umass.edu (Chris Lloyd)
Subject: Re: Mach messaging to kernel server vs. "traditional" kernel drivers
Organization: University of Massachusetts, Amherst
Date: Fri, 14 Aug 1992 20:32:48 GMT

In article <1992Aug14.133748.29123@ni.umd.edu> louie@sayshell.umd.edu (Louis A. Mamakos) writes:
>I'm doing a different driver which needs similar functions, but am
>considering using Mach messaging rather than a character special
>device to do what I want.  Now, one thing which I'm trying to
>determine how to implement with the Mach messaging design is how to do
>access control and credentials checking.  With the tradional UNIX
>device driver, I can use suser() to protect access to certain
>protected functions.  How can I determine the identity, in some useful
>sense, of the sender in the Mach messaging case?

The easiest way to do the equiv. of suser() is to pass the host_priv_self()
port around:

For the calls that require super user privileges, add another parameter
to the RPC of type port_t.
In the kernel server, when those calls come in, compare the port_t to
host_priv_self(), the port passed from the client will either map correctly
into the same port # or won't, sorta like a ticket required to do things.
The client side is then required to pass host_priv_self() for those calls
or they'll fail (host_priv_self() requires you to be root).

If you want more granular crendential checking, best is to have the client
send it's own task_self() to the kernel server, then get the pointer
to kernel structures and deference them task->u_address->uu_cred.
I forget how one goes about turning ports into actual kernel structure pointers
but it is/should be possible (can't remember if I ever got it working)

>	* It doesn't seem like it will buy me anything.  I was excited
>	at the prospect of using out-of-line data to move moderately size
>	hunks of data between the kernel driver and user code using
>	the fancy Mach copy-on-write VM.  But it seems that since the
>	loadable kernel servers don't allow this to work, and I have to
>	copy the data anyway.

out-of-line data is only real efficient when your passing page aligned
page sized data, anything else turns into a copy of sorts anyways. If your
data blocks are under half a page size or so, then copy is fine.
But as you say, this is broken in 2.0, there was another poster who
had this problem and said it was fixed in 3.0, but that hasn't materialized
yet.

I personally prefer the Mach interface because you don't have to worry
about your server/handler getting reentered, everything is single threaded
off the queue of messages (unless you add more threads yourself) so
there is less locking/sleep paranoia type things.  I also like the
flexibilty of being able to design whatever kind of interface I see fit, not
tied to read/write/ioctl for ALL purposes.

<shrug> all depends on your needs.

la la la,
-- 
:: Christopher Lloyd :: a74k110@titan.ucc.umass.edu :: Yrrid, Inc. ::
From: jfg@dxcern.cern.ch (Jean Francois Groff)
Newsgroups: comp.sys.next.programmer
Subject: Need help with programming DBTableView
Date: 19 Aug 92 12:26:22 GMT
Distribution: comp
Organization: CERN, European Research Center for Particle Physics


	Hello !

  Could anybody provide some example code dealing with DBTableView,
further than with IB. Or at least, the relevant parts of the
definitive documentation, which should be out by now. I'm using
Pre-Release 2 of NextStep 3.0. Any info much appreciated.

  I'm writing this for a colleague who doesn't have news access, so
please reply by mail to lamb@lsd.ch (NeXTMail happily accepted).

--
--
  Jean-Francois Groff (jfg@info.cern.ch)
  World-Wide Web initiative
  CERN, ECP division, CH-1211 Geneva 23, Switzerland
  Phone +41 22 767 3755 -- Fax +41 22 767 7155
--
"Life may at times be boring, but is it more fun to be dead ?"
                                                  -- Alcor
Newsgroups: comp.sys.next.programmer
Subject: Re: Drag&drop of colors in Views - how does -acceptColor: atPoint: work?
From: scott@nic.gac.edu (Scott Hess)
Date: 18 Aug 92 19:42:08
Organization: Gustavus Adolphus College
In-reply-to: pclark@bosslogic.com's message of Tue, 18 Aug 1992 06:32:38 GMTLines: 40

In article <1992Aug18.063238.3891@bosslogic.com>
	pclark@bosslogic.com (Pete Clark) writes:
>In article <SCOTT.92Aug17092008@nic.gac.edu>  writes:
>> So, what's up?  Am I just not doing something right?  There's not
>> much area to go wrong, here, and I've checked the spelling against
>> the documentation about a billion times.  It just doesn't seem to
>> work.  Anyone out there got an example of receiving colors for your
>> View?
>
>	This class works as expected under 3.0PR2. The instance of
>MyView is a subview of a Box, which is in a Window.

In order to hamstring the minor groundswell of response I've been
receiving, I figure I'll post this on the net and let everyone in
on The Real Dope.  The method _does_ work, with qualifications.
Apparently, if the receiving View is flipped, the test for whether
the swatch is in the View is wrong, so you don't get the message
when the drop is in the View - you get it when the drop is _above_
the View!  [Didn't they use View's -mouse:inRect:?]

In any case, there are a couple alternatives.  An obvious and
workable one is to do [myView setFlipped:NO].  I did that, and
things work awesome.

Another solution is the NextAnswers solution.  It uses a +poseAs:
on NXColorPanel which overrides +dragColor:withEvent:fromView: to
do things the right way.  I'm sure this works fine - it is a bit
involved, though.  Unflipping the View works much better with less
fuss and muss, when applicable.

[Some might ask "Why didn't scott check NextAnswers in the first
place?"  I did.  My index was screwed up, though, so the search
didn't turn up anything ...]

Later,
--
scott hess <shess@ssesco.com>  <Who achieved programmer nirvana on Aug 11th>
12901 Upton Avenue South, #326  Burnsville, MN 55337 (612) 895-1208 Anytime!
   <Text: One Class to bring them all and in the darkness bind them ...>

Newsgroups: comp.sys.next.programmer
From: BrianW@SoundS.WA.com (Brian Willoughby)
Subject: Re: _IO, _IOR, _IOW and _IOWR functions
Reply-To: BrianW@SoundS.WA.com
Organization: SoundSoftware, Bellevue, WA, USA
Date: Thu, 20 Aug 1992 06:52:55 GMT


Now that the curious seem to have turned the discussion to ioctl() calls, I  
would like to take the opportunity to re-post a question of mine about directly  
accessing the Intel 82077 Floppy Disk Controller chip.

For compatibility with a 10-sector per track 3.5" floppy format, I need to send  
a READ command directly to the controller chip with DMA enabled in order to  
read a sector written with an address tag of sector 0.  Reading multiple  
sectors with one call would be nice as well.

I have learned a great deal from the /NextDeveloper/Examples/Floppy code and  
have successfully been able to read sectors 1 through 9 with a higher level  
function {namely ioctl(fd, FDIOCRRW, &rawio)}, but apparently I cannot read  
sector 0 without going to the lowest level because FDIOCRRW is block based and  
assumes that each track starts with sector 1 when it determines the cylinder.

Here is what I have coded so far.  do_ioc() is taken from fdform.c with  
improved error reporting.  I tried sectors 0 and 1, combined with tracks 0 and  
1, for transfers of 1, 9 and 10 sectors without any luck.

| #include <sys/file.h>
| #include <sys/ioctl.h>
| #include <nextdev/fd_extern.h>
| #include <nextdev/disk.h>
| #include <nextdev/dma.h>
| 
| 	bzero(&ioreq, sizeof(struct fd_ioreq));
| 	ioreq.density = FD_DENS_1;
| 	ioreq.timeout = 5000;
| 	ioreq.command = FDCMD_CMD_XFR;
| 	pcmd->mfm = 1;
| 	pcmd->opcode = (read_flag ? FCCMD_READ : FCCMD_WRITE);
| 	pcmd->hds = head;
| 	pcmd->drive_sel = 0;
| 	pcmd->cylinder = cylinder;
| 	pcmd->head = head;
| 	pcmd->sector = sector;
| 	pcmd->sector_size = pfi->sectsize_info.n;
| 	pcmd->eot = EOT;
| 	pcmd->gap_length= pfi->sectsize_info.rw_gap_length;
| 	pcmd->dtl = 0xff;
| 	ioreq.num_cmd_bytes = SIZEOF_RW_CMD;
| 	ioreq.addrs = (caddr_t)addrs;
| 	ioreq.byte_count = DMA_ENDALIGN(int, sector_count * SECT_SIZE);
| 	ioreq.num_stat_bytes = SIZEOF_RW_STAT;
| 	ioreq.flags = (read_flag ? FD_IOF_DMA_RD : FD_IOF_DMA_WR);
| 	rtn = do_ioc(fd, &ioreq);

And here are the results interpreted by my error printing routines (if you can  
answer my question, you might be able to understand these based upon knowledge  
of the Intel controller):

| Accessing floppy disk volume 0
| ...Expected stat byte count = 0x7
|    received stat byte count = 0x0
| ...Unexpected status: a
| FDR_BADPHASE:   controller changed phase unexpectedly
| ...Read/Write Failed
| Status Register 0:
| Head Address 0
| Drive Select 0

Has anyone successully used the ioctl(fd, FDIOCREQ, fdiop) call to read and  
write a floppy?  Even code which uses FDIOCREQ to access a standard 9-sector  
disk would be useful.

Is NeXT listening?  You may be the only resource that can solve this...
-- 
Brian Willoughby	Software Design Engineer, BSEE
BrianW@SoundS.WA.com	SoundSoftware
NeXTmail welcome
Newsgroups: comp.sys.next.programmer
From: jgg@proforma.com (J. G. Gregory)
Subject: understanding make
Keywords: make
Organization: Pro Forma
Date: Fri, 14 Aug 1992 19:22:53 GMT

I am trying to debug a problem that occurs deep inside lex.  I want to turn on  
the debugging features of lex, but I can't seem to get "make" to compile the  
lex output with the debugging flags on.  I feel (and hope) that it is my weak  
understanding of make that is the problem.

I want to put -DLEXDEBUG in when I cc the lex output.  That is, in the sequence  
of commands involved in making an object file:

lex foo.lm
mv lex.yy.c foo.m
cc -g -Wall -DDEBUG    -c foo.m -o debug_obj/foo.o
                    ^^^
I want -DLEXDEBUG here^

foo.lm is in a subproject.  I have tried adding 
OTHER_CFLAGS = -DLEXDEBUG
to the Makefile.preamble in that subproject directory, but it doesn't have an  
effect.  I also tried rewriting the suffix rule for .lm to .o, but that didn't  
have an effect either.  Further, the default for .lm.o has a rm line which  
never happens on my system:
.lm.o:
	$(LEX) $(LFLAGS) $*.lm
	$(MV) $(MVFLAGS) lex.yy.c $*.m
	$(CC) $(CFLAGS) $(OBJCFLAGS) -c $*.m
	$(RM) $(RMFLAGS) $*.m

I think I must not be overriding something late enough.  I tried putting the  
things in Makefile.postamble, but had the same lack of success.

I can do what I want manually, but frustration with make looms so large that I  
feel I must ask for advice.  Nearly everything I have tried doesn't have the  
intended effect.  The NeXT make hierarchy is complex and hard to follow.  I  
have the Nutshell book on make, which is pretty weak, and no real help on  
something as complex as NeXT's make stuff.

Any and all advice appreciated.
--J Gregory
Newsgroups: comp.sys.next.programmer
From: mdixon@parc.xerox.com (Mike Dixon)
Subject: Re: Is @selector(foo:) constant?
Keywords: @selector, Objective-C, constant
Organization: Xerox PARC
Date: 22 Aug 92 00:42:05 GMT

>    I tried:
>
>	static unsigned int my_array[][3] =
>	{
>	   { 1, @selector(foo:), @selector(bar) },
>	   ...
>        }
>
>    The compiler came back and said:
>       initializer for static variable is not constant

the trick is that although @selector(foo:) isn't constant, &@selector(foo:)
is.  initialize your array with the addresses of the selectors, and
remember to dereference them before you use them.  for example, here's
some code from XText:

  typedef struct {
	  SEL   *sel;
	  short arg1;
	  short arg2;
	  keyCode key;
  } tbl_entry;

  const tbl_entry emacs_base[] = {
    {&@selector(moveChar:mode:), -1,  0, 0x351},  // ctrl-b    move back char
    {&@selector(moveChar:mode:), -1,  1, 0x401},  // ctrl-h  delete back char

                ... etc.

--

                                             .mike.
From: sksircar@phoenix.Princeton.EDU (Subrata Sircar)
Newsgroups: comp.sys.next.programmer
Subject: Re: Getting a PopUpList's window
Date: 14 Aug 92 22:11:17 GMT
Organization: SPAMIT
Originator: news@nimaster

dhg@sinix.UUCP (David Griffith) writes:
>In article <1992Aug12.002320.2320@afs.com> greg@afs.com writes:
>>You are doing an inherently problematic thing, because PopUpLists are NOT  
>>controls, like TextFields and Buttons. They inherit through the Window  
>>hierarchy and are actually subclasses of Menus. By definition, you cannot  
>>ask a Window what Window it lives on. The Matrix lives on the PopUpList,  
>>not the Window it appears to be on, so it's no help either. Even the cover  
>>button is no help, because it's not directly attached to the PopUp.

So keep the button around.  (This is the reverse of my problem, which is
usually how to munge with the PopUp List itself, or it's matrix).  When
you create the PopUp programmatically, keep the button (perhaps in your list
of things to free) as an id instance variable.  Overhead is small, since it
is a pointer.

The other alternative is to create the popUp in IB, where you get a handle to
the button.  Now, reference the popUp with [button target], or add a category
to PopUp to return the matrix (which is what I do) and munge it directly.

>I think NeXT should implement the concept of parent/child windows to
>provide a generic solution to this problem (i.e. the PopUpList window
>becomes the child of the main window). There would probably be many uses
>for such a feature besides PopUpLists. Also, closing/hiding the parent
>window could automatically close/hide the children.

I'm not so sure about this, but I really hope PopUp list has been debugged
and better integrated into 3.0; it's kind of a bastard child now.

-- 
Subrata Sircar | ssircar@canon.com | Prophet & SPAMIT Charter Member
Canon Information Systems and I do not speak for each other on all things.
"I wish people wouldn't instantly assume that I am an idiot." (Valentine)
"A restaurant is a whorehouse that does food instead of sex." (Roger Lustig)
Newsgroups: comp.sys.next.programmer
From: brod@jessica.stanford.edu (Brodie Lockard)
Subject: Re: NeXT Concepts.
Keywords: Objetive-C, super, NeXT Window Server, MACH.
Organization: Academic Information Resources
Distribution: usa
Date: Mon, 17 Aug 92 04:48:49 GMT

In article <900@tdat.teradata.COM> cyk@tos28.teradata.com () writes:

>   1] Can a client of a NeXT Step window server be running
>      on a remote host?  If this is possible, under which
>      document is this capability documented?

If you mean "Can an app running on one NeXT display on another?" then yes.
In the Preferences app on the displaying machine, under Unix Expert, check
"Public Window Server," log out, and log back in.  Then, open a shell on
the displaying machine, rlogin to the machine where the app is and type

appmachine>TheApp -NXHost displaymachine

After a bit, a miniwindow will appear at the bottom of displaymachine's
screen, representing the app.  Double-click it.

>   2] Does NeXT Step take advantage of MACH's threading, 
>      virtual memory management and messaging facilities?

Dunno.

>   3] In Concepts, there is an example, illustrating the use 
>      of SUPER in Objective-C, in the following way:

                ...
>		bInstance = [super new];
                ...
>
>       The semantics illustrated above seems to imply that 
>       bInstance will be pointing an instance of A since
>       "super" causes the invokataion of A's new.
>
>       Will class object B return a structure, which properly
>       represents the newly created instance of B, if B has 
>       additional instance variables other than A's?

bInstance will be pointing to an instance of B, which is exactly like an
instance of A, except that it has whatever additional instance variables
and methods you've declared in B.h.

Brodie Lockard      brod@jessica.stanford.edu
Newsgroups: comp.sys.next.programmer
From: bill@epnxt.jsc.nasa.gov
Subject: How do I tap into the selectionChanged method?
Reply-To: bill@epnxt.jsc.nasa.gov
Organization: nasa-jsc
Date: Tue, 18 Aug 1992 20:49:14 GMT

I have a soundview and wish to have my data variables updated everytime my  
selection area changes.  I have set all the approate flags except possibly  
some delegate.  What little documentation I have on this matter states the  
following:  "selectionChanged:  Sent to the delegate whenever the  
SoundView's selection Changes".  I also have set the setContinious flag to  
YES.  

I have a method which calls the getSelection method and prints the  
results.  My question is how do I automate the process so that my function  
is called whenever I mouse drag a new selection in the SoundView without  
having to physically call my function to run itself via a button?

Thanks in advance.	


			Bill
Newsgroups: comp.sys.next.programmer
From: ajetha@gpu.utcs.utoronto.ca (A. Jetha)
Subject: postscript
Organization: UTCS Public Access
Date: Fri, 21 Aug 1992 04:00:08 GMT

Hi,

Could someone give some example code on how to make text follow a defined path
in postscript.  I need to make some text that arcs, I mean follows an arc.

I would greatly appreciate your help!

Thanks 
AJ
Slowly conquering that steep NS learning curve.

Newsgroups: comp.sys.next.programmer
From: dave@nakiska.ucs.ualberta.ca (David Ross)
Subject: Re: Change HostID - How ??
Organization: University Of Alberta, Edmonton Canada
Date: Wed, 19 Aug 1992 19:41:02 GMT

In article <1992Aug18.153253.3473@midway.uchicago.edu>  
eer1@midway.uchicago.edu(Paul Woods) writes:
> Hi -
> 
>  Last week I posted to .sysadmin and I received a couple of responses to  
the  
> following question (none of them were detailed enough).  The HostID on a  
NeXT  
> can be changed ( At least that is what I have been told ) and I need to  
be able  
> to change it on several of my NeXT's.  HOW DO I PATCH THE OS SO THAT IT  
WILL  
> ALLOW ME TO CHANGE THE HOSTID.  I am not a programmer (not really  
anyway) so  
> please keep it on a very simple level.
> 
> Thanks,
> 
> Paul-

Hi Paul.  You can't change the hostid of a Sun or a NeXT.  (Unless there  
is some sort of magical system patch to do it). I missed your previous  
posting so I don't really understand why you would want to.
 
Some people may have read the man page on the "hostid" command and been  
mislead.  The man page says you can change it.  It then refers to the  
gethostid(2) call for more info.  In that man page it states that the  
hostid is permanent and unique for every machine.  It currently returns a  
4-byte integer with the first byte set to 1, and the last three bytes set  
to the last three bytes of the ethernet address of your machine (which are  
guaranteed to be unique).

The system call sethostid(2) doesn't really seem to work (there's no man  
page for it either).  In generic BSD I assume it is possible to set your  
hostid.  In fact I know it is on some machines - I've done it.  However  
the fixed hostid scheme makes a lot more sense to me as it can be used to  
identify a particular CPU and be guaranteed it will never change.  Many  
licensing schemes make use of this.

--
David A. Ross, Programmer Analyst  | dave@nakiska.ucs.ualberta.ca
Computing and Network Services     |  (NeXTmail accepted)
352 Gen Serv Bldg, Univ of Alberta | Phone: (403) 492-9339
Edmonton, Alberta, Canada  T6G 2H1 | Fax:   (403) 492-1729
From: dstrout@isi.edu (David Strout)
Newsgroups: comp.sys.next.programmer
Subject: Summary: Animating lots of small bitmaps
Date: 13 Aug 92 12:07:28 GMT
Reply-To: dstrout@darpa.mil (David Strout)
Distribution: usa
Organization: Information Sciences Institute, Univ. of So. California


Well, I got several responses from people (Thank you one and all!).
For my particular problem(bad flicker when animating a bunch of
bitmaps, each in a subview, in a large main view), turns out the the 
flashing was due to the way I was erasing my bitmaps before
re-drawing.  
I was doing it like this:

- drawSelf:(NXRect *)rects :(int)rectCount 
{

	PSsetgray(0);
	NXRectFill(rects);

	[self moveBy: 7 :0];

	[ship composite:NX_SOVER toPoint:&bounds.origin]; 

	return self;
}

where ship is an NXImage.  When I replaced the PSsetgray and
NXRectFill calls with [backGround composite:NX_SOVER
toPoint:&bounds.origin] where backGround is an NXImage the same size
as ship, initialized to the background, the flicker went away.  Better
examples of this are in BackSpace, by Sam Streeper, and PacMan, by Don
Yacktman.

Thanks again for the helpful suggestions.

dave.
From: car@informatik.uni-kiel.dbp.de (Carsten Rathsack)
Newsgroups: comp.sys.next.programmer
Subject: How to Compile XPilot?
Keywords: XPilot, MouseX, X11
Date: 18 Aug 92 08:41:11 GMT
Organization: Universitaet Kiel, Germany

I tried to compile the lately posted XPilot under NeXTstep 2.1 and MouseX
release 4. But it doesn't work. The program open some windows and
crashes always before the first pixel is drawn!

Did anybody successfully compile it under the same environment?
Did anybody even try to convert it to NeXTstep?

Any help is welcome

Carsten

---------------------------------------------------------------
  Carsten Rathsack                        Preusserstrasse 1-9 
  Christian-Albrechts-Universitaet Kiel   W-2300 Kiel 1
  Department of Computer Science          Germany
  email: car@informatik.uni-kiel.dbp.de  
---------------------------------------------------------------
Newsgroups: comp.sys.next.programmer
From: dpp@athena.com (David Pollak)
Subject: Re: Any chances of an improved Font Panel mechanism?
Reply-To: dpp@athena.com (David Pollak)
Organization: Athena Design, Inc.
Date: Wed, 12 Aug 1992 18:01:56 GMT

In article <by+y7zm@rpi.edu> gad@eclipse.its.rpi.edu (Garance A. Drosehn)  
writes:
> 
> In an article in comp.sys.next.software
>    subject: In-line graphics (was Re: SoftPC 2.0 or 3.0)
>    tlm@nextasy.physics.mcmaster.ca (Tom Marchioro) writes:
> 
> > Since Glenn has taken us to the issue of rewriting objects for
> > convenience and/or improved function, how about the Font Panel?
> > Are any "improvements" planned for in 3.0?  Like a shelf for
> > frequently used fonts?  or maybe make the "panel" into a browser
> > where you can make "folders" of fonts for specific types of
> > documents?  etc. etc.  All I've done with my machine is to add
> > the various PD fonts off of Sonata, plus the ones that came with
> > Illustrator, but I still get very tired of having to scroll through
> > all those fonts repeatedly to use just a few again and again on a
> > certain document.  Any hopes this will be improved?  or is this 
> > somehow more difficult than I think?
> > 
> > (As an incentive to Glenn, I bet if the font panel were more 
> > convenient people would be more interested in buying additional
> > fonts)
> 
> I'm also interested in seeing improvements to the font panel.  I'm not  
sure  
> which changes would do the most good, but once you have a lot of fonts  
the  
> current selection mechanism does get unweildy.
> 
> I picked up Stylist for this, and it helps a bit.  I've also gotten used  
to  
> "command-3 command-4"-ing in a document to copy a font from one place to  
> another.  I think it'd be nice if we could come up with some thing  
better  
> than that though.
> 
> Any takers?   :-)
> 

We have a extended the font panel in Mesa to provide drag and drop font  
support (the preview window acts just like a color well.)  Please take a  
look at the demo version of Mesa on the archives.  I will provide an  
unsupported copy of the code to developers who can make good use of it.

David

-- 
David Pollak - dpp@athena.com - NeXTMail Compliant
Attorney at Law,
Feeder of the Bears, Athena Design, Inc.
Organization: Penn State University
Date: Fri, 21 Aug 1992 23:32:22 EDT
From: <MKK2@psuvm.psu.edu>
Newsgroups: comp.sys.next.programmer
Subject: Re: Request for DBkit Information

I don't have anything to tell you, but I can try a suggestion.  Go in
person to the nearest NeXT employee.  Ask them.  Sign non-disclosure if
they want.  Get them to give you xeroxes of the manuals.

                                                        M-
Newsgroups: comp.sys.next.programmer