New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fwts_coreboot.c: add fwts_coreboot_cbmem_console_dump() #3
base: master
Are you sure you want to change the base?
Conversation
639faec
to
cd1ce41
Compare
src/lib/src/fwts_coreboot.c
Outdated
|
||
#include "fwts.h" | ||
|
||
fwts_list* fwts_coreboot_cbmem_log(void) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ on next line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/lib/src/fwts_coreboot_cbmem.c
Outdated
struct lb_record { | ||
uint32_t tag; /* tag ID */ | ||
uint32_t size; /* size of record (in bytes) */ | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on all structs: attribute ((packed))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/lib/src/fwts_coreboot_cbmem.c
Outdated
|
||
mem = malloc(size); | ||
|
||
if (!mem) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fwts_munmap(phy, size);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/lib/src/fwts_coreboot_cbmem.c
Outdated
|
||
count = memconsole_coreboot_read(console, coreboot_log, 0, console_p->size-1); | ||
if (count == 0) { | ||
free(console_p); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
free(coreboot_log);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
free(console_p); | ||
return NULL; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
free(console_p);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/lib/src/fwts_coreboot_cbmem.c
Outdated
return NULL; | ||
} | ||
|
||
coreboot_log = malloc(console_p->size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console->size
src/lib/src/fwts_coreboot_cbmem.c
Outdated
return NULL; | ||
} | ||
|
||
memset(coreboot_log, '\0', console_p->size); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console->size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/lib/src/fwts_coreboot_cbmem.c
Outdated
|
||
memset(coreboot_log, '\0', console_p->size); | ||
|
||
count = memconsole_coreboot_read(console, coreboot_log, 0, console_p->size-1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console->size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
e053ae6
to
e8149a5
Compare
Parse the full coreboot console log out of /dev/mem, if the google kernel module is not loaded. Does only work on x86 plattform. Todo: - add arm plattform support Tested with: - Lenovo thinkpad t410 - Qemu x86 The code is based on: - google kernel module memconsole-coreboot - coreboot util/cbmem https://review.coreboot.org/coreboot.git Signed-off-by: Marcello Sylvester Bauer <info@marcellobauer.com>
No description provided.