Page 4 of 4

Posted: Wed May 02, 2007 3:10 am
by AJ
Same kind of thing here. Because I'm trying to achieve some degree of modularity, I set up a Device Manager (from a separate binary) and the kernel itself as the first tasks. Once I have got the device manager up to a reasonable state I will hope to remove the kernel from scheduling or give it minimal runtime...

Posted: Wed May 02, 2007 3:44 am
by XCHG
Thank you guys. What I did was that I initiated kernel's process like this:

Code: Select all

  INVOKE  __DisableIRQPulse , IRQ_PULSE_IRQ0
  INVOKE  __CreateKernelProcess, OFFSET .KernelStartPointofProcess
  INVOKE  __EnableIRQPulse, IRQ_PULSE_IRQ0
  JMP     $
The label .KernelStartPointofProcess is where the kernel will have its process running. The little JMP at the end of the above code will actually end the unscheduled process of the kernel so from that point it will run from the specified label.

I coded a function called [__CreateKernelProcess] that adds the kernel to the process queue but with these flags:

Code: Select all

PROCESS_FLAG_KERNELPROCESS | PROCESS_FLAG_NOTSCHEDULED | PROCESS_PRIORITY_KERNEL
The PROCESS_FLAG_NOTSCHEDULED will cause the kernel not to be scheduled by the scheduler and only run where the CPU is in an idle mode. Cutting the story short, WOOOOHOOOO finally my context switching mechanism is working.

I really want to thank you, everyone: mystran, urxae, Aali, Frank, AJ and anyone who I forgot. Thank you.