Go to the documentation of this file.
18 #include <FreeNOS/System.h>
39 ERROR(
"failed to create memory context");
47 ERROR(
"failed to initialize MemoryContext: result = " << (
int) memResult);
60 ERROR(
"failed to allocate user stack");
68 ERROR(
"failed to map user stack");
79 ERROR(
"failed to allocate kernel stack");
116 regs->
seg.
fs = dataSel;
117 regs->
seg.
gs = dataSel;
118 regs->
seg.
es = dataSel;
119 regs->
seg.
ds = dataSel;
123 regs->
irq.
cs = codeSel;
virtual Result initialize()=0
Initialize the MemoryContext.
MemoryContext * m_memoryContext
MMU memory context.
Intel virtual memory implementation.
C void switchCoreState(Address *currentStack, Address stack)
Switch Core Stack.
Represents a process which may run on the host.
static void * set(void *dest, int ch, unsigned count)
Fill memory with a constant byte.
IntelProcess(ProcessID id, Address entry, bool privileged, const MemoryMap &map)
Constructor function.
struct CPURegs CPURegs
Structure represents the pusha/popa format.
#define PAGESIZE
ARM uses 4K pages.
MemoryMap m_map
Virtual memory layout.
#define MEMALIGN
Memory address alignment.
u32 ProcessID
Process Identification Number.
unsigned long Address
A memory address.
Address address
Starting address of the memory range.
SplitAllocator * getAllocator()
Get physical memory allocator.
Size alignment
Alignment in bytes or ZERO for default alignment.
virtual void reset(const Address entry)
Restart execution at the given entry point.
virtual Result initialize()
Initialize the Process.
Size size
Amount of memory in bytes.
TSS kernelTss
Task State Segment.
Allocator which separates kernel mapped memory at virtual and physical addresses.
virtual Result activate(bool initializeMMU=false)=0
Activate the MemoryContext.
Address phys
Physical address.
Structure represents the pusha/popa format.
virtual ~IntelProcess()
Destructor function.
Process which may execute on an Intel CPU.
Memory::Range range(Region region) const
Get memory range for the given region.
unsigned short u16
Unsigned 16-bit number.
virtual void execute(Process *previous)
Execute the process.
Describes virtual memory map layout.
static Kernel * instance()
Retrieve the instance.
Address m_entry
Entry point of the program.
Address m_kernelStackBase
Base kernel stack (fixed)
Contains all the CPU registers.
C void loadCoreState()
Load Core State.
Describes a range of memory.
Privileged Interrupt Registers (ring 0)
virtual Result initialize()
Initialize the Process.
#define ERROR(msg)
Output an error message.
virtual Result release(const Address addr)
Release memory page.
Address m_kernelStack
Current kernel stack address (changes during execution).
struct CPUState CPUState
Contains all the CPU registers.
#define INTEL_EFLAGS_DEFAULT
Address toPhysical(const Address virt) const
Convert Address to physical pointer.
Address virt
Virtual address.
Size size
Size in number of bytes.
static const Size KernelStackSize
Size of the kernel stack.
Access access
Page access flags.
virtual Result mapRangeContiguous(Memory::Range *range)
Map a range of contiguous physical pages to virtual addresses.
bool m_privileged
Privilege level.