From 70ca99a5e21616ae261f6c49c8955b516b4219d6 Mon Sep 17 00:00:00 2001 From: Ethan Benson Date: Fri, 20 May 2005 03:10:03 +0000 Subject: [PATCH] amiga partition table support. * Support for amiga partition tables. (Sven Luther) git-archimport-id: erbenson@alaska.net--public/yaboot--devel--1.3--patch-80 --- 0arch-timestamps0 | 45 +++++++++--------- ChangeLog | 16 +++++++ include/amiga-part.h | 42 +++++++++++++++++ second/partition.c | 110 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 191 insertions(+), 22 deletions(-) create mode 100644 include/amiga-part.h diff --git a/0arch-timestamps0 b/0arch-timestamps0 index b264f19..3cb519f 100644 --- a/0arch-timestamps0 +++ b/0arch-timestamps0 @@ -1,7 +1,7 @@ -./0arch-timestamps0 1109049412 1116476790 +./0arch-timestamps0 1116476796 1116558595 ./BUGS 1109049412 1000991730 ./COPYING 1109049412 1000991730 -./ChangeLog 1116476729 1116476779 +./ChangeLog 1116558534 1116558571 ./Config 1109049412 1002101497 ./INSTALL 1109049412 1000991730 ./Makefile 1109049412 1089576723 @@ -22,18 +22,18 @@ ./doc/examples/simpleboot.chrp 1109049412 1068017750 ./doc/examples/yaboot.conf.multi-boot 1109049412 1006348765 ./doc/examples/yaboot.conf.rs6000 1109049412 1006348765 -./doc/examples 1116476789 1068017750 +./doc/examples 1116558575 1068017750 ./doc/yaboot-howto.de.sgml 1109049413 1096186109 ./doc/yaboot-howto.sgml 1109049413 1096186082 -./doc 1116476789 1096186109 +./doc 1116558575 1096186109 ./etc/yaboot.conf 1109049413 1006348765 -./etc 1116476789 1007269243 +./etc 1116558575 1007269243 ./first/ofboot 1109049413 1065311880 -./first 1116476789 1071492158 +./first 1116558575 1071492158 ./include/asm/elf.h 1109049413 1000991730 ./include/asm/ppc_asm.tmpl 1109049413 1000991730 ./include/asm/processor.h 1109049413 1000991730 -./include/asm 1116476789 1007269243 +./include/asm 1116558575 1007269243 ./include/bootinfo.h 1109049413 1007200690 ./include/byteorder.h 1109049413 1000991730 ./include/cfg.h 1109049413 1007200690 @@ -42,12 +42,12 @@ ./include/debug.h 1109049413 1007200690 ./include/errors.h 1109049413 1007200690 ./include/et/com_err.h 1109049413 1000991731 -./include/et 1116476790 1007269243 +./include/et 1116558575 1007269243 ./include/ext2fs/bitops.h 1109049413 1003927524 ./include/ext2fs/ext2_err.h 1109049413 1003927524 ./include/ext2fs/ext2_io.h 1109049413 1003927524 ./include/ext2fs/ext2fs.h 1109049413 1003927524 -./include/ext2fs 1116476790 1007269243 +./include/ext2fs 1116558575 1007269243 ./include/fdisk-part.h 1109049413 1007200690 ./include/file.h 1109049413 1007200690 ./include/fs.h 1109049413 1007200690 @@ -56,13 +56,13 @@ ./include/linux/iso_fs.h 1109049413 1000991731 ./include/linux/stat.h 1109049413 1000991731 ./include/linux/types.h 1109049413 1000991731 -./include/linux 1116476790 1007269243 +./include/linux 1116558575 1007269243 ./include/mac-part.h 1109049413 1007200690 ./include/md5.h 1109049413 1000991730 ./include/partition.h 1109049413 1007200690 ./include/prom.h 1109049413 1007200690 ./include/reiserfs/reiserfs.h 1109049413 1025684115 -./include/reiserfs 1116476790 1025684115 +./include/reiserfs 1116558575 1025684115 ./include/setjm2.h 1109049413 1000991730 ./include/setjmp.h 1109049413 1000991730 ./include/stdlib.h 1109049413 1000991730 @@ -70,9 +70,10 @@ ./include/swab.h 1109049413 1000991730 ./include/types.h 1109049413 1000991730 ./include/xfs/xfs.h 1109049413 1002101334 -./include/xfs 1116476790 1007269244 +./include/xfs 1116558575 1007269244 ./include/yaboot.h 1109049413 1007200690 -./include 1116476789 1007269244 +./include/amiga-part.h 1116558586 1116558522 +./include 1116558575 1116558522 ./lib/ctype.c 1109049413 1000991731 ./lib/libext2fs.a 1109049413 1003927524 ./lib/malloc.c 1109049413 1007200690 @@ -80,8 +81,8 @@ ./lib/string.S 1109049413 1007200690 ./lib/strtol.c 1109049413 1000991731 ./lib/vsprintf.c 1109049413 1000991731 -./lib/strstr.c 1116476589 1116476589 -./lib 1116476790 1116476589 +./lib/strstr.c 1116476796 1116476589 +./lib 1116558575 1116476589 ./man/bootstrap.8 1109049413 1000991731 ./man/mkofboot.8 1109049413 1006348765 ./man/ofpath.8 1109049413 1000991731 @@ -89,7 +90,7 @@ ./man/yabootconfig.8 1109049413 1027929577 ./man/ybin.8 1109049413 1006348765 ./man/yaboot.8 1116476644 1090699543 -./man 1116476680 1116476667 +./man 1116558575 1116476667 ./man.patch 1109049413 1006348761 ./second/cache.S 1109049413 1007200690 ./second/cfg.c 1109049413 1007200690 @@ -104,17 +105,17 @@ ./second/fs_xfs.c 1109049413 1032059541 ./second/iso_util.c 1109049413 1003656415 ./second/md5.c 1109049413 1032059532 -./second/partition.c 1109049413 1032059525 ./second/prom.c 1109049413 1067937197 ./second/setjmp.S 1109049413 1000991732 ./second/yaboot.c 1113696387 1032059504 -./second 1116476790 1089575693 +./second/partition.c 1116558522 1116558522 +./second 1116558575 1116558522 ./util/elfextract.c 1109049413 1007303237 ./util/addnote.c 1109049413 1107321884 -./util 1116476790 1107321884 -./ybin/mkofboot 1116476790 1073219938 +./util 1116558575 1107321884 +./ybin/mkofboot 1116558575 1073219938 ./ybin/ofpath 1109049414 1089576762 ./ybin/ybin 1109049414 1089576732 ./ybin/yabootconfig 1109049414 1089576743 -./ybin 1116476790 1089576762 -. 1116476789 1116476779 +./ybin 1116558575 1089576762 +. 1116558575 1116558571 diff --git a/ChangeLog b/ChangeLog index 97531dd..aab1955 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,22 @@ # arch-tag: automatic-ChangeLog--erbenson@alaska.net--public/yaboot--devel--1.3 # +2005-05-20 03:10:03 GMT Ethan Benson patch-80 + + Summary: + amiga partition table support. + Revision: + yaboot--devel--1.3--patch-80 + + * Support for amiga partition tables. (Sven Luther) + + new files: + include/.arch-ids/amiga-part.h.id include/amiga-part.h + + modified files: + 0arch-timestamps0 ChangeLog second/partition.c + + 2005-05-19 04:26:37 GMT Ethan Benson patch-79 Summary: diff --git a/include/amiga-part.h b/include/amiga-part.h new file mode 100644 index 0000000..ad9a139 --- /dev/null +++ b/include/amiga-part.h @@ -0,0 +1,42 @@ +/* + * amiga-part.h - Structure of amiga partition table + * + * Copyright (C) 2004 Sven Luther + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#define AMIGA_RDB_MAX 16 +#define AMIGA_ID_RDB 0x5244534B /* 'RDSK' */ +#define AMIGA_ID_PART 0x50415254 /* 'PART' */ +#define AMIGA_END 0xffffffff + +#define AMIGA_ID 0 +#define AMIGA_LENGTH 1 +#define AMIGA_PARTITIONS 7 +#define AMIGA_CYL 16 +#define AMIGA_SECT 17 +#define AMIGA_HEADS 18 +#define AMIGA_RDBLIMIT 33 + + +#define AMIGA_PART_NEXT 4 +#define AMIGA_PART_FLAGS 8 +#define AMIGA_PART_LOWCYL 41 +#define AMIGA_PART_HIGHCYL 42 +#define AMIGA_PART_DOSTYPE 48 + +#define AMIGA_PART_BOOTABLE 0x1 +#define AMIGA_PART_NOMOUNT 0x2 diff --git a/second/partition.c b/second/partition.c index c866349..e3ab4c5 100644 --- a/second/partition.c +++ b/second/partition.c @@ -1,6 +1,8 @@ /* * partition.c - partition table support * + * Copyright (C) 2004 Sven Luther + * * Copyright (C) 2001, 2002 Ethan Benson * * Copyright (C) 1999 Benjamin Herrenschmidt @@ -31,6 +33,7 @@ #include "stdlib.h" #include "mac-part.h" #include "fdisk-part.h" +#include "amiga-part.h" #include "partition.h" #include "prom.h" #include "string.h" @@ -213,6 +216,110 @@ identify_iso_fs(ihandle device, unsigned int *iso_root_block) return 0; } +/* + * Detects and read amiga partition tables. + */ + +static int +_amiga_checksum (unsigned int blk_size) +{ + unsigned int sum; + int i, end; + unsigned int *amiga_block = (unsigned int *) block_buffer; + + sum = amiga_block[0]; + end = amiga_block[AMIGA_LENGTH]; + + if (end > blk_size) end = blk_size; + + for (i = 1; i < end; i++) sum += amiga_block[i]; + + return sum; +} + +static int +_amiga_find_rdb (const char *dev_name, prom_handle disk, unsigned int prom_blksize) +{ + int i; + unsigned int *amiga_block = (unsigned int *) block_buffer; + + for (i = 0; i