console: put the kernel log on screen from the first line
Everything the kernel printed went to the serial port and nowhere else until the first program started and called console_takeover(). On a machine with a UART that is fine. On one without -- a laptop, a Chromebox, anything built this century -- the screen showed the loader's progress bar and then nothing at all, for the whole of boot, on exactly the machines where something was going wrong. A report of "it shows Loading SchOS and freezes" cannot be acted on. The same boot with a log on it says which line it stopped after, and that is usually the whole diagnosis. The loader has already put a framebuffer on the screen and described it in the boot block, so there was a perfectly good console sitting unused for the entire early boot. kmain attaches it on its first line now. Not gated on the F8 verbose menu, which was the first instinct and is wrong: F8 is no use to someone whose machine resets before they can read anything. This is what Linux does too -- the log is the default and `quiet splash` is the thing you ask for. The splash survives until the kernel's first message, and a boot that succeeds clears the lot when the shell starts, so the only people who ever see this are the people who need to. vt_init is idempotent now, because the early attach brings the terminals up before main() reaches its usual call and the second one must not wipe six screens of boot messages. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VQ7Qx8E1q1M1bbCq8QLHS2
This commit is contained in:
parent
52e6e9b756
commit
7d44eb75a3
2 changed files with 50 additions and 0 deletions
|
|
@ -140,6 +140,15 @@ void
|
|||
vt_init(void)
|
||||
{
|
||||
int cols, rows;
|
||||
|
||||
// Idempotent. A verbose boot brings the terminals up early, before the PCI
|
||||
// bus is walked, so that the kernel log has somewhere to go; main() then
|
||||
// calls this again in its usual place. The second call must not wipe six
|
||||
// screens of boot messages.
|
||||
if (vt_ready) {
|
||||
vt_resize();
|
||||
return;
|
||||
}
|
||||
measure(&cols, &rows);
|
||||
|
||||
for (int i = 0; i < NVT; i++) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue