Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!rutgers!mephisto!udel!mmdf From: waltje@minixug.hobby.nl (Fred van Kempen) Newsgroups: comp.os.minix Subject: Re: Use of extended memory Message-ID: <26145@nigel.udel.EDU> Date: 30 Jul 90 23:08:34 GMT Sender: mmdf@ee.udel.EDU Lines: 107 From article <1990Jul27.183356.996@amd.com>, by ching@brahms.amd.com (Mike Ching): > Has anyone tested how extended memory is best used? Should it be used > to make a large RAM disk, increase cache buffer size, something else? > I assume that programs limited to 64K I&D can multi-task without > exhausting a whole lot of the 2M or more that resides in many of > today's PCs. I rarely run more than one thing in the background since > everything I want to do simultaneously seems to get disk bound. > Suggestions welcome. 1. Extended memory (as found in 286-based systems, above 1M) can be used as both user memory (in Protected Mode) and as RAM-disk(s). 2. Expanded memory (in PC's, the Lotus-Intel EMS spec) can be used only for RAM-disk(s). I run an AT with 4 to 8 Mbyte of main RAM (depending on what it needs..) and it also has an EMS-board with an additional 4Mb of RAM. My other machine, a 10MHz XT (V-20), has 640Kbyte main RAM, with an EMS-board equipped with 4Mbyte RAM. I added a driver to the kernel ("EMS"), which handles the EMS cards I keep mentioning here. It was once written by Terrence Holm, and it has been hacked by Peter van Epp for the Zucker EMS board. So, this little piece of code allow one to use those additional Mb's for things like RAM-disks and the like. The problem I faced was: how large a RAM disk do I need? Since I run NLMUG MINIX, which does not use the RAM disk for the root device, I always put /tmp on the RAM disk. However, it would be silly to make a /tmp of 4Mbyte... So, I added some more code to the kernel, which created a separate major device for all RAM-related disks: 9/0 /dev/ram - all of the RAM disk in main memory 9/1 /dev/ram1 - RAM disk, partition 1 9/2 /dev/ram2 - RAM disk, partition 2 9/3 /dev/ram3 - RAM disk, partition 3 9/4 /dev/ram4 - RAM disk, partition 4 9/5 /dev/eram - all of the RAM disk in extended (AT) memory 9/6 /dev/eram1 - AT_RAM disk, partition 1 9/7 /dev/eram2 - AT_RAM disk, partition 2 9/8 /dev/eram3 - AT_RAM disk, partition 3 9/9 /dev/eram4 - AT_RAM disk, partition 4 9/10 /dev/aram - all of the RAM disk in expanded (EMS) memory 9/11 /dev/aram1 - EMS_RAM disk, partition 1 9/12 /dev/aram2 - EMS_RAM disk, partition 2 9/13 /dev/aram3 - EMS_RAM disk, partition 3 9/14 /dev/aram4 - EMS_RAM disk, partition 4 Since NLMUG MINIX allows all RAM disk total sizes to be set at boot time, I could say: Main-memory RAM disk = 0K EMS-memory RAM disk = 4096K partition 1 = 2048K ----> /usr/bin (all binaries!) partition 2 = 1024K ----> /tmp partition 3 = 1024K ----> /usr/tmp Even on an XT, this works really comfortable, since no precious main memory is lost! On an AT, one can also use the "emem" disks to address extended memory while working in real mode, but since you would always want to work in PM on a 286, this is really not of any use. I will remove them from the driver as soon as I have the time... Now, for the interesting part of this message: Last week someone called me with some quesions regarding MINIX. While talking the hours away, he mentioned that he wrote a swapper for MINIX, which used a raw block-device as a swap device (a link to /dev/swap). Well, swapping to /dev/fd0 doesn't look good, and even with my 28ms HD it would be painfully slow. However, it works (so he tells me..), and it would certainly be a plus for machines with little physical memory. Last night I suddenly thought of another possibility: why not swap to one of the "RAM disk" deviced in EMS ? Since we can already divide the total available chunk of memory into several more usable pieces, it would be very possible to have the EMS card to function as both RAM disk _and_ swapper device: Main-memory RAM disk = 0K EMS-memory RAM disk = 4096K partition 1 = 1536K ----> /usr/bin (all binaries!) partition 2 = 512K ----> /tmp partition 3 = 512K ----> /usr/tmp partition 4 = 1536K ----> /dev/swap Swapping will always be slow, but I think that swapping to expanded or extended memory will be fast enough to be usable. Any comments anyone? (no, don't ask me the name of the guy I talked to. He will stand up and do his saying as soon as he is ready for it...) Fred. So, I can choose to put /tmp ( > > Mike Ching