// cmos.c // Author: Josh Holtrop // Created: 02/26/04 // Implements various CMOS function calls #include "hos_defines.h" #include "sys/cmos.h" #include "sys/io.h" //Returns the cmos type of floppy disk drive 0 (0 = not present) unsigned char cmos_getfd0() { outportb(0x70, 0x10); return (inportb(0x71) >> 4); } //Returns the cmos type of floppy disk drive 1 (0 = not present) unsigned char cmos_getfd1() { outportb(0x70, 0x10); return (inportb(0x71) & 0x0F); } //Returns the cmos type of hard disk drive 0 (0 = not present) unsigned char cmos_gethd0() { outportb(0x70, 0x12); return (inportb(0x71) >> 4); } //Returns the cmos type of hard disk drive 1 (0 = not present) unsigned char cmos_gethd1() { outportb(0x70, 0x12); return (inportb(0x71) & 0x0F); }