jueves, noviembre 16, 2006

 

Laboratorio 1 SO II

Sistemas Operativos 2
Laboratorio #1: Modificando MINIX
Alumno: Douglas Yovanny Velásquez Escoto


Examinando config.h

Se exploro el archivo /usr/incluye/minix/config.h
Con las dos secciones las cuales la primera contiene los parámetros configurables por el usuario.


/*=====================================================*
* This section contains user-settable parameters *
*===================================================== */
#define MACHINE IBM_PC /* Must be one of the names listed below */

#define IBM_PC 1 /* any 8088 or 80x86-based system */
#define SUN_4 40 /* any Sun SPARC-based system */
#define SUN_4_60 40 /* Sun-4/60 (aka SparcStation 1 or Campus) */
#define ATARI 60 /* ATARI ST/STe/TT (68000/68030) */
#define AMIGA 61 /* Commodore Amiga (68000) */
#define MACINTOSH 62 /* Apple Macintosh (68000) */

/* Word size in bytes (a constant equal to sizeof(int)). */
#if __ACK__
#define _WORD_SIZE _EM_WSIZE
#endif

/* Number of slots in the process table for user processes. */
#define NR_PROCS 32

/* The buffer cache should be made as large as you can afford. */
#if (MACHINE == IBM_PC && _WORD_SIZE == 2)
#define NR_BUFS 40 /* # blocks in the buffer cache */
#define NR_BUF_HASH 64 /* size of buf hash table; MUST BE POWER OF 2*/
#endif

#if (MACHINE == IBM_PC && _WORD_SIZE == 4)
#define NR_BUFS 80 /* # blocks in the buffer cache */
#define NR_BUF_HASH 128 /* size of buf hash table; MUST BE POWER OF 2*/
#endif



/* Enable or disable swapping processes to disk. */
#define ENABLE_SWAP 1


En la segunda sección, se encuentran varios parámetros internos del sistema

/*================================================*
* There are no user-settable parameters after this line *
*================================================*/
/* Set the CHIP type based on the machine selected. The symbol CHIP is actually
* indicative of more than just the CPU. For example, machines for which
* CHIP == INTEL are expected to have 8259A interrrupt controllers and the
* other properties of IBM PC/XT/AT/386 types machines in general. */
#define INTEL 1 /* CHIP type for PC, XT, AT, 386 and clones */
#define M68000 2 /* CHIP type for Atari, Amiga, Macintosh */
#define SPARC 3 /* CHIP type for SUN-4 (e.g. SPARCstation) */

/* Set the FP_FORMAT type based on the machine selected, either hw or sw */
#define FP_NONE 0 /* no floating point support */
#define FP_IEEE 1 /* conform IEEE floating point standard */

#if (MACHINE == IBM_PC)
#define CHIP INTEL
#endif

Cambiando el banner de inicio de MINIX

/usr/src/kernel/tty.c

/*================================================*
* tty_task *
*==================== ===========================*/
PUBLIC void tty_task()
{
/* Main routine of the terminal task. */

message tty_mess; /* buffer for all incoming messages */
register tty_t *tp;
unsigned line;

/* Initialize the terminal lines. */
for (tp = FIRST_TTY; tp < END_TTY; tp++) tty_init(tp);

/* Display the Minix startup banner. */
/* printf("Minix %s.%s Copyright 2001 Prentice-Hall, Inc.\n\n",
OS_RELEASE, OS_VERSION);*/
printf("*******************************************************************************\n");
printf("* Sistemas Operativos II - Douglas Yovanny Velasquez Escoto - 971269 *\n");
printf("*******************************************************************************\n");
…..







Backup imagen del Kernel actual
Ubicado en /minix/
El Kernel actual es mx204_060519 y se respaldo en mx204_060519.b


Make install
cd keymaps && make - install
cc -DKEYSRC=\"french.src\" genmap.c
./a.out > french.map
install -c french.map /usr/lib/keymaps/french.map
cc -DKEYSRC=\"german.src\" genmap.c
./a.out > german.map
install -c german.map /usr/lib/keymaps/german.map
cc -DKEYSRC=\"italian.src\" genmap.c
./a.out > italian.map
install -c italian.map /usr/lib/keymaps/italian.map
cc -DKEYSRC=\"japanese.src\" genmap.c
./a.out > japanese.map
install -c japanese.map /usr/lib/keymaps/japanese.map
cc -DKEYSRC=\"latin-am.src\" genmap.c
./a.out > latin-am.map
install -c latin-am.map /usr/lib/keymaps/latin-am.map
cc -DKEYSRC=\"olivetti.src\" genmap.c
./a.out > olivetti.map
install -c olivetti.map /usr/lib/keymaps/olivetti.map
cc -DKEYSRC=\"polish.src\" genmap.c
./a.out > polish.map
install -c polish.map /usr/lib/keymaps/polish.map
cc -DKEYSRC=\"scandinavn.src\" genmap.c
./a.out > scandinavn.map
install -c scandinavn.map /usr/lib/keymaps/scandinavn.map
cc -DKEYSRC=\"spanish.src\" genmap.c
./a.out > spanish.map
install -c spanish.map /usr/lib/keymaps/spanish.map
cc -DKEYSRC=\"uk.src\" genmap.c
./a.out > uk.map
install -c uk.map /usr/lib/keymaps/uk.map
cc -DKEYSRC=\"us-std.src\" genmap.c
./a.out > us-std.map
install -c us-std.map /usr/lib/keymaps/us-std.map
cc -DKEYSRC=\"us-swap.src\" genmap.c
./a.out > us-swap.map
install -c us-swap.map /usr/lib/keymaps/us-swap.map


make hdboot
exec cc -c -I/usr/include exec.c
exec cc -c -I/usr/include signal.c
exec cc -c -I/usr/include alloc.c
exec cc -c -I/usr/include utility.c
exec cc -c -I/usr/include table.c
exec cc -c -I/usr/include trace.c
exec cc -c -I/usr/include getset.c
exec cc -c -I/usr/include misc.c
exec cc -o mm -i main.o forkexit.o break.o exec.o signal.o alloc.o utility.o table.o trace.o getset.o misc.o -lsys
install -S 256w mm
cd ../fs && exec make -
exec cc -c -I/usr/include main.c
exec cc -c -I/usr/include open.c
exec cc -c -I/usr/include read.c
exec cc -c -I/usr/include write.c
exec cc -c -I/usr/include pipe.c
exec cc -c -I/usr/include device.c
exec cc -c -I/usr/include path.c
exec cc -c -I/usr/include mount.c
exec cc -c -I/usr/include link.c
exec cc -c -I/usr/include super.c
exec cc -c -I/usr/include inode.c
exec cc -c -I/usr/include cache.c
exec cc -c -I/usr/include cache2.c
exec cc -c -I/usr/include filedes.c
exec cc -c -I/usr/include stadir.c
exec cc -c -I/usr/include protect.c
exec cc -c -I/usr/include time.c
exec cc -c -I/usr/include lock.c
exec cc -c -I/usr/include misc.c
exec cc -c -I/usr/include utility.c
exec cc -c -I/usr/include table.c
exec cc -o fs -i main.o open.o read.o write.o pipe.o device.o path.o mount.o link.o super.o inode.o cache.o cache2.o filedes.o stadir.o protect.o time.o lock.o misc.o utility.o table.o -lsys
install -S 512w fs
exec make - image
exec cc -O -D_MINIX -D_POSIX_SOURCE init.c -o init
install -S 192w init
installboot -image image ../kernel/kernel ../mm/mm ../fs/fs init
text data bss size
69376 16756 98772 184904 ../kernel/kernel
14672 1156 30384 46212 ../mm/mm
29600 2400 107352 139352 ../fs/fs
7008 2084 1356 10448 init
------ ------ ------ -------
120656 22396 237864 380916 total
exec sh mkboot hdboot
rm /dev/c0d0p0s0:/minix/2.0.4r0
cp image /dev/c0d0p0s0:/minix/2.0.4r1
Done.


Modificando /usr/src/kernel/keyboard.c para listar los procesos cuando se presiona la tecla F6

/*===========================================================================*
* func_key *
*===========================================================================*/
PRIVATE int func_key(scode)
int scode; /* scan code for a function key */
{
/* This procedure traps function keys for debugging and control purposes. */

unsigned code;

if (scode & 0200) return(FALSE); /* key release */
code = map_key0(scode); /* first ignore modifiers */
if (code < F1 || code > F12) return(FALSE); /* not our job */

switch (map_key(scode)) { /* include modifiers */

case F1: p_dmp(); break; /* print process table */
case F2: map_dmp(); break; /* print memory map */
case F3: toggle_scroll(); break; /* hardware vs. software scrolling */
case F4: vmw_capture(); break; /* copy screen to host's clipboard */

case F5: /* network statistics */
#if ENABLE_DP8390
dp8390_dump();
#endif
#if ENABLE_RTL8139
rtl8139_dump();
#endif
#if ENABLE_LANCE
lance_dump();
#endif
#if ENABLE_EEPRO
eepro_dump();
#endif
break;
case F6:
printf("Ejecutar F6\n");
p_dmp();
break;

case CF7: sigchar(&tty_table[CONSOLE], SIGQUIT); break;



Comments: Publicar un comentario



<< Home

This page is powered by Blogger. Isn't yours?