10 #include <linux/ctype.h>
12 #include <linux/kernel.h>
13 #include <linux/string.h>
16 #include <linux/module.h>
20 #define BIOS_MEMCONSOLE_V1_MAGIC 0xDEADBABE
21 #define BIOS_MEMCONSOLE_V2_MAGIC (('M')|('C'<<8)|('O'<<16)|('N'<<24))
44 static char *memconsole_baseaddr;
45 static size_t memconsole_length;
56 .attr = {.name =
"log", .mode = 0444},
57 .read = memconsole_read,
65 "start = %d, end = %d, num = %d\n",
66 hdr->
v1.buffer_addr, hdr->
v1.start,
67 hdr->
v1.end, hdr->
v1.num_chars);
69 memconsole_length = hdr->
v1.num_chars;
77 "start = %d, end = %d, num_bytes = %d\n",
78 hdr->
v2.buffer_addr, hdr->
v2.start,
79 hdr->
v2.end, hdr->
v2.num_bytes);
81 memconsole_length = hdr->
v2.end - hdr->
v2.start;
90 static bool found_memconsole(
void)
95 address = get_bios_ebda();
109 for (cur = 0; cur <
length; cur++) {
114 found_v1_header(hdr);
120 found_v2_header(hdr);
131 .ident =
"Google Board",
140 static int __init memconsole_init(
void)
147 if (!found_memconsole())
150 memconsole_bin_attr.
size = memconsole_length;
157 static void __exit memconsole_exit(
void)