Hi Stuart,
On Tue, Jan 10, 2023 at 11:05:24AM +0000, Stuart Henderson wrote:
> On 2023/01/09 18:39, Crystal Kolipe wrote:
> > Another update to the console patchset...
>
> i386 ramdisk still fits.
>
> ; diff /tmp/old /tmp/new
> --- /tmp/old Tue Jan 10 03:56:19 2023
> +++ /tmp/new Tue Jan 10 03:54:13 2023
> @@ -4,12 +4,12 @@ text data bss dec hex
> 1083 0 0 1083 43b obj/wsemul_subr.o
> 4646 52 284 4982 1376 obj/wsemul_vt100.o
> 1182 0 0 1182 49e obj/wsemul_vt100_chars.o
> -1353 0 0 1353 549 obj/wsemul_vt100_keys.o
> -3795 0 0 3795 ed3 obj/wsemul_vt100_subr.o
> +1522 0 0 1522 5f2 obj/wsemul_vt100_keys.o
> +4585 0 0 4585 11e9 obj/wsemul_vt100_subr.o
> 90 0 0 90 5a obj/wsemulconf.o
> 621 0 0 621 26d obj/wsevent.o
> -731 3684 9 4424 1148 obj/wsfont.o
> +823 3688 9 4520 11a8 obj/wsfont.o
> 7308 72 64 7444 1d14 obj/wskbd.o
> -6892 0 0 6892 1aec obj/wskbdmap_mfii.o
> +6920 0 0 6920 1b08 obj/wskbdmap_mfii.o
> 1954 804 1 2759 ac7 obj/wskbdutil.o
> 2632 32 8 2672 a70 obj/wsmux.o
>
> So text from the changed ws*.o files goes from 12771->13850
It could be reduced further by not compiling the code that controls attributes
which are not supported by the vga console, I.E. they only work with rasops,
(see diff below).
(Also, I'm wondering whether the code that deals with edp->tabs==NULL is
really necessary. Why do we not allocate memory for tabs in
wsemul_vt100_cnattach?)
--- wsemul_vt100_subr.c.prev Mon Jan 9 13:28:25 2023
+++ wsemul_vt100_subr.c Tue Jan 10 08:15:56 2023
@@ -577,9 +577,11 @@
case 1: /* bold */
flags |= WSATTR_HILIT;
break;
+#ifndef SMALL_KERNEL
case 2: /* dim */
flags |= WSATTR_DIM;
break;
+#endif
case 3: /* italic */
flags |= WSATTR_ITALIC;
break;
@@ -592,6 +594,7 @@
case 7: /* reverse */
flags |= WSATTR_REVERSE;
break;
+#ifndef SMALL_KERNEL
/*
* Invisible text only makes the _glyph_ invisible.
*
@@ -607,6 +610,7 @@
case 21: /* double underline */
flags |= WSATTR_DOUBLE_UNDERLINE;
break;
+#endif
case 22: /* ~bold ~dim VT300 only */
flags &= ~WSATTR_HILIT;
flags &= ~WSATTR_DIM;
@@ -636,6 +640,7 @@
flags |= WSATTR_WSCOLORS;
fgcol = ARG(n) - 30;
break;
+#ifndef SMALL_KERNEL
/*
* Sequences starting CSI 38 escape to a larger
* colourspace, typically either 256 colours or 24-bit.
@@ -694,6 +699,7 @@
*/
n++;
break;
+#endif
case 39:
/* reset fg color */
fgcol = WSCOL_WHITE;
@@ -706,6 +712,7 @@
flags |= WSATTR_WSCOLORS;
bgcol = ARG(n) - 40;
break;
+#ifndef SMALL_KERNEL
case 48: /* set 8-bit background colour */
if (edp->nargs == n+1) {
break ;
@@ -729,6 +736,7 @@
}
n++;
break;
+#endif
case 49:
/* reset bg color */
bgcol = WSCOL_BLACK;