In article , focuseditsolutions@hotmail.com (Jim Cullen) wrote: > I own Beneath Apple Prodos...also I just found an article about > writing directly to the Disk with the controller by Neil Parker. Very > interesting.....I'm not trying to copy protect anything, but I'd like > to figure out how to create a custom boot disk.....or a > directly-bootable game...etc . > [...] > Thanks > > Jim If you don't need custom formatting or subsequent disk I/O (say for a game), you can create a custom boot disk by naming your binary "PRODOS". The boot loader on blocks 0 & 1 will load the file at $2000. You can even edit the name in the boot loader, if you prefer something else. Here's an article I wrote some years ago showing how to load a hi-res picture: [ Apple-Dayton Journal - Languages - Copyright 1987 ] Booting Without ProDOS by John B. Matthews, M.D. The program that allows a computer to read data stored on disk is often referred to as the disk operating system. Apple's ProDOS (Professional Disk Operating System) is a premier example. Since the disk operating system itself is stored on disk and the computer needs that program to read the disk, how does the machine ever get started? On the Apple ][, the disk controller card has a small program stored in its own read only memory (ROM) that can read the disk sufficiently well to load part of the operating system. That part, in turn, is able to read yet more code and so on until finally the entire operating system is in memory. It's like pulling oneself up by one's own bootstraps, hence the term boot. To create a bootable disk under ProDOS it suffices to initialize the disk and copy onto it the file named PRODOS. In the absence of this file, booting an initialized disk produces the somewhat disappointing message "UNABLE TO LOAD PRODOS". Apple licenses the ProDOS system software to commercial developers for an annual fee, but for collections of public domain software even this nominal charge is prohibitive. Fortunately, there is an alternative. The disk controller ROM is able, ultimately, to read the first 1024 bytes of information from the disk's outermost track into memory at $800. On a ProDOS formatted disk, this boot code then reads the ProDOS directory, searches for a system file named PRODOS, loads that file at $2000 (16384), and executes it. As long as the file is named PRODOS it will be loaded and executed. Naturally, the substitute PRODOS can't access the disk thereafter, but this is adequate for single load games or personalized disks. One can only hope that the boot code will not someday require a license fee. One technique is to create a substitute PRODOS file that displays a suitable hi-res image on the screen. The picture might include a splashy announcement along with a friendly suggestion that the user copy his or her own PRODOS file onto the disk for future use. Here is the step-by-step. 1) Create the hi-res artwork and save it as a file named PIC. 2) Initialize a blank disk using the ProDOS system utilities, filer or commercial alternative such as Copy ][+; name it /BLANK. 3) Load the picture into the screen buffer: BLOAD PIC,A$2000 4) Enter the monitor: CALL -151 5) Copy the first three bytes of the picture to the end of the screen buffer: 3FFD<2000.2002M 6) Enter a jump instruction in the first three bytes of the screen buffer: 2000: 4C 00 40 7) Enter the code in listing one into memory using either the mini-assembler or by typing directly into the monitor as in step 5). 8) Create an empty system file on the blank disk: CREATE /BLANK/PRODOS,TSYS 9) Save the whole mess: BSAVE /BLANK/PRODOS,A$2000,E$4028,TSYS Viola! Boot the disk and the picture appears. The code in this example merely fixes the three bytes at the picture's beginning and waits for a keypress. A more elaborate scheme is possible: as much as 40K bytes can be loaded this way. Conceivably, the boot code at $800 could be commandeered to read yet another file. Who needs ProDOS? Listing 1. ---------- 4000: AD FD 3F LDA 3FFD 4003: 8D 00 20 STA 2000 4006: AD FE 3F LDA 3FFE 4009: 8D 01 20 STA 2001 400C: AD FF 3F LDA 3FFF 400F: 8D 02 20 STA 2002 4012: AD 52 C0 LDA C052 4015: AD 54 C0 LDA C054 4018: AD 57 C0 LDA C057 401B: AD 50 C0 LDA C050 401E: 2C 00 C0 BIT C000 4021: 10 FB BPL 401E 4023: CE F4 03 DEC 3F4 4026: 6C FC FF JMP (FFFC) John ---- jmatthews at wright dot edu www dot wright dot edu/~john.matthews/