Also as a consequence of the below error, by setting "set debug=all" GRUB2 would output a lot of text and become unusable (with the below code) - as opposed to other modules where by setting "set pager=1" would make it quite usable.
Regarding the restart issue I traced the cause to the function call screen_read_char() from ./grub-core/term/i386/pc/vga_text.c. This gets called when (grub_curr_pos.y == ROWS - 1) -- my bad on forgetting the -1.
static void
inc_y (void)
{
grub_curr_pos.x = 0;
if (grub_curr_pos.y < ROWS - 1)
grub_curr_pos.y++;
else
{
#if 0
int x, y;
for (y = 0; y < ROWS - 1; y++)
for (x = 0; x < COLS; x++)
screen_write_char (x, y, screen_read_char (x, y + 1)); // restart happens on this call
for (x = 0; x < COLS; x++)
screen_write_char (x, ROWS - 1, ' ' | (cur_color << 8));
#else
int x, y;
for (y = 0; y < ROWS; y++)
for (x = 0; x < COLS; x++)
screen_write_char (x, y, ' ');
grub_curr_pos.y = 0;
#endif
}
}