示例#1
0
        public override void MainMethod()
        {
            Ensure.Init();
            CPU.DisableInts();
            GDT.Init();
            IDT.Init();
            ISR.Init();
            Console.Clear();
            ACPI.Init();
            ACPI.Enable();
            PageManager.Init();
            Heap.Init();
            GC.Init();
            Paging.Init();
            PIT.Init();
            RTC.Init();
            Scheduler.Init();
            CPU.EnableInts();
            DiskDrive.Init();
            //FatFileSystem.Init();
            PCI.Init();
            Driver.Init();
            AudioMixer.Init();

            new Thread(Event.Init, "Events").Start();
            new Thread(new SCI().Main, "Shell").Start();

            Scheduler.Idle();
        }
示例#2
0
        public async Task <IViewComponentResult> InvokeAsync(string AccountingSubject, int Month, int Page = 1, int LinkType = 0, int StartPage = 1, string AClass = "inner-page-link")
        {
            // 9-1.系統在ViewComponent【EmployeeList】中讀取Appsetting.json中的每頁筆數RowsPerPage以及分頁頁碼連結總數PageCount。
            int RowsPerPage = int.Parse(config["Page:RowsPerPage"]);
            int PageCount   = int.Parse(config["Page:PageCount"]);
            // 9-2.系統在ViewComponent【EmployeeList】讀取員工總數。
            long memberCount = await ISR.GetLedgerListCount(AccountingSubject, Month);

            // 9-3.系統依9-2傳回值將9傳送頁碼重設在Between 1 and (9讀取記錄筆數/RowsPerPage)+(9讀取記錄筆數%RowsPerPage==0?0:1)。
            int TotalPages = (int)(memberCount / RowsPerPage);

            if (memberCount % RowsPerPage > 0)
            {
                TotalPages += 1;
            }
            if (Page < 1)
            {
                Page = 1;
            }
            if (Page > TotalPages)
            {
                Page = TotalPages;
            }
            if (Page <= 0)
            {
                Page = 1;
            }
            // 9-4.系統計算資料Skip數=(9傳送頁碼(預設1)-1)*9-1讀取RowsPerPage。
            int Skip = (Page - 1) * RowsPerPage;
            // 9-5系統在ViewComponent【EmployeeListViewComponent】讀取部門員工清單:
            List <LedgerListViewModel> lLLVM = await ISR.GetLedgerList(AccountingSubject, Month, Skip, RowsPerPage);

            // 9-6.系統設定PagerTagHelper之相關參數
            int CurrentPage = Page;

            // 9-6-1.系統將管理者權限清單Session["EmployeeRights"]暫存在ViewBag.TR。
            ViewBag.TR   = HttpContext.Session.GetObjectFromJson <List <int> >("EmployeeRights");
            ViewBag.Page = Page;
            //9-7.系統回傳View(new EmployeeListManageViewModel {
            //listEmployeeListViewModel = 9 - 5讀取值,
            //CurrentPage = 9 - 6設定值,
            //TotalPages = 9 - 6設定值,
            //PageCount = 9 - 6設定值,
            //StartPage = 9 - 6設定值,
            //Parameters = 9 - 6設定值
            //});
            return(View(new LedgerListManageViewModel
            {
                listLedgerListViewModel = lLLVM,
                CurrentPage = CurrentPage,
                TotalPages = TotalPages,
                PageCount = PageCount,
                StartPage = StartPage,
                LinkType = LinkType,
                AClass = AClass
            }));
        }
示例#3
0
 public override void Init()
 {
     buffer = new CircularBuffer(32);
     states = new byte[255];
     for (int i = 0; i < 255; i++)
     {
         states[i] = 0;
     }
     ISR.SetIntHandler(1, Handler);
 }
示例#4
0
        public static void Init()
        {
            bool skip = false;

            if (skip)
            {
                ISR.old_esp   = 0;
                ISR.Registers = new ISR.IRQContext();
                ISR.CommonISRHandler(ref ISR.Registers);
            }
        }
示例#5
0
 public PS2Keyboard(PCIDevice host) : base(host)
 {
     Label  = "PS2 Keyboard";
     buffer = new CircularBuffer(32);
     states = new byte[255];
     for (int i = 0; i < 255; i++)
     {
         states[i] = 0;
     }
     ISR.SetIntHandler(1, Handler);
 }
        public async Task <IViewComponentResult> InvokeAsync(int Month)
        {
            List <GetLedgerMonthListViewModel> lGLMLVM = await ISR.GetLedgerMonthList(Month);

            long AddMoney = await ISR.GetLedgerMonthAddMoney(Month);

            long MinusMoney = await ISR.GetLedgerMonthMinusMoney(Month);

            return(View(new GetLedgerMonthListManageViewModel
            {
                listGetLedgerMonthListViewModel = lGLMLVM,
                AddMoney = AddMoney,
                MinusMoney = MinusMoney,
            }));
        }
示例#7
0
        public unsafe Interrupts(ulong idt_start)
        {
            idt = new tysos.Collections.StaticULongArray(idt_start, 256 * 16 / 8);
            idt.Clear(0);

            default_isr       = DefaultHandler;
            default_isrec     = DefaultHandlerErrorCode;
            default_isr_lapic = DefaultHandlerLapic;

            for (int i = 0; i < 256; i++)
            {
                UninstallHandler(i);
            }

            libsupcs.x86_64.Cpu.Lidt(idt_start, 256 * 16 - 1);
        }
示例#8
0
        public override void Init()
        {
            WaitSignal();
            IOPort.outb(p64, 0xA8);
            WaitSignal();
            IOPort.outb(p64, 0x20);
            WaitData();
            byte status = (byte)(IOPort.inb(p60) | 2);

            WaitSignal();
            IOPort.outb(p64, 0x60);
            WaitSignal();
            IOPort.outb(p60, status);
            Write(0xF6);
            Read();
            Write(0xF4);
            Read();
            ISR.SetIntHandler(12, HandleMouse);
        }
示例#9
0
        public PS2Mouse(PCIDevice host) : base(host)
        {
            Label = "PS2 Mouse";
            WaitSignal();
            IOPort.outb(p64, 0xA8);
            WaitSignal();
            IOPort.outb(p64, 0x20);
            WaitData();
            byte status = (byte)(IOPort.inb(p60) | 2);

            WaitSignal();
            IOPort.outb(p64, 0x60);
            WaitSignal();
            IOPort.outb(p60, status);
            Write(0xF6);
            Read();
            Write(0xF4);
            Read();
            ISR.SetIntHandler(12, HandleMouse);
        }
示例#10
0
 public static void SetGate(byte int_num, ISR handler)
 {
     idt[int_num] = handler;
 }
示例#11
0
        public static Booster RandomizeBooster_RTR()
        {
            Card    Temp            = new Card();
            Booster FinishedBooster = new Booster();

            for (int i = 0; i < 11; i++) //wybiera 11 losowych commonow
            {
                Random Number = new Random();
                commonNumbers[i] = Number.Next(1, ISR.getByName("RTR").NumberCommon); //ISR.getByName wyszukuje kolekcji o nazwie RTR
                for (int j = i - 1; j >= 0; j--)                                      //sprawdza czy common juz wystepowal, jesli tak to szuka jeszcze raz
                {
                    if (commonNumbers[i] == commonNumbers[j])
                    {
                        i--;
                        break;
                    }
                }
            }
            for (int i = 0; i < 11; i++)
            {
                int commoncounter = 0;
                foreach (Card Temp in ISR.getByName("RTR").CardLst)
                {
                    if (Temp.rarity == 0)
                    {
                        commoncounter++;
                        if (commoncounter == commonNumbers[i])
                        {
                            FinishedBooster.AddCard(Temp); // dodaje karte do boostera
                            break;
                        }
                    }
                }
            }
            for (int i = 0; i < 3; i++)
            {
                Random Number = new Random();
                uncommonNumbers[i] = Number.Next(1, ISR.getByName("RTR").NumberUCommon);
                for (int j = i - 1; j >= 0; j--)
                {
                    if (uncommonNumbers[i] == uncommonNumbers[j])
                    {
                        i--;
                        break;
                    }
                }
            }
            for (int i = 0; i < 3; i++)
            {
                int uncommoncounter = 0;
                foreach (Card Temp in ISR.getByName("RTR").CardLst)
                {
                    if (Temp.rarity == 1)
                    {
                        uncommoncounter++;
                        if (uncommoncounter == uncommonNumbers[i])
                        {
                            FinishedBooster.AddCard(Temp); // dodaje karte do boostera
                            break;
                        }
                    }
                }
            }
            int    MythicOrNotCount;
            Random MythicOrNot = new Random();

            MythicOrNotCount = MythicOrNot.Next(0, 7);
            if (MythicOrNotCount == 7)
            {
                Random Number = new Random();
                rareNumbers[0] = Number.Next(1, ISR.getByName("RTR").NumberMRare);
                int mrarecounter = 0;
                foreach (Card Temp in ISR.getByName("RTR").CardLst)
                {
                    if (Temp.rarity == 3)
                    {
                        mrarecounter++;
                        if (mrarecounter == rareNumbers[0])
                        {
                            FinishedBooster.AddCard(Temp); // dodaje karte do boostera
                            break;
                        }
                    }
                }
            }
            else
            {
                Random Number = new Random();
                rareNumbers[0] = Number.Next(1, ISR.getByName("RTR").NumberRare);
                int rarecounter = 0;
                foreach (Card Temp in ISR.getByName("RTR").CardLst)
                {
                    if (Temp.rarity == 2)
                    {
                        rarecounter++;
                        if (rarecounter == rareNumbers[0])
                        {
                            FinishedBooster.AddCard(Temp); // dodaje karte do boostera
                            break;
                        }
                    }
                }
            }



            return(FinishedBooster);
        }
示例#12
0
 public static void SetGate(byte int_num, ISR handler)
 {
     IDT.SetGate(int_num, handler);
 }