Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!psuvax1!rutgers!uwvax!puff!rt5.cs.wisc.edu!blochowi From: blochowi@rt5.cs.wisc.edu (Jason Blochowiak) Newsgroups: comp.sys.apple Subject: Re: IIgs Software Reboot Message-ID: <4129@puff.cs.wisc.edu> Date: 21 Dec 89 03:50:00 GMT References: <3388@sage.cc.purdue.edu> <0ZWjDCW00WAB00WG8F@andrew.cmu.edu> <4118@puff.cs.wisc.edu> Sender: news@puff.cs.wisc.edu Reply-To: blochowi@rt5.cs.wisc.edu (Jason Blochowiak) Organization: U of Wisconsin CS Dept Lines: 25 In article <4118@puff.cs.wisc.edu> blochowi@rt7.cs.wisc.edu (Jason Blochowiak) writes: > [I wrote about looking into adding support for sparse ProDOS files to > SmartBoot 8/16, someone else mentioned the problem, and I nuked the whole > thing :) ] Well, I took a poke at Apple's code briefly, but decided that I didn't really need to, so I stopped. I then looked at SmartBoot 8/16 to see how it loaded the files in, and I popped out one of Apple's manuals that details the way ProDOS stores files. Anyways, SB stops when it gets to a block that's 0, so it'd almost certainly die on a sparse ProDOS file. What would have to be changed (or, I hope you weren't expecting code :) is: After finding the appropriate directory entry corresponding to the file being looked for, grab the BLOCKS_USED field, and hold it somewhere. Then, in the file read routine (forgot the name or location, but it's pretty obvious), instead of stopping when you hit a 0 block, you: Look up the current block to be read. If it's a 0, you zero out the target area of memory, increment the target pointer, and increment the index into the index block. If it's a non-0 block, you read it in normally, and then decrement the BLOCKS_USED count - if it hits 0, you're done, otherwise go back to read the next block. Being the lazy guy I am, I probably won't code this unless I have to... If someone else does decide to code it, I'd be interested in seeing the result. -- Jason Blochowiak - blochowi@garfield.cs.wisc.edu or jason@madnix.uucp "Education, like neurosis, begins at home." - Milton R. Sapirstein