fix(baremetal): 512GB identity paging, early GOP splash, dual-output console & COM1/RTC timeout guards
- arch/x86_64/boot.s: Map 8GB..512GB using 1GB huge pages in PDPT; set Multiboot2 FB tag to required native 32bpp - drivers/serial.c: Add scratch register hardware probe & 50k timeout guard to prevent infinite polling hang on modern AMD chipsets - drivers/rtc.c: Add timeout guard to CMOS status register polling - drivers/vga.c: Bypass legacy 0x3D4/0x3D5 CRT ports in GOP mode; mirror all characters to active hardware framebuffer - drivers/vbe.c: Implement vbe_early_boot_splash, direct front-buffer console rendering & dynamic backbuffer allocation - kernel/kmain.c: Initialize GOP linear framebuffer at Step 0 for instant physical screen illumination; use pause+counter in render loop - scripts/build_iso.sh: Support universal GOP/VBE/VGA multi-resolution auto-detect for both bare metal and VirtualBox
This commit is contained in:
1 parent
6165197d0a
commit
da3f0788d0
11 files changed
+274
-57
No files matched your search
+23
-3
@@ -1,7 +1,22 @@
|
||||
#include <airlys/serial.h>
|
||||
#include <airlys/io.h>
|
||||
|
||||
static bool s_com1_present = false;
|
||||
|
||||
void serial_init(void) {
|
||||
/* Test if COM1 actually exists using UART scratch register (offset +7) */
|
||||
outb(COM1_PORT + 7, 0x55);
|
||||
if (inb(COM1_PORT + 7) != 0x55) {
|
||||
s_com1_present = false;
|
||||
return;
|
||||
}
|
||||
outb(COM1_PORT + 7, 0xAA);
|
||||
if (inb(COM1_PORT + 7) != 0xAA) {
|
||||
s_com1_present = false;
|
||||
return;
|
||||
}
|
||||
|
||||
s_com1_present = true;
|
||||
outb(COM1_PORT + 1, 0x00); /* Disable all interrupts */
|
||||
outb(COM1_PORT + 3, 0x80); /* Enable DLAB (set baud rate divisor) */
|
||||
outb(COM1_PORT + 0, 0x01); /* Set divisor to 1 (115200 baud) */
|
||||
@@ -16,12 +31,17 @@ static inline bool is_transmit_empty(void) {
|
||||
}
|
||||
|
||||
void serial_putchar(char c) {
|
||||
while (!is_transmit_empty()) {}
|
||||
outb(COM1_PORT, c);
|
||||
if (!s_com1_present) return;
|
||||
|
||||
uint32_t timeout = 50000;
|
||||
while (!is_transmit_empty() && --timeout > 0) {}
|
||||
if (timeout > 0) {
|
||||
outb(COM1_PORT, c);
|
||||
}
|
||||
}
|
||||
|
||||
void serial_puts(const char* str) {
|
||||
if (!str) return;
|
||||
if (!s_com1_present || !str) return;
|
||||
while (*str) {
|
||||
if (*str == '\n') {
|
||||
serial_putchar('\r');
|
||||
|
||||
Reference in new issue
Block a user