To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Multitasking under djgpp From: ptan AT compudyn DOT com (ptan) Date: Sat, 15 Jan 1994 23:36:00 -0500 Organization: Compudyn Systems Ltd. Hi. I'm trying to port a multitasking kernel I wrote to run under djgpp, and was wondering if I could find some answers to some questions: 1. I need to be able to hook into the timer, serial, and some other interrupts. What is the best way to do this? Should I hook into the DPMI functions or should I try to reprogram the IDT myself to point to my own interrupt handler (I want to have the interrupt handler reside in 32 bit protected mode for speed reasons). 2. I need to be able to use the timer ticks to call the scheduler to switch tasks. I've heard that DPMI does not allow interrupt tasks to interact with other tasks... specifically, that if the interrupt task is called, it must IRET, and cannot just ACK the 8259 and jump to the scheduler. Right now, my kernel just ACKs the interrupt from the 8259, pops the registers into my own context save area and then executes the interrupt handler and then runs the scheduler again. Now, bear with me, I'm new to the 32-bit IDT/GDT/LDT/TSS lingo, but as far as I understand it, I have cannot do this under DPMI. Is this true? Do I have to hack in something into go32 to allow the interrupt handler to change the IP of the TSS that was interrupted to point to the scheduler? Otherwise, I can't seem to see a way to do pre-emptive multitasking, or am I missing something obvious? 3. I've written my own low-level (direct to hardware) disk access routines that understands FAT file systems (and is re-entrant). Can I tell the paging routines to use that instead? (sorry, I got lost somewhere in the middle of deciphering the go32 source, so if it is obvious just yell). 4. I've heard that there is a problem locking down the pages for the interrupt handlers right now. Is there a workaround? Can I just disable paging for now? If so, how? Thanks. Paul Tan.