Print this page
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
loader: pxe receive cleanup
9475 libefi: Do not return only if ReceiveFilter
installboot: should support efi system partition
8931 boot1.efi: scan all display modes rather than
loader: spinconsole updates
loader: gfx experiment to try GOP Blt() function.
sha1 build test
loader: add sha1 hash calculation
common/sha1: update for loader build
loader: biosdisk rework
uts: 32-bit kernel FB needs mapping in low memory
uts: add diag-device
uts: boot console mirror with diag-device
uts: enable very early console on ttya
kmdb: add diag-device as input/output device
uts: test VGA memory exclusion from mapping
uts: clear boot mapping and protect boot pages test
uts: add dboot map debug printf
uts: need to release FB pages in release_bootstrap()
uts: add screenmap ioctl
uts: update sys/queue.h
loader: add illumos uts/common to include path
loader: tem/gfx font cleanup
loader: vbe checks
uts: gfx_private set KD_TEXT when KD_RESETTEXT is
uts: gfx 8-bit update
loader: gfx 8-bit fix
loader: always set media size from partition.
uts: MB2 support for 32-bit kernel
loader: x86 should have tem 80x25
uts: x86 should have tem 80x25
uts: font update
loader: font update
uts: tem attributes
loader: tem.c comment added
uts: use font module
loader: add font module
loader: build rules for new font setup
uts: gfx_private update for new font structure
uts: early boot update for new font structure
uts: font update
uts: font build rules update for new fonts
uts: tem update to new font structure
loader: module.c needs to include tem_impl.h
uts: gfx_private 8x16 font rework
uts: make font_lookup public
loader: font rework
uts: font rework
9259 libefi: efi_alloc_and_read should check for PMBR
uts: tem utf-8 support
loader: implement tem utf-8 support
loader: tem should be able to display UTF-8
7784 uts: console input should support utf-8
7796 uts: ldterm default to utf-8
uts: do not reset serial console
uts: set up colors even if tem is not console
uts: add type for early boot properties
uts: gfx_private experiment with drm and vga
uts: gfx_private should use setmode drm callback.
uts: identify FB types and set up gfx_private based
loader: replace gop and vesa with framebuffer
uts: boot needs simple tem to support mdb
uts: boot_keyboard should emit esc sequences for
uts: gfx_private FB showuld be written by line
kmdb: set terminal window size
uts: gfx_private needs to keep track of early boot FB
pnglite: move pnglite to usr/src/common
loader: gfx_fb
ficl-sys: add gfx primitives
loader: add illumos.png logo
ficl: add fb-putimage
loader: add png support
loader: add alpha blending for gfx_fb
loader: use term-drawrect for menu frame
ficl: add simple gfx words
uts: provide fb_info via fbgattr dev_specific array.
uts: gfx_private add alpha blending
uts: update sys/ascii.h
uts: tem OSC support (incomplete)
uts: implement env module support and use data from
uts: tem get colors from early boot data
loader: use crc32 from libstand (libz)
loader: optimize for size
loader: pass tem info to the environment
loader: import tem for loader console
loader: UEFI loader needs to set ISADIR based on
loader: need UEFI32 support
8918 loader.efi: add vesa edid support
uts: tem_safe_pix_clear_prom_output() should only
uts: tem_safe_pix_clear_entire_screen() should use
uts: tem_safe_check_first_time() should query cursor
uts: tem implement cls callback & visual_io v4
uts: gfx_vgatext use block cursor for vgatext
uts: gfx_private implement cls callback & visual_io
uts: gfx_private bitmap framebuffer implementation
uts: early start frame buffer console support
uts: font functions should check the input char
uts: font rendering should support 16/24/32bit depths
uts: use smallest font as fallback default.
uts: update terminal dimensions based on selected
7834 uts: vgatext should use gfx_private
uts: add spacing property to 8859-1.bdf
terminfo: add underline for sun-color
terminfo: sun-color has 16 colors
uts: add font load callback type
loader: do not repeat int13 calls with error 0x20 and
8905 loader: add skein/edonr support
8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Revert "NEX-16819 loader UEFI support"
This reverts commit ec06b9fc617b99234e538bf2e7e4d02a24993e0c.
Reverting due to failures in the zfs-tests and the sharefs-tests
NEX-16819 loader UEFI support
Includes work by Toomas Soome <tsoome@me.com>
Upstream commits:
loader: pxe receive cleanup
9475 libefi: Do not return only if ReceiveFilter
installboot: should support efi system partition
8931 boot1.efi: scan all display modes rather than
loader: spinconsole updates
loader: gfx experiment to try GOP Blt() function.
sha1 build test
loader: add sha1 hash calculation
common/sha1: update for loader build
loader: biosdisk rework
uts: 32-bit kernel FB needs mapping in low memory
uts: add diag-device
uts: boot console mirror with diag-device
uts: enable very early console on ttya
kmdb: add diag-device as input/output device
uts: test VGA memory exclusion from mapping
uts: clear boot mapping and protect boot pages test
uts: add dboot map debug printf
uts: need to release FB pages in release_bootstrap()
uts: add screenmap ioctl
uts: update sys/queue.h
loader: add illumos uts/common to include path
loader: tem/gfx font cleanup
loader: vbe checks
uts: gfx_private set KD_TEXT when KD_RESETTEXT is
uts: gfx 8-bit update
loader: gfx 8-bit fix
loader: always set media size from partition.
uts: MB2 support for 32-bit kernel
loader: x86 should have tem 80x25
uts: x86 should have tem 80x25
uts: font update
loader: font update
uts: tem attributes
loader: tem.c comment added
uts: use font module
loader: add font module
loader: build rules for new font setup
uts: gfx_private update for new font structure
uts: early boot update for new font structure
uts: font update
uts: font build rules update for new fonts
uts: tem update to new font structure
loader: module.c needs to include tem_impl.h
uts: gfx_private 8x16 font rework
uts: make font_lookup public
loader: font rework
uts: font rework
libefi: efi_alloc_and_read should check for PMBR
uts: tem utf-8 support
loader: implement tem utf-8 support
loader: tem should be able to display UTF-8
7784 uts: console input should support utf-8
7796 uts: ldterm default to utf-8
uts: do not reset serial console
uts: set up colors even if tem is not console
uts: add type for early boot properties
uts: gfx_private experiment with drm and vga
uts: gfx_private should use setmode drm callback.
uts: identify FB types and set up gfx_private based
loader: replace gop and vesa with framebuffer
uts: boot needs simple tem to support mdb
uts: boot_keyboard should emit esc sequences for
uts: gfx_private FB showuld be written by line
kmdb: set terminal window size
uts: gfx_private needs to keep track of early boot FB
pnglite: move pnglite to usr/src/common
loader: gfx_fb
ficl-sys: add gfx primitives
loader: add illumos.png logo
ficl: add fb-putimage
loader: add png support
loader: add alpha blending for gfx_fb
loader: use term-drawrect for menu frame
ficl: add simple gfx words
uts: provide fb_info via fbgattr dev_specific array.
uts: gfx_private add alpha blending
uts: update sys/ascii.h
uts: tem OSC support (incomplete)
uts: implement env module support and use data from
uts: tem get colors from early boot data
loader: use crc32 from libstand (libz)
loader: optimize for size
loader: pass tem info to the environment
loader: import tem for loader console
loader: UEFI loader needs to set ISADIR based on
loader: need UEFI32 support
8918 loader.efi: add vesa edid support
uts: tem_safe_pix_clear_prom_output() should only
uts: tem_safe_pix_clear_entire_screen() should use
uts: tem_safe_check_first_time() should query cursor
uts: tem implement cls callback & visual_io v4
uts: gfx_vgatext use block cursor for vgatext
uts: gfx_private implement cls callback & visual_io
uts: gfx_private bitmap framebuffer implementation
uts: early start frame buffer console support
uts: font functions should check the input char
uts: font rendering should support 16/24/32bit depths
uts: use smallest font as fallback default.
uts: update terminal dimensions based on selected
7834 uts: vgatext should use gfx_private
uts: add spacing property to 8859-1.bdf
terminfo: add underline for sun-color
terminfo: sun-color has 16 colors
uts: add font load callback type
loader: do not repeat int13 calls with error 0x20 and
8905 loader: add skein/edonr support
8904 common/crypto: make skein and edonr loader
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/common/ficl/main.c
+++ new/usr/src/common/ficl/main.c
1 1 /*
2 2 * stub main for testing Ficl
3 3 * $Id: main.c,v 1.2 2010/09/10 09:01:28 asau Exp $
4 4 */
5 5 /*
6 6 * Copyright (c) 1997-2001 John Sadler (john_sadler@alum.mit.edu)
7 7 * All rights reserved.
8 8 *
9 9 * Get the latest Ficl release at http://ficl.sourceforge.net
10 10 *
11 11 * I am interested in hearing from anyone who uses Ficl. If you have
12 12 * a problem, a success story, a defect, an enhancement request, or
13 13 * if you would like to contribute to the Ficl release, please
14 14 * contact me by email at the address above.
15 15 *
16 16 * L I C E N S E and D I S C L A I M E R
17 17 *
18 18 * Redistribution and use in source and binary forms, with or without
19 19 * modification, are permitted provided that the following conditions
20 20 * are met:
21 21 * 1. Redistributions of source code must retain the above copyright
22 22 * notice, this list of conditions and the following disclaimer.
23 23 * 2. Redistributions in binary form must reproduce the above copyright
24 24 * notice, this list of conditions and the following disclaimer in the
25 25 * documentation and/or other materials provided with the distribution.
26 26 *
27 27 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
28 28 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 30 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
31 31 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 32 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 33 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 34 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 35 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 36 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 37 * SUCH DAMAGE.
38 38 */
39 39
40 40 #include <stdio.h>
41 41 #include <stdlib.h>
42 42 #include <unistd.h>
43 43 #include <termios.h>
44 44 #include <sys/errno.h>
45 45
46 46 #include <ficl.h>
47 47 #include <ficlplatform/emu.h>
48 48 #include <libtecla.h>
49 49
50 50 #define LINELEN 1024
51 51 #define HISTORY 2048
52 52
53 53 static char *
54 54 prompt(void)
55 55 {
56 56 static char prompt[20]; /* probably too large, but well... */
57 57 char *pr, *p, *cp, *ev;
58 58 int n = 0;
59 59
60 60 if ((cp = getenv("prompt")) == NULL)
61 61 cp = ">";
62 62 pr = p = strdup(cp);
63 63
64 64 while (*p != 0) {
65 65 if ((*p == '$') && (*(p+1) == '{')) {
66 66 for (cp = p + 2; (*cp != 0) && (*cp != '}'); cp++)
67 67 ;
68 68 *cp = 0;
69 69 ev = getenv(p + 2);
70 70
71 71 if (ev != NULL)
72 72 n = sprintf(prompt+n, "%s", ev);
73 73 p = cp + 1;
74 74 continue;
75 75 }
76 76 prompt[n++] = *p;
77 77 p++;
78 78 }
79 79 if (prompt[n - 1] != ' ')
80 80 prompt[n++] = ' ';
81 81 prompt[n] = '\0';
82 82 free(pr);
83 83 return (prompt);
84 84 }
85 85
86 86 int
87 87 main(int argc, char **argv)
88 88 {
89 89 int returnValue = 0;
90 90 char *buffer;
91 91 GetLine *gl;
92 92 ficlVm *vm;
93 93 struct winsize ws;
94 94 int cols = 80, rows = 24;
|
↓ open down ↓ |
94 lines elided |
↑ open up ↑ |
95 95
96 96 if (ioctl(1, TIOCGWINSZ, &ws) != -1) {
97 97 if (ws.ws_col)
98 98 cols = ws.ws_col;
99 99 if (ws.ws_row)
100 100 rows = ws.ws_row;
101 101 }
102 102
103 103 clearenv();
104 104 asprintf(&buffer, "%d", cols);
105 - setenv("COLUMNS", buffer, 1);
105 + setenv("screen-#cols", buffer, 1);
106 106 free(buffer);
107 107 asprintf(&buffer, "%d", rows);
108 - setenv("LINES", buffer, 1);
108 + setenv("screen-#rows", buffer, 1);
109 109 free(buffer);
110 110
111 111 if (getenv("prompt") == NULL)
112 112 setenv("prompt", "${interpret}", 1);
113 113 if (getenv("interpret") == NULL)
114 114 setenv("interpret", "ok", 1);
115 115
116 116 if ((vm = bf_init("", NULL)) == NULL)
117 117 return (ENOMEM);
118 118 returnValue = ficlVmEvaluate(vm, ".ver cr quit");
119 119
120 120 /*
121 121 * load files specified on command-line
122 122 */
123 123 if (argc > 1) {
124 124 asprintf(&buffer, ".( loading %s ) cr include %s\n cr",
125 125 argv[1], argv[1]);
126 126 returnValue = ficlVmEvaluate(vm, buffer);
127 127 free(buffer);
128 128 }
129 129
130 130 if ((gl = new_GetLine(LINELEN, HISTORY)) == NULL) {
131 131 bf_fini();
132 132 return (ENOMEM);
133 133 }
134 134
135 135 while (returnValue != FICL_VM_STATUS_USER_EXIT) {
136 136 if ((buffer = gl_get_line(gl, prompt(), NULL, -1)) == NULL)
137 137 break;
138 138 returnValue = bf_run(buffer);
139 139 }
140 140
141 141 gl = del_GetLine(gl);
142 142 bf_fini();
143 143 return (returnValue);
144 144 }
|
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX