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/boot/sys/boot/i386/gptzfsboot/gptldr.S
+++ new/usr/src/boot/sys/boot/i386/gptzfsboot/gptldr.S
1 1 /*-
2 2 * Copyright (c) 2007 Yahoo!, Inc.
3 3 * All rights reserved.
4 4 * Written by: John Baldwin <jhb@FreeBSD.org>
5 5 *
6 6 * Redistribution and use in source and binary forms, with or without
7 7 * modification, are permitted provided that the following conditions
8 8 * are met:
9 9 * 1. Redistributions of source code must retain the above copyright
10 10 * notice, this list of conditions and the following disclaimer.
11 11 * 2. Redistributions in binary form must reproduce the above copyright
12 12 * notice, this list of conditions and the following disclaimer in the
13 13 * documentation and/or other materials provided with the distribution.
14 14 * 3. Neither the name of the author nor the names of any co-contributors
15 15 * may be used to endorse or promote products derived from this software
16 16 * without specific prior written permission.
17 17 *
18 18 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 21 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 28 * SUCH DAMAGE.
29 29 *
30 30 * $FreeBSD$
31 31 *
32 32 * Partly from: src/sys/boot/i386/boot2/boot1.S 1.31
33 33 */
34 34
35 35 /* Memory Locations */
36 36 .set MEM_REL,0x700 # Relocation address
37 37 .set MEM_ARG,0x900 # Arguments
|
↓ open down ↓ |
37 lines elided |
↑ open up ↑ |
38 38 .set MEM_ORG,0x7c00 # Origin
39 39 .set MEM_BUF,0x8cec # Load area
40 40 .set MEM_BTX,0x9000 # BTX start
41 41 .set MEM_JMP,0x9010 # BTX entry point
42 42 .set MEM_USR,0xa000 # Client start
43 43 .set BDA_BOOT,0x472 # Boot howto flag
44 44
45 45 /* Misc. Constants */
46 46 .set SIZ_PAG,0x1000 # Page size
47 47 .set SIZ_SEC,0x200 # Sector size
48 - .set COPY_BLKS,0x4 # Number of blocks
48 + .set COPY_BLKS,0x8 # Number of blocks
49 49 # to copy for boot2
50 50 .set COPY_BLK_SZ,0x8000 # Copy in 32k blocks; must be
51 51 # a multiple of 16 bytes
52 52
53 53 .globl start
54 54 .code16
55 55
56 56 /*
57 57 * Copy BTX and boot2 to the right locations and start it all up.
58 58 */
59 59
60 60 /*
61 61 * Setup the segment registers to flat addressing (segment 0) and setup the
62 62 * stack to end just below the start of our code.
63 63 */
64 64 start: xor %cx,%cx # Zero
65 65 mov %cx,%es # Address
66 66 mov %cx,%ds # data
67 67 mov %cx,%ss # Set up
68 68 mov $start,%sp # stack
69 69
70 70 /*
71 71 * BTX is right after us at 'end'. We read the length of BTX out of
72 72 * its header to find boot2. We need to copy boot2 to MEM_USR and BTX
73 73 * to MEM_BTX. Since those might overlap, we have to copy boot2
74 74 * backwards first and then copy BTX. We aren't sure exactly how long
75 75 * boot2 is, but it's currently under 128kB so we'll copy 4 blocks of 32kB
76 76 * each; this can be adjusted via COPY_BLK and COPY_BLK_SZ above.
77 77 */
78 78 mov $end,%bx # BTX
79 79 mov 0xa(%bx),%si # Get BTX length and set
80 80 add %bx,%si # %si to start of boot2
81 81 dec %si # Set %ds:%si to point at the
82 82 mov %si,%ax # last byte we want to copy
83 83 shr $4,%ax # from boot2, with %si made as
84 84 add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # small as possible.
85 85 and $0xf,%si #
86 86 mov %ax,%ds #
87 87 mov $MEM_USR/16,%ax # Set %es:(-1) to point at
88 88 add $(COPY_BLKS*COPY_BLK_SZ/16),%ax # the last byte we
89 89 mov %ax,%es # want to copy boot2 into.
90 90 mov $COPY_BLKS,%bx # Copy COPY_BLKS 32k blocks
91 91 copyloop:
92 92 add $COPY_BLK_SZ,%si # Adjust %ds:%si to point at
93 93 mov %ds,%ax # the end of the next 32k to
94 94 sub $COPY_BLK_SZ/16,%ax # copy from boot2
95 95 mov %ax,%ds
96 96 mov $COPY_BLK_SZ-1,%di # Adjust %es:%di to point at
97 97 mov %es,%ax # the end of the next 32k into
98 98 sub $COPY_BLK_SZ/16,%ax # which we want boot2 copied
99 99 mov %ax,%es
100 100 mov $COPY_BLK_SZ,%cx # Copy 32k
101 101 std
102 102 rep movsb
103 103 dec %bx
104 104 jnz copyloop
105 105 mov %cx,%ds # Reset %ds and %es
106 106 mov %cx,%es
107 107 mov $end,%bx # BTX
108 108 mov 0xa(%bx),%cx # Get BTX length and set
109 109 mov %bx,%si # %si to end of BTX
110 110 mov $MEM_BTX,%di # %di -> end of BTX at
111 111 add %cx,%si # MEM_BTX
112 112 add %cx,%di
113 113 dec %si
114 114 dec %di
115 115 rep movsb # Move BTX
116 116 cld # String ops inc
117 117 /*
118 118 * Enable A20 so we can access memory above 1 meg.
119 119 * Use the zero-valued %cx as a timeout for embedded hardware which do not
120 120 * have a keyboard controller.
121 121 */
122 122 seta20: cli # Disable interrupts
123 123 seta20.1: dec %cx # Timeout?
124 124 jz seta20.3 # Yes
125 125 inb $0x64,%al # Get status
126 126 testb $0x2,%al # Busy?
127 127 jnz seta20.1 # Yes
128 128 movb $0xd1,%al # Command: Write
129 129 outb %al,$0x64 # output port
130 130 seta20.2: inb $0x64,%al # Get status
131 131 testb $0x2,%al # Busy?
132 132 jnz seta20.2 # Yes
133 133 movb $0xdf,%al # Enable
134 134 outb %al,$0x60 # A20
135 135 seta20.3: sti # Enable interrupts
136 136
137 137 /*
138 138 * Save drive number from BIOS so boot2 can see it and start BTX.
139 139 */
140 140 movb %dl,MEM_ARG
141 141 jmp MEM_JMP # Start BTX
142 142 /*
143 143 * make sure the end is aligned for concatenated next module
144 144 */
145 145 .align 4
146 146 end:
|
↓ open down ↓ |
88 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX