Untitled
unknown
plain_text
a year ago
530 B
8
Indexable
#include <linux/module.h>
#include <linux/kernel.h>
static int __init my_module_init(void) {
uint64_t cr3_value;
// Read the CR3 register
asm volatile (
"movq %%cr3, %0"
: "=r" (cr3_value)
);
pr_info("CR3 Register value: 0x%llx\n", cr3_value);
return 0;
}
static void __exit my_module_exit(void) {
// Cleanup code here
}
module_init(my_module_init);
module_exit(my_module_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Read CR3 Register Example");
MODULE_AUTHOR("Your Name");
Editor is loading...
Leave a Comment