GO FAST WHEEEEEEEEEEEEEEEE (pit tick 1 time per millisecond, so 1ms accuracy instead of 2ms like before)

This commit is contained in:
apio 2022-09-25 22:00:36 +02:00
parent 40e8aa9ff6
commit 692221dd9e

View File

@ -61,7 +61,7 @@ extern "C" void _start()
kinfoln("Prepared PIC");
PIT::initialize(500); // 500 times per second
PIT::initialize(1000); // 1000 times per second
kinfoln("Prepared PIT");
@ -76,7 +76,7 @@ extern "C" void _start()
int64_t yvel = 10;
while (1)
{
sleep(5);
sleep(2);
uint32_t color = (uint32_t)Mersenne::get();
uint32_t* colptr = &color;
x += xvel;
@ -108,7 +108,7 @@ extern "C" void _start()
Scheduler::add_kernel_task([]() {
while (1)
{
sleep(200);
sleep(100);
uint32_t color = (uint32_t)Mersenne::get();
uint32_t* colptr = &color;
framebuffer0.paint_rect(Mersenne::get() % (framebuffer0.width() - 256),
@ -132,10 +132,6 @@ extern "C" void _start()
kinfoln("Prepared scheduler tasks");
ACPI::SDTHeader* rootSDT = ACPI::get_rsdt_or_xsdt();
bool isXSDT = ACPI::is_xsdt();
if (!ACPI::validate_rsdt_or_xsdt(rootSDT)) kerrorln("Invalid %s", isXSDT ? "XSDT" : "RSDT");
framebuffer0.clear(Color::Cyan);
Interrupts::enable();
@ -146,10 +142,5 @@ extern "C" void _start()
kinfoln("Found PCI device %x:%x, %s", dev.id().vendor, dev.id().device, pci_type_name(dev.type()));
});
kdbgln("System memory: %ld KB", Memory::get_system() / 1024);
kdbgln(" Free memory : %ld KB", PMM::get_free() / 1024);
kdbgln(" Used memory : %ld KB", PMM::get_used() / 1024);
kdbgln(" Reserved memory : %ld KB", PMM::get_reserved() / 1024);
Scheduler::exit();
}