Skip to content

Commit 7dac428

Browse files
committed
- My OLPC-tree debugging hack/patch.
svn path=/branches/olpc/; revision=40256
1 parent 432e9b5 commit 7dac428

File tree

1 file changed

+134
-0
lines changed

1 file changed

+134
-0
lines changed

olpc_26mar09.diff

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
Index: boot/freeldr/freeldr/arch/i386/loader.c
2+
===================================================================
3+
--- boot/freeldr/freeldr/arch/i386/loader.c (revision 27633)
4+
+++ boot/freeldr/freeldr/arch/i386/loader.c (working copy)
5+
@@ -85,7 +85,7 @@
6+
FrLdrStartup(ULONG Magic)
7+
{
8+
/* Goodbye OFW */
9+
- OFInterpret0("usb-quiet");
10+
+ //OFInterpret0("usb-quiet");
11+
12+
/* Disable Interrupts */
13+
_disable();
14+
Index: boot/freeldr/freeldr/arch/i386/macholpc.c
15+
===================================================================
16+
--- boot/freeldr/freeldr/arch/i386/macholpc.c (revision 27284)
17+
+++ boot/freeldr/freeldr/arch/i386/macholpc.c (working copy)
18+
@@ -230,9 +230,9 @@
19+
//char * gethomedir();
20+
//char *homedir = gethomedir();
21+
22+
+ ofwprintf("OlpcDiskReadLogicalSectors() SN %x %x, SC %x\n", (ULONG)(SectorNumber >> 25),
23+
+ (ULONG)((SectorNumber * 512) & 0xffffffff), SectorCount);
24+
25+
- //ofwprintf("OlpcDiskReadLogicalSectors() SN %x, SC %x\n", SectorNumber, SectorCount); //FIXME: incorrect due to SN being ULONGLONG
26+
-
27+
if( part_handle == -1 )
28+
{
29+
part_handle = OFOpen(BootPart);
30+
@@ -244,7 +244,7 @@
31+
}
32+
}
33+
34+
- //ofwprintf("Got partition handle %x\n", part_handle);
35+
+ ofwprintf("Got partition handle %x\n", part_handle);
36+
37+
if( part_handle == -1 )
38+
{
39+
Index: drivers/base/bootvid/vid_fb.c
40+
===================================================================
41+
--- drivers/base/bootvid/vid_fb.c (revision 27277)
42+
+++ drivers/base/bootvid/vid_fb.c (working copy)
43+
@@ -101,7 +101,8 @@
44+
if (!Transparent)
45+
Pixel[Col] = (0 != (FontPtr[Line] & Mask) ? Color : BackTextColor);
46+
else
47+
- Pixel[Col] = (0 != (FontPtr[Line] & Mask) ? Color : Pixel[Col]); // transparent background
48+
+ /* FIXME: A hack here preventing transparent chars */
49+
+ Pixel[Col] = (0 != (FontPtr[Line] & Mask) ? Color : BackTextColor/*Pixel[Col]*/); // transparent background
50+
51+
Mask = Mask >> 1;
52+
}
53+
@@ -182,7 +183,8 @@
54+
55+
if (!VidpInitialized)
56+
{
57+
- PhysicalAddress.QuadPart = 0xFD000000;
58+
+ PhysicalAddress.QuadPart = 0xFD000000; // OLPC
59+
+ //PhysicalAddress.QuadPart = 0xF0000000; // VMWare
60+
VidpMemory = MmMapIoSpace(PhysicalAddress, 0x200000, MmNonCached);
61+
if (VidpMemory == NULL)
62+
return FALSE;
63+
@@ -269,7 +271,7 @@
64+
VidFbDisplayString(
65+
IN PCSTR String)
66+
{
67+
- ULONG TopDelta = CHAR_HEIGHT-2;
68+
+ ULONG TopDelta = CHAR_HEIGHT;//-2;
69+
70+
/* Start looping the string */
71+
while (*String)
72+
Index: ntoskrnl/io/iomgr/iomgr.c
73+
===================================================================
74+
--- ntoskrnl/io/iomgr/iomgr.c (revision 27165)
75+
+++ ntoskrnl/io/iomgr/iomgr.c (working copy)
76+
@@ -400,6 +400,7 @@
77+
FILE_NON_DIRECTORY_FILE);
78+
if (!NT_SUCCESS(Status))
79+
{
80+
+ while (TRUE) { NtYieldExecution(); }; // HACK to watch olpc boot process
81+
/* Fail */
82+
KeBugCheckEx(INACCESSIBLE_BOOT_DEVICE,
83+
(ULONG_PTR)&DeviceName,
84+
Index: ntoskrnl/ke/i386/ctxswitch.S
85+
===================================================================
86+
--- ntoskrnl/ke/i386/ctxswitch.S (revision 26941)
87+
+++ ntoskrnl/ke/i386/ctxswitch.S (working copy)
88+
@@ -175,14 +175,14 @@
89+
/* Save the NPX State */
90+
mov ecx, [eax+KTHREAD_INITIAL_STACK]
91+
sub ecx, NPX_FRAME_LENGTH
92+
- fxsave [ecx]
93+
+ fsave [ecx]
94+
mov byte ptr [eax+KTHREAD_NPX_STATE], NPX_STATE_NOT_LOADED
95+
96+
DontSave:
97+
/* Load the NPX State */
98+
mov ecx, [esi+KTHREAD_INITIAL_STACK]
99+
sub ecx, NPX_FRAME_LENGTH
100+
- fxrstor [ecx]
101+
+ frstor [ecx]
102+
103+
/* Get the CR0 state and destination */
104+
mov edx, [ecx+FN_CR0_NPX_STATE]
105+
@@ -213,7 +213,7 @@
106+
jz DoneLoad
107+
108+
/* Save the FX State */
109+
- fxsave [ecx]
110+
+ fsave [ecx]
111+
112+
/* Check if we also have to save it in the parameter */
113+
mov ecx, [esp+20]
114+
Index: ntoskrnl/mm/freelist.c
115+
===================================================================
116+
--- ntoskrnl/mm/freelist.c (revision 26941)
117+
+++ ntoskrnl/mm/freelist.c (working copy)
118+
@@ -473,6 +473,16 @@
119+
&MmPageArray[j].ListEntry);
120+
MmStats.NrReservedPages++;
121+
}
122+
+ else if (j >= 0x7000000 / PAGE_SIZE)
123+
+ {
124+
+ MmPageArray[j].Flags.Type = MM_PHYSICAL_PAGE_BIOS;
125+
+ MmPageArray[j].Flags.Zero = 0;
126+
+ MmPageArray[j].Flags.Consumer = MC_NPPOOL;
127+
+ MmPageArray[j].ReferenceCount = 1;
128+
+ InsertTailList(&BiosPageListHead,
129+
+ &MmPageArray[j].ListEntry);
130+
+ MmStats.NrReservedPages++;
131+
+ }
132+
else if (j >= (ULONG)FirstPhysKernelAddress/PAGE_SIZE &&
133+
j < (ULONG)LastPhysKernelAddress/PAGE_SIZE)
134+
{

0 commit comments

Comments
 (0)