/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2010 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/partition.h>
#include <grub/msdos_partition.h>
GRUB_MOD_LICENSE ("GPLv3+");
{
N_("Override guessed mapping of Plan9 devices."),
N_("GRUBDEVICE=PLAN9DEVICE"),
{0, 0, 0, 0, 0, 0}
};
struct grub_plan9_header
{
};
static grub_err_t
grub_plan9_boot (void)
{
.eax = 0,
.ebx = 0,
.ecx = 0,
.edx = 0,
.edi = 0,
.esp = 0,
.ebp = 0,
.esi = 0
};
grub_video_set_mode ("text", 0, 0);
}
static grub_err_t
grub_plan9_unload (void)
{
return GRUB_ERR_NONE;
}
static grub_err_t
{
void *mem;
const grub_partition_t partition);
const grub_partition_t partition)
{
int file_disk = 0;
if (!noslash)
{
return 1;
}
noslash = 0;
{
do
{
return 1;
if (err)
{
return err;
}
ptr++;
pmapptr++;
}
pmapptr--;
}
else
{
int c = 0;
{
{
c = 1;
break;
c = 2;
break;
c = 3;
break;
c = 4;
break;
}
}
if (prefixescnt[c] == 0)
else
prefixescnt[c]);
prefixescnt[c]++;
return 1;
}
(void **) &pmap))
return 1;
{
}
return 0;
}
{
unsigned i;
int file_disk = 0;
if (!dev)
{
grub_print_error ();
return 0;
}
{
return 0;
}
break;
else
{
else
break;
/* Shouldn't happen as Plan9 doesn't work on these platforms. */
/* Plan9 doesn't see those. */
default:
/* Not sure how to handle those. */
case GRUB_DISK_DEVICE_PXE_ID:
case GRUB_DISK_DEVICE_NAND_ID:
if (!file_disk)
{
return 0;
}
/* if it's the disk the kernel is loaded from we need to name
it nevertheless. */
break;
case GRUB_DISK_DEVICE_ATA_ID:
{
int unit;
unit = 0;
else
}
break;
case GRUB_DISK_DEVICE_SCSI_ID:
{
int unit;
unit = 0;
else
0, 0);
break;
}
/* FIXME: how does Plan9 number controllers?
We probably need save the SCSI devices and sort them */
= grub_xasprintf ("sd0%u", (unsigned)
& 0xf));
break;
}
if (!plan9name)
{
grub_print_error ();
return 0;
}
+ sizeof ("part="), &pmapalloc,
(void **) &pmap))
{
return 1;
}
if (!file_disk)
else
{
}
noslash = 1;
return 1;
return 1;
return 0;
}
if (argc == 0)
rel = grub_relocator_new ();
if (!rel)
goto fail;
if (! file)
goto fail;
if (!pmap)
goto fail;
if (grub_disk_dev_iterate (fill_disk))
goto fail;
(void **) &pmap))
goto fail;
{
if (file_name)
file_name++;
else
if (*file_name)
file_name++;
if (bootpart)
else
}
if (!bootpath)
goto fail;
goto fail;
{
goto fail;
}
/* path */
/* magic */
{
int i;
for (i = 1; i < argc; i++)
}
configsize += pmapptr;
/* Terminating \0. */
configsize++;
{
if (err)
goto fail;
}
sizeof (GRUB_PLAN9_CONFIG_MAGIC) - 1);
*configptr++ = '\n';
{
int i;
for (i = 1; i < argc; i++)
{
*configptr++ = '\n';
}
}
{
memsize);
if (err)
goto fail;
}
{
goto fail;
- sizeof (hdr);
goto fail;
}
return GRUB_ERR_NONE;
fail:
if (file)
return grub_errno;
}
{
options);
}
{
}