Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!apple!farrier From: farrier@Apple.COM (Cary Farrier) Newsgroups: comp.sys.apple Subject: Re: IIgs Software Reboot Keywords: landslide, duplicable, intricate, citron Message-ID: <37227@apple.Apple.COM> Date: 13 Dec 89 17:10:23 GMT References: <1949868@mtsg.ubc.ca> Organization: Apple Computer Inc, Cupertino, CA Lines: 50 In article wombat@claris.com (Scott Lindsey) writes: >In article <1949868@mtsg.ubc.ca> Les_Ferch@MTSG.UBC.CA writes: > >> I need a routine that will reboot a IIgs in the same way that >> pressing Control-Apple-Reset does. I already have the program >> sreset.sys, but it's just a little too severe for my needs because >> it clears the /RAM5 volume. > >I do it by faking the ADB sequence after munging the power-up byte. >Note that this can do bad things if GS/OS is busy at the time, just >like rebooting manually when the drive's spinning. > > LDA >$0003F4 ; Power-up byte > EOR #$00FF ; muck it up. > STA >$0003F4 > > PEA $0000 > PEA $0000 > PEA $0000 > PEA $0010 > LDX #$0909 > JSL $E10000 ; Send the ADB message for Ctl-Apple-Reset > > ; Not reached: tool call doesn't return. > > > >Scott Lindsey |"Cold and misty morning. I heard a warning borne in the air >Claris Corp. | About an age of power when no one had an hour to spare" >ames!claris!wombat| DISCLAIMER: These are not the opinions of Claris, Apple, >wombat@claris.com | StyleWare, the author, or anyone else living or Dead. A better solution is to use the OS_SHUTDOWN call ($2003). When using this call, an os_shutdown message is sent to everybody in the system who would like to know when the system is going down. This call will also flush out any data to any files that has not been written out by the FST yet. If your programs would like to be notified of a shutdown, you can use the notification queue. Cary Farrier -- +---------------------------------------+---------------------------------+ | Cary Farrier | Internet : farrier@apple.com | | Apple II Systems Software Engineering | UUCP : apple!farrier | | Apple Computer, Inc. | Fax : (408) 974-1704 | | 20525 Mariani Ave. | AppleLink : FARRIER | | Cupertino, CA 95014 | or farrier@applelink.apple.com | +---------------------------------------+---------------------------------+ | I don't speak for Apple Computer, our products do. | +-------------------------------------------------------------------------+