Message-ID: <3CD24FD8.EB416D1@dit.upm.es>
Date: Fri, 03 May 2002 10:52:40 +0200
From: Javier Sedano <jsedano@dit.upm.es>
X-Mailer: Mozilla 4.79 [en] (X11; U; Linux 2.4.17 i686)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.minix
Subject: Reducing kernel size
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Original-NNTP-Posting-Host: taran2.dit.upm.es
X-Original-Trace: 3 May 2002 11:04:15 +0200, taran2.dit.upm.es
Lines: 79
NNTP-Posting-Host: 138.4.2.12
X-Trace: 3 May 2002 10:57:49 +0100, 138.4.2.12
Path: bunyip.cc.uq.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!news.xtra.co.nz!deine.net!news-ge.switch.ch!news.rediris.es!news-2.rediris.es!138.100.251.9.MISMATCH!news.upm.es!news.dit.upm.es!taran2.dit.upm.es
Xref: bunyip.cc.uq.edu.au comp.os.minix:38693
X-Cache: nntpcache 1.0.7.1 (see ftp://suburbia.net/pub/nntpcache)

Hi MINIXers,

	I'm trying to make my Minix a bit smaller, if possible. I asked about
this a few months ago and Martijn van Buul gave me a few hints; but now
I've found a bit more to play.

	I'm trying to remove the floppy and parprinter drivers from the kernel
(don't know how large will the saving be, but...), since my network is
up, and I don't need them (even serial code could be removed, but don't
know how to do so).

	My first step has been to comment out the lines regarding those drivers
in kernel/table.c

-----------
PUBLIC struct tasktab tasktab[] = {
        { tty_task,             TTY_STACK,      "TTY"           },
#if ENABLE_NETWORKING
        { dp8390_task,          DP8390_STACK,   "DP8390"        },
#endif
#if ENABLE_DOSDSK
        { dosdsk_task,          DOSDSK_STACK,   "DOSDSK"        },
#endif
#if ENABLE_CDROM
        { cdrom_task,           CDROM_STACK,    "CDROM"         },
#endif
#if ENABLE_AUDIO
        { audio_task,           AUDIO_STACK,    "AUDIO"         },
        { mixer_task,           MIXER_STACK,    "MIXER"         },
#endif
#if ENABLE_SCSI
        { scsi_task,            SCSI_STACK,     "SCSI"          },
#endif
#if ENABLE_WINI
        { winchester_task,      WINCH_STACK,    "WINCH"         },
#endif
        { syn_alrm_task,        SYN_ALRM_STACK, "SYN_AL"        },
        { idle_task,            IDLE_STACK,     "IDLE"          },
/*        { printer_task,         PRINTER_STACK,  "PRINTER"       }, */
/*        { floppy_task,          FLOP_STACK,     "FLOPPY"        }, */
        { mem_task,             MEM_STACK,      "MEMORY"        },
        { clock_task,           CLOCK_STACK,    "CLOCK"         },
        { sys_task,             SYS_STACK,      "SYS"           },
        { 0,                    HARDWARE_STACK, "HARDWAR"       },
        { 0,                    0,              "MM"            },
        { 0,                    0,              "FS"            },
#if ENABLE_NETWORKING
        { 0,                    0,              "INET"          },
#endif
        { 0,                    0,              "INIT"          },
};
-----------

	And them, reduced NR_TASKS in two in <minix/const.h>

----------
/* Number of tasks. */
#define NR_TASKS        (7 + ENABLE_WINI + ENABLE_SCSI + ENABLE_CDROM \
                        + ENABLE_DOSDSK + ENABLE_NETWORKING + 2 *
ENABLE_AUDIO)
----------


	The kernel now compiles and links, but when booted, gets frozzen at
"Executing in 16-bit protected mode". As far as I understood from the
code, for each entry in the tasktab table, a new process is created at
boottime, and its pc is set to the starting routine. And then, the
booting process continues, and they are managed as standard tasks.
Rigth? Then... why does it freezes?

	Any idea?


-- 
El futuro es WIN95.... A no ser que hagamos algo a tiempo.
--------
Javier Sedano Jarillo      http://www.it.uc3m.es/~jsedano
 jsedano@dit.upm.es (*)
 jsedano@ieee.org
