1 00:00:00,660 --> 00:00:05,540 I'm glad to see a good turnout. How many of you are really, 2 00:00:05,620 --> 00:00:07,860 really want to get Intel Management Engine off your 3 00:00:07,860 --> 00:00:12,320 system? All right. Motivated crowd. That's what I want to 4 00:00:12,320 --> 00:00:16,860 see. So let me give you a little bit about my motivation. I don't 5 00:00:16,860 --> 00:00:19,200 know about the rest of you but I'm very paranoid about my own 6 00:00:19,200 --> 00:00:23,000 personal system. I'm the kind of person that spends like a week 7 00:00:23,560 --> 00:00:28,100 fine tuning the SE Linux policies. And I first found out 8 00:00:28,100 --> 00:00:30,860 about the Management Engine, I don't know, six, eight years ago 9 00:00:31,260 --> 00:00:34,980 and it just planted this little seed of doubt in my mind. You 10 00:00:34,980 --> 00:00:38,540 know, as I'm there working away securing the OS layer and 11 00:00:38,540 --> 00:00:41,420 wondering like, well, what about this back door at the hardware 12 00:00:41,420 --> 00:00:45,980 layer that I can't touch and I can't get rid of? So I followed 13 00:00:45,980 --> 00:00:50,000 all the research and finally when there was a way to disable 14 00:00:50,000 --> 00:00:53,380 the Management Engine, I jumped on it right away. I bricked my 15 00:00:53,380 --> 00:00:57,800 laptop twice, not once but twice in the process. And I 16 00:00:57,800 --> 00:01:00,700 decided I wanted to put together a talk to help all of you to 17 00:01:00,700 --> 00:01:02,940 streamline it so you don't have to make the same mistakes that I 18 00:01:02,940 --> 00:01:09,320 did. So my name is Brian Milliron. I'm a freelance 19 00:01:09,320 --> 00:01:13,620 penetration tester. My company is ECR Security. I've been doing 20 00:01:13,620 --> 00:01:16,780 penetration testing for about eight years, primarily in the 21 00:01:16,780 --> 00:01:21,040 energy generation field. Prior to that, I spent about ten years 22 00:01:21,520 --> 00:01:27,780 as a security engineer and network architect. So I'm a 23 00:01:27,800 --> 00:01:31,900 security engineer. So when information about the Intel ME 24 00:01:31,900 --> 00:01:34,040 first started coming out, they called it a chip within a chip 25 00:01:34,040 --> 00:01:37,660 because it's a completely autonomous subsystem. It is not 26 00:01:37,660 --> 00:01:41,400 actually inside the CPU as they first thought. It's located on 27 00:01:41,400 --> 00:01:46,920 the PCH hub. It is completely closed source. It includes a 28 00:01:46,920 --> 00:01:49,780 number of modules, one of which is the AMT for remote 29 00:01:49,780 --> 00:01:54,320 administration. It works just like ILO for completely hardware 30 00:01:54,320 --> 00:01:57,780 level remote administration. It runs the Minix 3.0. It's a 31 00:01:57,800 --> 00:02:02,240 3D OS. It is included in all the Intel chipsets since 2008. 32 00:02:02,680 --> 00:02:06,480 And some of the limited subset of chipsets earlier than that 33 00:02:06,480 --> 00:02:10,760 going back to 2006. It runs on an Intel Quark 32-bit 34 00:02:10,760 --> 00:02:14,920 microprocessor. It has its own separate file system which is 35 00:02:14,920 --> 00:02:19,580 stored in SPI flash. Some of the other modules included in the 36 00:02:19,580 --> 00:02:23,740 management engine are boot guard, TPM, the DRM module, and 37 00:02:23,740 --> 00:02:27,780 quite a few others. So I'm a security engineer. I've been 38 00:02:27,800 --> 00:02:30,560 working on this for a long time. So some of the capabilities 39 00:02:30,560 --> 00:02:34,740 for the management engine. It's active even in the power off S3 40 00:02:34,740 --> 00:02:38,900 state. As long as the main power is connected, it can be 41 00:02:38,900 --> 00:02:44,140 activated. It has its own complete separate network and 42 00:02:44,140 --> 00:02:47,060 TCP IP stack which is completely independent of the operating 43 00:02:47,060 --> 00:02:51,620 system. It communicates out of band. And the OS cannot see or 44 00:02:51,620 --> 00:02:57,000 modify those packets at all. You might think, well, I have a 45 00:02:57,000 --> 00:02:57,780 network appliance. I don't have a network appliance. I don't have 46 00:02:57,800 --> 00:03:01,880 a network appliance. I have SEIM. I have got, you know, 47 00:03:01,900 --> 00:03:06,940 Wireshark running on a separate system. But does that system, 48 00:03:07,120 --> 00:03:12,180 does that network appliance also have an Intel ME chip in it? The 49 00:03:12,180 --> 00:03:15,380 ME has full read write access to all areas of the system main 50 00:03:15,380 --> 00:03:20,600 memory. It has full access to the system bus. It operates in 51 00:03:21,160 --> 00:03:24,320 SMM or protected system management mode. So the OS 52 00:03:24,320 --> 00:03:27,780 cannot see or interfere with any of its operations. It has a 53 00:03:27,780 --> 00:03:31,220 network interface. This is basically a God mode. It can 54 00:03:31,220 --> 00:03:35,620 read and write to anything on the system. If it receives a 55 00:03:35,620 --> 00:03:38,580 magic packet over the network interface, the AMT can be 56 00:03:38,580 --> 00:03:42,520 activated remotely to power on the system, change settings in 57 00:03:42,520 --> 00:03:46,840 the OS, change BIOS settings, view video output, do anything 58 00:03:46,840 --> 00:03:51,060 that a user could do sitting at the local terminal. Because it's 59 00:03:51,060 --> 00:03:57,220 intended for remote management. You might hope that the 60 00:04:00,560 --> 00:04:04,680 system would be very well locked down and hardened in 61 00:04:04,680 --> 00:04:09,140 security. That is unfortunately not the case. All the way back 62 00:04:09,140 --> 00:04:12,840 in 2009, Invisible Things Lab developed a root kit which lives 63 00:04:12,840 --> 00:04:16,140 inside the management engine in the system management mode, 64 00:04:16,760 --> 00:04:20,460 which can hide from the operating system any malware 65 00:04:20,460 --> 00:04:23,920 preventive software that you have on the operating system. It 66 00:04:23,920 --> 00:04:27,660 was completely persistent, could survive being, you know, the hard drive being 67 00:04:27,780 --> 00:04:34,380 wiped. Back in 2010, Vasilios Ververdes developed a certificate 68 00:04:34,380 --> 00:04:38,440 based authentication bypass to remotely enable, deploy and 69 00:04:38,440 --> 00:04:41,100 provision AMT even if it was disabled in the BIOS previously. 70 00:04:43,060 --> 00:04:46,920 And then here recently, just last year, 2017, the Silent Bob is 71 00:04:46,920 --> 00:04:49,620 Silent Vulnerability, remotely exploitable authentication 72 00:04:49,620 --> 00:04:57,680 bypass. You just send a null field to the, to the password, to the AMT and you 73 00:04:57,780 --> 00:05:01,440 get full remote management capabilities. The AMT must be 74 00:05:01,440 --> 00:05:06,300 enabled, however, for this to work. This does affect not only PCs. 75 00:05:06,520 --> 00:05:10,940 This affects servers, firewalls, HSM, security appliances, anything 76 00:05:11,520 --> 00:05:16,240 on your network that has an Intel chip is vulnerable to this. Again, 77 00:05:16,320 --> 00:05:20,000 also in 2017, buffer overflow leading to remote code execution. 78 00:05:21,500 --> 00:05:24,240 So unfortunately this thing is full of holes. This is just what 79 00:05:24,240 --> 00:05:27,560 we've discovered so far. It's closed source and it's very difficult to 80 00:05:27,560 --> 00:05:34,120 audit. And unfortunately, Intel makes it very difficult to get rid 81 00:05:34,120 --> 00:05:37,960 of. We all wish that there was just a simple check box in the BIOS 82 00:05:37,960 --> 00:05:40,920 where you could just say, turn it off. I'm not using this. I'm not 83 00:05:40,920 --> 00:05:44,480 even an enterprise user. But they want to make it as difficult as 84 00:05:44,480 --> 00:05:48,640 possible. The management engine firmware is located in a region 85 00:05:48,640 --> 00:05:52,840 of the SPI flash memory that is inaccessible to the BIOS and the 86 00:05:52,840 --> 00:05:57,540 OS. The core modules are RSA signed. And then you've got the 87 00:05:57,560 --> 00:06:01,060 RSA signature. If the signature verification fails, it will fail to 88 00:06:01,060 --> 00:06:07,040 boot. They're also using LCMA and Huffman compression as a form 89 00:06:07,040 --> 00:06:10,860 of obfuscation. They're using a hidden directory to make it very 90 00:06:10,860 --> 00:06:13,140 difficult for reverse engineers to figure out what this thing is 91 00:06:13,140 --> 00:06:18,940 actually doing. Additionally, there's an extra IME verification 92 00:06:18,940 --> 00:06:23,000 module which runs every 30 minutes to check to see that RSA 93 00:06:23,000 --> 00:06:27,540 signature. And so if you overwrite it on boot, you're 94 00:06:27,560 --> 00:06:30,880 going to see that it's going to check and find out that the RSA 95 00:06:30,880 --> 00:06:33,200 signature check fails and it's going to shut your system down. 96 00:06:34,040 --> 00:06:36,360 So Intel has gone to great lengths to make it very 97 00:06:36,360 --> 00:06:41,580 difficult to disable this. So there has been some people that 98 00:06:41,580 --> 00:06:44,620 have speculated that maybe this is an intentional backdoor. NSA 99 00:06:44,620 --> 00:06:47,880 has a history of these kind of things. I think it's useful to 100 00:06:48,400 --> 00:06:53,440 play a little game of what if. So if I was the NSA and I was 101 00:06:53,440 --> 00:06:55,780 designing a backdoor that I wanted to be loaded on every 102 00:06:55,780 --> 00:06:57,540 server and network appliance in the world, I would have to do a 103 00:06:58,320 --> 00:07:02,200 couple of things. I would want it to be completely independent 104 00:07:02,200 --> 00:07:05,600 of the main operating system. I would want it to be something 105 00:07:05,600 --> 00:07:09,660 that you cannot shut down, that can't be powered on any time 106 00:07:09,660 --> 00:07:13,840 even if the system is turned off. I would want it to be not 107 00:07:13,840 --> 00:07:17,320 just stealthy but completely invisible to anything on the OS. 108 00:07:18,880 --> 00:07:21,060 I would want it to have full access to everything on the 109 00:07:21,060 --> 00:07:24,840 system. And I would want it to have out of band communications 110 00:07:24,840 --> 00:07:27,540 for data exfiltration. So I would want it to be completely 111 00:07:27,560 --> 00:07:31,380 independent. Until ME does all of that. What else would I want 112 00:07:31,380 --> 00:07:34,300 if I was the NSA? And I want to have this backdoor on every 113 00:07:34,300 --> 00:07:37,700 system. I would want to have plausible deniability. I wouldn't 114 00:07:37,700 --> 00:07:42,320 want any evidence pointing to the NSA. I would want to have a 115 00:07:42,320 --> 00:07:48,620 single rogue engineer who is going to overlook a buffer 116 00:07:48,620 --> 00:07:51,200 overflow. Who is going to overlook a remote authentication 117 00:07:51,200 --> 00:07:55,860 bypass. That way there's nothing tying it back to us. So 118 00:07:55,860 --> 00:07:57,540 what are some capabilities for intelligence that are going to 119 00:07:57,560 --> 00:07:58,900 be used for intelligence gathering that such a backdoor 120 00:07:58,900 --> 00:08:04,660 might have? It could scrape RAM to pull encryption keys directly 121 00:08:04,660 --> 00:08:09,860 out of RAM. It could be used to exfiltrate data off of an air 122 00:08:09,860 --> 00:08:13,180 gap system by enabling a wireless module, even if the 123 00:08:13,180 --> 00:08:15,880 wireless was disabled in the BIOS and not configured. It 124 00:08:15,880 --> 00:08:19,140 could be re-enabled and used to exfiltrate data that way. It 125 00:08:19,140 --> 00:08:22,780 could also be used to infect a USB drive that was plugged in and 126 00:08:22,780 --> 00:08:25,540 then that USB drive is carried to a different air gap system to 127 00:08:25,540 --> 00:08:27,540 infect that system and create a two-derivative system that is 128 00:08:27,560 --> 00:08:27,860 going to be able to connect to an inter-directional 129 00:08:28,560 --> 00:08:36,460 communications channel back out to the wider world. So how do we 130 00:08:36,460 --> 00:08:40,200 disable the Intel management engine? The easy way, you can 131 00:08:40,200 --> 00:08:42,800 actually buy systems that are pre-configured with the 132 00:08:42,800 --> 00:08:46,640 management engine disabled. Purism laptops, system 76 133 00:08:46,640 --> 00:08:49,420 systems, that's an option when you make your purchase, you can 134 00:08:49,420 --> 00:08:52,120 have it disabled for you. Dell, if you're a government customer, 135 00:08:52,260 --> 00:08:54,260 again, some of their systems, you can ask for the management 136 00:08:54,260 --> 00:08:57,540 engine to be disabled at time of purchase. So that's one of the 137 00:08:57,560 --> 00:09:00,860 things you can do. Okay. This is DEF CON. You want to do it 138 00:09:00,860 --> 00:09:04,040 yourself. You want to hack it yourself. So a little bit of 139 00:09:04,040 --> 00:09:08,560 history. Igor Skuchinsky is a reverse engineer with hex rays. 140 00:09:09,260 --> 00:09:11,820 He's kind of the one that started all of this by he 141 00:09:11,820 --> 00:09:14,340 reverse engineered a large portion of the management engine 142 00:09:14,780 --> 00:09:17,380 and for the first time the rest of the world was able to see 143 00:09:17,380 --> 00:09:21,600 what is this thing actually doing. 2016 Trammell Hudson 144 00:09:21,600 --> 00:09:24,240 discovered that he could actually overwrite part of the 145 00:09:24,240 --> 00:09:27,100 management engine without invalidating the signature 146 00:09:27,100 --> 00:09:31,820 checks. It turns out Intel was not properly implementing the 147 00:09:31,820 --> 00:09:35,600 integrity verification in the firmware checksums. Nicola 148 00:09:35,600 --> 00:09:38,040 Corna followed up on this research and created a script 149 00:09:38,040 --> 00:09:40,780 that would delete most of the management engine components. 150 00:09:42,000 --> 00:09:44,660 You actually can delete all of the management engine modules 151 00:09:44,660 --> 00:09:49,460 except the ROMP and the BUP module. 2017, positive 152 00:09:49,460 --> 00:09:52,440 technologies discovered an additional way. There's an 153 00:09:52,440 --> 00:09:55,920 undocumented mode called HAP or high assurance platform that was 154 00:09:55,920 --> 00:09:57,080 put in at the request of the company. It's called the high 155 00:09:57,100 --> 00:09:59,400 assurance platform, called the NSA. Which disables the 156 00:09:59,400 --> 00:10:03,220 management engine after boot. So it boots up, it does its 157 00:10:03,220 --> 00:10:06,940 signature check and then it disables itself. It's kind of 158 00:10:06,940 --> 00:10:09,240 funny the NSA thinks the management engine is a security 159 00:10:09,240 --> 00:10:14,120 vulnerability. Who would have figured? Using both techniques 160 00:10:14,120 --> 00:10:18,400 together you can disable the management engine after boot up 161 00:10:18,400 --> 00:10:21,340 and then overwrite it so that it can not be reactivated. 162 00:10:23,380 --> 00:10:26,220 However, since the management engine is built into the BIOS, 163 00:10:26,260 --> 00:10:27,080 you can also build it from the very start so basically it is a 164 00:10:27,100 --> 00:10:30,320 going to need a new BIOS with the disabled management engine 165 00:10:30,320 --> 00:10:37,940 built into it. So how many of you know about Coreboot? A few, 166 00:10:38,080 --> 00:10:44,680 good. So it is an open source BIOS UEFI firmware. It is 167 00:10:44,680 --> 00:10:47,780 supported by Google and a lot of the Google engineers contribute 168 00:10:47,780 --> 00:10:52,520 code. It has very bare bones functionality. It initializes 169 00:10:52,520 --> 00:10:56,500 hardware and passes control to the OS. That's it. It does 170 00:10:56,500 --> 00:11:00,600 support Secure Boot using the VBoot module. However, it does 171 00:11:00,600 --> 00:11:04,040 have limited hardware support. Most Chromebooks it will work on 172 00:11:04,040 --> 00:11:08,640 because Google wants it to work on their hardware. Some of the 173 00:11:08,640 --> 00:11:12,000 other supported hardware is mostly older modules, Intel Ivy 174 00:11:12,000 --> 00:11:15,920 Bridge and Sandy Bridge or the AMD Athlon. It works on some 175 00:11:15,920 --> 00:11:19,940 older MacBooks, ThinkBads and Elitebooks as well. You might be 176 00:11:19,940 --> 00:11:23,340 thinking, I don't want to be stuck with older hardware, but 177 00:11:23,860 --> 00:11:26,440 I've found for my purposes that a four or five year old Elite 178 00:11:26,440 --> 00:11:31,020 Book or ThinkPad does the job. If you really have some high 179 00:11:31,020 --> 00:11:33,580 performance applications that you need to use this on, the Intel 180 00:11:33,580 --> 00:11:38,100 Pixel has some very, very high level specs. So you should be 181 00:11:38,100 --> 00:11:44,180 able to find a system that will be able to suit your needs. How 182 00:11:44,180 --> 00:11:46,400 much is it going to cost? You should be able to build this for 183 00:11:46,400 --> 00:11:50,960 under $100. If you just have a regular 8-pin chip, all you need 184 00:11:50,960 --> 00:11:56,420 is a Raspberry Pi and an SOIC 8-pin Pomona clip. If you have a 185 00:11:56,440 --> 00:12:01,140 one of the 1.8 low volt chips, you're going to need a few extra 186 00:12:01,140 --> 00:12:04,000 components here. You need a logic level converter, breadboard, a 187 00:12:04,000 --> 00:12:07,680 capacitor and a linear power supply. But it still is pretty 188 00:12:07,680 --> 00:12:14,220 cheap. So the first thing you would want to do is prepare the 189 00:12:14,220 --> 00:12:18,860 Cortbu ROM. You're going to want to build from source. Check out 190 00:12:18,860 --> 00:12:22,420 all the sub-modules. And you're going to need to download and 191 00:12:22,420 --> 00:12:26,420 build a payload. You can either use CBIAS or legacy BIAS to 192 00:12:26,420 --> 00:12:28,020 build a payload. Or you can use CBIAS or TIANOCORE for the UEFI 193 00:12:28,020 --> 00:12:36,000 depending on what you want. And it uses a menu config. It is 194 00:12:36,000 --> 00:12:38,460 specific to each type of hardware. That's one of the 195 00:12:38,460 --> 00:12:41,460 reasons that there's limited hardware support. And you're 196 00:12:41,460 --> 00:12:44,920 going to need to include all the proprietary binary blobs for that 197 00:12:44,920 --> 00:12:47,700 specific main board. So you're going to need your video driver, 198 00:12:48,020 --> 00:12:51,620 your LAN, and the management engine as well as a few other 199 00:12:51,620 --> 00:12:55,740 things. It is very important to make sure that you have the 200 00:12:55,740 --> 00:12:56,400 correct PC. You're going to want to have the correct PC 201 00:12:56,400 --> 00:13:01,020 address for the video BIOS or you're going to end up with a 202 00:13:01,020 --> 00:13:03,020 blank screen when you try to reboot. This is something that 203 00:13:03,020 --> 00:13:06,960 happened to me. You always want to use the address that's listed 204 00:13:06,960 --> 00:13:14,160 in LSPCI on the running system. So binary blobs. I know we all 205 00:13:14,160 --> 00:13:17,100 hate them, but until they're all reverse engineered and open 206 00:13:17,100 --> 00:13:20,680 sourced, we have to live with them. I found this personally to 207 00:13:20,680 --> 00:13:22,840 be the most confusing part of the process because the 208 00:13:22,840 --> 00:13:25,120 documentation on the Cortboot website is kind of limited in 209 00:13:25,120 --> 00:13:26,380 this area. So you're going to want to use the address that's 210 00:13:26,380 --> 00:13:28,400 listed in LSPCI. So they say you need these binary blobs, but 211 00:13:28,400 --> 00:13:30,060 they don't go into a lot of detail as to where do you get 212 00:13:30,060 --> 00:13:33,740 them from. What you're going to need is you're going to need the 213 00:13:33,740 --> 00:13:36,800 flash descriptor, the video BIOS, the clean Intel 214 00:13:36,800 --> 00:13:40,520 management engine, PCH reference code, and the memory reference 215 00:13:40,520 --> 00:13:43,140 code. And depending on your main board, you might also need 216 00:13:43,140 --> 00:13:46,600 an Intel firmware support package. So where do you get 217 00:13:46,600 --> 00:13:49,260 this stuff? You're going to get it out of the existing BIOS. 218 00:13:49,320 --> 00:13:50,940 You're going to want to go to the manufacturer's website, 219 00:13:51,220 --> 00:13:53,740 download the latest BIOS, and you're going to extract it from 220 00:13:53,740 --> 00:13:56,360 that binary. You can get it out of the existing BIOS. You can 221 00:13:56,360 --> 00:13:59,600 get it from the system itself just by doing a read on the BIOS 222 00:13:59,600 --> 00:14:02,520 chip. However, there's always a possibility that you get a bad 223 00:14:02,520 --> 00:14:07,180 read and you would end up with some corrupted code. Cortboot 224 00:14:07,180 --> 00:14:11,180 comes with some helper scripts. The extractblobs.sh is supposed 225 00:14:11,180 --> 00:14:14,160 to do all of the extraction for you. However, it didn't work for 226 00:14:14,160 --> 00:14:16,080 me. It's a little out of date. It hasn't been maintained in a 227 00:14:16,080 --> 00:14:20,060 while. They also include some tools, the CBFS tool and the 228 00:14:20,060 --> 00:14:22,620 IDF tool, which are going to do it. And I'm going to show you 229 00:14:22,620 --> 00:14:26,140 how to do this manually. So this command here, the CBFS tool 230 00:14:26,140 --> 00:14:29,420 BIOS print, is going to show you what's in your current BIOS. 231 00:14:30,720 --> 00:14:34,140 And it will look like this. This is kind of a typical BIOS 232 00:14:34,140 --> 00:14:38,000 structure. It tells you the offset and the binaries that are 233 00:14:38,000 --> 00:14:47,500 located in each offset. So here are some commands that you will 234 00:14:47,500 --> 00:14:51,980 use to extract the binary blobs. I've got all the commands here 235 00:14:51,980 --> 00:14:55,440 for the reference code, the machine reference code, the video 236 00:15:08,720 --> 00:15:09,120 reference code, the 237 00:15:09,120 --> 00:15:26,120 management engine. So you don't need to worry about taking 238 00:15:26,120 --> 00:15:31,240 binary that you extracted in the previous step. And it's going to basically overwrite 239 00:15:31,240 --> 00:15:35,680 everything that can be overwritten. And it will also set the half disabled bit for you. 240 00:15:39,200 --> 00:15:43,940 Once you have the cleaned management engine binary, you're ready to build the final 241 00:15:43,940 --> 00:15:51,500 core boot ROM. Do a final check of your config file. Make sure that the core boot knows the 242 00:15:51,500 --> 00:15:56,120 path for all of the binary blobs, including the management engine and the CBIAS payload. 243 00:15:57,480 --> 00:16:04,600 Verify, again, that your PCI address for your VGA is correct. And make sure that your main 244 00:16:04,600 --> 00:16:10,300 board model and vendor are correct. Core boot is going to pre-populate a lot of default values 245 00:16:10,300 --> 00:16:15,820 based on that. There's hundreds of different settings in the menu. And all of the defaults 246 00:16:15,820 --> 00:16:20,300 are good as long as you get the main board model and vendor correct. Although you can tweak it 247 00:16:20,300 --> 00:16:21,480 as needed as well. 248 00:16:23,380 --> 00:16:29,880 And once you've got all that, go ahead and build it. And next you're going to want to set up the 249 00:16:29,880 --> 00:16:36,060 flash ROM on your Raspberry Pi. You do want to check the flash ROM site to make sure that your 250 00:16:36,060 --> 00:16:43,120 hardware is supported. They do support most of the major vendors, so you should be okay. And all 251 00:16:43,120 --> 00:16:46,620 of the major distributions also have it built into their package management system, so you don't 252 00:16:46,620 --> 00:16:51,420 have to build it from source unless you have a very new chip and you have to build from source. 253 00:16:54,340 --> 00:17:03,960 And you're also going to want to RASP config to enable the SPI. And next you're going to want to 254 00:17:03,960 --> 00:17:09,340 find out physically where is the BIOS chip on your main board. Most likely it's going to be 255 00:17:09,340 --> 00:17:16,320 8 pins. It'll look a lot like this. It'll be located near the CMOS battery. And the two biggest 256 00:17:16,320 --> 00:17:21,220 manufacturers are Gigabyte and Winbond, and they will have a large G or a large W on the chip. 257 00:17:21,500 --> 00:17:27,740 And that will help you identify it. Here's another image of a BIOS chip on the main board. 258 00:17:28,140 --> 00:17:32,720 You can see there's not really very many 8-pin chips, you might have a couple. One of them is 259 00:17:32,720 --> 00:17:38,660 going to be your BIOS probably. If you're confused, you can just Google the model number that's 260 00:17:38,660 --> 00:17:46,480 on the chip itself and that will tell you if it's a BIOS chip or not and which model it is. Once 261 00:17:46,480 --> 00:17:50,440 you've identified it, or once you locate it, then you need to identify it. You need to figure out 262 00:17:50,440 --> 00:17:51,480 exactly which model number it is. And then you've got your BIOS chip on the main board, so you can 263 00:17:51,480 --> 00:17:54,320 number so you can get the specs. The model number will be 264 00:17:54,320 --> 00:17:57,400 printed on the chip. I've got an example here for what the model 265 00:17:57,400 --> 00:18:00,480 number actually indicates for this wind bond chip. The 25 266 00:18:00,480 --> 00:18:03,380 tells you what family it is. The X tells you it's dual SPI. The 267 00:18:03,380 --> 00:18:06,540 80 tells you it's an 8 megabyte chip. And the VAIZ tells you 268 00:18:06,540 --> 00:18:14,800 it's an SOIC 8 pin 208 mil chip. Once you have the model number, 269 00:18:14,900 --> 00:18:17,200 you're going to need to look up on the Internet the data sheet 270 00:18:17,200 --> 00:18:19,980 for that specific BIOS chip. You're going to need the pin 271 00:18:19,980 --> 00:18:23,240 out and you're going to need the voltage at the very least. So 272 00:18:23,240 --> 00:18:25,460 the voltage is either going to be a 3.3 volt or it's going to 273 00:18:25,460 --> 00:18:29,040 be a 1.8 volt. However, on this data sheet, it's not going to 274 00:18:29,040 --> 00:18:31,800 say 3.3 or 1.8. It's going to give you a range. It'll say 275 00:18:31,800 --> 00:18:36,300 something like 2.7 to 3.6 volts. That's because voltages 276 00:18:36,300 --> 00:18:40,420 are very rarely exact. This is an example of a pin out 277 00:18:40,420 --> 00:18:48,140 diagram. Notice the little dot next to the 1. So pin 1 is 278 00:18:48,140 --> 00:18:49,960 going to be marked physically on the chip. You're going to need 279 00:18:49,980 --> 00:18:54,040 a little indentation on the chip. That'll be pin 1 right 280 00:18:54,040 --> 00:18:59,380 there. Some of the manufacturers label the pins differently. Some 281 00:18:59,380 --> 00:19:04,080 of them call pin 2 SO. Some of them call pin 2 DO. Some of them 282 00:19:04,080 --> 00:19:10,580 call pin 5 SI. Some of them call it DI or SIO or DIO. The 283 00:19:10,580 --> 00:19:13,740 clock may be called S clock. The write protect may be called ACC. 284 00:19:14,880 --> 00:19:17,080 If you read the data sheet, it's going to tell you what the 285 00:19:17,080 --> 00:19:19,960 function is for each pin and that should tell you which is 286 00:19:19,980 --> 00:19:25,220 which. CS is going to be chip select. DO is data output. WP is 287 00:19:25,220 --> 00:19:30,440 write protect. GND is ground. DIO or DI is data input. CLK is 288 00:19:30,440 --> 00:19:38,500 clock. Hold is hold. VCC is for power. Here's a pin out showing 289 00:19:38,500 --> 00:19:41,520 you which pins for the Raspberry Pi is going to go to which pins 290 00:19:41,520 --> 00:19:49,760 on your SOIC Pomona clip. You'll notice that three of the 291 00:19:49,760 --> 00:19:53,020 pins on the Pomona clip are actually going to go to a single 292 00:19:53,020 --> 00:19:55,600 pin on the Raspberry Pi. So you're going to need to splice 293 00:19:55,600 --> 00:19:57,480 three wires together or you're going to need to use a bread 294 00:19:57,480 --> 00:20:03,720 board to make a bridge between them. This is an example of 295 00:20:03,720 --> 00:20:11,620 what it looks like all hooked up. Now, if you do have a 1.8 296 00:20:11,620 --> 00:20:14,220 volt chip that's called a low voltage chip, you're going to 297 00:20:14,220 --> 00:20:16,260 need to make a step down circuit. Otherwise, you'll fry 298 00:20:16,260 --> 00:20:19,480 your bias chip if you connect it directly to the 3.3 volt output 299 00:20:19,480 --> 00:20:24,740 on the Raspberry Pi. I have here a diagram, a wiring diagram 300 00:20:24,740 --> 00:20:29,060 for how to connect the Raspberry Pi to the logic level converter 301 00:20:29,620 --> 00:20:34,780 and the power supply and the Pomona clip. You are going to 302 00:20:34,780 --> 00:20:38,080 want to have probably a 10 nanofarad capacitor in between 303 00:20:38,620 --> 00:20:43,980 the output on the logic level converter and the input on the 304 00:20:44,640 --> 00:20:48,440 Pomona clip. This is going to remove some voltage fluctuations 305 00:20:48,440 --> 00:20:49,460 that could get in the way of the power supply and the Pomona clip. 306 00:20:49,480 --> 00:20:51,740 This could create noise in your data signal and it could cause 307 00:20:51,740 --> 00:20:58,700 you to get a bad read or a bad write. This is an example of a 308 00:20:58,700 --> 00:21:03,840 completed step down circuit here. You can see I've got the 309 00:21:03,840 --> 00:21:07,220 logic level converter mounted on a bread board and that thing at 310 00:21:07,220 --> 00:21:15,700 the top is the power supply. Now, what to do if your bias 311 00:21:15,700 --> 00:21:19,460 chip is actually one of those super rare 16 pin chips? You're 312 00:21:19,480 --> 00:21:23,960 still only going to be using 8 of the pins and they're all going to be 313 00:21:23,960 --> 00:21:26,800 the same as on a regular 8 pin chip. However, you're going to 314 00:21:26,800 --> 00:21:29,540 have 8 pins that are extra and you're going to want to either 315 00:21:29,540 --> 00:21:32,240 just leave them floating loose or you can connect them to the 316 00:21:32,240 --> 00:21:35,600 ground or to the power pin. And which of those three it is is 317 00:21:35,600 --> 00:21:37,860 going to depend on the documentation. So read the 318 00:21:37,860 --> 00:21:45,680 documentation, that should tell you. Okay, so after you've got 319 00:21:45,680 --> 00:21:47,600 everything wired up, you're going to need to test the connection. 320 00:21:49,480 --> 00:21:52,160 Before you physically connect the Pomona clip to the bias chip, 321 00:21:52,300 --> 00:21:54,580 make sure the power is disconnected from the laptop. 322 00:21:54,940 --> 00:21:57,700 Power supply disconnected, battery disconnected. The 323 00:21:57,700 --> 00:22:00,760 Raspberry Pi itself should be the only source of power unless 324 00:22:00,760 --> 00:22:03,140 you're using a step down circuit with a separate power supply. 325 00:22:05,000 --> 00:22:10,900 And here is the command to read the bias from flash ROM. I 326 00:22:10,900 --> 00:22:14,020 recommend that you do a read three times and do a hash 327 00:22:14,020 --> 00:22:16,900 checksum of each of the reads to make sure they're all the same 328 00:22:16,900 --> 00:22:18,540 to make sure that you're actually getting a good read. 329 00:22:20,820 --> 00:22:23,440 If there's any variation there, the hashes don't come back the 330 00:22:23,440 --> 00:22:25,640 same, you're going to want to disconnect and reconnect the 331 00:22:25,640 --> 00:22:27,600 clip, you're going to want to check all your connections and 332 00:22:27,600 --> 00:22:29,560 make sure that they're firm. You've got to have a good 333 00:22:29,560 --> 00:22:34,660 electrical connection before you do any write here. Once you get 334 00:22:34,660 --> 00:22:37,860 three sequential reads that are all good, then you're ready to 335 00:22:37,860 --> 00:22:41,520 write. Here's the command to do a write. You're going to write 336 00:22:41,520 --> 00:22:45,900 your previously prepared core boot ROM into the bias chip. And 337 00:22:45,900 --> 00:22:48,060 if there's not any errors, everything works out well. 338 00:22:48,180 --> 00:22:49,460 You're going to see the CBIOS, you're going to see the CBIOS, 339 00:22:49,480 --> 00:22:58,520 splash boot screen, it's going to look like this. So what 340 00:22:58,520 --> 00:23:02,620 happens if it doesn't work? Just because the screen is blank 341 00:23:02,620 --> 00:23:05,140 doesn't mean that you've bricked the system. It could be that you 342 00:23:05,140 --> 00:23:08,940 have entered incorrectly the PCI address for the video ROM, so the 343 00:23:08,940 --> 00:23:12,300 video is outputting to the wrong address. If you wait a few 344 00:23:12,300 --> 00:23:17,220 seconds, core boot will pass on the control to the Linux kernel 345 00:23:17,220 --> 00:23:19,460 or whatever you're using, and the Linux kernel is going to 346 00:23:19,480 --> 00:23:25,640 have its own VGA driver that will take over at that point. If 347 00:23:25,640 --> 00:23:28,100 it is truly bricked, you're going to need to re-flash it. You can 348 00:23:28,100 --> 00:23:31,220 either try and re-flash your core boot ROM or you can re-flash 349 00:23:31,220 --> 00:23:33,640 your original ROM and get it back to specs and just double 350 00:23:33,640 --> 00:23:36,420 check everything. Check all the settings in your config file. 351 00:23:36,640 --> 00:23:38,900 Check that all your wiring connections are solid. Use a 352 00:23:38,900 --> 00:23:43,020 multimeter to make sure that everything is connected well. If 353 00:23:43,020 --> 00:23:46,940 flash ROM cannot detect your chip, you can specify manually 354 00:23:46,940 --> 00:23:49,460 using the M flag. However, you should be able to detect your chip 355 00:23:49,480 --> 00:23:50,260 if it is supported. Usually that means there's a poor 356 00:23:50,260 --> 00:23:53,140 electrical connection. It should be able to automatically detect 357 00:23:53,140 --> 00:23:56,680 your chip if it's supported. The flash ROM developers can be 358 00:23:56,680 --> 00:23:59,700 reached for support questions on the flash ROM channel on 359 00:23:59,700 --> 00:24:06,660 freenode.net, and the core boot support mailing list is here. And 360 00:24:06,660 --> 00:24:10,520 here are some, a lot of really useful resources that I found 361 00:24:10,520 --> 00:24:16,680 useful when I was researching this. I'm going to go ahead and 362 00:24:21,520 --> 00:24:23,560 show you a few of them. And there we have it. Here's my 363 00:24:23,560 --> 00:24:26,120 contact info. If you want to get in touch with me, you have some 364 00:24:26,120 --> 00:24:28,040 comments or feedback, or you want to work together, 365 00:24:28,220 --> 00:24:31,460 collaborate on some research with me, or if you want to hire 366 00:24:31,460 --> 00:24:35,040 me, here's my website. I've got all the information about the 367 00:24:35,040 --> 00:24:36,860 services I provide on the website.