Message-ID: <3A637A74.23FFB7FC@montana.com>
From: Kelsang Dawa <dawa@montana.com>
X-Mailer: Mozilla 3.04 (X11; I; Linux 2.2.16 i586)
MIME-Version: 1.0
Newsgroups: comp.os.minix
Subject: Minimizing Minix Memory
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 55
Date: Mon, 15 Jan 2001 22:32:20 +0000
NNTP-Posting-Host: 208.4.224.66
X-Trace: newsfeed.slurp.net 979622964 208.4.224.66 (Mon, 15 Jan 2001 23:29:24 CDT)
NNTP-Posting-Date: Mon, 15 Jan 2001 23:29:24 CDT
Path: news.adfa.edu.au!clarion.carno.net.au!news0.optus.net.au!news1.optus.net.au!optus!intgwpad.nntp.telstra.net!newspump.monmouth.com!newspeer.monmouth.com!news.maxwell.syr.edu!newsfeed.slurp.net!not-for-mail
Xref: news.adfa.edu.au comp.os.minix:36542

Hi,

I am using the 16-bit version of Minix 2.0.2 and trying to install it on
a small handheld system that already runs DOS.  The target machine has
1M of memory and 2M of disk space in a flash ROM.  The plan is to create
a small system that will run elvis, a terminal emulator, and maybe a few
other small tools.  It's a toss up between Minix and DOS, but I thought
I would see how far I could get with Minix.

So far I have Minix installed on a large desktop machine where I am
running it inside a DOS box on top of Win98.  This development machine
has loads of power and space and could run a 32-bit system with lots of
RAM but I have installed 16-bit Minix and configured the DOS session to
use less than 1M of memory.

My first goal is to reduce the memory used by the kernel and system
tasks as much as possible. I have been tuning the parameters in
/usr/include/minix/config.h and rebuilding the system to check the
results.  That seemed to work fine.  I am down to a kernel+fs+mm+init in
about 140k.

This evening I started hunting through the source code for other
parameters I could reduce.  I came across /usr/src/fs/const.h and
started adjusting the number of in-core inodes and file table entries. 
When I did this I sometimes ended up with an unstable kernel and I have
no idea why.

My final configuration for this evening is stable with:

  #define NR_FILPS 48
  #define NR_INODES 16

but trying lower values produced a kernel that would run for a while but
couldn't do a 'make world'.  I think the values I tried were something
like NR_FILPS=32 and NR_INODES=8, but I didn't keep notes so I am not
sure.

The really hard part is that the unstable systems didn't fail in any
consistent way.  Running 'make world' on top of a bad kernel would make
the C compiler complain about finding non-ascii characters in source
files in one run, and then on the next try it would run fine.  A minute
later fsck would report that inodes had corrupt zones in them; they
could be fixed but then fsck would find different errors somewhere else.

1. Any ideas what might be going wrong as I squeeze the number of inodes
and file table entries?

2. Why the instability instead of a failure with a predictable pattern?

3. Any suggestions on how I could find the minimum limits?  Other than
suck-it-and-see.


Thanks for any help
dawa
