I have a sneaky suspicion that Microsoft restricted all access to direct hardware thru the HAL, so you'd have to write a driver that sits in that layer and lets your code thru. Not sure if you could boot up VMware and run DOS inside of that. You could always make a boot floppy and boot the machine directly into DOS.