aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gdb')
-rw-r--r--scripts/gdb/teachos/dump_mb2i.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/scripts/gdb/teachos/dump_mb2i.py b/scripts/gdb/teachos/dump_mb2i.py
index 06f4531..ca0c378 100644
--- a/scripts/gdb/teachos/dump_mb2i.py
+++ b/scripts/gdb/teachos/dump_mb2i.py
@@ -36,6 +36,12 @@ class MemoryType(IntEnum):
BAD = 5
+class FramebufferType(IntEnum):
+ INDEXED = 0
+ RGB = 1
+ TEXT = 2
+
+
TAG_NAMES = {
TagType.END: "End of Tags",
TagType.CMDLINE: "Boot Command Line",
@@ -69,6 +75,13 @@ MEMORY_TYPES = {
MemoryType.BAD: "Bad Memory",
}
+FRAMEBUFFER_TYPES = {
+ FramebufferType.INDEXED: "Indexed Color",
+ FramebufferType.RGB: "RGB",
+ FramebufferType.TEXT: "Text Mode",
+}
+
+
INDENT = f"{' '*11}"
@@ -221,4 +234,11 @@ class DumpMB2I(gdb.Command):
gdb.write(f"{INDENT}address: {base:#010x}\n")
def _write_framebuffer_info_tag(self, data):
- pass
+ address, pitch, width, height, bpp, type = struct.unpack_from("<QIIIBB", data)
+ type_string = FRAMEBUFFER_TYPES.get(type, "Unknown")
+ gdb.write(f"{INDENT}address: {address:#010x} | type: {type_string}\n")
+ gdb.write(f"{INDENT}depth: {bpp} | pitch: {self._format_size(pitch)}\n")
+ if type == FramebufferType.TEXT:
+ gdb.write(f"{INDENT}width: {width} chars | height: {height} chars\n")
+ else:
+ gdb.write(f"{INDENT}width: {width} px | height: {height} px\n")