zoukankan      html  css  js  c++  java
  • [水]用vb写了个PCB

    这学期我们学操作系统,所以得写个PCB。

    于是我借鉴了一下windows的PCB,写了这个

    Imports System.Runtime.InteropServices
    ''' <summary>
    ''' 这就是传说中的PCB
    ''' </summary> 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 ULong End Structure Enum ProcessFlag None AutoAlignment DisableBoost DisableQuantum = 4 End Enum Structure DispatcherHeader Dim UnionType As Byte Dim UnionData As UnionA <StructLayout(LayoutKind.Explicit)> Structure UnionA <FieldOffset(0)> Dim Abandoned As Byte <FieldOffset(1)> Dim Absolute As Byte <FieldOffset(2)> Dim NpxIrql As Byte <FieldOffset(3)> Dim Signalling As Byte <FieldOffset(0)> Dim Size As Byte <FieldOffset(1)> Dim Hand As Byte <FieldOffset(0)> Dim Inserted As Byte <FieldOffset(1)> Dim DebugActive As Byte <FieldOffset(2)> Dim DpcActive As Byte End Structure Dim Lock As Integer Dim SignalState As Integer Dim WaitListHead As LinkedList(Of ProcessSimulator) End Structure Structure KernelGlobalDescriptorTableEntry Dim LimitLow As Short Dim BaseLow As Short Dim HighWord As UInteger End Structure Structure KernelInterruptDescriptorTableEntry Dim Offset As Short Dim Selector As Short Dim Access As Short Dim ExtendedOffset As Short End Structure Enum KernelExecuteOptions As Byte None ExecuteDisable ExecuteEnable DisableThunkEmulation = 4 Permanent = 8 ExecuteDispatchEnable = 16 ImageDispatchEnable = 32 End Enum

    那个SingleLinkedList是我自定义的

    Public Class SingleLinkedList(Of T)
        Public Property [Next] As SingleLinkedList(Of T)
    Public Property Value As T
    End Class
  • 相关阅读:
    for, 类型转换和使用方法
    笔记,随时更改
    控制流程之while循环, for循环
    赋值,逻辑,运算符, 控制流程之if 判断
    常量,基本数据类型,输入输出,基本运算符
    介绍python由来, 安装python3.8.3 及其变量的定义, 小整数池
    数组去重多个条件
    vue 自定义指令
    截取指定名字的url参数
    常用的js
  • 原文地址:https://www.cnblogs.com/Nukepayload2/p/os_pcbmodel_vb.html
Copyright © 2011-2022 走看看