From: Philip Homburg Date: Mon, 10 Jul 2006 12:35:55 +0000 (+0000) Subject: Changed to use sys_readbios get the 'machine ID'. X-Git-Tag: v3.1.3~263 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/examples/outline.c?a=commitdiff_plain;h=a3fce7ce8d49846b422dbd8f71e94cdc55f1ef1e;p=minix.git Changed to use sys_readbios get the 'machine ID'. --- diff --git a/drivers/cmos/cmos.c b/drivers/cmos/cmos.c index d1d0e7444..b53106eef 100644 --- a/drivers/cmos/cmos.c +++ b/drivers/cmos/cmos.c @@ -147,10 +147,13 @@ PRIVATE int gettime(int who, int y2kflag, vir_bytes dst_time, int safe) /* First obtain the machine ID to see if we can read the CMOS clock. Only * for PS_386 and PC_AT this is possible. Otherwise, return an error. */ - sys_vircopy(SELF, BIOS_SEG, (vir_bytes) MACHINE_ID_ADDR, - SELF, D, (vir_bytes) &mach_id, MACHINE_ID_SIZE); + s = sys_readbios( MACHINE_ID_ADDR, &mach_id, MACHINE_ID_SIZE); + if (s != 0) { + printf("gettime: sys_readbios failed: %d\n", s); + return EINVAL; + } if (mach_id != PS_386_MACHINE && mach_id != PC_AT_MACHINE) { - printf("IS: Machine ID unknown. ID byte = %02x.\n", mach_id); + printf("gettime: machine ID unknown. ID byte = %02x.\n", mach_id); return(EFAULT); }