shithub: riscv

Download patch

ref: 0da58889017158bb6c22119d7f110574cfc94f01
parent: 4547b5070c9999f093ea49bd7d77b7452d9180f0
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sat May 9 03:50:05 EDT 2015

realemu: ignore access to CMOS/RTC address/data registers

the kernel wont allow access to i/o ports 0x70/0x71, so
ignore the access. reads return 0xFF. this fixes vesa on
lenovo e540.

--- a/sys/src/cmd/aux/realemu/main.c
+++ b/sys/src/cmd/aux/realemu/main.c
@@ -29,6 +29,7 @@
 static int cputrace;
 static int porttrace;
 static Pit pit[3];
+static uchar rtcaddr;
 
 static vlong pitclock;
 
@@ -186,6 +187,12 @@
 	case 0x65:	/* A20 gate */
 		w = 1 << 2;
 		break;
+	case 0x70:	/* RTC addr */
+		w = rtcaddr;
+		break;
+	case 0x71:	/* RTC data */
+		w = 0xFF;
+		break;
 	case 0x80:	/* extra dma registers (temp) */
 	case 0x84:
 	case 0x85:
@@ -243,6 +250,11 @@
 	case 0x63:
 	case 0x64:	/* KB controller input buffer (ISA, EISA) */
 	case 0x65:	/* A20 gate (bit 2) */
+		break;
+	case 0x70:	/* RTC addr */
+		rtcaddr = w & 0xFF;
+		break;
+	case 0x71:	/* RTC data */
 		break;
 	case 0x80:
 	case 0x84: