Core.asm

This file defines the entry point into the Core of PwnOS, and includes the rest of the Core.

See Also

Authors

  • Neil G.  Dickson

Compiling

Assemble$MASM$\ML.EXE /Fl /c /Cp /nologo $this$
Link$JLOC$\JLOC.EXE BootCore.loc “..\Compiled\BootCore.bin” “..\Boot\BootCore.map”
Summary
Core.asmThis file defines the entry point into the Core of PwnOS, and includes the rest of the Core.
Variables
ThreadSchedulerTSSThis is the special <TSS32> of the ThreadScheduler task.
CallVectorsThis is the CALLVECTORLIST structure containing the addresses to all Core functions acessible from Libraries, indexed by <Core Call Gate Constants>.
CoreAccessFlagsBits used to lock access to certain areas of the Core (e.g.
Functions
CoreCallGateEntry point into the Core from Libraries.

Variables

ThreadSchedulerTSS

ThreadSchedulerTSS TSS32 <>

This is the special <TSS32> of the ThreadScheduler task.

This must be first in the CoreData segment so that its address can be hardcoded in its TSS descriptor (see <GDT>).  It doesn’t need an entire EXTENDEDTSS, because <ThreadScheuler> doesn’t request its own thread info or use FPU/SSE/MMX.

CallVectors

CallVectors CALLVECTORLIST <>

This is the CALLVECTORLIST structure containing the addresses to all Core functions acessible from Libraries, indexed by <Core Call Gate Constants>.

CoreAccessFlags

CoreAccessFlags dword 0

Bits used to lock access to certain areas of the Core (e.g.  ThreadScheduler can only have one processor at a time).

See Also

  • <Core Access Flag Constants>

Functions

CoreCallGate

Entry point into the Core from Libraries.  eax contains one of the <Core Call Gate Constants>.

To call this from Libraries, use the CALL_CORE macro.  This must be first in the CoreCode segment to ensure that its address can be hardcoded as a constant in the call gate descriptor and CALL_CORE (see <GDT>).

The Core of PwnOS (a.k.a.
ThreadSchedulerTSS TSS32 <>
This is the special TSS32 of the ThreadScheduler task.
Saves the state of the previous task and jumps to the next task to run.
CallVectors CALLVECTORLIST <>
This is the CALLVECTORLIST structure containing the addresses to all Core functions acessible from Libraries, indexed by Core Call Gate Constants.
This structure defines the layout of CallVectors, containing the addresses of all Core functions accessible from Libraries.
The Libraries section of PwnOS provides common, useful functions and functionality, and a gateway to the Core.
CoreAccessFlags dword 0
Bits used to lock access to certain areas of the Core (e.g.
This file defines the structures, constants, and macros for the entry point into the Core of PwnOS, and includes the rest of the include files for Core.
The Sync section of Core provides functions for mutual exclusion.
The Memory section of Core provides memory management functions.
The Threads section of Core provides thread and process management functions, including common scheduling operations.
The Messages section of Core provides functions for sending and receiving messages to and from message queues.
The I/O section of Core provides device management functions.
The Files section of Core provides functions for accessing files and virtual files.
This structure defines the complete saved execution environment of a thread.
Call the CoreCallGate from Libraries with one of the Core Call Gate Constants and parameters.