i386/pc386: Add --ide-disable boot command line option.

This commit is contained in:
Chris Johns
2016-05-07 08:16:49 +10:00
parent 93fb879796
commit 02ef5d9a05

View File

@@ -74,66 +74,72 @@ unsigned long IDE_Controller_Count;
void bsp_ide_cmdline_init(void) void bsp_ide_cmdline_init(void)
{ {
bool ide1 = IDE1_DEFAULT; const char* ide_disable;
bool ide2 = IDE2_DEFAULT;
const char* ide;
/* ide_disable = bsp_cmdline_arg ("--ide-disable");
* Can have:
* --ide=0,1 if (ide_disable == NULL) {
*/ bool ide1 = IDE1_DEFAULT;
ide = bsp_cmdline_arg ("--ide="); bool ide2 = IDE2_DEFAULT;
const char* ide;
if (ide)
{
int i;
/* /*
* If a command line option exists remove the defaults. * Can have:
* --ide=0,1
*/ */
ide1 = ide2 = false; ide = bsp_cmdline_arg ("--ide=");
ide += sizeof ("--ide=") - 1; if (ide)
for (i = 0; i < 3; i++)
{ {
switch (ide[i]) int i;
/*
* If a command line option exists remove the defaults.
*/
ide1 = ide2 = false;
ide += sizeof ("--ide=") - 1;
for (i = 0; i < 3; i++)
{ {
case '0': switch (ide[i])
ide1 = true; {
break; case '0':
case '1': ide1 = true;
ide2 = true; break;
break; case '1':
case '2': ide2 = true;
case '3': break;
case '4': case '2':
case '5': case '3':
case '6': case '4':
case '7': case '5':
case '8': case '6':
case '9': case '7':
case ',': case '8':
break; case '9':
default: case ',':
break; break;
default:
break;
}
} }
} }
if (ide2 && !ide1)
IDE_Controller_Table[0] = IDE_Controller_Table[1];
if (ide1)
IDE_Controller_Count++;
if (ide2)
IDE_Controller_Count++;
/*
* Allow the user to get the initialise to print probing
* type information.
*/
ide = bsp_cmdline_arg ("--ide-show");
if (ide)
pc386_ide_show = true;
} }
if (ide2 && !ide1)
IDE_Controller_Table[0] = IDE_Controller_Table[1];
if (ide1)
IDE_Controller_Count++;
if (ide2)
IDE_Controller_Count++;
/*
* Allow the user to get the initialise to print probing
* type information.
*/
ide = bsp_cmdline_arg ("--ide-show");
if (ide)
pc386_ide_show = true;
} }