diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-08-07 01:11:08 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1997-08-07 01:11:08 +0000 |
commit | e99ea409c7e2fb49dc16c8c831dda6922012a744 (patch) | |
tree | 407d6b25dae317c7590d1916ffc3d0a3e605d429 /sys | |
parent | fc9619436dca1fdd419bf87739605ee8687a1bd5 (diff) |
call BIOS from C
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/i386/stand/libsa/biosmem.S | 44 | ||||
-rw-r--r-- | sys/arch/i386/stand/libsa/memprobe.c | 10 |
2 files changed, 6 insertions, 48 deletions
diff --git a/sys/arch/i386/stand/libsa/biosmem.S b/sys/arch/i386/stand/libsa/biosmem.S deleted file mode 100644 index 930a51b30b3..00000000000 --- a/sys/arch/i386/stand/libsa/biosmem.S +++ /dev/null @@ -1,44 +0,0 @@ -/* $OpenBSD: biosmem.S,v 1.4 1997/07/18 00:29:09 mickey Exp $ */ - -/* - * Copyright (c) 1997 Michael Shalayeff - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Michael Shalayeff. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - */ - -#include <machine/asm.h> -#define _LOCORE -#include <machine/biosvar.h> -#undef _LOCORE - -ENTRY(biosmem) - pushl %ebx - DOINT(0x12) - popl %ebx - ret diff --git a/sys/arch/i386/stand/libsa/memprobe.c b/sys/arch/i386/stand/libsa/memprobe.c index 76760fd1325..f07a9966914 100644 --- a/sys/arch/i386/stand/libsa/memprobe.c +++ b/sys/arch/i386/stand/libsa/memprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memprobe.c,v 1.7 1997/08/05 16:26:05 weingart Exp $ */ +/* $OpenBSD: memprobe.c,v 1.8 1997/08/07 01:11:07 mickey Exp $ */ /* * Copyright (c) 1997 Tobias Weingartner @@ -33,8 +33,8 @@ */ #include <sys/param.h> +#include <machine/biosvar.h> #include "libsa.h" -#include "biosdev.h" static int addrprobe __P((int)); @@ -43,7 +43,9 @@ memprobe() { int ram; - cnvmem = biosmem(); + __asm volatile(DOINT(0x12) "\n\t" : "=a" (cnvmem)); + + cnvmem &= 0xffff; /* probe extended memory * @@ -52,7 +54,7 @@ memprobe() */ for(ram = 1024; ram < 512*1024; ram += 4){ - if(!(ram % 1024)) + if(!(ram % 64)) printf("Probing memory: %d KB\r", ram-1024); if(addrprobe(ram)) break; |