site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=Y558hAxAz3VC3TTl2HkuymBghj9RZBuaF3DrZCOFY6M=; b=X2LYx5+qR+6EmGAI1lO5VwQq6hOF1dXm9EegTl+N1vEfM+/ftjqRZa+EeNm3/PvVcP lBp3aKa9l42rThXDvAu5HfQmPXdniGfgAGAbvGsutPGQqx1E463S61vppe9b3HMZb8do GKhk2OnH21JNEMBfVL+dvhIRtrsLsWDPrA84E= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=KVTZ18b0f+pZgCXctxOnRO9IcrLi7vg1wFLWdZ3IXKs5w2k5iHOfbEmOxJjC7Qdm61 lkq9Swd71+b1JvoOiIttPPBG8wKDi5RnBXSUPgP70lxllKoSzCHwdxQB13RcC8VWxNxc LEEdOqa4919yZ7J7NA6/2AC5CxZRKzh7XlA08= Hi guys! I'm writing my first KEXT. When i launch it, i've this problem: 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"); 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... 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) 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); } This email sent to site_archiver@lists.apple.com
participants (1)
-
Andrea Di Pasquale