Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/stand/lib Call bi_getbiosgeom() after loadfile...



details:   https://anonhg.NetBSD.org/src/rev/8912b938c775
branches:  trunk
changeset: 471710:8912b938c775
user:      drochner <drochner%NetBSD.org@localhost>
date:      Thu Apr 08 18:21:15 1999 +0000

description:
Call bi_getbiosgeom() after loadfile() returned successfully. This avoids
a memory leak if loadfile() gets an error.

diffstat:

 sys/arch/i386/stand/lib/exec.c |  18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diffs (39 lines):

diff -r 95233fb5d00f -r 8912b938c775 sys/arch/i386/stand/lib/exec.c
--- a/sys/arch/i386/stand/lib/exec.c    Thu Apr 08 17:07:02 1999 +0000
+++ b/sys/arch/i386/stand/lib/exec.c    Thu Apr 08 18:21:15 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec.c,v 1.9 1999/03/08 00:09:25 fvdl Exp $     */
+/*     $NetBSD: exec.c,v 1.10 1999/04/08 18:21:15 drochner Exp $        */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -112,10 +112,6 @@
 
        BI_ADD(&btinfo_console, BTINFO_CONSOLE, sizeof(struct btinfo_console));
 
-#ifdef PASS_BIOSGEOM
-       bi_getbiosgeom();
-#endif
-
        extmem = getextmem();
 
 #ifdef XMS
@@ -200,6 +196,18 @@
 
        close(fd);
 
+       /*
+        * Gather some information for the kernel. Do this after the
+        * "point of no return" to avoid memory leaks.
+        * (but before DOS might be trashed in the XMS case)
+        */
+#ifdef PASS_BIOSGEOM
+       bi_getbiosgeom();
+#endif
+#ifdef PASS_MEMMAP
+       bi_getmemmap();
+#endif
+
 #ifdef XMS
        if (loadaddr != origaddr) {
                /*



Home | Main Index | Thread Index | Old Index