39 lines
847 B
C
39 lines
847 B
C
#include "../command.h"
|
|
#include "../packet.h"
|
|
|
|
#include <magenta/debug/packet.h>
|
|
#include <stdio.h>
|
|
|
|
static int info_kernel(
|
|
const struct command *cmd,
|
|
struct debug_context *ctx,
|
|
int argc,
|
|
const char **argv,
|
|
void *argp)
|
|
{
|
|
struct mxdbg_packet req;
|
|
mxdbg_packet_init(&req, sizeof req, MXDBG_PACKET_IDENTIFY_KERNEL, 0);
|
|
size_t r, w;
|
|
debug_context_send_packet(ctx, &req);
|
|
|
|
struct packet *response
|
|
= debug_context_await_packet(ctx, MXDBG_PACKET_IDENTIFY_KERNEL);
|
|
|
|
struct mxdbg_packet_identify_kernel *id
|
|
= (struct mxdbg_packet_identify_kernel *)&response->p_packet;
|
|
|
|
printf("kernel identity: %s %s (%s)\n",
|
|
id->id_kernel_name,
|
|
id->id_kernel_version,
|
|
id->id_kernel_arch);
|
|
|
|
packet_destroy(response);
|
|
|
|
return 0;
|
|
}
|
|
|
|
const struct command cmd_info_kernel = {
|
|
.cmd_name = "kernel",
|
|
.cmd_callback = info_kernel,
|
|
};
|