bug-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: need terminfo for serial console?


From: Mario Klebsch
Subject: Re: need terminfo for serial console?
Date: Mon, 29 Apr 2002 22:00:43 +0200

Am Montag den, 29. April 2002, um 20:13, schrieb Yoshinori K. Okuji:

At Sun, 28 Apr 2002 22:25:04 -0700 (PDT),
Dr. Tilmann Bubeck <address@hidden> wrote:
it will not change the code much. The most obvious change would be, that all your hardcoded "escape strings", like "\e%dJ" will be replaced by something link "cursordown(X)". This is a new function which will get the escape code from the terminfo table. It will therefore work with any terminal, not just
vt100.

...
As Mario suggested, it would be a good idea to define escape sequences
in a configuration file, since this circumvents the limitation above,
and this doesn't depend upon external resources.

It would be sufficient to create a set of global variables, which contain the escape sequences, and to use these variables everywhere, where currently hard coded escape sequences are used.

My first thought was to use pointers to char, which could be initialized to some default value (string in text space). But when thinking about how to implement it, I stumbled across a memory allocation problem. I do not know, wether grub does have a memory allocator at all, nor wether it does have free(). Even it does have, there still would be the problem of how to know, wether to call free() or not, since it does not have to be called for the initialization value.

So the simplest solution probably is to use an array of char, which is initialized with a default value suitable for the console. The unix GRUB shell could use the current termcap/terminfo entry instead.

Despite of memory management, cursor addressing probably will be tricky. There were far to much vaiants to implement it, often using esoteric encoding for the coordinate values. termcap could serve as a template, but I am not sure, wether it is worth this effort (especially wether it is worth the procs in size of code). It probably is easier to implement a kind of dump tgoto(), which is based on cursor home an cursor movement.

73, Mario




reply via email to

[Prev in Thread] Current Thread [Next in Thread]