diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-05-09 07:50:05 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-05-09 07:50:05 +0200 |
commit | 0da58889017158bb6c22119d7f110574cfc94f01 (patch) | |
tree | 82e36a7bee3bdd227febf3935feadf4fc9b07693 | |
parent | 4547b5070c9999f093ea49bd7d77b7452d9180f0 (diff) |
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.
-rw-r--r-- | sys/src/cmd/aux/realemu/main.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/src/cmd/aux/realemu/main.c b/sys/src/cmd/aux/realemu/main.c index ff508291f..7283dcbe6 100644 --- a/sys/src/cmd/aux/realemu/main.c +++ b/sys/src/cmd/aux/realemu/main.c @@ -29,6 +29,7 @@ static int realmemfd; static int cputrace; static int porttrace; static Pit pit[3]; +static uchar rtcaddr; static vlong pitclock; @@ -186,6 +187,12 @@ rport(void *, ulong p, int len) 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: @@ -244,6 +251,11 @@ wport(void *, ulong p, ulong w, int len) 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: case 0x85: |