ZBGQUIK by Jay Sage (derived from BGQUICK by an unknown author) -------------------- Update to version 1.1 I added code to preserve additional memory areas. I needed this to save my DateStamper buffers (just in case) and the time registers of the SB180 BIOS real time clock. It may be possible to save some video memory areas or other buffers that you do not want to have reset to the state they had when BGQ.COM was saved. I also modified the code to use memory more efficiently. The SYSLIB and Z3LIB routines are needed only when ZBGQUIK is run and are not needed by the saved program code. Therefore, I have now put the memory buffer at the beginning of the library code so that it overwrites and reuses that space. A word of caution. The saved BGQ.COM file cannot be used for an initial loading of BGii with a virgin swap file created by PUTBG. It will only work with an initialized swap file. There may very well be other circumstances in which it will not work, since nothing in done to restore the swap file to the condition it was in when BGQ.COM was saved. Coldbooting my SB180 is a painful process (because of the time required to reinitialize the RAM disk), so I have not experimented fully. I would expect that this technique for reloading BGii is very fragile. -------------------- Version 1.0 This is a rewrite of the very clever BGQUICK by an author who¨ never identified himself in the documentation except with his initials¨ (kls). That program was designed to put one into a complete BGii¨ environment without having to go through the time-consuming process of¨ relinking BG.REL using LOADBG.COM. It was a great blessing! This version has been modified for use with BGii running under¨ ZCPR3. The main difference, besides the fact that the source code is¨ fully commented and uses library routines, is that the ZCPR3 multiple¨ command line buffer is preserved when the quick-load file is run. ¨ BGQUICK's file always put one back in the directory one was in when¨ the quick-load file was created, and there could be no further¨ commands on the command line after its invocation. The ZBGQUIK loader¨ program can be used in alias scripts (but don't try running it from a¨ ZEX script -- I'm not sure what would happen, but I don't think it¨ would be what one wanted). To use ZBGQUIK, load BGii and set it up in the configuration you¨ prefer, including OCPs, shells, error handlers, etc. Then enter the¨ command: ZBGQUIK A message will appear in the following form: Save length is nnH pages. where 'nn' is the number of pages you should save. You then enter the¨ command: SAVE nnH BGQ.COM using the number of pages given in the message and whatever name you¨ want to use for your BGii quick-loader. A completely installed version of BGii now resides on disk, so¨ that all you have to do to get in to backgrounder in the future is to¨ run BGQ.COM. BGQUICK and ZBGQUIK work by putting a complete image of the¨ operating system memory (from the DOS pointer over the top of memory¨ to the end of the first page) into a file, which, when it is run,¨ restores that complete image. There are risks with this procedure. ¨ It was shown by the original author to work on the Kaypro and¨ Superbrain. I have used it on my SB180. Anything else is up for¨ grabs. (Note that if the status line is on with the Kaypro, it will¨ be restored each time BGQ is run. The screen top, however, will be¨ incorrect, so the status line will come up at some random position on¨ the screen. The original author recommended keeping the staus line¨ off, at least until after entering BGQ.) On the Superbrain, the program will restore the screen to look¨ identical to the original save. On the Kaypro, it will not (memory ¨ mapped video is banked in on the Kaypro). Similarly, on the¨ Superbrain, video attributes will not be restored. The method used to leave the multiple command line buffer intact¨ when BGQ is run can be extended in a straightforward way to preserve¨ other buffers (e.g., NDR, shell stack, error handler, etc.). It would¨ even be fairly easy to accept command-line parameters to control¨ whether or not various buffers would be restored or left as is. It¨ would also be possible to enhance the ZBGQUIK code to take a file name¨ on the command line and automatically write the resulting image out to¨ disk instead of making the user perform a manual SAVE. Jay Sage, October 26, 1987