public Horizon(Switch Ns) { this.Ns = Ns; Scheduler = new KProcessScheduler(Ns.Log); Processes = new ConcurrentDictionary <int, Process>(); SystemState = new SystemStateMgr(); if (!Ns.Memory.Allocator.TryAllocate(HidSize, out long HidPA) || !Ns.Memory.Allocator.TryAllocate(FontSize, out long FontPA)) { throw new InvalidOperationException(); } HidSharedMem = new KSharedMemory(HidPA, HidSize); FontSharedMem = new KSharedMemory(FontPA, FontSize); Font = new SharedFontManager(Ns, FontSharedMem.PA); VsyncEvent = new KEvent(); }