Beispiel #1
0
        public KProcess(Horizon system) : base(system)
        {
            _processLock   = new object();
            _threadingLock = new object();

            CpuMemory = new MemoryManager(system.Device.Memory.RamPointer);

            CpuMemory.InvalidAccess += InvalidAccessHandler;

            AddressArbiter = new KAddressArbiter(system);

            MemoryManager = new KMemoryManager(system, CpuMemory);

            _fullTlsPages = new SortedDictionary <ulong, KTlsPageInfo>();
            _freeTlsPages = new SortedDictionary <ulong, KTlsPageInfo>();

            Capabilities = new KProcessCapabilities();

            RandomEntropy = new long[KScheduler.CpuCoresCount];

            _threads = new LinkedList <KThread>();

            Translator = new Translator(CpuMemory);

            Translator.CpuTrace += CpuTraceHandler;

            _svcHandler = new SvcHandler(system.Device, this);

            Debugger = new HleProcessDebugger(this);
        }
Beispiel #2
0
        public Horizon(Switch Device)
        {
            this.Device = Device;

            Processes = new ConcurrentDictionary <int, Process>();

            State = new SystemStateMgr();

            Scheduler = new KScheduler();

            TimeManager = new KTimeManager();

            AddressArbiter = new KAddressArbiter(this);

            Synchronization = new KSynchronization(this);

            CriticalSectionLock = new KRecursiveLock(this);

            if (!Device.Memory.Allocator.TryAllocate(HidSize, out long HidPA) ||
                !Device.Memory.Allocator.TryAllocate(FontSize, out long FontPA))
            {
                throw new InvalidOperationException();
            }

            HidSharedMem  = new KSharedMemory(HidPA, HidSize);
            FontSharedMem = new KSharedMemory(FontPA, FontSize);

            Font = new SharedFontManager(Device, FontSharedMem.PA);

            VsyncEvent = new KEvent(this);
        }
Beispiel #3
0
        public KProcess(KernelContext context) : base(context)
        {
            _processLock   = new object();
            _threadingLock = new object();

            AddressArbiter = new KAddressArbiter(context);

            _fullTlsPages = new SortedDictionary <ulong, KTlsPageInfo>();
            _freeTlsPages = new SortedDictionary <ulong, KTlsPageInfo>();

            Capabilities = new KProcessCapabilities();

            RandomEntropy = new long[KScheduler.CpuCoresCount];

            _threads = new LinkedList <KThread>();

            Debugger = new HleProcessDebugger(this);
        }
Beispiel #4
0
        public KProcess(Horizon system) : base(system)
        {
            _processLock   = new object();
            _threadingLock = new object();

            _system = system;

            AddressArbiter = new KAddressArbiter(system);

            _fullTlsPages = new SortedDictionary <ulong, KTlsPageInfo>();
            _freeTlsPages = new SortedDictionary <ulong, KTlsPageInfo>();

            Capabilities = new KProcessCapabilities();

            RandomEntropy = new long[KScheduler.CpuCoresCount];

            _threads = new LinkedList <KThread>();

            _svcHandler = new SvcHandler(system.Device, this);

            Debugger = new HleProcessDebugger(this);
        }
Beispiel #5
0
        public KProcess(KernelContext context) : base(context)
        {
            _processLock   = new object();
            _threadingLock = new object();

            AddressArbiter = new KAddressArbiter(context);

            _fullTlsPages = new SortedDictionary <ulong, KTlsPageInfo>();
            _freeTlsPages = new SortedDictionary <ulong, KTlsPageInfo>();

            Capabilities = new KProcessCapabilities();

            RandomEntropy = new ulong[KScheduler.CpuCoresCount];
            PinnedThreads = new KThread[KScheduler.CpuCoresCount];

            // TODO: Remove once we no longer need to initialize it externally.
            HandleTable = new KHandleTable(context);

            _threads = new LinkedList <KThread>();

            Debugger = new HleProcessDebugger(this);
        }