mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
mark physical address stuff as BSD
This commit is contained in:
@@ -8109,6 +8109,13 @@ The Linux kernel exposes physical addresses to userland through:
|
|||||||
|
|
||||||
In this section we will play with them.
|
In this section we will play with them.
|
||||||
|
|
||||||
|
The following files contain examples to access that data and test it out:
|
||||||
|
|
||||||
|
* link:lkmc/pagemap.h[]
|
||||||
|
* link:rootfs_overlay/lkmc/virt_to_phys.sh[]
|
||||||
|
* link:userland/linux/virt_to_phys_user.c[]
|
||||||
|
* link:userland/posix/virt_to_phys_test.c[]
|
||||||
|
|
||||||
First get a virtual address to play with:
|
First get a virtual address to play with:
|
||||||
|
|
||||||
....
|
....
|
||||||
@@ -8142,8 +8149,6 @@ Sample output physical address:
|
|||||||
0x7c7b800
|
0x7c7b800
|
||||||
....
|
....
|
||||||
|
|
||||||
Source: link:userland/linux/virt_to_phys_user.c[]
|
|
||||||
|
|
||||||
Now we can verify that `linux/virt_to_phys_user.out` gave the correct physical address in the following ways:
|
Now we can verify that `linux/virt_to_phys_user.out` gave the correct physical address in the following ways:
|
||||||
|
|
||||||
* <<qemu-xp>>
|
* <<qemu-xp>>
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
/* https://cirosantilli.com/linux-kernel-module-cheat#userland-physical-address-experiments
|
||||||
|
* https://cirosantilli.com/linux-kernel-module-cheat#pagemap-dump-out
|
||||||
|
*
|
||||||
|
* This file is dual licensed as both 3-Clause BSD and GPLv3.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifndef LKMC_PAGEMAP_H
|
#ifndef LKMC_PAGEMAP_H
|
||||||
#define LKMC_PAGEMAP_H
|
#define LKMC_PAGEMAP_H
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
/* https://cirosantilli.com/linux-kernel-module-cheat#pagemap-dump-out */
|
/* https://cirosantilli.com/linux-kernel-module-cheat#pagemap-dump-out
|
||||||
|
*
|
||||||
|
* This file is dual licensed as both 3-Clause BSD and GPLv3.
|
||||||
|
*/
|
||||||
|
|
||||||
#define _XOPEN_SOURCE 700
|
#define _XOPEN_SOURCE 700
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
/* https://cirosantilli.com/linux-kernel-module-cheat#userland-physical-address-experiments */
|
/* https://cirosantilli.com/linux-kernel-module-cheat#userland-physical-address-experiments
|
||||||
|
*
|
||||||
|
* This file is dual licensed as both 3-Clause BSD and GPLv3.
|
||||||
|
*/
|
||||||
|
|
||||||
#define _XOPEN_SOURCE 700
|
#define _XOPEN_SOURCE 700
|
||||||
#include <stdio.h> /* printf */
|
#include <stdio.h> /* printf */
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
/* https://cirosantilli.com/linux-kernel-module-cheat#userland-physical-address-experiments */
|
/* https://cirosantilli.com/linux-kernel-module-cheat#userland-physical-address-experiments
|
||||||
|
*
|
||||||
|
* This file is dual licensed as both 3-Clause BSD and GPLv3.
|
||||||
|
*/
|
||||||
|
|
||||||
#define _XOPEN_SOURCE 700
|
#define _XOPEN_SOURCE 700
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user