aboutsummaryrefslogtreecommitdiffstats
path: root/kernel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kernel.cpp')
-rw-r--r--kernel.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel.cpp b/kernel.cpp
index cbeab58..350a11e 100644
--- a/kernel.cpp
+++ b/kernel.cpp
@@ -67,6 +67,16 @@ void kernel_main(void)
ata_probe(bus1, ATA::Master, "1:0");
ata_probe(bus1, ATA::Slave, "1:1");
+ idt_register_callback(0x28, [](auto& regs) {
+ term.write(static_cast<char>(regs.eax));
+ });
+
+ term.write("Entering user mode...\n");
+ enter_user_mode([] {
+ asm volatile("int $0x28" :: "a" ('Z'));
+ for (;;);
+ });
+
for (;;) {
const auto ch = keyboard_read();
if (ch)