Date: Thu, 8 Apr 2004 11:08:24 -0700 (PDT) From: Andrew Reisse <areisse@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 50662 for review Message-ID: <200404081808.i38I8O15041909@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=50662 Change 50662 by areisse@areisse_g4 on 2004/04/08 11:07:35 bring in bootx 59.1.1 Affected files ... .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/Makefile#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/Makefile.postamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/Makefile.preamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/PB.project#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/Makefile#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/Makefile.postamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/Makefile.preamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/PB.project#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/bootinfo.hdr#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/Control2.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/MAC-PARTS.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/Makefile#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/Makefile.postamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/Makefile.preamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/PB.project#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/ci.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/ci_io.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/sl_words.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/CaseTables.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/HFSCompare.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/Makefile#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/Makefile.postamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/Makefile.preamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/PB.project#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/cache.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ext2fs.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ext2fs.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ext2fs_bswap.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ext2fs_dinode.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ext2fs_dir.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/fs.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/hfs.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/net.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ufs.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ufs_byteorder.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ufs_byteorder.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/Makefile#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/Makefile.postamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/Makefile.preamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/PB.project#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/boot_args.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/ci.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/device_tree.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/fs.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/libclite.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/sl.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/sl_words.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/Makefile#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/Makefile.postamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/Makefile.preamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/PB.project#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/bsearch.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/bswap.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/mem.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/prf.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/printf.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/sprintf.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/string.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/strtol.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/zalloc.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/Makefile#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/Makefile.postamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/Makefile.preamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/PB.project#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/appleboot.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/clut.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/device_tree.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/display.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/drivers.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/elf.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/elf.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/failedboot.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/lzss.c#1 branch .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/macho.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/main.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/netboot.h#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/fcode-to-c.tproj/Makefile#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/fcode-to-c.tproj/Makefile.postamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/fcode-to-c.tproj/Makefile.preamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/fcode-to-c.tproj/PB.project#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/fcode-to-c.tproj/fcode-to-c.c#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/macho-to-xcoff.tproj/Makefile#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/macho-to-xcoff.tproj/Makefile.postamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/macho-to-xcoff.tproj/Makefile.preamble#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/macho-to-xcoff.tproj/PB.project#2 integrate .. //depot/projects/trustedbsd/sedarwin73/apsl/BootX/macho-to-xcoff.tproj/macho-to-xcoff.c#2 integrate Differences ... ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/Makefile#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/Makefile.postamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/Makefile.preamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/PB.project#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/Makefile#2 (text+ko) ==== @@ -31,7 +31,7 @@ HEADER_PATHS = -I$(SRCROOT)/bootx.tproj/include.subproj NEXTSTEP_PB_CFLAGS = -static -NEXTSTEP_PB_LDFLAGS = -nostdlib -e _StartTVector -seg1addr 01C00000 +NEXTSTEP_PB_LDFLAGS = -nostdlib -e _StartTVector -seg1addr 05600000 NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/Makefile.postamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/Makefile.preamble#2 (text+ko) ==== @@ -127,7 +127,7 @@ # To include a version string, project source must exist in a directory named # $(NAME).%d[.%d][.%d] and the following line must be uncommented. -# OTHER_GENERATED_OFILES = $(VERS_OFILE) +OTHER_GENERATED_OFILES = $(VERS_OFILE) # This definition will suppress stripping of debug symbols when an executable # is installed. By default it is YES. ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/PB.project#2 (text+ko) ==== @@ -21,7 +21,7 @@ NEXTSTEP_COMPILEROPTIONS = "-static"; NEXTSTEP_INSTALLDIR = /bin; NEXTSTEP_JAVA_COMPILER = /usr/bin/javac; - NEXTSTEP_LINKEROPTIONS = "-nostdlib -e _StartTVector -seg1addr 01C00000"; + NEXTSTEP_LINKEROPTIONS = "-nostdlib -e _StartTVector -seg1addr 05600000"; NEXTSTEP_OBJCPLUS_COMPILER = /usr/bin/cc; PDO_UNIX_BUILDTOOL = $NEXT_ROOT/Developer/bin/make; PDO_UNIX_INSTALLDIR = /bin; ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/bootinfo.hdr#2 (text+ko) ==== @@ -1,6 +1,6 @@ <CHRP-BOOT> <COMPATIBLE> -MacRISC MacRISC3 +MacRISC MacRISC3 MacRISC4 </COMPATIBLE> <DESCRIPTION> Boot Loader for Mac OS X. ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/Control2.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/MAC-PARTS.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/Makefile#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/Makefile.postamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/Makefile.preamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/PB.project#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/ci.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/ci_io.c#2 (text+ko) ==== @@ -34,8 +34,10 @@ #include <sl_words.h> #include <libclite.h> -void putchar(int ch) +int putchar(int ch) { if ((ch == '\r') || (ch == '\n')) CallMethod(0, 0, SLWordsIH, "slw_cr"); else CallMethod(1, 0, SLWordsIH, "slw_emit", ch); + + return ch; } ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/ci.subproj/sl_words.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/CaseTables.h#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/HFSCompare.c#2 (text+ko) ==== @@ -194,6 +194,41 @@ return 1; } +// +// BinaryUnicodeCompare - Compare two Unicode strings; produce a relative ordering +// Compared using a 16-bit binary comparison (no case folding) +// +int32_t BinaryUnicodeCompare (u_int16_t * str1, u_int32_t length1, + u_int16_t * str2, u_int32_t length2) +{ + register u_int16_t c1, c2; + int32_t bestGuess; + u_int32_t length; + + bestGuess = 0; + + if (length1 < length2) { + length = length1; + --bestGuess; + } else if (length1 > length2) { + length = length2; + ++bestGuess; + } else { + length = length1; + } + + while (length--) { + c1 = *(str1++); + c2 = *(str2++); + + if (c1 > c2) + return (1); + if (c1 < c2) + return (-1); + } + + return (bestGuess); +} /* * UTF-8 (UCS Transformation Format) ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/Makefile#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/Makefile.postamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/Makefile.preamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/PB.project#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/cache.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ /* * cache.c - A simple cache for file systems meta-data. * - * Copyright (c) 2000 Apple Computer, Inc. + * Copyright (c) 2000 - 2003 Apple Computer, Inc. * * DRI: Josh de Cesare */ @@ -40,7 +40,7 @@ }; typedef struct CacheEntry CacheEntry; -#define kCacheSize (0x80000) +#define kCacheSize (kFSCacheSize) #define kCacheMinBlockSize (0x200) #define kCacheMaxBlockSize (0x4000) #define kCacheMaxEntries (kCacheSize / kCacheMinBlockSize) @@ -50,7 +50,7 @@ static long gCacheNumEntries; static long gCacheTime; static CacheEntry gCacheEntries[kCacheMaxEntries]; -static char gCacheBuffer[kCacheSize]; +static char *gCacheBuffer = (char *)kFSCacheAddr; unsigned long gCacheHits; unsigned long gCacheMisses; ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ext2fs.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ext2fs.h#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ext2fs_bswap.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ext2fs_dinode.h#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ext2fs_dir.h#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/fs.c#2 (text+ko) ==== @@ -53,6 +53,7 @@ #define kNumPartInfos (16) static PartInfo gParts[kNumPartInfos]; +static char gMakeDirSpec[1024]; // Private function prototypes long LookupPartition(char *devSpec); @@ -86,6 +87,18 @@ { long ret, index = 0; char *curName; + + if (!dirSpec) { + long idx, len; + + len = strlen(name); + + for (idx = len; idx && (name[idx] != '\\'); idx--) {} + idx++; + strncpy(gMakeDirSpec, name, idx); + name += idx; + dirSpec = gMakeDirSpec; + } while (1) { ret = GetDirEntry(dirSpec, &index, &curName, flags, time); ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/hfs.c#2 (text+ko) ==== @@ -43,6 +43,7 @@ static CICell gCurrentIH; static long long gAllocationOffset; static long gIsHFSPlus; +static long gCaseSensitive; static long gBlockSize; static char gBTreeHeaderBuffer[512]; static BTHeaderRec *gBTHeaders[2]; @@ -82,6 +83,8 @@ extern long FastRelString(char *str1, char *str2); extern long FastUnicodeCompare(u_int16_t *uniStr1, u_int32_t len1, u_int16_t *uniStr2, u_int32_t len2); +extern long BinaryUnicodeCompare(u_int16_t *uniStr1, u_int32_t len1, + u_int16_t *uniStr2, u_int32_t len2); extern void utf_encodestr(const u_int16_t *ucsp, int ucslen, u_int8_t *utf8p, u_int32_t bufsize); extern void utf_decodestr(const u_int8_t *utf8p, u_int16_t *ucsp, @@ -99,6 +102,7 @@ gAllocationOffset = 0; gIsHFSPlus = 0; + gCaseSensitive = 0; gBTHeaders[0] = 0; gBTHeaders[1] = 0; @@ -139,7 +143,8 @@ Read(ih, (long)gHFSPlusHeader, kBlockSize); // Not a HFS[+] volume. - if (gHFSPlus->signature != kHFSPlusSigWord) return -1; + if ((gHFSPlus->signature != kHFSPlusSigWord) && + (gHFSPlus->signature != kHFSXSigWord)) return -1; gIsHFSPlus = 1; gBlockSize = gHFSPlus->blockSize; @@ -495,6 +500,10 @@ gBTreeHeaderBuffer + btree * 256, 0); gBTHeaders[btree] = (BTHeaderRec *)(gBTreeHeaderBuffer + btree * 256 + sizeof(BTNodeDescriptor)); + if ((gIsHFSPlus && btree == kBTreeCatalog) && + (gBTHeaders[btree]->keyCompareType == kHFSBinaryCompare)) { + gCaseSensitive = 1; + } } curNode = gBTHeaders[btree]->rootNode; @@ -745,10 +754,17 @@ if ((searchKey->nodeName.length == 0) || (trialKey->nodeName.length == 0)) result = searchKey->nodeName.length - trialKey->nodeName.length; else - result = FastUnicodeCompare(&searchKey->nodeName.unicode[0], - searchKey->nodeName.length, - &trialKey->nodeName.unicode[0], - trialKey->nodeName.length); + if (gCaseSensitive) { + result = BinaryUnicodeCompare(&searchKey->nodeName.unicode[0], + searchKey->nodeName.length, + &trialKey->nodeName.unicode[0], + trialKey->nodeName.length); + } else { + result = FastUnicodeCompare(&searchKey->nodeName.unicode[0], + searchKey->nodeName.length, + &trialKey->nodeName.unicode[0], + trialKey->nodeName.length); + } } return result; ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/net.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ufs.c#2 (text+ko) ==== @@ -52,12 +52,8 @@ static long ReadFile(InodePtr fileInode, long *length); -#define kDevBlockSize (0x200) // Size of each disk block. -#define kDiskLableBlock (15) // Block the DL is in. - static CICell gCurrentIH; static long long gPartitionBase; -static char gDLBuf[8192]; static char gFSBuf[SBSIZE]; static struct fs *gFS; static long gBlockSize; @@ -74,9 +70,6 @@ long UFSInitPartition(CICell ih) { - disk_label_t *dl; - partition_t *part; - if (ih == gCurrentIH) return 0; printf("UFSInitPartition: %x\n", ih); @@ -92,30 +85,7 @@ gFS = (struct fs *)gFSBuf; if (gFS->fs_magic != FS_MAGIC) { - // Did not find it... Look for the Disk Label. - // Look for the Disk Label - Seek(ih, 1ULL * kDevBlockSize * kDiskLableBlock); - Read(ih, (long)gDLBuf, 8192); - - dl = (disk_label_t *)gDLBuf; - byte_swap_disklabel_in(dl); - - if (dl->dl_version != DL_VERSION) { - return -1; - } - - part = &dl->dl_part[0]; - gPartitionBase = (1ULL * (dl->dl_front + part->p_base) * dl->dl_secsize) - - (1ULL * (dl->dl_label_blkno - kDiskLableBlock) * kDevBlockSize); - - // Re-read the Super Block. - Seek(ih, gPartitionBase + SBOFF); - Read(ih, (long)gFSBuf, SBSIZE); - - gFS = (struct fs *)gFSBuf; - if (gFS->fs_magic != FS_MAGIC) { - return -1; - } + return -1; } // Calculate the block size and set up the block cache. ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ufs_byteorder.c#2 (text+ko) ==== @@ -77,102 +77,6 @@ } -static inline void -byte_swap_disklabel_common(disk_label_t *dl) -{ - - swapBigLongToHost(dl->dl_version); /* ditto */ - swapBigLongToHost(dl->dl_label_blkno); - swapBigLongToHost(dl->dl_size); - swapBigLongToHost(dl->dl_flags); - swapBigLongToHost(dl->dl_tag); -// swapBigShortToHost(dl->dl_checksum); -// if (dl->dl_version >= DL_V3) -// swapBigShortToHost(dl->dl_un.DL_v3_checksum); -// else -// swapBigIntsToHost(dl->dl_un.DL_bad, NBAD); - -} - - -void -byte_swap_disklabel_in(disk_label_t *dl) -{ - - byte_swap_disklabel_common(dl); - byte_swap_disktab_in(&dl->dl_dt); - -} - - -static inline void -byte_swap_disktab_common(struct disktab *dt) -{ - - register unsigned int i; - - swapBigLongToHost(dt->d_secsize); - swapBigLongToHost(dt->d_ntracks); - swapBigLongToHost(dt->d_nsectors); - swapBigLongToHost(dt->d_ncylinders); -// swapBigLongToHost(dt->d_rpm); - swapBigShortToHost(dt->d_front); - swapBigShortToHost(dt->d_back); -// swapBigShortToHost(dt->d_ngroups); -// swapBigShortToHost(dt->d_ag_size); -// swapBigShortToHost(dt->d_ag_alts); -// swapBigShortToHost(dt->d_ag_off); -// swapBigIntsToHost(dt->d_boot0_blkno, NBOOTS); - - for (i=0; i < NPART; i++) - byte_swap_partition(&dt->d_partitions[i]); - -} - -/* - * This is particularly grody. The beginning of the partition array is two - * bytes low on the 68 wrt natural alignment rules. Furthermore, each - * element of the partition table is two bytes smaller on 68k due to padding - * at the end of the struct. - */ -void -byte_swap_disktab_in(struct disktab *dt) -{ - - struct partition *pp; - int i; - - /* - * Shift each struct partition up in memory by 2 + 2 * offset bytes. - * Do it backwards so we don't overwrite anything. - */ - for (i=NPART - 1; i >=0; i--) { - struct partition temp; - pp = &dt->d_partitions[i]; - /* beware: compiler doesn't do overlapping struct assignment */ - temp = *(struct partition *)(((char *) pp) - 2 * (i + 1)); - *pp = temp; - } - - byte_swap_disktab_common(dt); - -} - - -void -byte_swap_partition(struct partition *part) -{ - - swapBigLongToHost(part->p_base); - swapBigLongToHost(part->p_size); - swapBigShortToHost(part->p_bsize); - swapBigShortToHost(part->p_fsize); - swapBigShortToHost(part->p_cpg); - swapBigShortToHost(part->p_density); - -} - - void byte_swap_inode_in(struct dinode *dc, struct dinode *ic) { ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/fs.subproj/ufs_byteorder.h#2 (text+ko) ==== @@ -43,10 +43,8 @@ #include <sys/param.h> #include <sys/types.h> -#include <sys/disktab.h> #include <sys/vnode.h> #include <sys/buf.h> -#include <dev/disk.h> #include <ufs/ufs/quota.h> #include <ufs/ufs/inode.h> #include <ufs/ffs/fs.h> @@ -54,8 +52,5 @@ void byte_swap_ints(int *array, int count); void byte_swap_shorts(short *array, int count); -void byte_swap_disklabel_in(disk_label_t *dl); -void byte_swap_disktab_in(struct disktab *dt); -void byte_swap_partition(struct partition *part); void byte_swap_inode_in(struct dinode *dc, struct dinode *ic); void byte_swap_dir_block_in(char *addr, int count); ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/Makefile#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/Makefile.postamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/Makefile.preamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/PB.project#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/boot_args.h#2 (text+ko) ==== @@ -25,7 +25,7 @@ /* * boot_args.h - Data stuctures for the information passed to the kernel. * - * Copyright (c) 1998-2000 Apple Computer, Inc. + * Copyright (c) 1998-2003 Apple Computer, Inc. * * DRI: Josh de Cesare */ @@ -59,7 +59,8 @@ // Boot argument structure - passed into kernel at boot time. #define kBootArgsRevision (1) -#define kBootArgsVersion (1) +#define kBootArgsVersion1 (1) +#define kBootArgsVersion2 (2) #define BOOT_LINE_LENGTH (256) @@ -76,4 +77,17 @@ }; typedef struct boot_args boot_args, *boot_args_ptr; +struct compressed_kernel_header { + u_int32_t signature; + u_int32_t compress_type; + u_int32_t adler32; + u_int32_t uncompressed_size; + u_int32_t compressed_size; + u_int32_t reserved[11]; + char platform_name[64]; + char root_path[256]; + u_int8_t data[0]; +}; +typedef struct compressed_kernel_header compressed_kernel_header; + #endif /* ! _BOOTX_BOOT_ARGS_H_ */ ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/ci.h#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/device_tree.h#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/fs.h#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/libclite.h#2 (text+ko) ==== @@ -41,7 +41,7 @@ #include <stddef.h> // ci_io.c -extern void putchar(int ch); +extern int putchar(int ch); // prf.c extern void prf(const char *fmt, unsigned int *adx, void (*putfn_p)(), @@ -83,7 +83,7 @@ // mem.c extern void *memcpy(void *dst, const void *src, size_t len); extern void *memset(void *dst, int ch, size_t len); -extern void *bcopy(void *src, void *dst, int len); +extern void bcopy(const void *src, void *dst, size_t len); extern void bzero(void *dst, int len); // bsearch.c ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/sl.h#2 (text+ko) ==== @@ -25,7 +25,7 @@ /* * sl.h - Headers for configuring the Secondary Loader * - * Copyright (c) 1998-2002 Apple Computer, Inc. + * Copyright (c) 1998-2003 Apple Computer, Inc. * * DRI: Josh de Cesare */ @@ -37,33 +37,26 @@ /* -Memory Map... Assumes 32 MB +Memory Map: assumes 96 MB Physical Address -Open Firmware Version 1x, 2x 3x -00000000 - 00003FFF : Exception Vectors -00004000 - 002FFFFF : Free Memory -00300000 - 004FFFFF : OF Image / Free Memory -00500000 - 01DFFFFF : Free Memory -01E00000 - 01FFFFFF : Free Memory / OF Image +Open Firmware Version 3x, 4x, ... +00000000 - 00003FFF : Exception Vectors +00004000 - 057FFFFF : Free Memory +05800000 - 05FFFFFF : OF Image Logical Address 00000000 - 00003FFF : Exception Vectors -00004000 - 013FFFFF : Kernel Image, Boot Struct and Drivers -01400000 - 01BFFFFF : File Load Area -01C00000 - 01CFFFFF : Secondary Loader Image -01D00000 - 01DFFFFF : Malloc Area -01E00000 - 01FFFFFF : Unused - -To provide a consistant Logical Memory Usage between OF 1,2 and OF 3 -the Logical Addresses 0x00300000 - 0x004FFFFF will be mapped to -Physical Address 0x01E00000 - 0x01FFFFFF and will be copied back -just before the kernel is loaded. +00004000 - 03FFFFFF : Kernel Image, Boot Struct and Drivers +04000000 - 04FFFFFF : File Load Area +05000000 - 053FFFFF : FS Cache +05400000 - 055FFFFF : Malloc Zone +05600000 - 057FFFFF : BootX Image +05800000 - 05FFFFFF : Unused - */ #define kVectorAddr (0x00000000) @@ -71,22 +64,25 @@ // OF 3.x #define kImageAddr (0x00004000) -#define kImageSize (0x013FC000) +#define kImageSize (0x03FFC000) // OF 1.x 2.x #define kImageAddr0 (0x00004000) #define kImageSize0 (0x002FC000) #define kImageAddr1 (0x00300000) #define kImageSize1 (0x00200000) -#define kImageAddr1Phys (0x01E00000) +#define kImageAddr1Phys (0x05800000) #define kImageAddr2 (0x00500000) -#define kImageSize2 (0x00F00000) +#define kImageSize2 (0x03B00000) + +#define kLoadAddr (0x04000000) +#define kLoadSize (0x01000000) -#define kLoadAddr (0x01400000) -#define kLoadSize (0x00800000) +#define kFSCacheAddr (0x05000000) +#define kFSCacheSize (0x00400000) -#define kMallocAddr (0x01D00000) -#define kMallocSize (0x00100000) +#define kMallocAddr (0x05400000) +#define kMallocSize (0x00200000) // Default Output Level #define kOutputLevelOff (0) @@ -96,6 +92,7 @@ #define kOFVersion1x (0x01000000) #define kOFVersion2x (0x02000000) #define kOFVersion3x (0x03000000) +#define kOFVersion4x (0x04000000) // Device Types enum { @@ -162,9 +159,9 @@ extern long gBootMode; extern long gBootDeviceType; extern long gBootFileType; +extern char gHaveKernelCache; extern char gBootDevice[256]; extern char gBootFile[256]; -extern char gRootDir[256]; extern char gTempStr[4096]; @@ -174,6 +171,9 @@ extern char *gKeyMap; +extern long gRootAddrCells; +extern long gRootSizeCells; + extern CICell gChosenPH; extern CICell gOptionsPH; extern CICell gScreenPH; @@ -185,6 +185,7 @@ extern CICell gStdOutIH; extern CICell gKeyboardIH; +extern long ThinFatBinary(void **binary, unsigned long *length); extern long GetDeviceType(char *devSpec); extern long ConvertFileSpec(char *fileSpec, char *devSpec, char **filePath); extern long MatchThis(CICell phandle, char *string); @@ -194,10 +195,12 @@ extern unsigned long Alder32(unsigned char *buffer, long length); // Externs for macho.c -extern long DecodeMachO(void); +extern long ThinFatBinaryMachO(void **binary, unsigned long *length); +extern long DecodeMachO(void *binary); // Externs for elf.c -extern long DecodeElf(void); +extern long ThinFatBinaryElf(void **binary, unsigned long *length); +extern long DecodeElf(void *binary); // Externs for device_tree.c extern long FlattenDeviceTree(void); @@ -217,4 +220,7 @@ extern long InitConfig(void); extern long ParseConfigFile(char *addr); +// Externs for lzss.c +extern int decompress_lzss(u_int8_t *dst, u_int8_t *src, u_int32_t srclen); + #endif /* ! _BOOTX_SL_H_ */ ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/include.subproj/sl_words.h#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/Makefile#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/Makefile.postamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/Makefile.preamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/PB.project#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/bsearch.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/bswap.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/mem.c#2 (text+ko) ==== @@ -79,9 +79,9 @@ return dst; } -void *bcopy(void *src, void *dst, int len) +void bcopy(const void *src, void *dst, size_t len) { - return memcpy(dst, src, len); + memcpy(dst, src, len); } void bzero(void *dst, int len) ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/prf.c#2 (text+ko) ==== @@ -50,6 +50,7 @@ #define SPACE 1 #define ZERO 2 +#define UCASE 16 /* * Scaled down version of C Library printf. @@ -80,7 +81,7 @@ } cp = prbuf; do { - *cp++ = "0123456789abcdef"[n%b]; + *cp++ = "0123456789abcdef0123456789ABCDEF"[(flag & UCASE) + n%b]; n /= b; width++; } while (n); @@ -140,7 +141,10 @@ minwidth *= 10; minwidth += c - '0'; goto again; - case 'x': case 'X': + case 'X': + flag |= UCASE; + /* fall through */ + case 'x': b = 16; goto number; case 'd': ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/printf.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/sprintf.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/string.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/strtol.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/libclite.subproj/zalloc.c#2 (text+ko) ==== @@ -32,14 +32,14 @@ /* * zalloc.c - malloc functions. * - * Copyright (c) 1998-2000 Apple Computer, Inc. + * Copyright (c) 1998-2003 Apple Computer, Inc. * * DRI: Josh de Cesare */ #include <libclite.h> -#define ZALLOC_NODES 384 +#define ZALLOC_NODES 768 #define ZDEBUG 0 ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/Makefile#2 (text+ko) ==== @@ -14,7 +14,7 @@ HFILES = appleboot.h clut.h elf.h failedboot.h netboot.h -CFILES = main.c macho.c device_tree.c display.c drivers.c elf.c +CFILES = main.c macho.c device_tree.c display.c drivers.c elf.c lzss.c OTHERSRCS = Makefile.preamble Makefile Makefile.postamble ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/Makefile.postamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/Makefile.preamble#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/PB.project#2 (text+ko) ==== @@ -14,7 +14,7 @@ netboot.h ); M_FILES = (); - OTHER_LINKED = (main.c, macho.c, device_tree.c, display.c, elf.c, drivers.c); + OTHER_LINKED = (main.c, macho.c, device_tree.c, display.c, elf.c, drivers.c, lzss.c); OTHER_SOURCES = (Makefile.preamble, Makefile, Makefile.postamble); SUBPROJECTS = (); TOOLS = (); ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/appleboot.h#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/clut.h#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/device_tree.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/display.c#2 (text+ko) ==== ==== //depot/projects/trustedbsd/sedarwin73/apsl/BootX/bootx.tproj/sl.subproj/drivers.c#2 (text+ko) ==== @@ -32,6 +32,8 @@ #include <sl.h> +#define DRIVER_DEBUG 0 + enum { kTagTypeNone = 0, kTagTypeDict, @@ -133,11 +135,12 @@ static void FreeTag(TagPtr tag); static char *NewSymbol(char *string); static void FreeSymbol(char *string); +#if DRIVER_DEBUG static void DumpTag(TagPtr tag, long depth); +#endif static ModulePtr gModuleHead, gModuleTail; static TagPtr gPersonalityHead, gPersonalityTail; -static char gExtensionsSpec[4096]; static char gDriverSpec[4096]; static char gFileSpec[4096]; static char gTempSpec[4096]; @@ -150,9 +153,7 @@ if (gBootFileType == kNetworkDeviceType) { NetLoadDrivers(dirSpec); } else if (gBootFileType == kBlockDeviceType) { - strcpy(gExtensionsSpec, dirSpec); - strcat(gExtensionsSpec, "System\\Library\\"); - FileLoadDrivers(gExtensionsSpec, 0); + FileLoadDrivers(dirSpec, 0); } else { >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200404081808.i38I8O15041909>