main.c (39441) | main.c (39450) |
---|---|
1/*- 2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $Id: main.c,v 1.4 1998/09/14 18:27:06 msmith Exp $ | 26 * $Id: main.c,v 1.5 1998/09/17 23:52:15 msmith Exp $ |
27 */ 28 29/* 30 * MD bootstrap main() and assorted miscellaneous 31 * commands. 32 */ 33 34#include <stand.h> --- 43 unchanged lines hidden (view full) --- 78 printf("\n"); 79 printf("%s, Revision %s\n", bootprog_name, bootprog_rev); 80 printf("(%s, %s)\n", bootprog_maker, bootprog_date); 81 printf("memory: %d/%dkB\n", getbasemem(), getextmem()); 82#if 0 83 printf("diskbuf at %p, %d sectors\n", &diskbuf, diskbuf_size); 84 printf("using %d bytes of stack at %p\n", (&stacktop - &stackbase), &stacktop); 85#endif | 27 */ 28 29/* 30 * MD bootstrap main() and assorted miscellaneous 31 * commands. 32 */ 33 34#include <stand.h> --- 43 unchanged lines hidden (view full) --- 78 printf("\n"); 79 printf("%s, Revision %s\n", bootprog_name, bootprog_rev); 80 printf("(%s, %s)\n", bootprog_maker, bootprog_date); 81 printf("memory: %d/%dkB\n", getbasemem(), getextmem()); 82#if 0 83 printf("diskbuf at %p, %d sectors\n", &diskbuf, diskbuf_size); 84 printf("using %d bytes of stack at %p\n", (&stacktop - &stackbase), &stacktop); 85#endif |
86 | 86 |
87 /* We're booting from a BIOS disk, try to spiff this */ 88 currdev.d_dev = devsw[0]; /* XXX presumes that biosdisk is first in devsw */ 89 currdev.d_type = currdev.d_dev->dv_type; 90 currdev.d_kind.biosdisk.unit = 0; /* XXX wrong, need to get from bootinfo etc. */ 91 currdev.d_kind.biosdisk.slice = -1; /* XXX should be able to detect this, default to autoprobe */ 92 currdev.d_kind.biosdisk.partition = 0; /* default to 'a' */ | 87 /* We're booting from a BIOS disk, try to spiff this */ 88 currdev.d_dev = devsw[0]; /* XXX presumes that biosdisk is first in devsw */ 89 currdev.d_type = currdev.d_dev->dv_type; 90 currdev.d_kind.biosdisk.unit = 0; /* XXX wrong, need to get from bootinfo etc. */ 91 currdev.d_kind.biosdisk.slice = -1; /* XXX should be able to detect this, default to autoprobe */ 92 currdev.d_kind.biosdisk.partition = 0; /* default to 'a' */ |
93 94 /* Create i386-specific variables */ | |
95 | 93 |
94 /* Create i386-specific variables */ 95 |
|
96 env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&currdev), i386_setcurrdev, env_nounset); 97 env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&currdev), env_noset, env_nounset); 98 setenv("LINES", "24", 1); /* optional */ 99 100 archsw.arch_autoload = i386_autoload; 101 archsw.arch_getdev = i386_getdev; 102 archsw.arch_copyin = i386_copyin; 103 archsw.arch_copyout = i386_copyout; --- 13 unchanged lines hidden (view full) --- 117command_reboot(int argc, char *argv[]) 118{ 119 120 printf("Rebooting...\n"); 121 delay(1000000); 122 __exit(0); 123} 124 | 96 env_setenv("currdev", EV_VOLATILE, i386_fmtdev(&currdev), i386_setcurrdev, env_nounset); 97 env_setenv("loaddev", EV_VOLATILE, i386_fmtdev(&currdev), env_noset, env_nounset); 98 setenv("LINES", "24", 1); /* optional */ 99 100 archsw.arch_autoload = i386_autoload; 101 archsw.arch_getdev = i386_getdev; 102 archsw.arch_copyin = i386_copyin; 103 archsw.arch_copyout = i386_copyout; --- 13 unchanged lines hidden (view full) --- 117command_reboot(int argc, char *argv[]) 118{ 119 120 printf("Rebooting...\n"); 121 delay(1000000); 122 __exit(0); 123} 124 |
125/* provide this for panic */ | 125/* provide this for panic, as it's not in the startup code */ |
126void 127exit(int code) 128{ 129 __exit(code); 130} 131 132#if 0 /* XXX learn to ask BTX */ 133 --- 26 unchanged lines hidden --- | 126void 127exit(int code) 128{ 129 __exit(code); 130} 131 132#if 0 /* XXX learn to ask BTX */ 133 --- 26 unchanged lines hidden --- |