::SHE+ILA:: Kernel ASM Source [12] -- The Task Table

77
0
  • Squishy Plushie's avatar Artist
    Squishy Pl...
  • DDG Model
    Kling 3
  • Access
    Public
  • Created
    2w ago
  • Try

Prompt

A beautiful purple-haired woman wearing a long purple velvet ankle-length dress with flouncy sleeves and purple suede high heels. She is going though a turnstile.

More about ::SHE+ILA:: Kernel ASM Source [12] -- The Task Table

// Here we have some of the Buf Wait code, and the scheduler task table.
// We have chosen to use a linear table rather than a linked list or Buf queue, since this is an experimental OS and we may well benchmark the difference.
// Normally we would have a queue for each wait and suspend condition (waiting state), and one for each CPU core (running state).
// But since ::SHE+ILA:: currently only supports a finite number of concurrent threads, we will use a TSS pointer and a Buf pointer instead for now (may change later).
TaskTableEntry <:: (= timeslice:32, stateflags:8, priority:8, pctcpu:16, TSSpointer:32, Bufpointer:32, nextrunnableentry:32 =); // Located in GS
// pctcpu retains the dynamic cpu percentage of each task, so the scheduler can fairly improve response time
TaskTable <:: 1024#TaskTableEntry; // Up to 1K threads should be plenty
SystemGlobalSegment << TaskTable; // Append to GS segment
FWAITEMPTY: _PROC // FBI "?Buf" call, taskID in EBP, Buf in EBX
_MOV GS:[TaskTableEntry.Bufpointer+EBP],EBX; // Identify which Buf we're waiting for (the Buf should also have a backpointer to the TaskTable)
_CALL SWITCHTASKS; // Make the highest priority runnable task active (load its TSS segment)
// Note that we use hardware 80x86 task switching, since we don't (yet) use the FPU87 registers
// When the Buf becomes nonempty we will rescan the tasklist and reactivate it
This happens when FINSERT is called to append data to the Buf (and the Buf's backpointer is nonNULL)
_RET; // TODO: Review other scheduler conditions!
_}; // End ASM block
// TODO: Update FINSERT procedure to "signal" the thread as appropriate
// *** More soon :) ***

Comments


Loading Dream Comments...

Discover more dreams from this artist