Finally a solution to usb installs

This commit is contained in:
Huntereb 2019-12-06 16:04:16 -05:00
parent 1720d5eae7
commit 1fcd19d445
2 changed files with 6 additions and 2 deletions

View File

@ -155,6 +155,8 @@ namespace tin::install::nsp
{
LOG_DEBUG("buffering 0x%lx-0x%lx", offset, offset + size);
tin::util::USBCmdHeader header = tin::util::USBCmdManager::SendFileRangeCmd(m_nspName, offset, size);
if (tin::util::USBRead(buf, header.dataSize) == 0) THROW_FORMAT("USB error");
u8* ourBuffer = (u8*)memalign(0x1000, header.dataSize);
if (tin::util::USBRead(ourBuffer, header.dataSize) == 0) THROW_FORMAT("USB error");
memcpy(buf, ourBuffer, header.dataSize);
}
}

View File

@ -155,6 +155,8 @@ namespace tin::install::xci
{
LOG_DEBUG("buffering 0x%lx-0x%lx", offset, offset + size);
tin::util::USBCmdHeader header = tin::util::USBCmdManager::SendFileRangeCmd(m_xciName, offset, size);
if (tin::util::USBRead(buf, header.dataSize) == 0) THROW_FORMAT("USB error");
u8* ourBuffer = (u8*)memalign(0x1000, header.dataSize);
if (tin::util::USBRead(ourBuffer, header.dataSize) == 0) THROW_FORMAT("USB error");
memcpy(buf, ourBuffer, header.dataSize);
}
}