debug(main): 转储 BootInfo 地址处原始 88 字节

BootInfo=0xde20d00 非 NULL 但字段全 0。转储该地址原始字节,区分内存确实全 0
(bootloader 写入未生效/重定位缺失)还是内核读错偏移(布局不匹配)。
This commit is contained in:
TermiNexus committed 2026-08-26 19:23:30 +08:00
1 parent 963e0ed53f
commit 87d4e359d8
1 file changed
+12
+12
View File
@@ -142,6 +142,18 @@ class ViperKernel:
t.CUInt64T(BootInfo), BootInfo.MemmapAddr, BootInfo.MemmapSize,
BootInfo.MemmapDescSize, BootInfo.framebuffer_addr)
serial.puts(c.Addr(_dbbuf))
# [DBG] 转储 BootInfo 地址处原始 88 字节(用后移除)
_dbraw: t.CArray[t.CChar, 16]
_dbi: t.CInt = 0
while _dbi < 88:
if (_dbi % 16) == 0:
viperlib.snprintf(c.Addr(_dbraw), 16, "\n[DB] %04x:", _dbi)
serial.puts(c.Addr(_dbraw))
_dbv: t.CUInt8T = c.Deref(t.CUInt8T(t.CUInt64T(BootInfo) + t.CUInt64T(_dbi), t.CPtr))
viperlib.snprintf(c.Addr(_dbraw), 16, " %02x", _dbv)
serial.puts(c.Addr(_dbraw))
_dbi += 1
serial.puts("\n[DB] dump end\n")
if BootInfo is not None:
paging.init(BootInfo.MemmapAddr, BootInfo.MemmapSize)