This file contains the bootstrap (including Master Boot Record) for PwnOS.
| Boot.asm | This file contains the bootstrap (including Master Boot Record) for PwnOS. |
| MBR | This segment contains the master boot record of PwnOS |
| BootData | This segment contains data for the 1st-level bootstrap code of PwnOS |
| Variables | |
| GDT | INITIAL GLOBAL DESCRIPTOR TABLE |
| IDT | INTERRUPT DESCRIPTOR TABLE |
| Boot | This segment contains the 1st-level bootstrap code of PwnOS |
| Functions | |
| 32-bit Entry Point | This code sets up some basic 32-bit Protected Mode stuff |
| ACPI Boot | Searches for Root System Description Pointer (RDSP) |
| Not Good Enough | This is where the bootloader goes if the computer boot doesn’t go properly, like if the RSDP isn’t found, or if the ACPI info isn’t valid. |
| ACPI Boot Continued | RSDP found, so scan RSDT for Multiple APIC Description Table (MADT) |
| Check Processor Requirements | |
| I/ O APIC Setup | |
| Memory Type Range Registers (MTRRs) and Page Attriubute Table Register (PAT MSR) | |
| Local APIC Setup & Multi-Processor Startup | |
| IDE Bus Master Setup (NEED PCI SPECIFICATIONS FOR THIS) | |
| Read MBRs to Find NTFS Partition | |
| Initialize Data in & for Core | |
| Task Functions | |
| Functions | |
| SetTSSDescriptor | Sets the TSS descriptor corresponding with the current processor to select the specified TSS. |
| Timing Functions | |
| Functions | |
| WaitNanoseconds | |
| ATA/ ATAPI Functions | |
| Functions | |
| ATAIdentifyDevice | Fills in the 512-byte buffer with the information returned by ATA_CC_IDENTIFY_DEVICE. |
| ATAIdentifyPacketDevice | Fills in the 512-byte buffer with the information returned by ATA_CC_IDENTIFY_PACKET_DEVICE. |
| CompactATAIdentify | Fills in the ATADEVICEINFO of the specified device with the information returned by ATAIdentifyDevice. |
| ATAIsValidDevice | Checks the ATADEVICEINFO of the specified device to see if it is a valid, supported device. |
This segment contains the 1st-level bootstrap code of PwnOS
| Functions | |
| 32-bit Entry Point | This code sets up some basic 32-bit Protected Mode stuff |
| ACPI Boot | Searches for Root System Description Pointer (RDSP) |
| Not Good Enough | This is where the bootloader goes if the computer boot doesn’t go properly, like if the RSDP isn’t found, or if the ACPI info isn’t valid. |
| ACPI Boot Continued | RSDP found, so scan RSDT for Multiple APIC Description Table (MADT) |
| Check Processor Requirements | |
| I/ O APIC Setup | |
| Memory Type Range Registers (MTRRs) and Page Attriubute Table Register (PAT MSR) | |
| Local APIC Setup & Multi-Processor Startup | |
| IDE Bus Master Setup (NEED PCI SPECIFICATIONS FOR THIS) | |
| Read MBRs to Find NTFS Partition | |
| Initialize Data in & for Core |
This is where the bootloader goes if the computer boot doesn’t go properly, like if the RSDP isn’t found, or if the ACPI info isn’t valid.
| Functions | |
| SetTSSDescriptor | Sets the TSS descriptor corresponding with the current processor to select the specified TSS. |
Sets the TSS descriptor corresponding with the current processor to select the specified TSS.
| pTSS | virtual address of the TSS |
| Functions | |
| ATAIdentifyDevice | Fills in the 512-byte buffer with the information returned by ATA_CC_IDENTIFY_DEVICE. |
| ATAIdentifyPacketDevice | Fills in the 512-byte buffer with the information returned by ATA_CC_IDENTIFY_PACKET_DEVICE. |
| CompactATAIdentify | Fills in the ATADEVICEINFO of the specified device with the information returned by ATAIdentifyDevice. |
| ATAIsValidDevice | Checks the ATADEVICEINFO of the specified device to see if it is a valid, supported device. |
Fills in the 512-byte buffer with the information returned by ATA_CC_IDENTIFY_DEVICE. If the device is a packet device, it calls ATAIdentifyPacketDevice.
| pDest | pointer to 512-byte buffer |
| DriveNum | one of: ATA_DEVICE_DEV0, ATA_DEVICE_DEV1, ATA_DEVICE_DEV0 or 1, ATA_DEVICE_DEV1 or 1 |
Fills in the 512-byte buffer with the information returned by ATA_CC_IDENTIFY_PACKET_DEVICE. Called by ATAIdentifyDevice
| pDest | pointer to 512-byte buffer |
| DriveNum | one of: ATA_DEVICE_DEV0, ATA_DEVICE_DEV1, ATA_DEVICE_DEV0 or 1, ATA_DEVICE_DEV1 or 1 |
Fills in the ATADEVICEINFO of the specified device with the information returned by ATAIdentifyDevice. If the device is invalid (e.g. no device at all), the nSectors field is set to -1.
| Drive0To3 | ATA device index, from 0 to 3 |
| pSource | pointer to info block returned from ATAIdentifyDevice |
Checks the ATADEVICEINFO of the specified device to see if it is a valid, supported device.
| Drive0To3 | ATA device index, from 0 to 3 |
INITIAL GLOBAL DESCRIPTOR TABLE
GDT dq 0 ;NULL descriptor
INTERRUPT DESCRIPTOR TABLE
IDT: INT_DESC offset IntDivError ;00 Divide Error