Gentoo Archives: gentoo-dev

From: Richard Yao <ryao@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Killing UEFI Secure Boot
Date: Wed, 20 Jun 2012 22:19:13
Message-Id: 4FE24BB7.3000904@gentoo.org
1 Peter, thanks for the detailed email. I have a few questions.
2
3 1. As far as I know, Das U-Boot and Core Boot are mutually exclusive.
4 Why should Linux distribution developers want to use Core Boot instead
5 of Das U-Boot?
6 2. It seems to me that you do not need any Linux code. Exactly what is
7 the relationship between the Core Boot codebase and the Linux codebase?
8 3. How does getting a x86 system to boot differ from getting a MIPS
9 system or ARM system to boot? Does it only work because the vendors made
10 it work or is x86 fundamentally harder?
11
12 On 06/19/2012 11:27 PM, Peter Stuge wrote:
13 > Hi, I have about 11 years of experience with coreboot. I got
14 > involved while developing a custom BIOS for an embedded system.
15 >
16 > You may already have caught some presentation I or one of the other
17 > developers have made about the project. There's a bunch of links
18 > over at http://www.coreboot.org/Screenshots
19 >
20 >
21 > Richard Yao wrote:
22 >> Core Boot is a Linux distribution.
23 > Sorry sir, but no.
24 >
25 > coreboot (one word, lowercase) is an open source BIOS replacement.
26 >
27 > Proprietary BIOSes do two things:
28 >
29 > 1. hardware initialization
30 > on http://stuge.se/pc2010.png everything red requires init by firmware
31 >
32 > 2. starts an operating system
33 > this means implementing the BIOS Boot Specification, running
34 > master boot record code into real mode segment 7c00h, eltorito
35 > CD-ROM extensions and all of that crap
36 >
37 > coreboot does step 1. and nothign else, and significantly faster than
38 > common proprietary BIOSes.
39 >
40 > When coreboot is done it starts another, separate, program, we call
41 > that program "the payload."
42 >
43 > The payload and coreboot are stored together in the boot flash, but
44 > are not linked together. The payload can be any bare-metal program.
45 >
46 > There are many legacy-free bootloader payloads, including GRUB2 and
47 > gPXE/iPXE/whateverit'scalledtoday, but it can just as easily be an
48 > operating system kernel or an embedded application if no OS is
49 > needed. Boot flash are often 32Mbit today, so Linux and a small
50 > initramfs fits comfortably.
51 >
52 > The default payload is SeaBIOS, which is also the firmware QEMU uses.
53 >
54 > SeaBIOS is an open source legacy BIOS implementation, and the
55 > combination of coreboot and SeaBIOS provides a legacy-compatible
56 > boot environment that starts your system exactly like an
57 > old-fashioned proprietary BIOS.
58 >
59 > With coreboot my laptop boots from power button to firefox in a
60 > little over 8 seconds. Out of that time, coreboot runs for about
61 > 600 milliseconds. This is a fairly typical number.
62 >
63 >
64 >> The 80386's RESET state is emulated uniformly across all x86 and amd64,
65 >> so it should not take much effort to support the basic functions of
66 >> setting up the CPU, loading the kernel (from the EEPROM) and jumping
67 >> into it.
68 > This is word for word what the founders of the coreboot project (then
69 > called LinuxBIOS) thought back in 1999, and it blew up in their face.
70 >
71 > In the following 15 years hardware has gotten significantly more
72 > complex, and significantly more closed, again please have a look
73 > at http://stuge.se/pc2010.png
74 >
75 > The closer you are to the CPU the more impossible it is to acquire
76 > reliable documentation for how to program the hardware.
77 >
78 >
79 >> Those are the only things that a BIOS replacement needs to do.
80 > Please join the project! If you find lowlevel programming interesting
81 > it is an amazing good time, even if progress is slow at times. Now is
82 > a fantastic time to get involved! For the first time in the history
83 > of the project, there is code in the repository for all current
84 > hardware platforms from both AMD and Intel.
85 >
86 >
87 >> they are doing far more than those basic functions
88 > I hope I've been able to clarify that actually coreboot does nothing
89 > other than what is neccessary. This is the very essence of coreboot.
90 >
91 >
92 >> Basic functionality would only require the work of a few people.
93 > I'm afraid that this is rather naive.
94 >
95 > An experienced coreboot developer given all required documentation[1]
96 > (and ideally some 100-1000k EUR/USD worth of test equipment) can
97 > possibly do a port to a new hardware platform (new CPU and chipset)
98 > in twelve to eighteen months full time.
99 >
100 > A hard core developer but without previous experience from PC
101 > firmware and coreboot should add some six months for loading the
102 > domain into her head.
103 >
104 > [1] For Intel this requires two stages of NDAs and a decent business
105 > case where Intel will sell five-six figure amounts of chips, or fewer
106 > chips but to an important customer.
107 >
108 > In contrast, AMD put the documentation on their webpage.
109 >
110 > NVIDIA did not give the documentation to anyone no matter what the
111 > business case. VIA doesn't publish documentation on the web, but
112 > some coreboot developers do have good relations with them.
113 >
114 >
115 > Over the last couple years Google have hired most of the active
116 > coreboot developers including the project founder, and they've been
117 > working on support for Intel's Sandy Bridge and Ivy Bridge platforms,
118 > which powers the new Chromebook. I do not know how much time they've
119 > spent, but from my outside view I estimate that it took this amazing
120 > team of engineers between 25 and 30 man-months. This may be a very
121 > optimistic estimate.
122 >
123 > These new Intel platforms require a blob, firmware for a
124 > microcontroller in the chipset, which runs while the main CPU is
125 > still held in reset, in order to do some early prepararation of the
126 > system.
127 >
128 > The firmware blob is signed by Intel. I don't know if the signature
129 > scheme has been broken, I guess it might at some point, but that will
130 > likely be by the usual IT security crowd suspects.
131 >
132 > In Google's coreboot code they are using Intel's reference code for
133 > initializing the memory controller. This is so far also a blob, again
134 > as opposed to AMD who have released their reference code under dual
135 > BSD and GPL license, and although it is theoretically possible to
136 > replace this with self-written code that is not really economical.
137 >
138 > Please look through the SDRAM, DDR and DDR2 self-written init code
139 > in coreboot for the various platforms, and then think about the
140 > complexity added by DDR3, and I expect that hardware vendors and
141 > JEDEC are hard at work on DDR4.
142 >
143 > Memory controller init involves among other things a brute force
144 > search of electrical signal drive strengths to find the correct
145 > setting for stable operation.
146 >
147 >
148 >> Linux already has thousands of developers working on hardware support,
149 >> including developers from Intel. We should be able to leverage that.
150 > Forget about that. Everything that happens on the Linux level is
151 > really a different matter.
152 >
153 >
154 >> Did I miss any technical obstacles?
155 > PCs have 35 years of hardware legacy. It's quite possibly the worst
156 > pile of hardware crap on top of hardware crap you can imagine. It's
157 > a feat that anything works at all.
158 >
159 > You mention 80386, but all PCs still start in real mode, 8086 style.
160 > In another five or ten years maybe that will change, and (some)
161 > hardware will become much more locked down. But I'm not sure, DOS
162 > remains a significant market.
163 >
164 > Someone said "Intel make the best x86 emulators." and that is spot
165 > on. Besides that microcontroller inside your CPU there's of course
166 > also the CPU microcode. There are no modern x86 machines.
167 >
168 >
169 > FSF has long considered coreboot a high priority project, because it
170 > makes UEFI irrelevant, and it very much puts users in full control,
171 > while at the same time being transparent thanks to the open source.
172 >
173 > They don't do much in terms of contributions though. I can understand
174 > that. The way for coreboot to become relevant is to ship from factory.
175 > Everyone with experience from the IBV (Independent BIOS Vendor)
176 > industry knows what a special marketplace this is. It's very
177 > interesting, but don't let anyone tell you that anything is easy.
178 >
179 > The technical obstacles are the least of the problems.
180 >
181 >
182 > //Peter
183 >

Replies

Subject Author
[gentoo-dev] Re: Killing UEFI Secure Boot Duncan <1i5t5.duncan@×××.net>