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:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=5iBUOrhtW2pndei2IV0W8I5aIEWmxfwNf9+QElYjHRY=; b=N/2jRQDvuO97IYqmq7kcxvQiVjr1HYhwN9DNONIqe+OGNXqBnRQ/zz+Ej9DzWD8VQK+q8+El+KMgO4lJmnqe2HkBL4yTsCI2lKpjxXP4MUetO0y7xH9Q/PMuSz1DviepvoHj1PlCaY5Ln7NTRGGjI9wdIf2S+Qe/2B4vEnHJrYg= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=a8P0n1X8LAflu4PfpX9hIGlfKCc0M48PPlCtfGvbfvjQN2gPTgz3Ux2W5V5wypXsEZ4XsbNL+c0lSs5pn4HpHlaaEpW6X+SmuN09cFobwNoNqJZJxjEPEouSdTpEIFqC5ezN3bsspRcm1TcDN34x4XoUYCVQNYpqGAocKXqmAe0=
The problem is that kMemoryTypePhysical != kIOMemoryTypePhysical64. The former is a 32-bit I/O physical address. The later is a 64-bit CPU physical address.
Right, makes sense. I tried doing what you described and ended up with: Unresolved kernel trap(cpu 1): 0x300 - Data access DAR=0x6572436D00001000 PC=0x00000000000B3E40 Latest crash info for cpu 1: Exception state (sv=0x26c76500) PC=0x000B3E40; MSR=0x00009030; DAR=0x00001000; DSISR=0x00200000; LR=0x000B26A8; R1=0x268F2A20; XCP=0x0000000C (0x300 - Data access) Backtrace: 0x000B2618 0x003622DC 0x26C95310 0x26C949AC 0x0037AA38 0x00377CB8 0x00093E0C 0x0002C1B4 0x00024C88 0x000B2C4C 0x00000000 backtrace terminated - frame not mapped or invalid: 0xBFFFE260 I hate to be the guy who posts code and asks for help, but I'm pretty stuck at this point, as the documentation I could find on this was scarce at best. Anyway, here is what I tried running: IOOptionBits opt = kIOMemoryTypePhysical64 | kIODirectionOut; struct IOPhysicalRange* range = (IOPhysicalRange*)IOMalloc(sizeof(struct IOPhysicalRange)); range->address = inStruct->offset; range->length = MEM_READ_CHUNK; task_t task; IOLog("calling withoptions\n"); IOSleep(2000); IOMemoryDescriptor* d = IOMemoryDescriptor::withOptions(range, 1, 0, task, opt); IOLog("withoptions ran\n"); IOSleep(5000); IOFree(range, sizeof(IOPhysicalRange)); if (d == NULL) { IOLog("IO-Init failed on the page %u\n", inStruct->offset); goto End; } ret = d->prepare(); if (ret != kIOReturnSuccess) { IOLog("IO-Prepare failed on the page %u\n", inStruct->offset); goto End; } char* buf = (char*) IOMalloc(MEM_READ_CHUNK); int copied; IOLog("printing: %d %d %d\n", (int)buf, MEM_READ_CHUNK, inStruct->offset); copied = d->readBytes(0, buf, MEM_READ_CHUNK); It prints out "calling with options" in the system log but not "withoptions ran". Did I screw up that call as well? Thank you, Timur _______________________________________________ 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... This email sent to site_archiver@lists.apple.com