1 | /*␊ |
2 | * Copyright (c) 1999-2003 Apple Computer, Inc. All rights reserved.␊ |
3 | *␊ |
4 | * @APPLE_LICENSE_HEADER_START@␊ |
5 | * ␊ |
6 | * Portions Copyright (c) 1999-2003 Apple Computer, Inc. All Rights␊ |
7 | * Reserved. This file contains Original Code and/or Modifications of␊ |
8 | * Original Code as defined in and that are subject to the Apple Public␊ |
9 | * Source License Version 2.0 (the "License"). You may not use this file␊ |
10 | * except in compliance with the License. Please obtain a copy of the␊ |
11 | * License at http://www.apple.com/publicsource and read it before using␊ |
12 | * this file.␊ |
13 | * ␊ |
14 | * The Original Code and all software distributed under the License are␊ |
15 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER␊ |
16 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,␊ |
17 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,␊ |
18 | * FITNESS FOR A PARTICULAR PURPOSE OR NON- INFRINGEMENT. Please see the␊ |
19 | * License for the specific language governing rights and limitations␊ |
20 | * under the License.␊ |
21 | * ␊ |
22 | * @APPLE_LICENSE_HEADER_END@␊ |
23 | */␊ |
24 | /* ␊ |
25 | * Mach Operating System␊ |
26 | * Copyright (c) 1990 Carnegie-Mellon University␊ |
27 | * Copyright (c) 1989 Carnegie-Mellon University␊ |
28 | * All rights reserved. The CMU software License Agreement specifies␊ |
29 | * the terms and conditions for use and redistribution.␊ |
30 | */␊ |
31 | ␊ |
32 | /*␊ |
33 | * INTEL CORPORATION PROPRIETARY INFORMATION␊ |
34 | *␊ |
35 | * This software is supplied under the terms of a license agreement or ␊ |
36 | * nondisclosure agreement with Intel Corporation and may not be copied ␊ |
37 | * nor disclosed except in accordance with the terms of that agreement.␊ |
38 | *␊ |
39 | * Copyright 1988, 1989 by Intel Corporation␊ |
40 | */␊ |
41 | ␊ |
42 | /*␊ |
43 | * Copyright 1993 NeXT Computer, Inc.␊ |
44 | * All rights reserved.␊ |
45 | */␊ |
46 | ␊ |
47 | /*␊ |
48 | * Completely reworked by Sam Streeper (sam_s@NeXT.com)␊ |
49 | * Reworked again by Curtis Galloway (galloway@NeXT.com)␊ |
50 | */␊ |
51 | ␊ |
52 | ␊ |
53 | #include "boot.h"␊ |
54 | #include "bootstruct.h"␊ |
55 | #include "fake_efi.h"␊ |
56 | #include "sl.h"␊ |
57 | #include "libsa.h"␊ |
58 | #include "platform.h"␊ |
59 | #include "graphics.h"␊ |
60 | #ifndef OPTION_ROM␊ |
61 | #include "appleboot.h"␊ |
62 | #endif␊ |
63 | #include "modules.h"␊ |
64 | #include "xml.h"␊ |
65 | ␊ |
66 | #ifndef DEBUG_BOOT␊ |
67 | #define DEBUG_BOOT 0␊ |
68 | #endif␊ |
69 | ␊ |
70 | #if DEBUG_BOOT␊ |
71 | #define DBG(x...)␉␉printf(x)␊ |
72 | #else␊ |
73 | #define DBG(x...)␉␉␊ |
74 | #endif␊ |
75 | ␊ |
76 | ␊ |
77 | typedef struct platform_info {␊ |
78 | ␉char platformName[PLATFORM_NAME_LEN];␊ |
79 | ␉char rootPath[ROOT_PATH_LEN];␊ |
80 | } PlatformInfo;␊ |
81 | ␊ |
82 | char *gPlatformName = NULL;␊ |
83 | //char gRootPath[256];␊ |
84 | long gBootMode; /* defaults to 0 == kBootModeNormal */␊ |
85 | bool gOverrideKernel;␊ |
86 | char gBootKernelCacheFile[512];␊ |
87 | char gMKextName[512];␊ |
88 | char gMacOSVersion[8];␊ |
89 | char *gRootDevice = NULL;␊ |
90 | bool uuidSet = false;␊ |
91 | #ifndef OPTION_ROM␊ |
92 | bool gEnableCDROMRescan;␊ |
93 | bool gScanSingleDrive;␊ |
94 | #endif␊ |
95 | ␊ |
96 | int bvCount = 0;␊ |
97 | //int␉menucount = 0;␊ |
98 | int gDeviceCount = 0; ␊ |
99 | ␊ |
100 | BVRef bvr;␊ |
101 | BVRef menuBVR;␊ |
102 | BVRef bvChain;␊ |
103 | ␊ |
104 | //static void selectBiosDevice(void);␊ |
105 | ␊ |
106 | static bool getOSVersion(char *str);␊ |
107 | static void getRootDevice();␊ |
108 | ␊ |
109 | #ifdef NBP_SUPPORT␊ |
110 | static bool gUnloadPXEOnExit = false;␊ |
111 | #endif␊ |
112 | ␊ |
113 | /*␊ |
114 | * How long to wait (in seconds) to load the␊ |
115 | * kernel after displaying the "boot:" prompt.␊ |
116 | */␊ |
117 | #define kBootErrorTimeout 5␊ |
118 | ␊ |
119 | /*␊ |
120 | * Default path to kernel cache file␊ |
121 | */␊ |
122 | #define kDefaultCachePath "/System/Library/Caches/com.apple.kext.caches/Startup/kernelcache"␊ |
123 | ␊ |
124 | //==========================================================================␊ |
125 | // Zero the BSS.␊ |
126 | ␊ |
127 | static void zeroBSS(void)␊ |
128 | {␊ |
129 | ␉extern char _DATA__bss__begin, _DATA__bss__end;␊ |
130 | ␉extern char _DATA__common__begin, _DATA__common__end;␊ |
131 | ␉␊ |
132 | ␉bzero(&_DATA__bss__begin, (&_DATA__bss__end - &_DATA__bss__begin));␊ |
133 | ␉bzero(&_DATA__common__begin, (&_DATA__common__end - &_DATA__common__begin));␊ |
134 | }␊ |
135 | ␊ |
136 | //==========================================================================␊ |
137 | // Malloc error function␊ |
138 | ␊ |
139 | #ifdef SAFE_MALLOC␊ |
140 | static inline void malloc_error(char *addr, size_t size, const char *file, int line)␊ |
141 | {␊ |
142 | stop("\nMemory allocation error! Addr=0x%x, Size=0x%x, File=%s, Line=%d\n", (unsigned)addr, (unsigned)size, file, line);␊ |
143 | }␊ |
144 | #else␊ |
145 | static inline void malloc_error(char *addr, size_t size)␊ |
146 | {␊ |
147 | printf("\nMemory allocation error (0x%x, 0x%x)\n", (unsigned)addr, (unsigned)size);␊ |
148 | asm volatile ("hlt");␊ |
149 | }␊ |
150 | #endif␊ |
151 | ␊ |
152 | //==========================================================================␊ |
153 | //Initializes the runtime. Right now this means zeroing the BSS and initializing malloc.␊ |
154 | //␊ |
155 | void initialize_runtime(void)␊ |
156 | {␊ |
157 | ␉zeroBSS();␊ |
158 | ␉malloc_init(0, 0, 0, malloc_error);␊ |
159 | }␊ |
160 | ␊ |
161 | //==========================================================================␊ |
162 | // execKernel - Load the kernel image (mach-o) and jump to its entry point.␊ |
163 | ␊ |
164 | static int ExecKernel(void *binary)␊ |
165 | {␊ |
166 | entry_t kernelEntry;␊ |
167 | int ret;␊ |
168 | ␉␊ |
169 | bootArgs->kaddr = bootArgs->ksize = 0;␊ |
170 | ␉␊ |
171 | ␉if(gMacOSVersion[3] <= '6')␊ |
172 | ␉{␊ |
173 | ␉␉bootArgs->Version = kBootArgsVersion1;␉␉␊ |
174 | ␉␉bootArgs->Revision = gMacOSVersion[3];␉␊ |
175 | ␉}␊ |
176 | ␉else ␊ |
177 | ␉{␉␉␊ |
178 | #if kBootArgsVersion > 1␊ |
179 | ␉␉␊ |
180 | ␉␉bootArgs->Version = kBootArgsVersion;␉␉␊ |
181 | ␉␉bootArgs->Revision = kBootArgsRevision;␊ |
182 | #else␊ |
183 | ␉␉bootArgs->Version = 2;␊ |
184 | bootArgs->Revision = 0;␊ |
185 | #endif␊ |
186 | ␉}␊ |
187 | ␉␊ |
188 | ␉execute_hook("ExecKernel", (void*)binary, NULL, NULL, NULL, NULL, NULL);␊ |
189 | ␊ |
190 | ret = DecodeKernel(binary,␊ |
191 | &kernelEntry,␊ |
192 | (char **) &bootArgs->kaddr,␊ |
193 | (int *)&bootArgs->ksize );␊ |
194 | ␊ |
195 | if ( ret != 0 )␊ |
196 | return ret;␊ |
197 | ␉␊ |
198 | // Reserve space for boot args for 10.7 only (for 10.6 and earlier, we will convert (to legacy) the structure and reserve kernel memory for it later.)␊ |
199 | ␉if(gMacOSVersion[3] == '7')␊ |
200 | reserveKernBootStruct();␊ |
201 | ␉␊ |
202 | // Load boot drivers from the specifed root path.␊ |
203 | ␉␊ |
204 | if (!gHaveKernelCache) {␊ |
205 | ␉␉LoadDrivers("/");␊ |
206 | }␊ |
207 | ␉␊ |
208 | #if TEXT_SPINNER␊ |
209 | ␉clearActivityIndicator();␊ |
210 | #endif␊ |
211 | ␉␊ |
212 | if (gErrors) {␊ |
213 | printf("Errors encountered while starting up the computer.\n");␊ |
214 | printf("Pausing %d seconds...\n", kBootErrorTimeout);␊ |
215 | sleep(kBootErrorTimeout);␊ |
216 | }␊ |
217 | ␉␊ |
218 | ␉execute_hook("md0Ramdisk", NULL, NULL, NULL, NULL, NULL, NULL);␊ |
219 | ␊ |
220 | setupFakeEfi();␊ |
221 | ␉␉␊ |
222 | verbose("Starting Darwin %s\n",( archCpuType == CPU_TYPE_I386 ) ? "x86" : "x86_64");␊ |
223 | #ifdef NBP_SUPPORT␊ |
224 | // Cleanup the PXE base code.␊ |
225 | ␉␊ |
226 | if ( (gBootFileType == kNetworkDeviceType) && gUnloadPXEOnExit ) {␊ |
227 | ␉␉if ( (ret = nbpUnloadBaseCode()) != nbpStatusSuccess )␊ |
228 | {␊ |
229 | ␉printf("nbpUnloadBaseCode error %d\n", (int) ret);␊ |
230 | sleep(2);␊ |
231 | }␊ |
232 | }␊ |
233 | #endif ␊ |
234 | bool wait = false;␊ |
235 | ␉const char *strval = 0;␊ |
236 | ␉int dummysize /*= 0*/;␉␊ |
237 | ␉␊ |
238 | ␉getBoolForKey(kWaitForKeypressKey, &wait, &bootInfo->bootConfig);␊ |
239 | ␉␊ |
240 | ␉if (getValueForBootKey(bootArgs->CommandLine, "-wait", &strval, &dummysize))␊ |
241 | ␉{␊ |
242 | ␉␉wait = true;␊ |
243 | ␉␉␊ |
244 | ␉␉if (strval && strcmp(strval, "no") == 0) {␊ |
245 | ␉␉␉wait = false;␊ |
246 | ␉␉} ␉␉␊ |
247 | ␉}␊ |
248 | ␉␉␊ |
249 | ␉if (wait == true) {␊ |
250 | ␉␉pause();␊ |
251 | ␉}␊ |
252 | ␉␉␉␊ |
253 | ␉if ((execute_hook("GUI_ExecKernel", NULL, NULL, NULL, NULL, NULL, NULL) == 0))␊ |
254 | ␉//if (bootArgs->Video.v_display == VGA_TEXT_MODE)␊ |
255 | ␉{␊ |
256 | ␉␉setVideoMode( GRAPHICS_MODE, 0 );␊ |
257 | ␉␉␊ |
258 | #ifndef OPTION_ROM␊ |
259 | ␉␉ ␊ |
260 | ␉␉if(!gVerboseMode)␊ |
261 | ␉␉{␉␉␉␊ |
262 | ␉␉␉drawColorRectangle(0, 0, DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT, 0x01); ␊ |
263 | ␉␉␊ |
264 | ␉␉␉uint8_t *appleBootPict; ␊ |
265 | ␉␉␉uint16_t bootImageWidth = kAppleBootWidth; ␊ |
266 | ␉␉␉uint16_t bootImageHeight = kAppleBootHeight; ␊ |
267 | ␉␉␉uint8_t *bootImageData = NULL; ␉␉ ␊ |
268 | ␉␉␉uint16_t x, y;␊ |
269 | ␉␉␉␊ |
270 | ␉␉␉unsigned long screen_params[4] = {DEFAULT_SCREEN_WIDTH, DEFAULT_SCREEN_HEIGHT, 32, 0};␉// here we store the used screen resolution␊ |
271 | ␉␉␉// Prepare the data for the default Apple boot image. ␊ |
272 | ␉␉␉appleBootPict = (uint8_t *) decodeRLE(gAppleBootPictRLE, kAppleBootRLEBlocks, bootImageWidth * bootImageHeight); ␊ |
273 | ␉␉␉if (appleBootPict) { ␊ |
274 | ␉␉␉␉convertImage(bootImageWidth, bootImageHeight, appleBootPict, &bootImageData); ␊ |
275 | ␉␉␉␉if (bootImageData) {␉␊ |
276 | ␉␉␉␉␉x = (screen_params[0] - MIN(kAppleBootWidth, screen_params[0])) / 2; ␊ |
277 | ␉␉␉␉␉y = (screen_params[1] - MIN(kAppleBootHeight, screen_params[1])) / 2; ␊ |
278 | ␉␉␉␉␉drawDataRectangle(x, y, kAppleBootWidth, kAppleBootHeight, bootImageData);␊ |
279 | ␉␉␉␉␉free(bootImageData);␊ |
280 | ␉␉␉␉}␊ |
281 | ␉␉␉␉free(appleBootPict); ␊ |
282 | ␉␉␉}␊ |
283 | ␉␉␊ |
284 | ␉␉}␊ |
285 | #endif␊ |
286 | ␉}␊ |
287 | ␊ |
288 | ␉setupBooterLog();␊ |
289 | ␉␊ |
290 | finalizeBootStruct();␊ |
291 | ␉␊ |
292 | ␉if (gMacOSVersion[3] <= '6') ␊ |
293 | ␉␉reserveKernLegacyBootStruct(); ␉␉␊ |
294 | ␉␊ |
295 | ␉␊ |
296 | ␉execute_hook("Kernel Start", (void*)kernelEntry, (void*)bootArgs, NULL, NULL, NULL, NULL);␉// Notify modules that the kernel is about to be started␊ |
297 | #if UNUSED␊ |
298 | ␉turnOffFloppy();␊ |
299 | #endif␊ |
300 | #if BETA␊ |
301 | #include "smp.h"␊ |
302 | #include "apic.h"␊ |
303 | ␉IMPS_LAPIC_WRITE(LAPIC_LVT1, LAPIC_ICR_DM_NMI);␊ |
304 | #endif␊ |
305 | ␉␊ |
306 | ␉if (gMacOSVersion[3] <= '6') {␊ |
307 | ␉␉␊ |
308 | ␉␉// Jump to kernel's entry point. There's no going back now. XXX LEGACY OS XXX␊ |
309 | ␉␉startprog( kernelEntry, bootArgsLegacy );␊ |
310 | ␉}␉␊ |
311 | ␉␉␉␊ |
312 | ␉outb(0x21, 0xff); /* Maskout all interrupts Pic1 */␊ |
313 | ␉outb(0xa1, 0xff); /* Maskout all interrupts Pic2 */␊ |
314 | ␉␉␊ |
315 | ␉// Jump to kernel's entry point. There's no going back now. XXX LION XXX␊ |
316 | startprog( kernelEntry, bootArgs );␊ |
317 | ␉␊ |
318 | // Not reached␊ |
319 | ␉␊ |
320 | return 0;␊ |
321 | }␊ |
322 | ␊ |
323 | //==========================================================================␊ |
324 | // This is the entrypoint from real-mode which functions exactly as it did␊ |
325 | // before. Multiboot does its own runtime initialization, does some of its␊ |
326 | // own things, and then calls common_boot.␊ |
327 | void boot(int biosdev)␊ |
328 | {␊ |
329 | ␉initialize_runtime();␊ |
330 | ␉// Enable A20 gate before accessing memory above 1Mb.␊ |
331 | ␉enableA20();␊ |
332 | ␉common_boot(biosdev);␊ |
333 | }␊ |
334 | ␊ |
335 | //==========================================================================␊ |
336 | // The 'main' function for the booter. Called by boot0 when booting␊ |
337 | // from a block device, or by the network booter.␊ |
338 | //␊ |
339 | // arguments:␊ |
340 | // biosdev - Value passed from boot1/NBP to specify the device␊ |
341 | // that the booter was loaded from.␊ |
342 | //␊ |
343 | // If biosdev is kBIOSDevNetwork, then this function will return if␊ |
344 | // booting was unsuccessful. This allows the PXE firmware to try the␊ |
345 | // next boot device on its list.␊ |
346 | void common_boot(int biosdev)␊ |
347 | {␊ |
348 | int status;␊ |
349 | char *bootFile;␊ |
350 | bool quiet;␊ |
351 | bool firstRun = true;␊ |
352 | bool instantMenu;␊ |
353 | #ifndef OPTION_ROM␊ |
354 | bool rescanPrompt;␊ |
355 | #endif␊ |
356 | unsigned int allowBVFlags = kBVFlagSystemVolume|kBVFlagForeignBoot;␊ |
357 | unsigned int denyBVFlags = kBVFlagEFISystem;␊ |
358 | ␉␊ |
359 | #ifdef NBP_SUPPORT␊ |
360 | // Set reminder to unload the PXE base code. Neglect to unload␊ |
361 | // the base code will result in a hang or kernel panic.␊ |
362 | gUnloadPXEOnExit = true;␊ |
363 | #endif␊ |
364 | // Record the device that the booter was loaded from.␊ |
365 | gBIOSDev = biosdev & kBIOSDevMask;␊ |
366 | ␉␊ |
367 | ␉␊ |
368 | ␉␊ |
369 | // Setup VGA text mode.␊ |
370 | // Not sure if it is safe to call setVideoMode() before the␊ |
371 | // config table has been loaded. Call video_mode() instead.␊ |
372 | #if DEBUG␊ |
373 | printf("before video_mode\n");␊ |
374 | #endif␊ |
375 | video_mode( 2 ); // 80x25 mono text mode.␊ |
376 | #if DEBUG␊ |
377 | printf("after video_mode\n");␊ |
378 | #endif␊ |
379 | #if !TEXT_SPINNER␊ |
380 | ␉printf("Starting Chameleon ...\n");␊ |
381 | #endif␊ |
382 | ␉␊ |
383 | ␉initBooterLog();␊ |
384 | ␉␊ |
385 | ␉// Initialize boot info structure.␊ |
386 | initKernBootStruct();␊ |
387 | ␉␊ |
388 | ␉␊ |
389 | // Scan and record the system's hardware information.␊ |
390 | scan_platform();␊ |
391 | ␉␊ |
392 | // First get info for boot volume.␊ |
393 | scanBootVolumes(gBIOSDev, 0);␊ |
394 | bvChain = getBVChainForBIOSDev(gBIOSDev);␊ |
395 | setBootGlobals(bvChain);␊ |
396 | ␉␊ |
397 | // Load boot.plist config file␊ |
398 | status = loadSystemConfig(&bootInfo->bootConfig);␊ |
399 | ␉␊ |
400 | if (getBoolForKey(kQuietBootKey, &quiet, &bootInfo->bootConfig) && quiet) {␊ |
401 | gBootMode |= kBootModeQuiet;␊ |
402 | }␊ |
403 | ␉␊ |
404 | // Override firstRun to get to the boot menu instantly by setting "Instant Menu"=y in system config␊ |
405 | if (getBoolForKey(kInsantMenuKey, &instantMenu, &bootInfo->bootConfig) && instantMenu) {␊ |
406 | firstRun = false;␊ |
407 | }␊ |
408 | ␉␊ |
409 | #ifndef OPTION_ROM␊ |
410 | ␉// Enable touching a single BIOS device only if "Scan Single Drive"=y is set in system config.␊ |
411 | if (getBoolForKey(kScanSingleDriveKey, &gScanSingleDrive, &bootInfo->bootConfig) && gScanSingleDrive) {␊ |
412 | gScanSingleDrive = true;␊ |
413 | }␊ |
414 | ␉␊ |
415 | ␉// Create a list of partitions on device(s).␊ |
416 | if (gScanSingleDrive)␊ |
417 | ␉{␊ |
418 | ␉␉scanBootVolumes(gBIOSDev, &bvCount);␊ |
419 | } ␊ |
420 | ␉else ␊ |
421 | #endif␊ |
422 | ␉{␊ |
423 | ␉␉scanDisks(gBIOSDev, &bvCount);␊ |
424 | }␊ |
425 | ␉␊ |
426 | ␉// Create a separated bvr chain using the specified filters.␊ |
427 | bvChain = newFilteredBVChain(0x80, 0xFF, allowBVFlags, denyBVFlags, &gDeviceCount);␊ |
428 | ␉gBootVolume = selectBootVolume(bvChain);␊ |
429 | ␉␊ |
430 | ␉␊ |
431 | ␉// Intialize module system␊ |
432 | ␉if(init_module_system())␊ |
433 | ␉{␊ |
434 | ␉␉load_all_modules();␊ |
435 | ␉}␊ |
436 | ␉␊ |
437 | // Loading preboot ramdisk if exists.␊ |
438 | ␉execute_hook("loadPrebootRAMDisk", NULL, NULL, NULL, NULL, NULL, NULL);␊ |
439 | ␉␊ |
440 | #ifndef OPTION_ROM␊ |
441 | ␊ |
442 | // Disable rescan option by default␊ |
443 | gEnableCDROMRescan = false;␊ |
444 | ␉␊ |
445 | // Enable it with Rescan=y in system config␊ |
446 | if (getBoolForKey(kRescanKey, &gEnableCDROMRescan, &bootInfo->bootConfig) && gEnableCDROMRescan) {␊ |
447 | gEnableCDROMRescan = true;␊ |
448 | }␊ |
449 | ␉␊ |
450 | // Ask the user for Rescan option by setting "Rescan Prompt"=y in system config.␊ |
451 | rescanPrompt = false;␊ |
452 | if (getBoolForKey(kRescanPromptKey, &rescanPrompt , &bootInfo->bootConfig) && rescanPrompt && biosDevIsCDROM(gBIOSDev)) {␊ |
453 | gEnableCDROMRescan = promptForRescanOption();␊ |
454 | }␊ |
455 | #endif␊ |
456 | ␉␊ |
457 | ␊ |
458 | ␉␊ |
459 | ␉␊ |
460 | #if DEBUG␊ |
461 | printf(" Default: %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", gBootVolume, gBootVolume->biosdev, gBootVolume->part_no, gBootVolume->flags);␊ |
462 | printf(" bt(0,0): %d, ->biosdev: %d, ->part_no: %d ->flags: %d\n", gBIOSBootVolume, gBIOSBootVolume->biosdev, gBIOSBootVolume->part_no, gBIOSBootVolume->flags);␊ |
463 | getc();␊ |
464 | #endif␊ |
465 | ␉␊ |
466 | ␉␊ |
467 | ␉␊ |
468 | setBootGlobals(bvChain);␊ |
469 | ␉␊ |
470 | // Parse args, load and start kernel.␊ |
471 | while (1) {␊ |
472 | const char *val;␊ |
473 | int len;␊ |
474 | int trycache = 0;␊ |
475 | long flags, cachetime, kerneltime, exttime;␊ |
476 | #ifdef BOOT_HELPER_SUPPORT␉␉␊ |
477 | ␉␉long time;␊ |
478 | #endif␊ |
479 | int ret = -1;␊ |
480 | void *binary = (void *)kLoadAddr;␊ |
481 | ␉␉␊ |
482 | // additional variable for testing alternate kernel image locations on boot helper partitions.␊ |
483 | char bootFileSpec[512];␊ |
484 | ␉␉␊ |
485 | // Initialize globals.␊ |
486 | ␉␉␊ |
487 | sysConfigValid = false;␊ |
488 | gErrors = false;␊ |
489 | ␉␉␊ |
490 | status = getBootOptions(firstRun);␊ |
491 | firstRun = false;␊ |
492 | if (status == -1) continue;␊ |
493 | ␉␉␊ |
494 | status = processBootOptions();␊ |
495 | // Status==1 means to chainboot␊ |
496 | if ( status == 1 ) break;␊ |
497 | // Status==-1 means that the config file couldn't be loaded or that gBootVolume is NULL␊ |
498 | if ( status == -1 )␊ |
499 | {␊ |
500 | ␉␉␉// gBootVolume == NULL usually means the user hit escape.␊ |
501 | ␉␉␉if(gBootVolume == NULL)␊ |
502 | ␉␉␉{␊ |
503 | ␉␉␉␉freeFilteredBVChain(bvChain);␊ |
504 | #ifndef OPTION_ROM␊ |
505 | ␉␉␉␉if (gEnableCDROMRescan)␊ |
506 | ␉␉␉␉␉rescanBIOSDevice(gBIOSDev);␊ |
507 | #endif␊ |
508 | ␉␉␉␉␊ |
509 | ␉␉␉␉bvChain = newFilteredBVChain(0x80, 0xFF, allowBVFlags, denyBVFlags, &gDeviceCount);␊ |
510 | ␉␉␉␉setBootGlobals(bvChain);␊ |
511 | ␉␉␉}␊ |
512 | ␉␉␉continue;␊ |
513 | }␊ |
514 | ␉␉␉␉␉␉␊ |
515 | // Other status (e.g. 0) means that we should proceed with boot.␊ |
516 | ␉␉execute_hook("GUI_PreBoot", NULL, NULL, NULL, NULL, NULL, NULL);␊ |
517 | ␉␉␊ |
518 | ␉␉// Find out which version mac os we're booting.␊ |
519 | ␉␉getOSVersion(gMacOSVersion);␊ |
520 | ␉␉␊ |
521 | ␉␉if (platformCPUFeature(CPU_FEATURE_EM64T)) {␊ |
522 | ␉␉␉archCpuType = CPU_TYPE_X86_64;␊ |
523 | ␉␉} else {␊ |
524 | ␉␉␉archCpuType = CPU_TYPE_I386;␊ |
525 | ␉␉}␊ |
526 | ␉␉if (getValueForKey(karch, &val, &len, &bootInfo->bootConfig)) {␊ |
527 | ␉␉␉if (strncmp(val, "i386", 4) == 0) {␊ |
528 | ␉␉␉␉archCpuType = CPU_TYPE_I386;␊ |
529 | ␉␉␉}␊ |
530 | ␉␉}␊ |
531 | ␊ |
532 | ␉␉// Notify moduals that we are attempting to boot␊ |
533 | ␉␉execute_hook("PreBoot", NULL, NULL, NULL, NULL, NULL, NULL); ␊ |
534 | ␉␉␊ |
535 | ␉␉if (execute_hook("getProductNamePatched", NULL, NULL, NULL, NULL, NULL, NULL) == 0)␉␉␉␉␉␊ |
536 | ␉␉␉local_readSMBIOS(1); // read smbios Platform Name␊ |
537 | ␉␉␊ |
538 | ␉␉getRootDevice();␊ |
539 | ␉␉␊ |
540 | ␉␉if (!getValueForBootKey(bootArgs->CommandLine, kIgnorePrelinkKern, &val, &len)) {␉␉␊ |
541 | ␉␉␊ |
542 | ␉␉␉if (getValueForKey(kPrelinkKernelKey, &val, &len, &bootInfo->bootConfig)) {␊ |
543 | ␉␉␉␉strlcpy(gBootKernelCacheFile, val, len+1);␊ |
544 | ␉␉␉␉bootInfo->adler32 = 0; //TODO: get the (unsigned long)adler32 value from kernelcache path string␊ |
545 | ␉␉␉␉␉␉␊ |
546 | ␉␉␉} else {␊ |
547 | ␉␉␉␉if(gMacOSVersion[3] == '7'){␊ |
548 | ␉␉␉␉␉sprintf(gBootKernelCacheFile, "%s", kDefaultCachePath);␊ |
549 | ␉␉␉␉}␊ |
550 | ␉␉␉␉else if(gMacOSVersion[3] <= '6')␊ |
551 | ␉␉␉␉{␉␉␉ ␊ |
552 | ␊ |
553 | ␉␉␉␉␉␉PlatformInfo *platformInfo = malloc(sizeof(PlatformInfo));␊ |
554 | ␉␉␉␉␉␉if (platformInfo) {␊ |
555 | ␉␉␉␉␉␉␉␊ |
556 | ␉␉␉␉␉␉␉bzero(platformInfo, sizeof(PlatformInfo));␊ |
557 | ␉␉␉␉␉␉␉␊ |
558 | ␉␉␉␉␉␉␉if (gPlatformName)␊ |
559 | ␉␉␉␉␉␉␉␉strlcpy(platformInfo->platformName,gPlatformName, sizeof(platformInfo->platformName)+1);␊ |
560 | ␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␉␊ |
561 | ␉␉␉␉␉␉␉if (gRootDevice) {␊ |
562 | ␉␉␉␉␉␉␉␉char *rootPath_p = platformInfo->rootPath;␊ |
563 | int len = strlen(gRootDevice) + 1;␊ |
564 | if (len > sizeof(platformInfo->rootPath)) {␊ |
565 | len = sizeof(platformInfo->rootPath);␊ |
566 | }␊ |
567 | ␉␉␉␉␉␉␉␉memcpy(rootPath_p, gRootDevice,len);␊ |
568 | ␊ |
569 | ␉␉␉␉␉␉␉␉rootPath_p += len;␊ |
570 | ␊ |
571 | len = strlen(bootInfo->bootFile);␊ |
572 | ␊ |
573 | if ((rootPath_p - platformInfo->rootPath + len) >=␊ |
574 | sizeof(platformInfo->rootPath)) {␊ |
575 | ␊ |
576 | len = sizeof(platformInfo->rootPath) -␊ |
577 | (rootPath_p - platformInfo->rootPath);␊ |
578 | } ␊ |
579 | ␉␉␉␉␉␉␉␉memcpy(rootPath_p, bootInfo->bootFile, len);␉␉␉␉␉␉␉␊ |
580 | ␉␉␉␉␉␉␉␉␊ |
581 | ␉␉␉␉␉␉␉}␉␊ |
582 | ␉␉␉␉␉␉␉␊ |
583 | ␉␉␉␉␉␉␉if (!platformInfo->platformName[0] || !platformInfo->rootPath[0]) {␊ |
584 | ␉␉␉␉␉␉␉␉platformInfo->platformName[0] = platformInfo->rootPath[0] = 0;␊ |
585 | ␉␉␉␉␉␉␉}␊ |
586 | ␉␉␉␉␉␉␉//memcpy(gRootPath,platformInfo->rootPath, sizeof(platformInfo->rootPath));␊ |
587 | ␊ |
588 | ␉␉␉␉␉␉␉␊ |
589 | ␉␉␉␉␉␉␉bootInfo->adler32 = OSSwapHostToBigInt32(local_adler32((unsigned char *)platformInfo, sizeof(*platformInfo)));␊ |
590 | ␉␉␉␉␉␉␉␊ |
591 | ␉␉␉␉␉␉␉free(platformInfo);␉␊ |
592 | ␉␉␉␉␉␉}␊ |
593 | ␊ |
594 | ␉␉␉␉␉DBG("Adler32: %08lX\n",bootInfo->adler32);␊ |
595 | ␉␉␉␉␊ |
596 | ␉␉␉␉␉if (gMacOSVersion[3] < '6') {␊ |
597 | ␉␉␉␉␉␉sprintf(gBootKernelCacheFile, "%s.%08lX", "/System/Library/Caches/com.apple.kernelcaches/kernelcache",bootInfo->adler32);␊ |
598 | ␉␉␉␉␉␉ret = GetFileInfo(NULL, gBootKernelCacheFile, &flags, &cachetime);␊ |
599 | ␉␉␉␉␉␉if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)) {␊ |
600 | ␉␉␉␉␉␉␉bootInfo->adler32 = 0;␊ |
601 | ␉␉␉␉␉␉␉sprintf(gBootKernelCacheFile, "%s", "/System/Library/Caches/com.apple.kernelcaches/kernelcache"); ␊ |
602 | ␉␉␉␉␉␉}␉␉␉␉␉␉␊ |
603 | ␉␉␉␉␉} else␊ |
604 | ␉␉␉␉␉␉sprintf(gBootKernelCacheFile, "%s_%s.%08lX", kDefaultCachePath, (archCpuType == CPU_TYPE_I386) ? "i386" : "x86_64", bootInfo->adler32); //Snow Leopard␊ |
605 | ␉␉␉␉␉␉␉␉␊ |
606 | ␉␉␉␉␉␉␉␉␊ |
607 | ␉␉␉␉}␉␉␉␊ |
608 | ␉␉␉␊ |
609 | ␉␉␉}␉␉␊ |
610 | ␊ |
611 | ␉␉}␊ |
612 | ␉␉␊ |
613 | ␉␉// Check for cache file.␊ |
614 | ␉␉trycache = (((gBootMode & kBootModeSafe) == 0) &&␊ |
615 | ␉␉␉␉␉!gOverrideKernel &&␊ |
616 | ␉␉␉␉␉(gBootFileType == kBlockDeviceType) &&␊ |
617 | ␉␉␉␉␉(gMKextName[0] == '\0') &&␊ |
618 | ␉␉␉␉␉(gBootKernelCacheFile[0] != '\0'));␊ |
619 | ␉␉␊ |
620 | ␉␉verbose("Loading Darwin %s\n", gMacOSVersion);␊ |
621 | ␉␉␊ |
622 | if (trycache ) do {␊ |
623 | ␉␉␉␊ |
624 | // if we haven't found the kernel yet, don't use the cache␊ |
625 | ret = GetFileInfo(NULL, bootInfo->bootFile, &flags, &kerneltime);␊ |
626 | if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)) {␊ |
627 | trycache = 0;␊ |
628 | ␉␉␉␉bootInfo->adler32 = 0;␊ |
629 | break;␊ |
630 | }␊ |
631 | ret = GetFileInfo(NULL, gBootKernelCacheFile, &flags, &cachetime);␊ |
632 | if ((ret != 0) || ((flags & kFileTypeMask) != kFileTypeFlat)␊ |
633 | || (cachetime < kerneltime)) {␊ |
634 | ␉␉␉␉trycache = 0;␊ |
635 | ␉␉␉␉bootInfo->adler32 = 0;␊ |
636 | ␉␉␉␉break;␉␉␉␉ ␊ |
637 | } ␊ |
638 | ret = GetFileInfo("/System/Library/", "Extensions", &flags, &exttime);␊ |
639 | if ((ret == 0) && ((flags & kFileTypeMask) == kFileTypeDirectory)␊ |
640 | && (cachetime < exttime)) {␊ |
641 | trycache = 0;␊ |
642 | ␉␉␉␉bootInfo->adler32 = 0;␊ |
643 | break;␊ |
644 | }␊ |
645 | if (kerneltime > exttime) {␊ |
646 | exttime = kerneltime;␊ |
647 | }␊ |
648 | if (cachetime != (exttime + 1)) {␊ |
649 | trycache = 0;␊ |
650 | ␉␉␉␉bootInfo->adler32 = 0;␊ |
651 | break;␊ |
652 | }␊ |
653 | } while (0);␊ |
654 | ␉␉␊ |
655 | do {␊ |
656 | if (trycache) {␊ |
657 | bootFile = gBootKernelCacheFile;␊ |
658 | verbose("Loading kernel cache %s\n", bootFile);␊ |
659 | ␉␉␉␉if (gMacOSVersion[3] == '7') {␉␉␉␉␉␊ |
660 | ␉␉␉␉␉ret = LoadThinFatFile(bootFile, &binary);␊ |
661 | ␉␉␉␉␉if (ret <= 0 && archCpuType == CPU_TYPE_X86_64)␊ |
662 | ␉␉␉␉␉{␊ |
663 | ␉␉␉␉␉␉archCpuType = CPU_TYPE_I386;␊ |
664 | ␉␉␉␉␉␉ret = LoadThinFatFile(bootFile, &binary);␉␉␉␉␊ |
665 | ␉␉␉␉␉}␊ |
666 | ␉␉␉␉} else {␊ |
667 | ␉␉␉␉␉ret = LoadFile(bootFile);␊ |
668 | ␉␉␉␉␉binary = (void *)kLoadAddr;␊ |
669 | ␉␉␉␉}␊ |
670 | ␉␉␉␉␊ |
671 | if (ret >= 0) {␊ |
672 | break;␊ |
673 | }␊ |
674 | ␉␉␉␉␊ |
675 | }␊ |
676 | ␉␉␉bootInfo->adler32 = 0;␊ |
677 | bootFile = bootInfo->bootFile;␊ |
678 | #ifdef BOOT_HELPER_SUPPORT␊ |
679 | ␉␉␉␊ |
680 | // Try to load kernel image from alternate locations on boot helper partitions.␊ |
681 | sprintf(bootFileSpec, "com.apple.boot.P/%s", bootFile);␊ |
682 | ret = GetFileInfo(NULL, bootFileSpec, &flags, &time); ␊ |
683 | ␉ ␉ if (ret == -1)␊ |
684 | ␉ ␉ {␊ |
685 | ␉␉␉␉sprintf(bootFileSpec, "com.apple.boot.R/%s", bootFile);␊ |
686 | ␉␉␉␉ret = GetFileInfo(NULL, bootFileSpec, &flags, &time); ␊ |
687 | ␉␉␉␉if (ret == -1)␊ |
688 | ␉␉␉␉{␊ |
689 | ␉␉␉␉␉sprintf(bootFileSpec, "com.apple.boot.S/%s", bootFile);␊ |
690 | ␉␉␉␉␉ret = GetFileInfo(NULL, bootFileSpec, &flags, &time); ␊ |
691 | ␉␉␉␉␉if (ret == -1)␊ |
692 | ␉␉␉␉␉{␊ |
693 | ␉␉␉␉␉␉// Not found any alternate locations, using the original kernel image path.␊ |
694 | ␉␉␉␉␉␉strcpy(bootFileSpec, bootFile);␊ |
695 | ␉␉␉␉␉}␊ |
696 | ␉␉␉␉}␊ |
697 | }␊ |
698 | #else␊ |
699 | ␉␉␉strcpy(bootFileSpec, bootFile);␊ |
700 | #endif␊ |
701 | ␉␉␉␊ |
702 | verbose("Loading kernel %s\n", bootFileSpec);␊ |
703 | ret = LoadThinFatFile(bootFileSpec, &binary);␊ |
704 | if (ret <= 0 && archCpuType == CPU_TYPE_X86_64)␊ |
705 | {␊ |
706 | ␉␉␉␉archCpuType = CPU_TYPE_I386;␊ |
707 | ␉␉␉␉ret = LoadThinFatFile(bootFileSpec, &binary);␉␉␉␉␊ |
708 | }␊ |
709 | ␉␉␉␊ |
710 | } while (0);␊ |
711 | #if TEXT_SPINNER␊ |
712 | clearActivityIndicator();␊ |
713 | #endif␊ |
714 | ␉␉␊ |
715 | #if DEBUG␊ |
716 | printf("Pausing...");␊ |
717 | sleep(8);␊ |
718 | #endif␊ |
719 | ␉␉␊ |
720 | if (ret <= 0) {␊ |
721 | ␉␉␉printf("Can't find %s\n", bootFile);␊ |
722 | ␉␉␉␊ |
723 | ␉␉␉sleep(1);␊ |
724 | #ifdef NBP_SUPPORT␊ |
725 | if (gBootFileType == kNetworkDeviceType) {␊ |
726 | // Return control back to PXE. Don't unload PXE base code.␊ |
727 | gUnloadPXEOnExit = false;␊ |
728 | break;␊ |
729 | }␊ |
730 | #endif␊ |
731 | } else {␊ |
732 | /* Won't return if successful. */␊ |
733 | ret = ExecKernel(binary);␊ |
734 | }␊ |
735 | }␊ |
736 | ␊ |
737 | // chainboot␊ |
738 | if (status==1) {␊ |
739 | ␉␉if (getVideoMode() == GRAPHICS_MODE) {␉// if we are already in graphics-mode,␊ |
740 | ␉␉␉setVideoMode(VGA_TEXT_MODE, 0);␉// switch back to text mode␊ |
741 | ␉␉}␊ |
742 | }␊ |
743 | #ifdef NBP_SUPPORT␊ |
744 | if ((gBootFileType == kNetworkDeviceType) && gUnloadPXEOnExit) {␊ |
745 | ␉␉nbpUnloadBaseCode();␊ |
746 | }␊ |
747 | #endif␊ |
748 | }␊ |
749 | ␊ |
750 | ␊ |
751 | // Maximum config table value size␊ |
752 | #define VALUE_SIZE 2048␊ |
753 | static void getRootDevice()␊ |
754 | {␊ |
755 | ␉const char *val = 0;␊ |
756 | int cnt = 0;␊ |
757 | ␉␊ |
758 | ␉if (getValueForKey(kBootUUIDKey, &val, &cnt, &bootInfo->bootConfig)){␊ |
759 | ␉␉uuidSet = true;␉␉␊ |
760 | ␉␉␊ |
761 | } else {␊ |
762 | ␉␉if (getValueForBootKey(bootArgs->CommandLine, kRootDeviceKey, &val, &cnt)) {␊ |
763 | ␉␉␉if (*val == '*' && *(val + 1) != '/' && *(val + 1) != 'u') { ␊ |
764 | ␉␉␉␉val += 1; //skip the *␊ |
765 | ␉␉␉␉uuidSet = true;␉␉␉␉␊ |
766 | ␉␉␉␉␊ |
767 | ␉␉␉} else if (*val == '*' && *(val + 1) == 'u') {␊ |
768 | ␉␉␉␉␊ |
769 | ␉␉␉␉if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->bootConfig)) ␊ |
770 | ␉␉␉␉␉uuidSet = true;␉␉␉␉␊ |
771 | ␉␉␉␉␊ |
772 | ␉␉␉} ␉␉␉␊ |
773 | ␉␉} else {␊ |
774 | #ifdef BOOT_HELPER_SUPPORT␊ |
775 | ␉␉␉//␊ |
776 | ␉␉␉// Try an alternate method for getting the root UUID on boot helper partitions.␊ |
777 | ␉␉␉//␊ |
778 | ␉␉␉if (gBootVolume->flags & kBVFlagBooter)␊ |
779 | ␉␉␉{␊ |
780 | ␉␉␉␉if((loadHelperConfig(&bootInfo->helperConfig) == 0)␊ |
781 | ␉␉␉␉ && getValueForKey(kHelperRootUUIDKey, &val, &cnt, &bootInfo->helperConfig) )␊ |
782 | ␉␉␉␉{␊ |
783 | ␉␉␉␉␉getValueForKey(kHelperRootUUIDKey, &val, &cnt, &bootInfo->helperConfig);␊ |
784 | ␉␉␉␉␉uuidSet = true;␊ |
785 | ␉␉␉␉␉goto out;␊ |
786 | ␉␉␉␉}␊ |
787 | ␉␉␉}␊ |
788 | #endif␊ |
789 | ␉␉␉␊ |
790 | ␉␉␉if ( getValueForKey( kBootDeviceKey, &val, &cnt, &bootInfo->bootConfig)) {␊ |
791 | ␉␉␉␉extern int ArgCntRemaining;␊ |
792 | ␉␉␉␉uuidSet = false;␊ |
793 | ␉␉␉␉char * valueBuffer;␊ |
794 | ␉␉␉␉valueBuffer = malloc(VALUE_SIZE);␊ |
795 | ␉␉␉␉char * argP = bootArgs->CommandLine;␊ |
796 | ␉␉␉␉valueBuffer[0] = '*';␊ |
797 | ␉␉␉␉cnt++;␊ |
798 | ␉␉␉␉strlcpy(valueBuffer + 1, val, cnt);␉␉␉␉␊ |
799 | ␉␉␉␉if (!copyArgument( kRootDeviceKey, valueBuffer, cnt, &argP, &ArgCntRemaining))␊ |
800 | ␉␉␉␉{␊ |
801 | ␉␉␉␉␉free(valueBuffer);␊ |
802 | ␉␉␉␉␉printf("Error: boot arguments too long, unable to set root device !!");␊ |
803 | ␉␉␉␉␉getc();␊ |
804 | ␉␉␉␉␉return;␊ |
805 | ␉␉␉␉}␊ |
806 | ␉␉␉␉free(valueBuffer);␊ |
807 | ␉␉␉␉goto out;␊ |
808 | ␉␉␉}␊ |
809 | ␉␉␉␊ |
810 | ␉␉␉if (gBootVolume->fs_getuuid && gBootVolume->fs_getuuid (gBootVolume, bootInfo->uuidStr) == 0) {␊ |
811 | ␉␉␉␉verbose("Setting boot-uuid to: %s\n", bootInfo->uuidStr);␊ |
812 | ␉␉␉␉uuidSet = true;␊ |
813 | ␉␉␉␉gRootDevice = bootInfo->uuidStr;␊ |
814 | ␉␉␉␉return;␊ |
815 | ␉␉␉}␊ |
816 | ␉␉␊ |
817 | ␉␉}␉␊ |
818 | ␉}␊ |
819 | ␉␉␊ |
820 | out:␉␊ |
821 | ␉verbose("Setting %s to: %s\n", uuidSet ? kBootUUIDKey : "root device", (char* )val); ␊ |
822 | ␉gRootDevice = (char* )val;␊ |
823 | }␊ |
824 | ␊ |
825 | static bool getOSVersion(char *str)␊ |
826 | {␊ |
827 | ␉bool valid = false;␊ |
828 | ␉config_file_t systemVersion;␊ |
829 | ␉const char *val;␊ |
830 | ␉int len;␊ |
831 | ␉␊ |
832 | ␉if (!loadConfigFile("System/Library/CoreServices/SystemVersion.plist", &systemVersion))␊ |
833 | ␉{␊ |
834 | ␉␉valid = true;␊ |
835 | ␉}␊ |
836 | ␉else if (!loadConfigFile("System/Library/CoreServices/ServerVersion.plist", &systemVersion))␊ |
837 | ␉{␊ |
838 | ␉␉valid = true;␊ |
839 | ␉}␊ |
840 | ␉␊ |
841 | ␉if (valid)␊ |
842 | ␉{␊ |
843 | ␉␉if (getValueForKey(kProductVersion, &val, &len, &systemVersion))␊ |
844 | ␉␉{␊ |
845 | ␉␉␉// getValueForKey uses const char for val␊ |
846 | ␉␉␉// so copy it and trim␊ |
847 | ␉␉␉*str = '\0';␊ |
848 | ␉␉␉strncat(str, val, MIN(len, 4));␊ |
849 | ␉␉}␊ |
850 | ␉␉else␊ |
851 | ␉␉␉valid = false;␊ |
852 | ␉}␊ |
853 | ␉␊ |
854 | ␉return valid;␊ |
855 | }␊ |
856 | ␊ |
857 | unsigned long␊ |
858 | local_adler32( unsigned char * buffer, long length )␊ |
859 | {␊ |
860 | long cnt;␊ |
861 | unsigned long result, lowHalf, highHalf;␊ |
862 | ␊ |
863 | lowHalf = 1;␊ |
864 | highHalf = 0;␊ |
865 | ␉␊ |
866 | ␉for ( cnt = 0; cnt < length; cnt++ )␊ |
867 | {␊ |
868 | if ((cnt % 5000) == 0)␊ |
869 | {␊ |
870 | lowHalf %= 65521L;␊ |
871 | highHalf %= 65521L;␊ |
872 | }␊ |
873 | ␉␉␊ |
874 | lowHalf += buffer[cnt];␊ |
875 | highHalf += lowHalf;␊ |
876 | }␊ |
877 | ␉␊ |
878 | ␉lowHalf %= 65521L;␊ |
879 | ␉highHalf %= 65521L;␊ |
880 | ␉␊ |
881 | ␉result = (highHalf << 16) | lowHalf;␊ |
882 | ␉␊ |
883 | ␉return result;␊ |
884 | }␊ |
885 | |