Chameleon

Chameleon Commit Details

Date:2011-06-14 04:58:26 (8 years 2 days ago)
Author:Azimutz
Commit:1010
Parents: 1009
Message:Small rearrangement on boot.h. Add comment and fix indentation on LoadDrivers(); r937 is a "no go"! Clean relocated/disabled code on load.c. Clean white space on makefiles and shorten some lines of code.
Changes:
M/trunk/i386/boot2/drivers.c
M/trunk/i386/Makefile
M/trunk/i386/boot2/boot.h
M/trunk/i386/boot2/Makefile
M/trunk/i386/config/Makefile
M/trunk/i386/libsaio/load.c

File differences

trunk/i386/libsaio/load.c
249249
250250
251251
252
253
254
255
256
257
258
259252
260253
261254
return 0;
}
/*#if DEBUG
printf("segname: %s, vmaddr: %x, vmsize: %x, fileoff: %x, filesize: %x, nsects: %d, flags: %x.\n",
segCmd->segname, (unsigned)vmaddr, (unsigned)vmsize, (unsigned)fileaddr, (unsigned)filesize,
(unsigned) segCmd->nsects, (unsigned)segCmd->flags);
getc();
#endif*/
if (! ((vmaddr >= KERNEL_ADDR &&
(vmaddr + vmsize) <= (KERNEL_ADDR + KERNEL_LEN)) ||
(vmaddr >= HIB_ADDR &&
trunk/i386/boot2/drivers.c
183183
184184
185185
186
186
187187
188188
189189
......
222222
223223
224224
225
226225
226
227227
228228
229229
230
231
230
231
232232
233
233
234234
235235
236236
237237
238
239
240
241
242
243
244
245
246
247
248
249
238
239
240
241
242
243
244
245
246
247
248
249
250
250251
251
252252
253253
254254
}
else if ( gBootFileType == kBlockDeviceType )
{
if(!gHaveKernelCache)
if (!gHaveKernelCache)
{
// Non-prelinked kernel, load system mkext.
// NOTE: In it's default state, XNU cannot be both prelinked, and load additional drivers
}
}
//Azi: dependencies still need to be added to E/E.mkext!!
// First try to load Extra extensions from the ramdisk if isn't aliased as bt(0,0).
if (gRAMDiskVolume && !gRAMDiskBTAliased)
{
strcpy(dirSpecExtra, "rd(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
strcpy(dirSpecExtra, "rd(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
}
// Next try to load Extra extensions from the selected root partition.
strcpy(dirSpecExtra, "/Extra/");
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// If failed, then try to load Extra extensions from the boot partition
// in case we have a separate booter partition or a bt(0,0) aliased ramdisk.
if ( !(gBIOSBootVolume->biosdev == gBootVolume->biosdev && gBIOSBootVolume->part_no == gBootVolume->part_no)
|| (gRAMDiskVolume && gRAMDiskBTAliased) )
{
// Next try a specfic OS version folder ie 10.5
sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion);
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// Next we'll try the base
strcpy(dirSpecExtra, "bt(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
// If failed, then try to load Extra extensions from the boot partition
// in case we have a separate booter partition or a bt(0,0) aliased ramdisk.
if ( !(gBIOSBootVolume->biosdev == gBootVolume->biosdev && gBIOSBootVolume->part_no == gBootVolume->part_no)
|| (gRAMDiskVolume && gRAMDiskBTAliased) )
{
// Next try a specfic OS version folder ie 10.5
sprintf(dirSpecExtra, "bt(0,0)/Extra/%s/", &gMacOSVersion);
if (FileLoadDrivers(dirSpecExtra, 0) != 0)
{
// Next we'll try the base
strcpy(dirSpecExtra, "bt(0,0)/Extra/");
FileLoadDrivers(dirSpecExtra, 0);
}
}
}
}
}
else
trunk/i386/boot2/Makefile
2323
2424
2525
26
26
2727
2828
2929
......
4343
4444
4545
46
46
47
4748
4849
4950
......
112113
113114
114115
115
116116
117117
118118
......
122122
123123
124124
125
126125
127
128
129
130126
131127
132
128
129
133130
134131
135
136132
137133
138134
......
145141
146142
147143
148
149144
150145
151146
......
153148
154149
155150
156
151
157152
158153
159154
160155
161
162156
163157
164158
-fno-builtin -DSAIO_INTERNAL_USER -static $(OMIT_FRAME_POINTER_CFLAG) \
-mpreferred-stack-boundary=2 -fno-align-functions -fno-stack-protector \
-march=pentium4 -msse2 -mfpmath=sse -msoft-float -nostdinc -include $(SRCROOT)/autoconf.h
CPPFLAGS := $(CPPFLAGS) -nostdinc++ -include $(SRCROOT)/autoconf.h
DEFINES=
# The ordering is important;
# boot2.o must be first.
OBJS = boot2.o boot.o graphics.o drivers.o prompt.o options.o lzss.o mboot.o \
ramdisk.o picopng.o resume.o bmdecompress.o graphic_utils.o gui.o modules.o modules_support.o boot_modules.o
ramdisk.o picopng.o resume.o bmdecompress.o graphic_utils.o gui.o modules.o \
modules_support.o boot_modules.o
# button.o browser.o scrollbar.o == NOTYET
UTILDIR = ../util
@${RM} $(SYMROOT)/${SYMBOLS_MODULE}
@$(LD) -arch i386 \
-undefined dynamic_lookup \
-dylib -read_only_relocs suppress \
-final_output Symbols \
-macosx_version_min 10.6 \
-o $(OBJROOT)/Symbols_LINKER_ONLY.dylib
endif
@make embed_symbols# this is done in a sub process after boot.sys exists so the strings are populated correctly
# this is done in a sub process after boot.sys exists so the strings are populated correctly
@make embed_symbols
@${RM} $(SYMROOT)/boot2.sys
@( size=`ls -l $(SYMROOT)/boot | awk '{ print $$5}'` ; \
if expr "$$size" ">" "$(MAXBOOTSIZE)" > /dev/null ;\
echo "\t******* boot is $$size bytes *******"; \
fi)
embed_symbols:
ifeq (${CONFIG_MODULES}, y)
@echo ================= Embedding Symbols.dylib =================
@$(SYMROOT)/machOconv $(SYMROOT)/boot2.sys $(SYMROOT)/boot &> /dev/null
@echo "\t******* Patching at $(PATCH_ADDR) ******"
@stat -f%z $(SYMROOT)/boot | perl -ane "print pack('V',@F[0]);" | dd conv=notrunc of=${SYMROOT}/boot.sys bs=1 count=4 seek=$(PATCH_ADDR) &> /dev/null
@stat -f%z $(SYMROOT)/boot | perl -ane "print pack('V',@F[0]);" | dd conv=notrunc of=${SYMROOT}/boot.sys bs=1 count=4 seek=$(PATCH_ADDR) &> /dev/null
endif
@echo "\t[MACHOCONV] boot"
@$(SYMROOT)/machOconv $(SYMROOT)/boot.sys $(SYMROOT)/boot
$(SYMROOT)/art.h:
@if [ "$(PNGCRUSH)" ]; then\
echo "optimizing art files ...\n$(PNGCRUSH) $(PNGOPTIONS) artwork/$(THEME)"; \
trunk/i386/boot2/boot.h
3838
3939
4040
41
42
4143
4244
4345
46
4447
4548
4649
......
6871
6972
7073
71
72
73
74
7574
7675
7776
78
79
80
8177
8278
8379
......
8581
8682
8783
84
8885
8986
87
9088
9189
9290
91
92
93
94
95
96
97
98
9399
94100
95101
96102
97103
98
99
100
101104
102105
103106
104107
105
106
107108
108109
109
110
111
112
113110
114111
115112
#define kTextModeKey"Text Mode"
#define kQuietBootKey"Quiet Boot"
#define kKernelFlagsKey"Kernel Flags"
#define karch"arch"/* boot.c */
#define kProductVersion"ProductVersion"/* boot.c */
#define kMKextCacheKey"MKext Cache"
#define kKernelNameKey"Kernel"
#define kKernelCacheKey"Kernel Cache"
#define kUseKernelCache"UseKernelCache"/* boot.c */
#define kBootDeviceKey"Boot Device"
#define kTimeoutKey"Timeout"
#define kRootDeviceKey"rd"
#define kEnableC3States"EnableC3State"/* acpi_patcher.c */
#define kEnableC4States"EnableC4State"/* acpi_patcher.c */
#define kUseAtiROM"UseAtiROM"/* ati.c */
#define kAtiConfig"AtiConfig"/* ati.c */
#define kATYbinimage"ATYbinimage"/* ati.c */
#define kWake"Wake"/* boot.c */
#define kForceWake"ForceWake"/* boot.c */
#define kWakeImage"WakeImage"/* boot.c */
#define kProductVersion"ProductVersion"/* boot.c */
#define karch"arch"/* boot.c */
#define kUseKernelCache"UseKernelCache"/* boot.c */
#define kbusratio"busratio"/* cpu.c */
#define kHidePartition"Hide Partition"/* disk.c */
#define kRenamePartition"Rename Partition"/* disk.c */
#define kDefaultPartition"Default Partition"/* sys.c */
#define kSMBIOSKey"SMBIOS"/* fake_efi.c */
#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
#define kSystemID"SystemId"/* fake_efi.c */
#define kSystemType"SystemType"/* fake_efi.c */
#define kUseMemDetect"UseMemDetect" /* platform.c */
#define kPCIRootUID"PCIRootUID"/* pci_root.c */
#define kUseAtiROM"UseAtiROM"/* ati.c */
#define kAtiConfig"AtiConfig"/* ati.c */
#define kATYbinimage"ATYbinimage"/* ati.c */
#define kUseNvidiaROM"UseNvidiaROM"/* nvidia.c */
#define kVBIOS"VBIOS"/* nvidia.c */
#define kdcfg0 "display_0"/* nvidia.c */
#define kdcfg1 "display_1"/* nvidia.c */
#define kPCIRootUID"PCIRootUID"/* pci_root.c */
#define kEthernetBuiltIn"EthernetBuiltIn"/* pci_setup.c */
#define kGraphicsEnabler"GraphicsEnabler"/* pci_setup.c */
#define kForceHPET"ForceHPET"/* pci_setup.c */
#define kUseMemDetect"UseMemDetect" /* platform.c */
#define kMD0Image"md0"/* ramdisk.h */
#define kSMBIOSdefaults"SMBIOSdefaults"/* smbios_patcher.c */
#define kDefaultPartition"Default Partition"/* sys.c */
#define kUSBBusFix"USBBusFix"/* usb.c */
#define kEHCIacquire"EHCIacquire"/* usb.c */
#define kUHCIreset"UHCIreset"/* usb.c */
trunk/i386/config/Makefile
1515
1616
1717
18
19
20
1821
19
20
21
2222
2323
2424
25
2625
2726
28
29
3027
3128
3229
3330
3431
3532
36
37
38
3933
4034
4135
DIR = util
include ${SRCROOT}/Make.rules
OBJECTS = cconfig.o32 cconfig.o64 zconf.tab.o32 zconf.tab.o64 \
yesno.o32 yesno.o64 textbox.o32 textbox.o64 menubox.o32 \
menubox.o64 checklist.o32 checklist.o64 inputbox.o32 inputbox.o64
OBJECTS = cconfig.o32 cconfig.o64 zconf.tab.o32 zconf.tab.o64 yesno.o32 yesno.o64 textbox.o32 textbox.o64 menubox.o32 menubox.o64 checklist.o32 checklist.o64 inputbox.o32 inputbox.o64
DEFINES = -DKBUILD_NO_NLS -DCURSES_LOC=\<ncurses.h\> -DPATH_MAX=256 -DPACKAGE=\"chameleon\"
LDFLAGS = -lncurses -lmenu
PROGRAMS = cconfig
SYMPROG = $(addprefix $(SYMROOT)/, $(PROGRAMS))
DIRS_NEEDED = $(OBJROOT) $(SYMROOT)
all: $(DIRS_NEEDED) $(SYMPROG)
$(SYMPROG): $(addprefix $(OBJROOT)/, $(OBJECTS))
@echo "\t[LD32] $(@F)_32"
@$(CC) $(CFLAGS) $(LDFLAGS) $(DEFINES) -arch i386 -o $(SYMROOT)/$(@F)_32 $(OBJROOT)/*.o32
trunk/i386/Makefile
5151
5252
5353
54
54
5555
5656
5757
"RC_CFLAGS=$(RC_CFLAGS)" $@ \
) || exit $$?; \
done
config rebuild_config:
@for i in config; \
do \

Archive Download the corresponding diff file

Revision: 1010