On Thu, 26 Feb 2004 21:34:26 +0100, Steffen Kaiser wrote:

Just found a way to do it! Just before executing the shell, "setvec(0x22, shutdown)". In new_psp(), after "p->ps_isv22 = getvec(0x22);", compare the vector to shutdown and if it matches, "setvec(0x22, int22_handler);". Voila! Expect the patch in a couple of hours ;-)

As you already know, this didn't work :-(


maybe I totally misinterpreted the stuff, but Init_DosExec() from within kernel() loads process0, right?? Init_DosExec eventually ends up in DosExec() -- or at least in a function identical to it??

DosExec() spawns for example DosComLoader(), which does:

     /* point to the PSP so we can build it                  */
     setvec(0x22, MK_FP(user_r->CS, user_r->IP));
     new_psp(mem, mem + asize);

So, within kernel() when Init_DosExec() is called, will the function know where the persistent "shutdown()" is located? If so, fake up an user_r structure before calling Init_DosExec and place the address therein. <basta>

I tried to change user_r->CS and user_r->IP, but the linker complained. But as the public demands the ROM-DOS-like possibility to re-type shell name, I thought I'd better move the while loop at the end of main.c:kernel() to the resident space. I've already implemented everything but the jump from INIT to resident code. The current kernel NEVER does this. All the communication between the INIT and resident code is through Int 21h. So, I may break all rules and jump to the resident part via a special assembler function. But this is not easy. The stack must be properly set up. I feel that I'm going to screw things up again (as usually!), and I think that I'd better not. Bart won't accept this total rule break. And he seems to accept the crash. As you see, it couldn't be worse! Until we understand what he meant by the "hook removed to save space", we're DOOMED TO CRASH! :-(


Lucho


------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to