/* amiga.c - Read amiga partition tables (RDB). */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2002,2004,2005,2006,2007 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>
GRUB_MOD_LICENSE ("GPLv3+");
struct grub_amiga_rdsk
{
/* "RDSK". */
} __attribute__ ((packed));
struct grub_amiga_partition
{
/* "PART". */
} __attribute__ ((packed));
static grub_uint32_t
{
grub_uint32_t r = 0;
sz /= sizeof (grub_uint32_t);
r += grub_be_to_cpu32 (*ptr);
return r;
}
static grub_err_t
const grub_partition_t partition))
{
int partno = 0;
unsigned pos;
/* The RDSK block is one of the first 15 blocks. */
{
/* Read the RDSK block which is a descriptor for the entire disk. */
return grub_errno;
{
/* Found the first PART block. */
break;
}
}
if (next == -1)
return grub_error (GRUB_ERR_BAD_PART_TABLE,
"Amiga partition map not found");
/* The end of the partition list is marked using "-1". */
while (next != -1)
{
/* Read the RDSK block which is a descriptor for the entire disk. */
return grub_errno;
return grub_error (GRUB_ERR_BAD_PART_TABLE,
"invalid Amiga partition map");
/* Calculate the first block and the size of the partition. */
return grub_errno;
partno++;
}
return 0;
}
/* Partition map type. */
{
.name = "amiga",
};
{
}
{
}