diff options
Diffstat (limited to 'sys/arch/i386/stand/libsa/memprobe.c')
-rw-r--r-- | sys/arch/i386/stand/libsa/memprobe.c | 47 |
1 files changed, 27 insertions, 20 deletions
diff --git a/sys/arch/i386/stand/libsa/memprobe.c b/sys/arch/i386/stand/libsa/memprobe.c index 1a67eafb84d..a50cac42932 100644 --- a/sys/arch/i386/stand/libsa/memprobe.c +++ b/sys/arch/i386/stand/libsa/memprobe.c @@ -1,8 +1,33 @@ -/* $OpenBSD: memprobe.c,v 1.1 1997/03/31 03:12:14 weingart Exp $ */ +/* $OpenBSD: memprobe.c,v 1.2 1997/03/31 23:06:30 mickey Exp $ */ #include <sys/param.h> -#include <libsa.h> +#include "libsa.h" +#include "biosdev.h" +static int addrprobe __P((int)); + +void +memprobe() +{ + int ram; + + cnvmem = biosmem(0); + extmem = biosmem(1); + + /* probe extended memory + * + * There is no need to do this in assembly language. This are + * much easier to debug in C anyways. + */ + for(ram = 1024; ram < 512*1024; ram += 4){ + + printf("Probing memory: %d KB\r", ram-1024); + if(addrprobe(ram)) break; + } + + printf("\n"); + extmem = ram - 1024; +} /* addrprobe(kloc): Probe memory at address kloc * 1024. * @@ -30,21 +55,3 @@ static int addrprobe(int kloc){ } -/* memprobe(): return probed memory size in KB for extended memory - * - * There is no need to do this in assembly language. This are - * much easier to debug in C anyways. - */ -int memprobe(void){ - int ram; - - for(ram = 1024; ram < 512*1024; ram += 4){ - - printf("Probing memory: %d KB\r", ram-1024); - if(addrprobe(ram)) break; - } - - printf("\n"); - return(ram-1024); -} - |