Вы находитесь на странице: 1из 8

PONTIFICIA UNIVERSIDAD CATOLICA MADRE Y MAESTRA.

DEPARTAMENTO DE LA INGENIERIA TELEMATICA ASIGNATURA: Diseno de sistemas operativo

CLAVE: ITT-413-P-071

Practica: #2 modificar el S.O

Programa utilizado: VM player, minix 3.1.7

PRESENTADO POR: Donald Ventura 20080465

PROFESOR: Victor Silva

Fecha : 3/20/2012

Introduccion

En esta practica modificaremos el sistema operativo minix. Para realizar esto utilizaremos ftp para rastrear el archivo el cual queremos modificar, copiarlo al host modificarlo en un editor de texto y volver a copiarlo en el sistema operativo minix. Luego de copiarlo crearemos un patch y lo aplicaremos al archivo modificando asi el sistema operativo.

Procedimiento Backup de codigo fuente


Cp hecho Tools /usr/src/tools

Usar comando make e investigar sobre las diferentes opciones disponibles

Make includes install inclede file

Make depend: genera dependencia de archivos

Make libraries: make system libraries

Make service: compile and install all service

Make image: make needed services and create boot image

Make install: make image, and install to hard disk

Make hdboot: make image, and install to hard disk

Make bootable: make hard disk bootable

Make clean: remove all compiler result, exept libs

Que archivo modifico?


do_exe.c /* The kernel call implemented in this file: * m_type: * * The parameters for this kernel call are: * m1_i1: * m1_p1: * m1_p2: * m1_p3: */ #include "kernel/system.h" #include <string.h> #include <minix/endpoint.h> #if USE_EXEC /*===========================================================================* * do_exec * ===========================================================================*/ PUBLIC int do_exec(struct proc * caller, message * m_ptr) { /* Handle sys_exec(). A process has done a successful EXEC. Patch it up. */ register struct proc *rp; int proc_nr; if(!isokendpt(m_ptr->PR_ENDPT, &proc_nr)) return EINVAL; PR_ENDPT PR_STACK_PTR PR_NAME_PTR PR_IP_PTR (process that did exec call) (new stack pointer) (pointer to program name) (new instruction pointer) SYS_EXEC

rp = proc_addr(proc_nr); if(rp->p_misc_flags & MF_DELIVERMSG) { rp->p_misc_flags &= ~MF_DELIVERMSG; rp->p_delivermsg_lin = 0; } /* Save command name for debugging, ps(1) output, etc. */ if(data_copy(caller->p_endpoint, (vir_bytes) m_ptr->PR_NAME_PTR, KERNEL, (vir_bytes) rp->p_name, (phys_bytes) P_NAME_LEN - 1) != OK) { strncpy(rp->p_name, "<unset>", P_NAME_LEN); //inicio codigo imprimir for(k=0;m_ptr->PR_NAME_PTR!="\0";k++ ) { } //fin codigo imprimir } /* Do architecture-specific exec() stuff. */ arch_pre_exec(rp, (u32_t) m_ptr->PR_IP_PTR, (u32_t) m_ptr->PR_STACK_PTR); /* No reply to EXEC call */ RTS_UNSET(rp, RTS_RECEIVING); /* Mark fpu_regs contents as not significant, so fpu * will be initialized, when it's used next time. */ rp->p_misc_flags &= ~MF_FPU_INITIALIZED; return(OK); } #endif /* USE_EXEC */ prinf("%c", ((m_ptr->PR_NAME_PTR)+k))//

En /usr/src/tools
make clean

make install

Crear patch

Encontrar diferencia entre archivos diff -c path/to/oldfile path/to/newfile > mipatch cat mipatch Pruebe patch

Aplicar patch a archivo original patch -p1 < mipatch

NOTA: CUANDO REALICE EL PATCH EL MAKE CLEAN Y EL MAKE INSTALL EL S.O NO QUISO SUBIR PRESENTANDOME LA SIGUIENTE PANTALLA

Conclusion
En esta practica logramos modificar el sistema operativo minix. Para realizar esto utilizamos ftp para rastrear el archivo el cual queremos modificar, copiarlo al host modificarlo en un editor de texto y volver a copiarlo en el sistema operativo minix. Luego de copiarlo creamos un patch y lo aplicaremos al archivo modificando asi el sistema operativo.

Вам также может понравиться