#include int main(void) { printf("=== Simulating Canonical I/O Protocol ===\n"); printf("Step 1: OS polls STATUS register until not BUSY\n"); printf(" (in reality this loop wastes CPU)\n"); printf("Step 2: OS writes data to DATA register (PIO)\n"); printf("Step 3: OS writes command to COMMAND register\n"); printf("Step 4: OS polls STATUS until complete\n"); printf("I/O done. Using interrupts would overlap this wait with other computation.\n"); return 0; }