Author Topic: A few bugs I found  (Read 1554 times)

0 Members and 1 Guest are viewing this topic.

loc[a]lhost

  • Entrant
  • Posts: 6
A few bugs I found
« on: January 18, 2012, 07:09:12 PM »
I was experimenting with the undocumented "Kernel Cache" boot flag that lets you choose a custom kernel cache path explicitly instead of using the default path.

However, it didn't work at all, so I started debugging it and found 2 issues:

1) In sys.c, the GetFileInfo() function has the following code:
Code: [Select]
strncpy(gMakeDirSpec, name, idx);This results in gMakeDirSpec not being a null-terminated in most cases. Adding "gMakeDirSpec[idx] = '\0';" fixes this.

2) I'm not sure this is a bug, but boot.c tests a weird condition for the kernel cache file time:
Code: [Select]
if (ret == 0 && cachetime != (exttime + 1)) {
trycache = 0;
break;
}
This makes using a custom kernel cache path harder, as I need to carefully craft the cache file time to satisfy the condition above.


After making the fixes, I can use a custom kernel cache file just fine.

Could you add those fixes to the trunk?

Note:
Maybe this feature should be more documented. I use a hardware RAID volume for booting (HighPoint RAID controller), and Chameleon has problems reading files that have a physical offset of more than 2TB in the volume. Until now, I used to defragment my drive every time I update my boot files (kexts, kernel, etc.). Now, with the custom kernel cache path, I no longer have to do this.

ErmaC

  • Resident
  • Posts: 134
Re: A few bugs I found
« Reply #1 on: January 19, 2012, 02:49:13 AM »
open an issue at : http://forge.voodooprojects.org/p/chameleon/issues/
With the proper diff patch file.

Fabio
P6T Deluxe v1 i7 940 Quadro Fx 5600
P6T SE i7 920 GeForce GT 240