Comments
Loading Dream Comments...
You must be logged in to write a comment - Log In
ArtistA beautiful purple-haired ragdoll wearing a long purple velvet ankle-length dress with flouncy sleeves and purple suede high heels. Around her are many separate sheets of paper.
// Here is the third part of the Virtual Storage subsystem of the ::SHE+ILA:: Kernel.
// STILL TO DO: Use of EBX.flags TO AVOID SWAPPING OUT UNMODIFIED PAGES :)
// STILL TO DO: Set up lba's AND handle MULTIPAGE SEGMENTS :)
// STILL TO DO: Process any address registers :)
{_ // Begin ASM block
STARTUPVS: _PROC; // Called at system bootup
_MOV ECX, 32768; // Number of page frames in extended RAM
L3: _MOV EBX,pagetable; // Point to start of page table
_CALL NEWPF; // Initialise that entry
_ADD EBX,#PageTableEntry; // Add the size of each entry
_LOOP L3; // And go round to do the next
_RET
SHUTDOWNVS: _PROC; // Called at system shutdown
_MOV ECX, 32768; // Number of page frames
L4: _MOV EBX,pagetable; // Point to start of pagetable
_CALL DELETEPF; // Close that entry
_ADD EBX,#PageTableEntry; // Next entry
_LOOP L4; // And go round to do the next
_RET
SWAPIN: _PROC; // Swap in a page, on demand, entry in EBX
_CMP EBX.pgtblseg,0; // Is it present?
_JZ L5; // No it isn't
_MOV EAX,EBX; // Yes it is, so return it
_RET
L5: _CMP GS:[framecount],32767; // Have we any free page frames?
_JB L6; // Yes we have
// No we haven't so swap one out
_MOV EBX,GS:[swapEBX]; // Page to swap out
_CALL DELETEPF
L6: _CALL NEWPF; // Swap in the one we want
_MOV EAX,EBX; // Return it to caller
_RET
_} // End ASM block
// **** More Kernel Code Soon :) ****