Chameleon

Chameleon Commit Details

Date:2010-08-06 21:40:30 (13 years 7 months ago)
Author:Azimutz
Commit:318
Parents: 317
Message:More clean up...
Changes:
M/branches/azimutz/Chazileon/i386/libsaio/platform.c
M/branches/azimutz/Chazileon/i386/libsaio/saio_types.h
M/branches/azimutz/Chazileon/i386/boot2/kernel_patcher.c
M/branches/azimutz/Chazileon/i386/libsaio/usb.c
M/branches/azimutz/Chazileon/i386/libsaio/sys.c

File differences

branches/azimutz/Chazileon/i386/libsaio/usb.c
2222
2323
2424
25
2526
2627
2728
......
3738
3839
3940
41
4042
4143
4244
4345
4446
4547
48
4649
4750
4851
......
5861
5962
6063
64
6165
6266
6367
64
68
69
6570
66
67
68
69
70
71
7172
72
73
7374
7475
7576
76
77
78
77
78
79
7980
8081
8182
......
8687
8788
8889
89
90
91
92
90
91
9392
9493
9594
9695
9796
98
99
97
10098
10199
102100
101
103102
104103
105104
......
201200
202201
203202
204
203
205204
206205
207206
......
209208
210209
211210
212
211
213212
214213
215214
#define DBG(x...)
#endif
struct pciList
{
pci_dt_t* pciDev;
// Add usb device to the list
void notify_usb_dev(pci_dt_t *pci_dev)
{
struct pciList* current = usbList;
if(!usbList)
{
usbList = (struct pciList*)malloc(sizeof(struct pciList));
usbList->next = NULL;
usbList->pciDev = pci_dev;
}
else
{
}
}
// Loop through the list and call the apropriate patch function
int usb_loop()
{
int retVal = 1;
bool fix_ehci, fix_uhci, fix_legacy, fix_usb;
bool fix_ehci, fix_uhci, fix_usb, fix_legacy;
fix_ehci = fix_uhci = fix_usb = fix_legacy = false;
fix_ehci = fix_uhci = fix_legacy = fix_usb = false;
getBoolForKey(kUSBBusFixKey, &fix_usb, &bootInfo->bootConfig);
if (fix_usb)
if (getBoolForKey(kUSBBusFix, &fix_usb, &bootInfo->bootConfig))
{
fix_ehci = fix_uhci = fix_legacy = true;
fix_ehci = fix_uhci = fix_legacy = fix_usb;// Disable all if none set
}
else
{
getBoolForKey(kEHCIacquireKey, &fix_ehci, &bootInfo->bootConfig);
getBoolForKey(kUHCIresetKey, &fix_uhci, &bootInfo->bootConfig);
getBoolForKey(kLegacyOffKey, &fix_legacy, &bootInfo->bootConfig);
getBoolForKey(kEHCIacquire, &fix_ehci, &bootInfo->bootConfig);
getBoolForKey(kUHCIreset, &fix_uhci, &bootInfo->bootConfig);
getBoolForKey(kLegacyOff, &fix_legacy, &bootInfo->bootConfig);
}
struct pciList* current = usbList;
{
// EHCI
case 0x20:
if (fix_ehci)
retVal &= ehci_acquire(current->pciDev);
if (fix_legacy)
retVal &= legacy_off(current->pciDev);
if(fix_ehci) retVal &= ehci_acquire(current->pciDev);
if(fix_legacy) retVal &= legacy_off(current->pciDev);
break;
// UHCI
case 0x00:
if (fix_uhci)
retVal &= uhci_reset(current->pciDev);
if (fix_uhci) retVal &= uhci_reset(current->pciDev);
break;
}
current = current->next;
}
return retVal;
int ehci_acquire (pci_dt_t *pci_dev)
{
intj, k;
intj, k;
uint32_tbase;
uint8_teecp;
uint8_tlegacy[8];
boolalwaysHardBIOSReset;
alwaysHardBIOSReset = false;
if (!getBoolForKey(kEHCIhardKey, &alwaysHardBIOSReset, &bootInfo->bootConfig)) {
if (!getBoolForKey(kEHCIhard, &alwaysHardBIOSReset, &bootInfo->bootConfig)) {
alwaysHardBIOSReset = true;
}
branches/azimutz/Chazileon/i386/libsaio/sys.c
9595
9696
9797
98
98
9999
100100
101101
{ "hd", 0x80, kBIOSDevTypeHardDrive }, /* DEV_HD */
{ "en", 0xE0, kBIOSDevTypeNetwork }, /* DEV_EN */
{ "rd", 0x100, kBIOSDevTypeHardDrive },
{ "bt", 0x101, kBIOSDevTypeHardDrive }, // turbo - type for booter partition Azi: or ramdisk bt aliased!
{ "bt", 0x101, kBIOSDevTypeHardDrive }, // turbo - type for booter partition Azi: or ramdisk bt aliased??
{ 0, 0 }
};
branches/azimutz/Chazileon/i386/libsaio/platform.c
3838
3939
4040
41
42
41
4342
43
4444
45
46
45
46
4747
48
49
50
51
52
53
54
55
48
49
5650
5751
5852
5953
60
54
6155
6256
6357
}
/** scan mem for memory autodection purpose */
void scan_mem()
{
void scan_mem() {
static bool done = false;
if (done) return;
if (done)
return;
bool useAutodetection = true;
getBoolForKey(kUseMemDetect, &useAutodetection, &bootInfo->bootConfig);
bool useAutodetection = true; //Azi:default
getBoolForKey(kUseMemDetectKey, &useAutodetection, &bootInfo->bootConfig);
if (useAutodetection)
{
if (dram_controller_dev != NULL)
{
if (useAutodetection) {
if (dram_controller_dev!=NULL) {
scan_dram_controller(dram_controller_dev); // Rek: pci dev ram controller direct and fully informative scan ...
}
scan_memory(&Platform); // unfortunately still necesary for some comp where spd cant read correct speed
scan_spd(&Platform);
//pause(); //Azi:---
//getc();
}
done = true;
}
branches/azimutz/Chazileon/i386/libsaio/saio_types.h
215215
216216
217217
218
218
219219
220220
221221
kPartitionTypeHPFS = 0x07,
kPartitionTypeFAT16 = 0x06,
kPartitionTypeFAT32 = 0x0c,
kPartitionTypeEXT3 = 0x83 //Azi:---
kPartitionTypeEXT3 = 0x83
};
//#define BIOS_DEV_TYPE(d) ((d) & kBIOSDevTypeMask)
branches/azimutz/Chazileon/i386/boot2/kernel_patcher.c
1414
1515
1616
17
18
17
18
1919
2020
2121
......
109109
110110
111111
112
113112
114113
115114
#define SYMBOL_PANIC1
#define SYMBOL_PMCPUEXITHALTTOOFF2
#define SYMBOL_LAPIC_INIT3
#define SYMBOL_COMMPAGE_STUFF_ROUTINE4 // not needed to boot -legacy :)
#define NUM_SYMBOLS5 // change according nr of simbols
#define SYMBOL_COMMPAGE_STUFF_ROUTINE4 //Azi: not needed to boot -legacy
#define NUM_SYMBOLS5
#define SYMBOL_CPUID_SET_INFO_STRING"_cpuid_set_info"
#define SYMBOL_PANIC_STRING"_panic"
// Unknown CPU's
default:
// TODO: Impersonate CPU based on user selection
//patch_cpuid_set_info(kernelData, CPUFAMILY_INTEL_PENRYN, CPUID_MODEL_PENRYN); // Impersonate CPU
patch_cpuid_set_info(kernelData, 0, 0);// Remove Panic Call
break;

Archive Download the corresponding diff file

Revision: 318