Commit 09b96474 authored by Tronel Frederic's avatar Tronel Frederic
Browse files

Ajout d'un nouvel appel système côté noyau pour lire dans la mémoire kernel directement.

parent 2f05baf5
...@@ -109,6 +109,7 @@ extern uint64 sys_nice(void); ...@@ -109,6 +109,7 @@ extern uint64 sys_nice(void);
extern uint64 sys_create_mutex(void); extern uint64 sys_create_mutex(void);
extern uint64 sys_acquire_mutex(void); extern uint64 sys_acquire_mutex(void);
extern uint64 sys_release_mutex(void); extern uint64 sys_release_mutex(void);
extern uint64 sys_read_kmem(void);
static uint64 (*syscalls[])(void) = { static uint64 (*syscalls[])(void) = {
[SYS_fork] sys_fork, [SYS_fork] sys_fork,
...@@ -137,6 +138,7 @@ static uint64 (*syscalls[])(void) = { ...@@ -137,6 +138,7 @@ static uint64 (*syscalls[])(void) = {
[SYS_create_mutex] sys_create_mutex, [SYS_create_mutex] sys_create_mutex,
[SYS_acquire_mutex] sys_acquire_mutex, [SYS_acquire_mutex] sys_acquire_mutex,
[SYS_release_mutex] sys_release_mutex, [SYS_release_mutex] sys_release_mutex,
[SYS_read_kmem] sys_read_kmem,
}; };
void void
......
...@@ -32,4 +32,6 @@ ...@@ -32,4 +32,6 @@
#define SYS_acquire_mutex 25 #define SYS_acquire_mutex 25
#define SYS_release_mutex 26 #define SYS_release_mutex 26
#define SYS_read_kmem 30
#endif #endif
...@@ -100,3 +100,14 @@ sys_uptime(void) ...@@ -100,3 +100,14 @@ sys_uptime(void)
release(&tickslock); release(&tickslock);
return xticks; return xticks;
} }
uint64
sys_read_kmem(void)
{
uint64 addr;
argaddr(0, &addr);
printf("Call read kernel mem with addr: %p\n", addr);
return *(int *)addr;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment