Chameleon

Chameleon Commit Details

Date:2010-09-25 23:56:41 (13 years 6 months ago)
Author:Evan Lojewski
Commit:551
Parents: 550
Message:More bugfixes. more modules should work now. Memory module temperarily disabled.
Changes:
M/branches/meklort/i386/modules/Ethernet/Ethernet.c
M/branches/meklort/i386/modules/Makefile
M/branches/meklort/i386/boot2/boot.c
M/branches/meklort/i386/modules/USBFix/USBFix.c
M/branches/meklort/i386/modules/GraphicsEnabler/GraphicsEnabler.c
M/branches/meklort/i386/modules/GraphicsEnabler/nvidia.c
M/branches/meklort/i386/libsaio/pci.c
M/branches/meklort/i386/libsaio/saio_internal.h

File differences

branches/meklort/i386/libsaio/pci.c
2020
2121
2222
23
23
2424
2525
2626
......
137137
138138
139139
140
140
141
141142
142143
143144
......
150151
151152
152153
154
155
153156
154157
155158
156159
157
160
158161
159162
160163
......
174177
175178
176179
177
180
178181
179
182
180183
181184
182185
#endif
pci_dt_t*root_pci_dev;
static char* dev_path;
static char* dev_path;// TODO: Figure out what is going on here...
uint8_t pci_config_read8(uint32_t pci_addr, uint8_t reg)
void build_pci_dt(void)
{
dev_path = malloc(sizeof(char) * 256);
dev_path = malloc(sizeof(char) * 256);// TODO: remove
root_pci_dev = malloc(sizeof(pci_dt_t));
bzero(root_pci_dev, sizeof(pci_dt_t));
enable_pci_devs();
char *get_pci_dev_path(pci_dt_t *pci_dt)
{
char* buffer = malloc(sizeof(char) * 256);
pci_dt_t*current;
pci_dt_t*end;
chartmp[64];
dev_path[0] = 0;
buffer[0] = 0;
end = root_pci_dev;
int uid = getPciRootUID();
sprintf(tmp, "/Pci(0x%x,0x%x)",
current->dev.bits.dev, current->dev.bits.func);
}
strcat(dev_path, tmp);
sprintf(buffer, "%s%s", buffer, tmp);
}
return dev_path;
return buffer;
}
#ifndef OPTION_ROM
branches/meklort/i386/libsaio/saio_internal.h
172172
173173
174174
175
175
176176
177177
178178
extern long LoadVolumeFile(BVRef bvr, const char *fileSpec);
extern long LoadFile(const char *fileSpec);
extern long ReadFileAtOffset(const char * fileSpec, void *buffer, uint64_t offset, uint64_t length);
extern long LoadThinFatFile(const char *fileSpec, void **binary);
extern long LoadThinFatFile(const char *fileSpec, void **binary);
extern long GetDirEntry(const char *dirSpec, long long *dirIndex, const char **name,
long *flags, long *time);
extern long GetFileInfo(const char *dirSpec, const char *name,
branches/meklort/i386/boot2/boot.c
140140
141141
142142
143
144
143145
144146
145147
146148
147
149
148150
149151
150152
......
574576
575577
576578
577
578579
579580
580581
bootArgs->kaddr = bootArgs->ksize = 0;
execute_hook("ExecKernel", (void*)binary, NULL, NULL, NULL);
ret = DecodeKernel(binary,
&kernelEntry,
(char **) &bootArgs->kaddr,
(int *)&bootArgs->ksize );
if ( ret != 0 )
return ret;
} else {
/* Won't return if successful. */
// Notify modules that ExecKernel is about to be called
execute_hook("ExecKernel", binary, NULL, NULL, NULL);
ret = ExecKernel(binary);
}
}
branches/meklort/i386/modules/USBFix/USBFix.c
2525
2626
2727
28
2928
3029
3130
void USBFix_start()
{
//printf("Hooking 'ExecKernel'\n");
register_hook_callback("PCIDevice", &USBFix_pci_hook);
register_hook_callback("Kernel Start", &USBFix_start_hook);
branches/meklort/i386/modules/GraphicsEnabler/GraphicsEnabler.c
1515
1616
1717
18
1918
19
20
2021
2122
2223
......
2526
2627
2728
28
29
30
31
32
33
34
35
29
3630
37
31
32
33
34
35
36
37
3838
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
5457
58
5559
56
57
5860
#define kGraphicsEnabler"GraphicsEnabler"
void GraphicsEnabler_hook(void* arg1, void* arg2, void* arg3, void* arg4);
void GraphicsEnabler_hook(pci_dt_t* current, void* arg2, void* arg3, void* arg4);
void GraphicsEnabler_start()
{
register_hook_callback("PCIDevice", &GraphicsEnabler_hook);
void GraphicsEnabler_hook(pci_dt_t* current, void* arg2, void* arg3, void* arg4)
{
if(current->class_id != PCI_CLASS_DISPLAY_VGA) return;
char *devicepath = get_pci_dev_path(current);
bool do_gfx_devprop = false;
getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig);
if (do_gfx_devprop)
if(current && current->class_id == PCI_CLASS_DISPLAY_VGA)
{
switch (current->vendor_id)
char *devicepath = get_pci_dev_path(current);
bool do_gfx_devprop = false;
getBoolForKey(kGraphicsEnabler, &do_gfx_devprop, &bootInfo->bootConfig);
if (do_gfx_devprop)
{
case PCI_VENDOR_ID_ATI:
verbose("ATI VGA Controller [%04x:%04x] :: %s \n",
current->vendor_id, current->device_id, devicepath);
setup_ati_devprop(current);
break;
case PCI_VENDOR_ID_INTEL:
//message to be removed once support for these cards is added
verbose("Intel VGA Controller [%04x:%04x] :: %s (currently NOT SUPPORTED)\n",
current->vendor_id, current->device_id, devicepath);
break;
case PCI_VENDOR_ID_NVIDIA:
setup_nvidia_devprop(current);
break;
switch (current->vendor_id)
{
case PCI_VENDOR_ID_ATI:
verbose("ATI VGA Controller [%04x:%04x] :: %s \n",
current->vendor_id, current->device_id, devicepath);
setup_ati_devprop(current);
break;
case PCI_VENDOR_ID_INTEL:
//message to be removed once support for these cards is added
verbose("Intel VGA Controller [%04x:%04x] :: %s (currently NOT SUPPORTED)\n",
current->vendor_id, current->device_id, devicepath);
break;
case PCI_VENDOR_ID_NVIDIA:
setup_nvidia_devprop(current);
break;
}
}
}
}
branches/meklort/i386/modules/GraphicsEnabler/nvidia.c
5757
5858
5959
60
60
6161
6262
6363
#include "nvidia.h"
#ifndef DEBUG_NVIDIA
#define DEBUG_NVIDIA 1
#define DEBUG_NVIDIA 0
#endif
#if DEBUG_NVIDIA
branches/meklort/i386/modules/Makefile
2727
2828
2929
30
30
3131
3232
3333
# The order of building is important.
# TODO: exclude Symbols from find so it isn't compiled twice
SUBDIRS = Symbols Resolution Memory KernelPatcher KextPatcher HelloWorld GUI GraphicsEnabler ACPIPatcher HPET USBFix
SUBDIRS = Symbols Resolution KernelPatcher KextPatcher HelloWorld GUI GraphicsEnabler ACPIPatcher HPET USBFix
all embedtheme optionrom tags debug install installhdrs:
@rm -rf $(OBJROOT)
branches/meklort/i386/modules/Ethernet/Ethernet.c
4646
4747
4848
49
50
5149
52
50
51
5352
54
55
53
54
55
56
57
58
59
60
61
62
63
64
65
66
5667
57
68
69
5870
59
60
71
72
6173
6274
6375
int devprop_add_network_template(struct DevPropDevice *device, uint16_t vendor_id)
{
if(!device)
return 0;
uint8_t builtin = 0x0;
if((vendor_id != 0x168c) && (builtin_set == 0))
if(device)
{
builtin_set = 1;
builtin = 0x01;
if((vendor_id != 0x168c) && (builtin_set == 0))
{
builtin_set = 1;
builtin = 0x01;
}
if(!devprop_add_value(device, "built-in", (uint8_t*)&builtin, 1))
{
return 0;
}
devices_number++;
return 1;
}
if(!devprop_add_value(device, "built-in", (uint8_t*)&builtin, 1))
else
{
return 0;
devices_number++;
return 1;
}
}
void set_eth_builtin(pci_dt_t *eth_dev)

Archive Download the corresponding diff file

Revision: 551