diff options
| author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-11-02 00:32:46 +0100 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-11-02 00:32:46 +0100 |
| commit | 2020190f945dbc264963abec22659df95cd61f04 (patch) | |
| tree | b3e0817a3ee9d7ed0ab3438bcf9515b290cd7fc3 | |
| parent | 153f96ebc6b8a155f2a619faa54cfe11163f75c2 (diff) | |
| download | plan9front-2020190f945dbc264963abec22659df95cd61f04.tar.xz | |
pc, pc64: more sanity checking for lowraminit()
| -rw-r--r-- | sys/src/9/pc/memory.c | 2 | ||||
| -rw-r--r-- | sys/src/9/pc64/memory.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/src/9/pc/memory.c b/sys/src/9/pc/memory.c index 851f1b1d7..5f2429265 100644 --- a/sys/src/9/pc/memory.c +++ b/sys/src/9/pc/memory.c @@ -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 */ diff --git a/sys/src/9/pc64/memory.c b/sys/src/9/pc64/memory.c index 27e01de64..a4ff047d6 100644 --- a/sys/src/9/pc64/memory.c +++ b/sys/src/9/pc64/memory.c @@ -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 */ |
