main.c (181436) | main.c (190046) |
---|---|
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 --- 11 unchanged lines hidden (view full) --- 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 27#include <sys/cdefs.h> | 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 --- 11 unchanged lines hidden (view full) --- 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 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/boot/pc98/loader/main.c 181436 2008-08-08 19:41:20Z jhb $"); | 28__FBSDID("$FreeBSD: head/sys/boot/pc98/loader/main.c 190046 2009-03-19 13:53:42Z nyan $"); |
29 30/* 31 * MD bootstrap main() and assorted miscellaneous 32 * commands. 33 */ 34 35#include <stand.h> 36#include <string.h> --- 103 unchanged lines hidden (view full) --- 140 * walk through devsw if we actually booted off of PXE. 141 */ 142 if (kargs->bootflags & KARGS_FLAGS_PXE) 143 pxe_enable(kargs->pxeinfo ? PTOV(kargs->pxeinfo) : NULL); 144 else if (kargs->bootflags & KARGS_FLAGS_CD) 145 bc_add(initial_bootdev); 146 } 147 | 29 30/* 31 * MD bootstrap main() and assorted miscellaneous 32 * commands. 33 */ 34 35#include <stand.h> 36#include <string.h> --- 103 unchanged lines hidden (view full) --- 140 * walk through devsw if we actually booted off of PXE. 141 */ 142 if (kargs->bootflags & KARGS_FLAGS_PXE) 143 pxe_enable(kargs->pxeinfo ? PTOV(kargs->pxeinfo) : NULL); 144 else if (kargs->bootflags & KARGS_FLAGS_CD) 145 bc_add(initial_bootdev); 146 } 147 |
148 archsw.arch_autoload = i386_autoload; 149 archsw.arch_getdev = i386_getdev; 150 archsw.arch_copyin = i386_copyin; 151 archsw.arch_copyout = i386_copyout; 152 archsw.arch_readin = i386_readin; 153 archsw.arch_isainb = isa_inb; 154 archsw.arch_isaoutb = isa_outb; 155 |
|
148 /* 149 * March through the device switch probing for things. 150 */ 151 for (i = 0; devsw[i] != NULL; i++) 152 if (devsw[i]->dv_init != NULL) 153 (devsw[i]->dv_init)(); 154 printf("BIOS %dkB/%dkB available memory\n", bios_basemem / 1024, bios_extmem / 1024); 155 if (initial_bootinfo != NULL) { 156 initial_bootinfo->bi_basemem = bios_basemem / 1024; 157 initial_bootinfo->bi_extmem = bios_extmem / 1024; 158 } 159 160 printf("\n"); 161 printf("%s, Revision %s\n", bootprog_name, bootprog_rev); 162 printf("(%s, %s)\n", bootprog_maker, bootprog_date); 163 164 extract_currdev(); /* set $currdev and $loaddev */ 165 setenv("LINES", "24", 1); /* optional */ | 156 /* 157 * March through the device switch probing for things. 158 */ 159 for (i = 0; devsw[i] != NULL; i++) 160 if (devsw[i]->dv_init != NULL) 161 (devsw[i]->dv_init)(); 162 printf("BIOS %dkB/%dkB available memory\n", bios_basemem / 1024, bios_extmem / 1024); 163 if (initial_bootinfo != NULL) { 164 initial_bootinfo->bi_basemem = bios_basemem / 1024; 165 initial_bootinfo->bi_extmem = bios_extmem / 1024; 166 } 167 168 printf("\n"); 169 printf("%s, Revision %s\n", bootprog_name, bootprog_rev); 170 printf("(%s, %s)\n", bootprog_maker, bootprog_date); 171 172 extract_currdev(); /* set $currdev and $loaddev */ 173 setenv("LINES", "24", 1); /* optional */ |
166 167 archsw.arch_autoload = i386_autoload; 168 archsw.arch_getdev = i386_getdev; 169 archsw.arch_copyin = i386_copyin; 170 archsw.arch_copyout = i386_copyout; 171 archsw.arch_readin = i386_readin; 172 archsw.arch_isainb = isa_inb; 173 archsw.arch_isaoutb = isa_outb; | |
174 175 interact(); /* doesn't return */ 176 177 /* if we ever get here, it is an error */ 178 return (1); 179} 180 181/* 182 * Set the 'current device' by (if possible) recovering the boot device as 183 * supplied by the initial bootstrap. 184 * 185 * XXX should be extended for netbooting. 186 */ 187static void 188extract_currdev(void) 189{ 190 struct i386_devdesc new_currdev; | 174 175 interact(); /* doesn't return */ 176 177 /* if we ever get here, it is an error */ 178 return (1); 179} 180 181/* 182 * Set the 'current device' by (if possible) recovering the boot device as 183 * supplied by the initial bootstrap. 184 * 185 * XXX should be extended for netbooting. 186 */ 187static void 188extract_currdev(void) 189{ 190 struct i386_devdesc new_currdev; |
191 int major, biosdev = -1; | 191 int major; 192 int biosdev = -1; |
192 193 /* Assume we are booting from a BIOS disk by default */ 194 new_currdev.d_dev = &biosdisk; 195 196 /* new-style boot loaders such as pxeldr and cdldr */ 197 if (kargs->bootinfo == 0) { 198 if ((kargs->bootflags & KARGS_FLAGS_CD) != 0) { 199 /* we are booting from a CD with cdboot */ --- 118 unchanged lines hidden --- | 193 194 /* Assume we are booting from a BIOS disk by default */ 195 new_currdev.d_dev = &biosdisk; 196 197 /* new-style boot loaders such as pxeldr and cdldr */ 198 if (kargs->bootinfo == 0) { 199 if ((kargs->bootflags & KARGS_FLAGS_CD) != 0) { 200 /* we are booting from a CD with cdboot */ --- 118 unchanged lines hidden --- |