Displaying 11 results from an estimated 11 matches for "whichpart".
2007 Oct 17
3
Adding a "boot from local hard disk" option to syslinux menu, booted from USB
...n let me know if what I want to do is
possible at all with syslinux; and possibly how to do
it...
Thanks,
Cheers
///
int main(int argc, char *argv[])
{
char *mbr, *boot_sector = NULL;
struct part_entry *partinfo;
char *drivename, *partition, *endds, *endps,
*waittotals;
int hd, drive, whichpart;
static com32sys_t inreg; /* In bss, so zeroed
automatically */
int idd, idp, endd, endp;
FILE *f;
char *log = "/chsdlog.txt";
char logsc[1024];
char *logs = &logsc;
char logrc[10240];
char *logr = &logrc;
char inch[20];
int ix = 0;
int waittotal;
char c...
2010 Jan 09
2
chain.c32 add grldr= command for Grub4dos
...instead of DL. Indulge them. *
regs.ebx.b[0] = regs.edx.b[0] = drive;
+ /* grldr of Grub4dos wants the partition number in DH:
+ 0xff: whole drive
+ 0-3: primary partitions
+ 4-*: logical partitions
+ */
+ if (opt.grldr)
+ regs.edx.b[1] = 0xff;
+
whichpart = 0; /* Default */
- if (partition)
+ if (partition) {
whichpart = strtoul(partition, NULL, 0);
+ /* grldr of Grub4dos wants the partiton number in DH. */
+ if (opt.grldr)
+ regs.edx.b[1] = whichpart -1;
+ }
+
if (!(drive & 0x80) &...
2010 Jun 30
2
[PATCH] chain.c32: add menu support to grub loader
...rub) {
+ char *path;
regs.ip = 0x200; /* jump 0x200 bytes into the loadfile */
+ /* 89 bytes reserved for menu at offset 0x217 */
+ path = zalloc(89);
+
+ if (path && opt.grubmenu) {
+ char partition[5]; /* maximum is ",100" and up! */
+ int len;
+
+ if (whichpart > 1)
+ sprintf(partition, ",%d", whichpart - 1);
+ else
+ partition[0] = '\0';
+ sprintf(path, "(%cd%d%s)/",
+ drive & 0x80 ? 'h': 'f',
+ (drive & 0x7),
+ partition);
+ len = strlen(path);
+ strncpy (path + len...
2010 Dec 21
2
[PATCH] chain.c32: support chainloading GRUB2 core.img
...* We only care about top-level partition, so we only need to change
- * "part1" to the appropriate value:
- * -1: whole drive (default) (-1 = 0xFF)
- * 0-3: primary partitions
- * 4-*: logical partitions
- */
- stage2->install_partition.part1 = whichpart - 1;
-
- /*
- * Grub Legacy reserves 89 bytes (from 0x8217 to 0x826f) for the
- * config filename. The filename passed via grubcfg= will overwrite
- * the default config filename "/boot/grub/menu.lst".
- */
- if (opt.grubcfg) {
- if (strlen(opt.grubcfg) > s...
2010 Aug 08
1
PATCH/RFC chain.c: update iterator code, yank from chain.c, move both to separate directory
1) code split and move
Iterator related functionality is yanked from chain.c and moved to
iterator.{c,h}. Both are moved to com32/chain and this way chain.c is ready
for further splitting.
Alternatively, partiter could be moved to com32/lib at any time in the future.
It's potentially useful for other modules (e.g. if someone wanted to code
partition dumper or editor).
2) Iterator updates
2008 Apr 24
1
[PATCH] chain.c32: fix booting from logical partitions
...at altlinux.ru>
---
com32/modules/chain.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/com32/modules/chain.c b/com32/modules/chain.c
index b790bd0..ec92cd0 100644
--- a/com32/modules/chain.c
+++ b/com32/modules/chain.c
@@ -228,7 +228,7 @@ find_logical_partition(int whichpart, char *table, struct part_entry *self,
struct part_entry *found;
int i;
- if ( *(uint16_t *)(ptab + 0x1fe) != 0xaa55 )
+ if ( *(uint16_t *)(table + 0x1fe) != 0xaa55 )
return NULL; /* Signature missing */
/* We are assumed to already having enumerated all the data partitions
--...
2010 Jun 28
0
[PATCH] chain.c32: pass partition number to stage2 of Grub Legacy
...ition
+ * variable, located at memory address 0x8208.
+ * We only need to change the value of memory address 0x820a too:
+ * -1: whole drive (default)
+ * 0-3: primary partitions
+ * 4-*: logical partitions */
+ ((uint8_t*) data[ndata].data)[0x20a] = (uint8_t)(whichpart - 1);
}
ndata++;
--
1.6.3.3
2010 Jun 30
0
[PATCH] chain.c32: add grubcfg= for passing an alternative config
...only need to change
+ * "part1" to the appropriate value:
+ * -1: whole drive (default) (-1 = 0xFF)
* 0-3: primary partitions
- * 4-*: logical partitions */
+ * 4-*: logical partitions
+ */
((uint8_t*) data[ndata].data)[0x20a] = (uint8_t)(whichpart - 1);
+
+ /*
+ * Grub Legacy reserves 89 bytes (from 0x8217 to 0x826f) for the
+ * config filename. The filename passed via grubcfg= will overwrite
+ * the default config filename "/boot/grub/menu.lst".
+ */
+ if (opt.grubcfg && strlen(opt.grubcfg) <...
2010 Jun 30
1
(no subject)
...only need to change
+ * "part1" to the appropriate value:
+ * -1: whole drive (default) (-1 = 0xFF)
* 0-3: primary partitions
- * 4-*: logical partitions */
+ * 4-*: logical partitions
+ */
((uint8_t*) data[ndata].data)[0x20a] = (uint8_t)(whichpart - 1);
+
+ /*
+ * Grub Legacy reserves 89 bytes (from 0x8217 to 0x826f) for the
+ * config filename. The filename passed via grubcfg= will overwrite
+ * the default config filename "/boot/grub/menu.lst".
+ */
+ if (opt.grubcfg && strlen(opt.grubcfg) <...
2010 Jul 24
0
[PATCH] chain.c: allocation fixes
...t main(int argc, char *argv[])
struct mbr *mbr = NULL;
char *p;
struct disk_part_iter *cur_part = NULL;
+ void *sect_area = NULL, *file_area = NULL;
+ struct part_entry *hand_area = NULL;
+
struct syslinux_rm_regs regs;
char *drivename, *partition;
int hd, drive, whichpart = 0; /* MBR by default */
@@ -1523,6 +1531,7 @@ int main(int argc, char *argv[])
goto bail;
}
data[ndata].base = load_base;
+ file_area = (void *)data[ndata].data;
load_base = 0x7c00; /* If we also load a boot sector */
/* Create boot info table: needed when you want to chainload
@@...
2010 Jul 26
5
[RFC/PATCH] New chainloading functionality
This patch introduces extra functionality to chain.c, mainly with reference to
BPB adjustments, but not only that. It expects 3 small patches I sent earlier
(they are included for easy reference, patches 1-3/4).
The changes introduced are:
1) file and boot sector use separate options to control load address and jump
address (if applicable). Options are as described below:
*