📄 os.xml
字号:
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Cmpi">
<summary>
Compare contents of r1 with 1. If r1 < 9 set sign flag. If r1 > 9 clear sign flag.
If r1 == 9 set zero flag.
<pre>
14 r1, $9
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Cmpr">
<summary>
Compare contents of r1 with r2. If r1 < r2 set sign flag. If r1 > r2 clear sign flag.
If r1 == r2 set zero flag.
<pre>
15 r1, r2
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Jlt">
<summary>
If the sign flag is set, jump to the instruction that is offset r1 bytes from the current instruction
<pre>
16 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Jgt">
<summary>
If the sign flag is clear, jump to the instruction that is offset r1 bytes from the current instruction
<pre>
17 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Je">
<summary>
If the zero flag is set, jump to the instruction that is offset r1 bytes from the current instruction
<pre>
18 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Call">
<summary>
Call the procedure at offset r1 bytes from the current instrucion.
The address of the next instruction to excetute after a return is pushed on the stack
<pre>
19 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Callm">
<summary>
Call the procedure at offset of the bytes in memory pointed by r1 from the current instrucion.
The address of the next instruction to excetute after a return is pushed on the stack
<pre>
20 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Ret">
<summary>
Pop the return address from the stack and transfer control to this instruction
<pre>
21
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Alloc">
<summary>
Allocate memory of the size equal to r1 bytes and return the address of the new memory in r2.
If failed, r2 is cleared to 0.
<pre>
22 r1, r2
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.AcquireLock">
<summary>
Acquire the OS lock whose # is provided in register r1.
Icf the lock is not held by the current process
the operation is a no-op
<pre>
23 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.ReleaseLock">
<summary>
Release the OS lock whose # is provided in register r1.
Another process or the idle process
must be scheduled at this point.
if the lock is not held by the current process,
the instruction is a no-op
<pre>
24 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Sleep">
<summary>
Sleep the # of clock cycles as indicated in r1.
Another process or the idle process
must be scheduled at this point.
If the time to sleep is 0, the process sleeps infinitely
<pre>
25 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.SetPriority">
<summary>
Set the priority of the current process to the value
in register r1
<pre>
26 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Exit">
<summary>
This opcode causes an exit and the process's memory to be unloaded.
Another process or the idle process must now be scheduled
<pre>
27
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.FreeMemory">
<summary>
Free the memory allocated whose address is in r1
<pre>
28 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.MapSharedMem">
<summary>
Map the shared memory region identified by r1 and return the start address in r2
<pre>
29 r1, r2
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.SignalEvent">
<summary>
Signal the event indicated by the value in register r1
<pre>
30 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.WaitEvent">
<summary>
Wait for the event in register r1 to be triggered resulting in a context-switch
<pre>
31 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Input">
<summary>
Read the next 32-bit value into register r1
<pre>
32 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.MemoryClear">
<summary>
set the bytes starting at address r1 of length r2 to zero
<pre>
33 r1, r2
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.TerminateProcess">
<summary>
Terminate the process whose id is in the register r1
<pre>
34 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Popr">
<summary>
Pop the contents at the top of the stack into register r1
<pre>
35 r1
</pre>
</summary>
</member>
<member name="F:Hanselman.CST352.InstructionType.Popm">
<summary>
Pop the contents at the top of the stack into the memory pointed to by register r1
<pre>
36 r1
</pre>
</summary>
</member>
<member name="T:Hanselman.CST352.CPU">
<summary>
CPU is never instanciated, but is "always" there...like a real CPU. :) It holds <see cref="F:Hanselman.CST352.CPU.physicalMemory"/>
and the <see cref="F:Hanselman.CST352.CPU.registers"/>. It also provides a mapping from <see cref="T:Hanselman.CST352.Instruction"/>s to SystemCalls in
the <see cref="T:Hanselman.CST352.OS"/>.
</summary>
</member>
<member name="F:Hanselman.CST352.CPU.pageSize">
<summary>
The size of a memory page for this system. This should be a multiple of 4. Small sizes (like 4) will
cause the system to thrash and page often. 16 is a nice compromise for such a small system.
64 might also work well. This probably won't change, but it is nice to be able to.
This is loaded from Configuration on a call to <see cref="M:Hanselman.CST352.CPU.initPhysicalMemory(System.UInt32)"/>
</summary>
</member>
<member name="F:Hanselman.CST352.CPU.clock">
<summary>
The clock for the system. This increments as we execute each <see cref="T:Hanselman.CST352.Instruction"/>.
</summary>
</member>
<member name="F:Hanselman.CST352.CPU.theOS">
<summary>
The CPU's reference to the <see cref="T:Hanselman.CST352.OS"/>. This is set by the <see cref="T:Hanselman.CST352.EntryPoint"/>.
</summary>
</member>
<member name="M:Hanselman.CST352.CPU.initPhysicalMemory(System.UInt32)">
<summary>
Initialized our <see cref="F:Hanselman.CST352.CPU.physicalMemory"/> array that represents physical memory. Should only be called once.
</summary>
<param name="memorySize">The size of physical memory</param>
</member>
<member name="F:Hanselman.CST352.CPU.physicalMemory">
<summary>
Here is the actual array of bytes that contains the physical memory for this CPU.
</summary>
</member>
<member name="F:Hanselman.CST352.CPU.registers">
<summary>
We have 10 registers. R11 is the <see cref="P:Hanselman.CST352.CPU.ip"/>, and we don't use R0. R10 is the <see cref="P:Hanselman.CST352.CPU.sp"/>. So, that's 1 to 10, and 11.
</summary>
</member>
<member name="F:Hanselman.CST352.CPU.bitFlagRegisters">
<summary>
We have a Sign Flag and a Zero Flag in a <see cref="T:System.Collections.BitArray"/>
</summary>
</member>
<member name="M:Hanselman.CST352.CPU.executeNextOpCode">
<summary>
Takes the process id from the <see cref="F:Hanselman.CST352.OS.currentProcess"/> and the CPU's <see cref="P:Hanselman.CST352.CPU.ip"/> and
gets the next <see cref="T:Hanselman.CST352.Instruction"/> from memory. The <see cref="T:Hanselman.CST352.InstructionType"/> translates
via an array of <see cref="T:Hanselman.CST352.SystemCall"/>s and retrives a <see cref="T:System.Delegate"/> from <see cref="M:Hanselman.CST352.CPU.opCodeToSysCall(Hanselman.CST352.InstructionType)"/>
and calls it.
</summary>
</member>
<member name="M:Hanselman.CST352.CPU.opCodeToSysCall(Hanselman.CST352.InstructionType)">
<summary>
The <see cref="T:Hanselman.CST352.InstructionType"/> translates via an array of <see cref="T:Hanselman.CST352.SystemCall"/>s and
retrives a <see cref="T:System.Delegate"/> and calls it.
</summary>
<param name="opCode">An <see cref="T:Hanselman.CST352.InstructionType"/> enum that maps to a <see cref="T:Hanselman.CST352.SystemCall"/></param>
</member>
<member name="M:Hanselman.CST352.CPU.DumpRegisters">
<summary>
Dumps the values of <see cref="F:Hanselman.CST352.CPU.registers"/> as the <see cref="T:Hanselman.CST352.CPU"/> currently sees it.
</summary>
</member>
<member name="M:Hanselman.CST352.CPU.DumpInstruction">
<summary>
Dumps the current <see cref="T:Hanselman.CST352.Instruction"/> for the current process at the current <see cref="P:Hanselman.CST352.CPU.ip"/>
</summary>
</member>
<member name="M:Hanselman.CST352.CPU.DumpPhysicalMemory">
<summary>
Dumps the content of the CPU's <see cref="F:Hanselman.CST352.CPU.physicalMemory"/> array.
</summary>
</member>
<member name="M:Hanselman.CST352.CPU.BytesToUInt(System.Byte[])">
<summary>
Pins down a section of memory and converts an array of bytes into an unsigned int (<see cref="T:System.UInt32"/>)
</summary>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -