home *** CD-ROM | disk | FTP | other *** search
/ The Grim Reaper 11A / Grim_Reaper_The_Issue_11_1993___Side_A_BASIC.atr / ram.doc < prev    next >
Text File  |  2023-02-26  |  10KB  |  1 lines

  1. Ramdisks¢--------¢¢Well after seeing John's desperate plea for articles in issue 9 of TGR, I decided to put some time aside and write an article for TGR. I have not got all that much time on my hands nowdays but I enjoy reading TGR so much that I have said to hell with everything else, I don't care if I fail all my exams, writing an article for The Grim Reaper is much more important and is likely to bring me more fame and money (nought pounds, nought pence! So I break even for a change instead of going into the red!).¢ It was then that I came across a major stumbling block: what the hell do I write an article about? It is all very well saying "I'm going to write an article", but it is a good idea to have something to write about. So I spent several hours thinking about this, and in the end, due to not being able to think of anything better to write about, I decided to do something on ramdisks and expanded memory.¢ For those of you that don't know what a ramdisk is, then think of it as a virtual drive (nice word that: virtual, something that appears to exist but doesn't really!). Basically what the ramdisk does is it uses the extra memory in your computer as a disk drive. There are several different kinds of ramdisk available depending on what system you have. If you have a standard 130XE then the DOS 2.5 ramdisk handler is available, it gives you 499 free sectors. Even if you don't have an expanded machine you might stil be able to experience a ramdisk. I beleive that there does exist a program that uses the 8K of ram under the BASIC cartridge as a ramdisk. I have not seen this so I can't comment on it, but it can't give you a very big ramdisk, still it might be of some use though. Then there are the bigger ramdisks, which allow you to have 128K, 192K, 256K and even 1Meg's worth of ramdisk (which is the biggest I have ever seen). You must of course have enough expanded memory in your computer to use these though.¢ The code to do this is all built into DOS. Not all DOSes support ramdisks however. As well as the code built into DOS there is usually a program called RAMDISK.COM on the floppy disk. What this piece of code does is to format the ramdisk and copy some files onto it, usually the DUP.SYS and MEM.SAV files. However you don't actually need the RAMDISK.COM file in order to use your ramdisk. Try booting up without it and then use the format option from DOS to format your ramdisk, and you should find that your ramdisk is there. This may depend on your DOS however, since it will not always work. The problem is that some DOSes, like DOS 2.5, need to be told beforehand which drives are set up, and which aren't. In the case of DOS 2.5 this is done by using a POKE into location 1802. Try booting up with BASIC and then type:¢¢ ? PEEK(1802)¢¢This will tell you which drives are set up with your current version of DOS. There is one bit per drive with drive 1 being the least significant bit. So if you get a value of 3 for example that would mean that the bits would look like this:¢¢128 64 32 16 8  4  2  1¢-----------------------¢ 0  0  0  0  0  0  1  1¢¢This means that drives 1 and 2 are active, if you want to use your ramdisk (you need to have some expanded ram for this!), then use:¢¢POKE 1802,131¢¢This will leave drives 1 and 2 on and it will also switch on drive 8 (the ramdisk). If you only have one floppy drive then¢¢POKE 1802,129¢¢and this will switch on drives 1 and 8. Now go back to DOS and use the SAVE DOS FILES option to save the new version of DOS to disk. Reboot and you should find that you can now use your ramdisk without the RAMDISK.COM file. Of course the ramdisk will be empty, so you now have maximum space to copy any files across. This can be very useful, especially if you have only got a small ramdisk.¢ Well that's enough technical stuff, now let me tell you a bit more about my ramdisk.¢ Once upon a time all my Atari equipment was just stock standard equipment, no upgrades, no nothing, just the basic stuff. And I was happy with it. I didn't mind too much about having to wait 10 minutes for an assembly code program to compile into machine code. I didn't really mind all that much playing 'Postman Pat' with my 1050 and my floppies (you open the letter box, put the floppy in, it whirls round a bit, you take it out and put another one in, etc). Hey, this is just one of the facts of life, it's part of owning a disk drive, you just get on with it and make the best of it. So I always used to have loads of disks strewn all over my drive and computer and desk, and everywhere else basically.¢ But then I came across a 1MEG XE and it was love at first sight. After giving some bloke a few pieces of paper (Hey what a bargain exchange, a computer for a couple of pictures of the Queen!) I picked up my new Atari and took it home. I got home, plugged it in and fired her away, and we were in business. I booted up with the ramdisk handler and there it was, a 2500+ sector ramdisk, and this was only on the 320K setting! Wow, amazing! Next thing I do is go about passing some stuff from floppy over to the ramdisk, and then loading it in from the ramdisk as a test, and it all worked brilliantly. I did have a couple of teething problems like the fact that the version of Textpro I was using didn't like MYDOS very much (which the ramdisk handler was running from), but I got hold of an updated version of Textpro and that problem was soon fixed. From then on it has been wonderful. No more hanging around waiting ages for programs to load from a floppy, I just have to copy them once from a floppy to the ramdisk, and then they are readily available and can be loaded in a second or two. For example, when I'm writing some machine code, I can go from the text editor to DOS and then to the compiler in a couple of seconds. The biggest delay is in fact typing in the filenames. Also compilation times more than halved! This makes writing programs a lot easier, reducing all that time spent hanging around just waiting for things to load. An added bonus is that it means that I don't have to use my 1050 quite so often, so wear and tear on the drive is reduced, hopefully extending its life!¢ So why would you want a ramdisk?¢ If you do anything other than play games on your Atari then a ramdisk is something really worth thinking about, it sure cuts down on wasted time. If you can't afford a hard drive then a ramdisk is the next best thing. If you own a 130XE with 128K then you will already have a 499 sector ramdisk, if you think that that is good, imagine what you could do with 1MEG's worth! Personally I find the 499 sector ramdisk much too restrictive, you run out of space before you know it. I like to have at least 1000 sectors worth and preferably a lot more! If you would have asked me about a ram expansion a year ago I would have said that I didn't need one, but now I can't live without one! There are one or two things to be careful about when using a ramdisk, the first is to always remember to save any files you want to keep BEFORE you switch your computer off, otherwise you will be sorry! (OK I admit it, I did do it once). It sounds silly but it is so easy to do, especially if you're in a hurry, but after a short while you soon get used to it. The other thing to remember is to make backups to floppy of anything you don't want to lose, especially if you're writing machine code programs. The rule I tend to use is if I've just written a really difficult piece of code then I save it straight away, otherwise I back it up every three or four compilations. The good news is that if you do happen to cause a lock-up then, if you can create a cold start without switching your computer off, the ramdisk and all the info in it will still be there. You must not however cause the cold start with the ramdisk handler file on the disk in your drive since this will reformat your ramdisk. Instead just have a disk in your drive with the DOS files but no ramdisk handler, this should take you back into DOS (if you remember to disable BASIC otherwise you will end up in BASIC) with your ramdisk intact.¢ If you have a chance to get hold of some expanded RAM for your system then I strongly suggest you do so, you won't regret it! I have not looked back since I got mine. If you have an 800XL or 64K 600XL then try the YORKY upgrade (I believe that Richard Gore still has some of these left, check out his ads in N.A.U. and News-Disk!). Apparently they just plug straight into the parallel bus connector on the back of your machine, no soldering required! Also try Derek Fern or Gralin International and check out the contact column in N.A.U. as well. If you are handy with a soldering iron then you might want to try and build your own. There are several disks about this flying around the public domain, check your favourite library for one. I got my machine from a Mr M.G. Rice. Last time I saw he had a few of these for sale in the Contact column of N.A.U., he might still have some left. Believe me if you do anything half serious on your Atari then a ramdisk is well worth considering.¢¢Raphael Espino¢¢¢Disclaimer: If you try adding your own upgrade to your system and something goes wrong, then don't blame me you do so at your own risk!!!¢¢ED: It is possible to have a Ramdisk on an unmodified 800XL and if you follow these instructions you'll have the proof!¢ Load a DOS 2.5 disk with BASIC enabled and when the READY prompt appears enter¢¢POKE 1802,129¢¢Now press RESET and load DOS. When DUP has loaded format drive 8 and write the DOS files to it. Go back to BASIC and type¢¢POKE 5439,ASC("8")¢¢Now goto DOS and you'll find DUP appears instantly! I can't see this being completely bug-proof though and I may be damaging another part of memory when doing this. It does prove that it is possible to have a ramdisk on a 64K 800XL though!¢