diff --git a/src/userland/mbr/main.c b/src/userland/mbr/main.c index 7ae4f5e..280807c 100644 --- a/src/userland/mbr/main.c +++ b/src/userland/mbr/main.c @@ -15,7 +15,17 @@ void *dataHere = requestMemory(1, NULL, firstSector); device->mbr = malloc(sizeof(ClassicMBR)); memcpy(dataHere + 446, device->mbr, sizeof(ClassicMBR)); - printf("MBR signature: 0x%x%x\n", device->mbr->signature[0], device->mbr->signature[1]); + if (device->mbr->signature[0] != 0x55 || device->mbr->signature[1] != 0xAA) { + printf("MBR signature did not match, got: 0x%x%x\n", device->mbr->signature[0], device->mbr->signature[1]); + return; + } + for (uint32_t entry = 0; entry < 4; entry++) { + PartitionTableEntry *partition = &device->mbr->entries[entry]; + printf("partition %i: %i: start: %i, end: %i, active: %i\n", entry, partition->type, partition->lbaStart, partition->lbaStart + partition->sectorCount, partition->active); + if (partition->type == 0xEE) { + printf("partition %i is a GPT\n", entry); + } + } } int32_t main() { diff --git a/src/userland/mbr/main.c b/src/userland/mbr/main.c index 7ae4f5e..280807c 100644 --- a/src/userland/mbr/main.c +++ b/src/userland/mbr/main.c @@ -15,7 +15,17 @@ void *dataHere = requestMemory(1, NULL, firstSector); device->mbr = malloc(sizeof(ClassicMBR)); memcpy(dataHere + 446, device->mbr, sizeof(ClassicMBR)); - printf("MBR signature: 0x%x%x\n", device->mbr->signature[0], device->mbr->signature[1]); + if (device->mbr->signature[0] != 0x55 || device->mbr->signature[1] != 0xAA) { + printf("MBR signature did not match, got: 0x%x%x\n", device->mbr->signature[0], device->mbr->signature[1]); + return; + } + for (uint32_t entry = 0; entry < 4; entry++) { + PartitionTableEntry *partition = &device->mbr->entries[entry]; + printf("partition %i: %i: start: %i, end: %i, active: %i\n", entry, partition->type, partition->lbaStart, partition->lbaStart + partition->sectorCount, partition->active); + if (partition->type == 0xEE) { + printf("partition %i is a GPT\n", entry); + } + } } int32_t main() { diff --git a/src/userland/usb/xhci/xhci.c b/src/userland/usb/xhci/xhci.c index 35c1feb..1f9556c 100644 --- a/src/userland/usb/xhci/xhci.c +++ b/src/userland/usb/xhci/xhci.c @@ -5,6 +5,8 @@ #include #include +// see https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf + XHCIInputContext *createInputContext(SlotXHCI *slot) { XHCIInputContext *inputContext = requestMemory(1, 0, 0); inputContext->inputControl.addContextFlags = 3;