Skip to content

Commit

Permalink
Fix bug where Console::the() was initialized too late.
Browse files Browse the repository at this point in the history
Yet another problem due to lack of BSS zeroing in the kernel loader...
  • Loading branch information
awesomekling committed Oct 30, 2018
1 parent 00c21d1 commit b833aa4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Kernel/Console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ static Console* s_the;

Console& Console::the()
{
ASSERT(s_the);
return *s_the;
}

Expand Down
2 changes: 1 addition & 1 deletion Kernel/Syscall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ DWORD handle(DWORD function, DWORD arg1, DWORD arg2, DWORD arg3)
case Syscall::PosixTtynameR:
return current->sys$ttyname_r((int)arg1, (char*)arg2, (size_t)arg3);
default:
kprintf("int0x80: Unknown function %x requested {%x, %x, %x}\n", function, arg1, arg2, arg3);
kprintf("<%u> int0x80: Unknown function %x requested {%x, %x, %x}\n", current->pid(), function, arg1, arg2, arg3);
break;
}
return 0;
Expand Down
3 changes: 2 additions & 1 deletion Kernel/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,15 @@ void init()
kmalloc_init();
vga_init();

auto console = make<Console>();

RTC::initialize();
PIC::initialize();
gdt_init();
idt_init();

keyboard = new Keyboard;

auto console = make<Console>();
VirtualConsole::initialize();
tty0 = new VirtualConsole(0, VirtualConsole::AdoptCurrentVGABuffer);
tty1 = new VirtualConsole(1);
Expand Down

0 comments on commit b833aa4

Please sign in to comment.