KEXT resolving problem
KEXT resolving problem
- Subject: KEXT resolving problem
- From: Andrea Di Pasquale <email@hidden>
- Date: Wed, 17 Jun 2009 15:28:33 +0200
Hi guys!
I'm writing my first KEXT. When i launch it, i've this problem:
Manson:tmp spikey$ sudo kextload -vt host_info.kext
kextload: resolving dependencies for kernel extensions with validation
and authentication failures
kextload: extension host_info.kext appears to be loadable
kextload: loading extension host_info.kext
kextload: sending 1 personality to the kernel
kld(): Undefined symbols:
_host_info
_host_self
kextload: kld_load_from_memory() failed for module /private/tmp/
host_info.kext/Contents/MacOS/host_info
kextload: a link/load error occured for kernel extension host_info.kext
link/load failed for extension host_info.kext
(run kextload with -t for diagnostic output)
The code is:
#include <sys/systm.h>
#include <mach/mach_types.h>
#include <mach/mach_host.h>
#include <mach/host_info.h>
#include <kern/kern_types.h>
#include <kern/host.h>
kern_return_t
host_info_start(kmod_info_t *ki, void *d)
{
host_basic_info_t info;
mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT;
kern_return_t ret;
printf("KEXT has loaded!\n");
ret = host_info(host_self(), HOST_BASIC_INFO, (host_info_t) info,
&count);
if (ret == KERN_FAILURE)
printf("KEXT host_info() error!\n");
printf("CPU Stat:\n");
printf("=========\n");
printf("- Max CPUs: %d\n", info->max_cpus);
printf("- Avaible CPUs: %d\n", info->avail_cpus);
printf("- Max Physical CPUs\n", info->physical_cpu_max);
printf("- Physical CPUs: %d\n", info->physical_cpu);
printf("- Max Logical CPUs: %d\n", info->logical_cpu_max);
printf("- Logical CPUs: %d\n", info->logical_cpu);
return (ret);
}
kern_return_t
host_info_stop(kmod_info_t *ki, void *d)
{
printf("KEXT will be unloaded\n");
return (KERN_SUCCESS);
}
Can you help me, please?
Best regards,
-- Andrea
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden