[comp.os.minix] Multi-partition boot continued

motti@ocsmd.ocs.com (Motti Bazar) (04/17/89)

Hi there,
I wasn't on the net for some time and lost a lot of mail that was sent to
me concerning my multi-partition boot utility.
From whatever was recovered, I'll try to answer. If you sent me mail and
did not get any answer, please mail it to me again and I'll do my best.
Since last time, I added more things to it but its not finished so its
not posted yet.
Some mail messages asked me to contact Dr. T. about incorporating it
into the Minix distribution. So here I'm asking, do you think it
should me incorporated ??? If somebody missed it I can post it again !

Second, I'm still using V1.2 because I did too many changes and I don't
have the time to convert now. Yesterday, I tried to write a small
program that outputs to the screen characters above ascii 127. The
output I got was the correct character but with a funny attribute.
I don't know if it was fixed in the >V1.2 versions or not.

The solution is:

In the kernel file tty.c, when looking for characters to show on screen,
if no escape sequence is been handled and its a regular character,
its outputed to screen with its current attribute.
The problem was that the character value is defined as "char" and if you
try to put there a value greater then 127 the sign will be extended and
the attribute will be ored with 0xFFcc instead of with 0x00cc. The small
fix just ands the character value with 0x00FF before the or with the
attribute and solves the problem.

/*===================================================================*
 *			out_char				     *
 *===================================================================*/
PRIVATE out_char(tp, c)
register struct tty_struct *tp;	/* pointer to tty struct */
char c;				/* character to be output */
{
	.
	.
  switch(c) {
	.
	.
    default:		/* printable chars are stored in ramqueue */
      if (tp->tty_column >= LINE_WIDTH) return;	/* long line */
      if (tp->tty_rwords == TTY_RAM_WORDS) flush(tp);
      tp->tty_ramqueue[tp->tty_rwords++] = tp->tty_attribute | (c & 0x00FF);
      tp->tty_column++;	/* next column */                           ^
      return;							    |
  }								    |
}								Was only c


Have fun ... Motti