pc, pc64: more sanity checking for lowraminit()

This commit is contained in:
cinap_lenrek 2014-11-02 00:32:46 +01:00
parent 153f96ebc6
commit 2020190f94
2 changed files with 4 additions and 0 deletions

View file

@ -388,6 +388,8 @@ lowraminit(void)
x = PADDR(CPU0END);
bda = (uchar*)KADDR(0x400);
pa = ((bda[0x14]<<8)|bda[0x13])*KB;
if(pa > 640*KB)
pa = 640*KB;
if(x < pa){
mapfree(&rmapram, x, pa-x);
memset(KADDR(x), 0, pa-x); /* keep us honest */

View file

@ -386,6 +386,8 @@ lowraminit(void)
x = PADDR(CPU0END);
bda = (uchar*)KADDR(0x400);
pa = ((bda[0x14]<<8)|bda[0x13])*KB;
if(pa > 640*KB)
pa = 640*KB;
if(x < pa){
mapfree(&rmapram, x, pa-x);
memset(KADDR(x), 0, pa-x); /* keep us honest */