Aug 88 Mousehole
Volume Number: | | 4
|
Issue Number: | | 8
|
Column Tag: | | Mousehole Report
|
Mousehole Report
By Rusty Hodgee, Mousehole BBS
From: gbryan (Geoff Bryan)
Subject: LSP Interfaces
Has anyone seen a more complete set of interfaces for the ROM & System routines beyond what Think put out last fall? If not, it looks like a long session of porting over the MPW 2.0 interface files. (What started me on this quest was the discovery that the Shutdown Manager routines do not seem to be in last falls 1.11 update package. Dont know what else is missing or different.) [We have blasted Think repeatedly for taking so long to keep LS Pascal up to date with the latest set of goodies from Apple. There is a new version coming, they tell me, but, like the LS C update, who knows when? If nothing is forth coming at the Boston Expo, you can bet we will blast them again! They do have a Shutdown Manager glue patch you can get if you call for it. You might want to look at TMLs new MPW Pascal II., available at the MacTutor booth at the Boston Expo. -Ed]
From: pepnerd (Peter Kramer)
Subject: menus
Im just a beginner at programming the mac. Im trying to set up menus using the code in Using the Macintosh Toolbox with C by Takatsuka et. al. Im not sure how to call InitGraf() in the situation where I have not set up any windows, only menus. In my development system the example (Aztec C) the call to InitGraf() uses the argument &thePort. However I cannot find where thePort is defined. Its quite distressing to double click on an application icon and get nothing but a bomb!
From: ericlim (Eric Lim, Flushing, NY)
Subject: Re: menus
Im not familiar with Aztec because Im using MPW C 2.0.2 and I think the variable thePort is defined in the Quickdraw.h header or include file.
From: think
Subject: Re: menus
Its not important to know where thePort is defined; all thats important is that you pass the correct series of initializations in order to get your application started:
{
InitGraf(&thePort);
InitFonts();
InitWindows();
InitMenus();
TEInit()
InitDialogs(NIL); }
Typically, thePort is defined as an extern GrafPtr in Quickdraw.h (in LightspeedC) or in the appropriate header for other C compilers. --Rich Siegel, THINK Technologies
[The variable thePort is one of those mysterious Quickdraw global variables that no one ever talks about once you are convinced the proper call works correctly. The first few issues of MacTutor, over three years ago, addressed this subject in depth, explaining how the Quickdraw Globals are stored relative to A5 and how they work. The Mac system is responsible for the Quickdraw Globals maintenance. Refer to Volume 1 of The Best of MacTutor for more information. -Ed]
From: laskey (Jim Laskey, Halifax, NS)
Subject: Second Stack
Is there a safe way for an application to allocate a second system stack? TGS systems is currently developing a visual programming language known as Prograph. One of the main features of Prograph is the ability to perform editing and debugging of source code while in an execution state. All routine calling sequences are performed through a system stack as per normal. However, the state of the execution system stack must be kept separate from the system stack used during editing and debugging. The solution was to allocate a second system stack just for execution and use the defacto system stack for debugging and editing. Where does one allocate the second stack? For the sake of the stack sniffer this second stack was allocated between ApplLimit and A5. Early versions of Prograph used the following sequence to allocate the second stack;
newStack = ApplLimit;
ApplLimit = newStack - DefltStack;
MaxApplZone();
Until testing on the Mac II, this worked quite well. On the Mac II, strange things began happening whenever Prograph switched to the second system stack. Text would not show up in menus and window frames were drawn incorrectly. The only notable difference between the Mac II and the other systems was that DefltStack was 16k greater on the Mac II, presumably to handle color Toolbox calls. The stack allocation algorithm was changed to the following;
newStack = ApplLimit + DefltStack / 2;
MaxApplZone();
This works fine. However, what happens when a Toolbox call needs a large chunk of the stack? Is there a safe way for an application to allocate a second system stack?
[I dont think so. This sounds like one of those nifty ideas that will probably never work since it will never quite match up with Apples changing system file, and MultiFinder evolution. I suggest you scrap this approach and try something less controversial. Can Apple DTS suggest a safe approach? -Ed]
From: mark (Mark Murphy, Anaheim, CA)
Subject: New Stacks
I need to be able to create a new stack from within a script! The only thing I have found is doMenu New Stack.... Yet, I do not wish the modal dialog to come up to the user. I need to create a stack and be able to name it myself, from the script without user input. Anyone have any ideas?
From: rdclark (Richard Clark, Tustin, CA)
Subject: Re: New Stacks
Well, since youre probably not planning to use HyperDA with your stack (as it wouldnt allow you to write to the new stack anyway), you can get away with using an XCMD. What this command should do is to duplicate an existing template stack and then rename it. If the template doesnt exist, then you should put up a dialog box to that effect and execute a doMenu New Stack to let the user create the *TEMPLATE*. If you *really* dont want the user to see a file selection dialog, you could encapsulate a new stack as a bunch of resources in your stack. The XCMD would read one of these resources and use it to create the stacks data fork. The other resources would be copies into the resource fork. However, this second method could get kinda ugly.
Subject: SCSI Accelerator
From: thecloud
I have tried using the SCSI Accelerator INIT (version 1.1) on my Jasmine 20 (miniscribe drive). It doesnt do ANYTHING for performance; the Disk Timer II numbers before and after were exactly the same. The Jasmine formatting software doesnt let you set the interleave (v.2.34), but I understood it to be 2:1, which was recommended by SCSI Accelerators author. So am I missing something, or does this INIT only work on certain brands of hard drives?
Some Responses from Usenet
From: Ephraim Vishniac
The SCSI Accelerator INIT only has the opportunity to work on drives which do all of their SCSI operations through the SCSI manager: theres no way for it to trap hardware access. In order to get decent performance, the Jasmine software goes straight to the hardware on the Mac Plus. So, the INIT cant do anything for that drive that it doesnt do for itself already. Though I havent examined it, I expect that what this INIT does is replace Apples tight loop for blind transfers with an unrolled loop of some length. This lets you tighten up your interleaving one notch on many drives.
Defense of Apple: They chose the speed of blind reads and writes deliberately to accommodate the varied timing of as many drives as possible. They certainly knew how to write a faster loop, but were aware that it wouldnt work with many of the then-available drives.
Claimer: I wrote the Jasmine software up to version 1.95 or so.
From: dolf@uva.UUCP (Dolf Starreveld)
As already explained in two previous messages by Maarten Carels and me, the original version of SCSI Accelerator indeed tried to speedup blind SCSI operations by loop unfolding. It installed the patches only on a Plus and one of the two patches was installed in the wrong place. This is a serious BUG. It may cause polled (non-blind) writes to only poll the first byte of a scInc/scNoInc transfer and not the rest, therefore effectively reducing these to blind writes. A good driver uses blind operations when it can, so if a driver uses polled writes there is a very nice probability that in these cases some serious mishap may come to you. Another error was that the patch code always assumed 512 byte transfers in each scInc/scNoInc command. This is incorrect and may also be the cause of the original accelerator failing on certain drives (notably Rodime 20Mb).
I have a new version that fixes all these bugs and installs patches at the correct places. The first version (SCSI-accel) is the one described above. The second version addresses the timing problem Ephraim addresses above under In defense of Apple for some drives. As we found out (I have a very old Rodime RO652) some old drives (and maybe even some new ones) cant keep up with two consecutive move.b instructions. The original Apple code always had the delay of one DBRA between any two bytes transferred. This is, as stated by Ephraim, long enough for the code to work with any drive. The Rodime 652 needs a small delay between each two bytes, but a DBRA is an overkill.
If you dont use a MacPlus, you might as well stop here. If your driver does not use the SCSI manager SCSIRBlind and SCSWBlind routines, ditto. If you dont know, install and just see if it works. If not youre driver either doesnt use these calls or does polled operations.
Subject: cdevs and System 6.0
Practically all the public domain/shareware cdevs I used with no problem under System 4.2/Control Panel 3.2 appear to break under System 6.0/CP 3.3. Usually its The Control Panel cannot get enough memory (with almost 2 megs free?!), but other alerts have popped up as well. One of the broken cdevs includes the Apple Sample cdev from IM V, which I compiled myself. Hmmmm.... I think the problem may be that these cdevs do not have a sysz resource. Am I right?
Well, after looking more closely, I discovered the reason why various cdevs were breaking under System 6.0: they check for the presence of certain packages in the System file (usually PACK 7 or PACK 4) that no longer exist! (except in the ROM). Even Apples Sample cdev in IM V does this (although theres a brief disclaimer that you really should check for the packages in ROM). Ouch. Then theres the MultiFinder test. Most sample source code Ive seen (actually, ALL) checks for MultiFinders presence by testing to see whether the WaitNextEvent trap is implemented. Now, in System 6.0, its implemented ALL THE TIME, whether youre in MF or not. So if application X assumes its running under MultiFinder when it isnt, well, look out.
Question: how do you detect MultiFinders presence or absence under 6.0? [Answer: Your not supposed to care if MulitFinder is there or not; only check for the various services you expect. -Ed]
From: rusty (Mr. Rusty Hodge, Orange, CA)
Subject: Modem Problems
Hello, glad to see the Usenet stuff here. Did you know about the modem problem on line 2252? Im using a Novation Professional 2400 modem and when I dial 2252 I connect at a weird level. Your modem answer tone throws my modem into a strange state where I hear a single handshake tone that neither modem seems to recognize. I have to manually hang up to clear my modem or let the S10 register time out. I have only been able to connect once on 2252 at 2400 baud. Line 1190 seems to work fine at 1200 baud. Just thought Id let you know.
From: billw (Bill White, Santa Ana, CA)
Subject: Re: Modem Problems
I checked the problem with funny carrier tones, and discovered that there is a low-pitched tone being transmitted from one of the system modems.
From: rusty (Mr. Rusty Hodge, Orange, CA)
Subject: Re: Modem Problems
Well, Ill let you be the test. Here are the 4 mousehole 2400 numbers, in the order of their hunting sequence: 921-2252, 921-2255, 921-1090, 921-1161.
From: billw (Bill White, Santa Ana, CA)
Subject: Re: Modem Problems
I checked all the lines in the hunting sequence and sure enough, the problem is actually on the modem connected to 921-2252. Its a low-pitched tone that is being sent, and which masks the carrier tone.
From: rusty (Mr. Rusty Hodge, Orange, CA)
Subject: Re: Modem Problems
Okay Bill- Thanks for your hard work and effort. It is apparently something that isnt consistent: I am on that line now and had no trouble connecting. Ill check it out though; Ill stick a spare modem on it and see what happens.
From: stu (Stuart Davison, Tucson, AZ)
Subject: Had some noise problems...
I had some problems so far. They are as follows: sometimes I keep getting cancelled with a ** and I have to reread the message over and over until I get the full message. It may have been the lines, I called back several times and got through a few times without much of a problem. My question is, is there some way to temporarily disable the interrupt so that if the line is interrupting it wont cause such a problem?
From: rusty (Mr. Rusty Hodge, Orange, CA)
Subject: Re: Had some noise problems...
The Interrupt key defaults to RUBOUT/DELETE. Delete is a kinda common noise character. Go to M on the main menu and change your interrupt key to ^C or something. ^C seems to work well in a noisy environment.
From: rusty (Mr. Rusty Hodge, Orange, CA)
Subject: Security Access Levels
Since Ive gotten about 15 letters about this, I thought id post a bit about security levels. When you initially call, you have a security level of 1. This lets you read and post messages locally. To post to the network, you need a level of at least 2. I will only give people network access (level 2) if they request it. If you request it, it will take about a week before I get around to doing it. So, please be patient and only request network access if you intend to write to the network. Finally- inappropriate network activity will result in your network access being denied. It is suggested that you read the usenet topics a week or two before posting to them. A level of 0 means you have been bad and your account is suspended.
From: rusty (Mr. Rusty Hodge, Orange, CA)
Subject: Modem Info
Wouldnt you know it- just when we get the 2 new Mitsuba Modems, Mitsuba changes their firmware to be identical with the PP2400SA! So there is the possibility that 2400 will not be 100% reliable until I get around to cloning some ROMS from the old units. HOWEVER, the good modems are on the 921-2252 numbers, the bad ones are on the 1090 numbers. If 2252s lines are busy you will be bumped to 1090, and may not connect at 2400. ALSO- The 998-1199 number is now using the good old 1200 baud UDS modem (read: ultra-high quality). If you are getting noise connecting to 2252 or 1090 at 1200, please try the 1199 number.
From: rusty (Mr. Rusty Hodge, Orange, CA)
Subject: MouseHole Access
It has been asked by many people if MouseHole is available to non-MacTutor subscribers. Currently, MouseHole is free to all users. In the future there will probably be a small annual charge for non-MacTutor subscribers. The MouseHole download, which is an entirely seperate system, costs $10/year for basic access, and $20/yr for unlimited access.
From: cfuller (Clayton Fuller, Whittier, CA)
Subject: IW spooler
Multifinder is pretty much a curiosity to me at the moment. The two things I need it to do it cannot. More likely I just dont know how. First, how can I print to the Imagewriter in the background? Second, what terminal emulation programs will allow me to download in the background?
From: ossian1 (Santa Ana, CA)
Subject: Re: term emulator
VersaTerm does just fine in background download mode. Its also only $99 to normal folk, and who knows, maybe the company will give students a discount. jvs - ossian
From: rusty (Mr. Rusty Hodge, Orange, CA)
Subject: Re: term emulator
I have problems using VersaTerm Pro on MHDL. I stopped using plain-old VersaTerm because I *thought* it didnt download in the background. Ill have to try it.
From: rick (Rick Boarman, Claris Corporation)
Subject: Re: term emulator
I use MicroPhone II to down load in the background. It works just fine even if it is a little pricey ($295 I think).
From: greg (Greg Kearney, Casper, WY)
Subject: Re: term emulator
Red Ryder 10.3 will download in the background
From: ms (Michael Steiner, Sierra Vista, AZ)
Subject: IW SPooler
Clayton, Multifinder does not have an IW background print option. If you want to spool to the IW, you will need one of the commercial, shareware or pub domain spoolers. As far as downloading in the background, there are a number of utils that will do that, but for term emul. programs, I think that only MicroPhone II will do that, but I may be mistaken.
From: lnedry (Larry Nedry, Anaheim, CA)
Subject: MouseHole Download
The MouseHole Download can be reached at (714) 533-6112. At present there are two phone lines at 2400 baud. If you are a new caller, type new at the logon: prompt. There is a fee for downloading but you may browse all you want before deciding if you want to join. The cost for 1 year is as follows: For 45 minutes of download time per day - $10.00 For 300 minutes of download time per day - $20.00 You can signup with MasterCard or Visa by typing a $ at the main menu. Type a ? for help. 128 and 1024 byte X-Modem is the protocol in use. Ill be happy to answer any questions you may have. Larry Nedry (MHD sysop)
From: spud (Spud Potato)
Subject: MF Terminal programs...
The new version of AppleLink (v. 5.0) downloads in the background with no apparent slowdown in speed....
From: rich (Rich Siegel, Bedford, MA)
Subject: Re: LS Pascal Radius SANE incompatability
It is, in fact, a problem with Radius SANE. I talked to Ron Marianetti at Radius (who did the Radius SANE INIT), and he did track it down to his bug. Theres a new version. I think its 1.1 or 1.2 of Radius SANE that is available to fix the problem. --Rich Rich Siegel THINK Technologies
From: tomh (Tom Herbst, Ithaca, NY)
Subject: Palette Manager in LSP
I am having a great deal of difficulty adding the necessary interface file to use the Palette Manager with LightSpeed Pascal. I manually entered the appropriate data structures, inlines, etc. gleaned from Inside Mac V, the MacTutor articles, and the Programmers Online Companion (all consistent), but the SetPalette calls crash even MacsBug with bus errors. Is there a copy of the necessary code along with a simple (i.e. create a palette, a NewCWindow, and draw a rectangle) program example out there somewhere? My PaletteMgr and example program compile ok, but run very inconsistently, sometimes drawing things in the default (startup) palette and more frequently crashing the whole shebang.
From: rick (Rick Boarman, Claris Corporation)
Subject: Re: MacTutor Disks
Many a times we have wished that we could download MacTutor source code from some board (ours?). Wed be willing to pay some fee for this handy service. Can this be setup? [Yes, Rusty and I are setting up a private MacTutor download for a fee, exclusive to the Mousehole. -Ed]
From: ericlim (Eric Lim, Flushing, NY)
Subject: Modeless Dialog/List Manager
HELP! HELP !! Does anyone know of a technique on using the List Manager Package in a UserItem inside a Modeless Dialog? I dont want to create the window and controls on my own, I want to use IsDialogEvent and DialogSelect. Any suggestions on how I can do this? So far, Im getting a system error when I use LNEW with rView set to the rectangle of the UserItem. I got the Modeless Dialog to work on a regular dialog with a UserItem. I also got the List Manager to work on a regular window that I created. But it just bombs when I use Modeless Dialog with the List Manager Package. I would appreciate any help or suggestions I could get. Thanks a lot! [Forget the Dialog Manager and just use the list manager into a window. -Ed]
From: tompink (Tom Pinkerton, Iowa City, IA)
Subject: Ending DA drvrCtl routine
For a while now, Ive been using an ending to the drvrCtl desk accessory routine that was supplied with my MDS development package. That ending, rather than simply returning, calls the low-level Device Manager routine IODone (pointed to by the JIODone global variable) before returning. Ive been blindly keeping this in all my DA sources without really knowing its purpose. I assume that who ever wrote the sample DA for the MDS development system knew what he or she were doing when they added this call. All I can figure is that the call somehow clears the IO Request sent to the DA from the driver IO Queue so that other devices wont receive the request (since they neednt bother with it, I guess). Does anyone know anything about this?
From: asc (Alex Colwell, El Segundo, CA
Subject: Using TTEView in MacApp
Is there anybody using MacApp? We are trying to develop an application using MacApp here at HAC (Hughes Aircraft Company). The application is design to handle various aspects of the mission planning (ie. war games simulation). My problem is trying to create a TTEView object inside another view. Rather creating the text edit view object at the time DoMakeViews method is invoked. I would like to able bounce around in the current view and create a TTEView object relative to the mouse click position. The TTEViews DoKeyCommand and DoMouseCommand methods are never invoked. The current view methods is always getting it before the TTEViews methods. I tried to pass the information on to the TEViews method, but always crashes and transfer to MacApps debugger. I have created a TCatView to contain the current view of interest and create the TTEView, but it does not work either. I tried to force setting the current child view using the SetCurrentChild, but it crashes, too. I am really stump how to make this application work properly. So far, I am really disappointed in MacApp. Its suppose to be easier to program for the Macintosh, but I think it is worst than traditional Macintosh programming. If anybody has any thoughts, please let me know.
From: david (David Schlesinger)
Subject: DRVRs and Asynch I/O Calls
Im currently writing a DRVR to handle a network protocol, and one aspect of the dDevice Manager interface has me a little puzzled: I understand that I can make asynchronous calls to the driver, and that these will be handled at interrupt level. What part of the MAC OS calls my DRVR? How often does this happen? Is my DRVR called only when the drivers i/o queue is non-empty? I also gather that I can defer processing a _Control call by returning with a RTS rather than via jIODone. Will my DRVR be called to service subsequent requests in the queue if I defer a call? Inside Mac doesnt really detail all the specifics of managing asynch calls to driver ids. Any wizards who have some insight , your help would be greatly appreciated!