wok-6.x rev 3917
syslinux/ifmem: pre-94 bioses support
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Tue Aug 18 18:21:24 2009 +0200 (2009-08-18) |
parents | 65dd59012383 |
children | 0cd931b3cd79 |
files | syslinux/stuff/extra/ifmem.c |
line diff
1.1 --- a/syslinux/stuff/extra/ifmem.c Tue Aug 18 17:42:15 2009 +0200 1.2 +++ b/syslinux/stuff/extra/ifmem.c Tue Aug 18 18:21:24 2009 +0200 1.3 @@ -41,6 +41,7 @@ 1.4 1.5 static unsigned long memory_size(void) 1.6 { 1.7 + unsigned long res; 1.8 com32sys_t ireg, oreg; 1.9 1.10 memset(&ireg, 0, sizeof ireg); 1.11 @@ -48,7 +49,14 @@ 1.12 ireg.eax.w[0] = 0xe801; 1.13 __intcall(0x15, &ireg, &oreg); 1.14 1.15 - return oreg.ecx.w[0] + ( oreg.edx.w[0] << 6); 1.16 + res = oreg.ecx.w[0] + ( oreg.edx.w[0] << 6); 1.17 + if (!res) { 1.18 + memset(&ireg, 0, sizeof ireg); 1.19 + ireg.eax.w[0] = 0x8800; 1.20 + __intcall(0x15, &ireg, &oreg); 1.21 + res = ireg.eax.w[0]; 1.22 + } 1.23 + return res; 1.24 } 1.25 1.26 int main(int argc, char *argv[])