This is a patch that will allow Linux to boot on machines with less then 640k of conventional memory. It uses int 0x12 to get conventional memory size, and loads Linux based on that. It will work with anything between 256K and 640K of conventional memory. (Of course, you still need plenty of extended memory.) Currently, only the bootsector loader will work on non-640K machines, but all loaders should still work on 640K machines. It was developed and tested on 2.0.10, but it should work on most of the 2.0.x kernels. Hopefully, after enough people have verified it as stable, it will make it into the official kernel. Files: ftp://sunsite.unc.edu/pub/Linux/system/Linux-boot/patch-non640k-0.9.* To apply the patch, make sure linux source is in /usr/src/linux and run: cd /usr/src gzip -cd patch-non640k-0.9.gz |patch -p0 Possible problems: - setup.S version. The version number in the setup.S header should probably be bumped up so that newer loaders can be written to recognise this kernel's abiltity to boot on non-640k machines. As I'm not the primary maintainer of setup.S, I didn't change the version number. - SMP (multiprocessor). I avoided changing anything related to SMP. There is something in arch/i386/mm/init.c that seems to assume 640k of memory in SMP machines; I did *not* change it. - thinkpad. Also in init.c, low memory initialization went to 0x9f000 instead of 0xa0000, apparently because the thinkpad uses that last page for something else. I have assumed that the thinkpads int 0x12 will take this into account and properly return a smaller memory size. I don't have a thinkpad to test this assumption on. Tested: I conducted a total of 10 tests. 8 of which were all combinations of the following: 1) Machine. I tested on an new Pentium Pro with 32Mb memory (including 640k conventional), and on an old 386 with 512K of base memory and 2 Mb of extended memory. (Getting Linux to boot on this machine was something of a trick; I had to run swapon directly from /etc/inittab instead of from the startup script.) 2) bzImage vs. zImage. 3) Artificially convince it that it's running on a 256k machine (by uncommenting a line in bootsect.S), versus using int 0x12. All combinations of the above is a total of 8 tests. The remaining two tests were to boot a zImage with LILO and LOADLIN on the Pentium Pro. With one minor exception, all tests worked as expected. (Of course, you expect zImage on simulated 256K to print "out of memory" and wait for reboot.) When I used LOADLIN to boot, I got the expected 384K reserved memory on the Memory kernel message. However, when booting with the bootsector or with LILO, I get 388K reserved memory on the 686. Further investigation showed that int 0x12 returned 639K conventional memory unless DOS was loaded. If DOS was loaded, it returned the full 640K. Apparently, there is BIOS data there that DOS beleives it can either move or ignore. I don't think this is too much of a problem, because at its worst, I will simply have 4K (round 1K to full page) less memory. The LSM entry: Begin3 Title: Patch-non640k Version: 0.9 Entered-date: 13 August 1996 Description: This is a patch for Linux Kernel 2.0.10 that allows it to boot on machines that have anything between 256k and 640k of conventional memory. At the time of this writing, the package will be uploaded to /pub/Linux/incoming. Eventually it will wind up at Primary-site and in an official kernel release. Keywords: 640k 512k boot conventional base Author: mmogilvi@elbert.uccs.edu (Matthew M. Ogilvie) Primary-site: sunsite.unc.edu /pub/Linux/system/Linux-boot/ (permanent) sunsite.unc.edu /pub/Linux/Incoming/ (temporary) 805 patch-non640k-0.9.lsm 12k patch-non640k-0.9.gz 4k patch-non640k-0.9.README Platforms: Linux 2.0.10 (or a version with same boot code) on i386 architecture. End - Matthew Ogilvie (mmogilvi@elbert.uccs.edu)