Permalink
Browse files

Merge branch 'master' into 0.4.6a

  • Loading branch information...
chenall committed Aug 6, 2014
2 parents 0d2f04e + 73df31e commit e6e11c1673717466432bb8df495957caf4c3c55a
Showing with 20 additions and 4 deletions.
  1. +1 −1 stage2/asm.S
  2. +18 −2 stage2/builtins.c
  3. +1 −1 stage2/stage2.c
View
@@ -161,7 +161,7 @@ codestart:
/* internal variables follow */
. = EXT_C(main) + 0x74
VARIABLE(menu_num_ctrl)
.long 0x2000
.long 0x10002000
#include "grub4dos_int_ver.h"
#ifdef GRUB4DOS_INT_VER
.long GRUB4DOS_INT_VER
View
@@ -11694,6 +11694,7 @@ write_func (char *arg, int flags)
unsigned long tmp_partition;
unsigned long long offset;
unsigned long long len;
unsigned long long bytes = 4;
char tmp_file[16];
//int block_file = 0;
@@ -11709,6 +11710,13 @@ write_func (char *arg, int flags)
if (! safe_parse_maxint (&p, &offset))
return 0;
}
else if (grub_memcmp (arg, "--bytes=", 8) == 0)
{
p = arg + 8;
if (! safe_parse_maxint (&p, &bytes))
return 0;
if (bytes > 8) bytes = 8;
}
else
break;
arg = skip_to (0, arg);
@@ -11860,7 +11868,15 @@ write_func (char *arg, int flags)
p = arg;
if (! safe_parse_maxint (&p, &val))
goto fail;
*((unsigned *)(unsigned int) RAW_ADDR (addr += offset)) = (unsigned)val;
addr += offset;
arg = (char*)(unsigned int)addr;
p = (char*)(unsigned int)&val;
while(bytes--)
{
*arg++ = *p++;
}
// *((unsigned *)(unsigned int) RAW_ADDR (addr)) = (unsigned)val;
if (debug > 0)
grub_printf ("Address 0x%lx: Value 0x%x\n", (unsigned long long)addr, (*((unsigned *)(unsigned int) RAW_ADDR (addr))));
if (addr != (int)&saved_drive)
@@ -11883,7 +11899,7 @@ static struct builtin builtin_write =
"write",
write_func,
BUILTIN_MENU | BUILTIN_CMDLINE | BUILTIN_SCRIPT | BUILTIN_HELP_LIST | BUILTIN_IFTITLE,
"write [--offset=SKIP] ADDR_OR_FILE INTEGER_OR_STRING",
"write [--offset=SKIP] [--bytes=N] ADDR_OR_FILE INTEGER_OR_STRING",
"Write a 32-bit value to memory or write a string to file(or device!)."
};
View
@@ -237,7 +237,7 @@ print_entry (int y, int highlight,int entryno, char *config_entries)
is_highlight = highlight;
gotoxy (MENU_BOX_X - 1, y);
grub_putchar(highlight ? (menu_num_ctrl[2] = entryno,0x10) : ' ', 255);
grub_putchar(highlight ? (menu_num_ctrl[2] = entryno,menu_num_ctrl[3]) : ' ', 255);
if (entry)
{
if (config_entries == (char*)titles)

0 comments on commit e6e11c1

Please sign in to comment.