Message-ID: <3C2CC72F.74E7102F@dit.upm.es>
Date: Fri, 28 Dec 2001 20:25:35 +0100
From: Javier Sedano <jsedano@dit.upm.es>
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.18pre21 i686)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.minix
Subject: Re: A bit more memory neede
References: <3C299C9E.72E28261@dit.upm.es> <slrna2p2mh.ea5.pienjo@mud.stack.nl>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Original-NNTP-Posting-Host: taran.dit.upm.es
X-Original-Trace: 28 Dec 2001 21:30:36 +0100, taran.dit.upm.es
Lines: 95
NNTP-Posting-Host: 138.4.2.12
X-Trace: 28 Dec 2001 20:27:38 +0100, 138.4.2.12
Path: bunyip.cc.uq.edu.au!news1.optus.net.au!optus!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!btnet-peer1!btnet!newsfeeds.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!t-online.de!news-ge.switch.ch!news.rediris.es!news-2.rediris.es!138.100.251.9.MISMATCH!news.upm.es!news.dit.upm.es!taran.dit.upm.es
Xref: bunyip.cc.uq.edu.au comp.os.minix:38074
X-Cache: nntpcache 1.0.7.1 (see ftp://suburbia.net/pub/nntpcache)

Martijn van Buul wrote:
> 
> Every process has two chunks of memory[1]: Data memory and code ("text")
> memory. Data memory is considered to be unique for a signle process, code
> memory may be shared (If there are two instances of 'sh' running, they share
> the same code segment). The values under 'TEXT' and 'CODE' give the
> starting address of each of the segments. 'SIZE' is the combined size.
> 

If I understand it, the memory used by the processes is:
	The addition of every data sizes
	+
	The addition of every different code sizes
	+
	The kernel size

But the two first sizes are not shown (you have told that the number
shows the start of the assigned segment), because just adding SIZE
values counts code sizes more than one time each. Isn't it?

> >       How can I free a little more memory? I've been reading xt/README, but
> > does not provide a lot of information. I changed ash to sh, a recompiled
> > the kernel to fit exactly my system, but...
> 
> There's not much you can do. You can make the disk cache smaller, but that
> will make your system slower. Other things (number of consoles, PTYs, slots
> in the process list) can be reduced too. Apart from that, there's little you
> can do to the kernel.
> 

Uff!

I've set 2 consoles, 0 PTY (INET is not added to this kernel! I think it
would really be unusable if I add it), and processes list does not waste
a lot of memory, do it? (I'll try it anyway).

I'll try to remove serial and parallel port code too. It will disable me
for using PLIP/SLIP, but can be a little better for standalone usage.

> Just use as little memory as possible. This may require you to do 'exec vi'
> instead of 'vi', even if this means that you'll need to login again.
> 

A little hack: does init show the login prompt (I haven't seen any getty
process in the F1 dump)? Can I hack it to run always a shell? That way,
when "exec foo" ends, init will spawn the shell again. It's a BIG
security hole (I'm looking for a better word for joke, but my english
level is not good enought ;-) but can help me to do it.

> 2.0.3 has a swapping system, but it's not powerful enough to cope with 640K
> machines.
> 

Why not? I supposse that the Memory Management will try to send to disk
a full non-system-process when more memory is used (I mean, it will not
try to swap File System process), and get it back to memory (maybe
swaping out another process) when it's needed by the Process Management.
That can involve a few messages between MM and PM, but won't need a lot
of memory itself. I'm not talking about speed nor performance (that's a
matter of disk speed (and a bit of CPU), not memory), but just
capability of being coded. I'm just making a few self thought, so forbid
any error ;-)

I read the messages about it about two month ago, but it was told that
2.0.3 couldn't run on 8086/640k, so I didn't try it. It was also told
that a solution was being searched. How is this going on? Swap over an
MFM disk can be really anoying, but at least my machinne would work.

> 
> If you're lucky, you might be able to find an old 'EMS' memory card. I think
> the memory manager of 2.0.3 can be tweaked to effectively use it.
> 

Uhm... let's think about the next thing (hacking thoughs while waiting
for time to leave to home ;-): let's create an 8-bit ISA card with RAM
(non-volatile RAM would be better). Let's say 1MB. And let's map it into
the IO address space, using 1k blocks (a register in the card, mapped
into another adrress, must be set by software to select a given block).

That's cheap hardware and can be (relatively) easy to made at home.

And now let's code a block device driver that just writes/reads from the
card every block wanted by the FS. Now, let's set this block device to
be the swapping area.

How fast would it be? It wouldn't use DMA (in order to keep hardware
cheap and easy), so every 1024 bytes needs to be written/read by the CPU
(the driver). That's a big permormance lost.

--
El README es para los cobardes. Se valiente: ejecuta.
----
Javier Sedano Jarillo            jsedano@dit.upm.es(*)
Dep. de Ingeniera Telemtica    jsedano@ieee.org
Univ. Politcnica de Madrid      jsedano@it.uc3m.es
