From: Ben Gras Date: Wed, 7 Sep 2005 12:37:21 +0000 (+0000) Subject: Remove some old cd junk from boot monitor X-Git-Tag: v3.1.0~167 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zpipe.c?a=commitdiff_plain;h=782de64c6f6a33b9c5ee6d192b968c24f3838755;p=minix.git Remove some old cd junk from boot monitor --- diff --git a/boot/boot.c b/boot/boot.c index eabbd02fb..6a8571281 100755 --- a/boot/boot.c +++ b/boot/boot.c @@ -1856,84 +1856,6 @@ void monitor(void) unsigned char cdspec[25]; void bootcdinfo(u32_t, int *, int drive); -void fixcdroot(void) -{ - int i, d; - int ret; - char name[20]; - u32_t addr; - char *bootcd; - /* Booting from CD? If so, add the cdroot in.. */ - int driveno, termno; - char *drive, *term, *rid; - - if((rid = b_value("ramimagedev"))) { - static int f = 0; - int i, j; - char ram[15]; - ram[0] = 'c'; - ram[1] = '0'; - if(rid[0] == 'c' || rid[0] == 'C') j = 2; - else j = 0; - f++; - for(i = 2; i < sizeof(ram)-1; i++, j++) { - ram[i] = rid[j]; - if(ram[i] == 'p') ram[i] = '\0'; - if(ram[i] == '\0') break; - } - ram[sizeof(ram)-1] = '\0'; - - b_setvar(E_SPECIAL|E_VAR, "ramname", ram); - } - - /* the rest of this code is.. not finished */ - return; - - if(!(bootcd = b_value("bootcd")) || bootcd[0] != '1') return; - if(!(drive = b_value("drive"))) return; - if(!(term = b_value("term"))) termno = 0; - else termno = term[0] - '0'; - driveno = 100 * (drive[0] - '0') + 10 * (drive[1] - '0') + drive[2] - '0'; - - /* cdroot has to be derived from what the BIOS - * says the actual CD was. - */ - memset(cdspec, 0, sizeof(cdspec)); - - addr = mon2abs(cdspec); - ret = 0x38; - printf("bootcdinfo (%lx, drive %d, term %d)..\n", addr, driveno, termno); - bootcdinfo(addr, &ret, (termno << 8) | driveno); - - i = 0; - printf("drive %02x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", - driveno, - cdspec[i], cdspec[i+1], cdspec[i+2], cdspec[i+3], - cdspec[i+4], cdspec[i+5], cdspec[i+6], cdspec[i+7], - cdspec[i+8], cdspec[i+9], cdspec[i+10], cdspec[i+11]); - - /* CD's are faked to be booting from partition 1 - * (more to the point, that is their appropriate - * root partition to mount). - */ - strcpy(bootdev.name, "d0p1"); - - /* boot_spec[3] is the controller number (0 or 1), - * boot_spec[8] is the device specification. The - * below only works for IDE CD drives. boot_spec is - * filled in by BIOS after an int 0x13 call in boothead.s. - */ - bootdev.name[1] += boot_spec[3] * 2 + boot_spec[8]; - bootdev.primary = 1; /* p1 */ - b_setvar(E_SPECIAL|E_VAR, "cdroot", bootdev.name); /* dXp1 */ - strcpy(name, "c0"); - strcat(name, bootdev.name); - name[4] = '\0'; - b_setvar(E_SPECIAL|E_VAR, "cddrive", name); /* c0dX */ - - return; -} - void boot(void) /* Load Minix and start it, among other things. */ { @@ -1944,15 +1866,11 @@ void boot(void) /* Get environment variables from the parameter sector. */ get_parameters(); - fixcdroot(); - while (1) { /* While there are commands, execute them! */ while (cmds != nil) execute(); - fixcdroot(); - /* The "monitor" is just a "read one command" thing. */ monitor(); }