这学期我们学操作系统,所以得写个PCB。
于是我借鉴了一下windows的PCB,写了这个
Imports System.Runtime.InteropServices'''''' 这就是传说中的PCB ''' Structure KPROCESS Dim Header As DispatcherHeader Dim ProfileListHead As LinkedList(Of ProcessProfileSimulator) Dim DirectoryTableBase As UInteger Dim LdtDescriptor As KernelGlobalDescriptorTableEntry Dim Int21Descriptor As KernelInterruptDescriptorTableEntry Dim IopmOffset As Short Dim Iopl As Byte Dim ActiveProcessors As UInteger Dim KernelTime As UInteger Dim UserTime As UInteger Dim ReadyListHead As LinkedList(Of ProcessSimulator) Dim SwapListEntry As SingleLinkedList(Of ProcessSimulator) Dim VdmTrapcHandler As IntPtr Dim ThreadListHead As LinkedList(Of ThreadSimulator) Dim ProcessLock As UInteger Dim Affinity As UInteger Dim ProcessFlags As ProcessFlag Dim BasePriority As SByte Dim QuantumReset As SByte Dim State As Byte Dim ThreadSeed As Byte Dim PowerState As Byte Dim IdealNode As Byte Dim Visited As Byte Dim ExecuteOptions As Byte Dim StackCount As UInteger Dim ProcessListEntry As LinkedList(Of ProcessSimulator) Dim CycleTime As ULongEnd StructureEnum ProcessFlag None AutoAlignment DisableBoost DisableQuantum = 4End EnumStructure DispatcherHeader Dim UnionType As Byte Dim UnionData As UnionAStructure UnionA Dim Abandoned As Byte Dim Absolute As Byte Dim NpxIrql As Byte Dim Signalling As Byte Dim Size As Byte Dim Hand As Byte Dim Inserted As Byte Dim DebugActive As Byte Dim DpcActive As Byte End Structure Dim Lock As Integer Dim SignalState As Integer Dim WaitListHead As LinkedList(Of ProcessSimulator)End StructureStructure KernelGlobalDescriptorTableEntry Dim LimitLow As Short Dim BaseLow As Short Dim HighWord As UIntegerEnd StructureStructure KernelInterruptDescriptorTableEntry Dim Offset As Short Dim Selector As Short Dim Access As Short Dim ExtendedOffset As ShortEnd StructureEnum KernelExecuteOptions As Byte None ExecuteDisable ExecuteEnable DisableThunkEmulation = 4 Permanent = 8 ExecuteDispatchEnable = 16 ImageDispatchEnable = 32End Enum
那个SingleLinkedList是我自定义的
Public Class SingleLinkedList(Of T) Public Property [Next] As SingleLinkedList(Of T) Public Property Value As TEnd Class