Inserted some line print()'s for debugging
This commit is contained in:
parent
c1f7148f30
commit
7126409aee
1 changed files with 16 additions and 2 deletions
|
|
@ -34,7 +34,7 @@
|
||||||
#define USE_MP_SERVICES 0 /* without fallback to ACPI parser and APIC INIT + SIPI */
|
#define USE_MP_SERVICES 0 /* without fallback to ACPI parser and APIC INIT + SIPI */
|
||||||
|
|
||||||
#if BBDEBUG
|
#if BBDEBUG
|
||||||
#define DBG(fmt, ...) do{Print(fmt,__VA_ARGS__); }while(0);
|
#define DBG(fmt, ...) do{Print(fmt,__VA_ARGS__); }while(0)
|
||||||
#else
|
#else
|
||||||
#define DBG(fmt, ...)
|
#define DBG(fmt, ...)
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -1493,20 +1493,26 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(argc>1) {
|
if(argc>1) {
|
||||||
configfile=argv[2];
|
configfile=argv[1];
|
||||||
} else {
|
} else {
|
||||||
configfile=L"\\BOOTBOOT\\CONFIG";
|
configfile=L"\\BOOTBOOT\\CONFIG";
|
||||||
}
|
}
|
||||||
|
|
||||||
Print(L"Booting OS...\n");
|
Print(L"Booting OS...\n");
|
||||||
|
|
||||||
|
#if 1
|
||||||
// get memory for bootboot structure
|
// get memory for bootboot structure
|
||||||
bootboot = NULL;
|
bootboot = NULL;
|
||||||
|
Print(L"LINE %d\n", (int)__LINE__ );
|
||||||
status = uefi_call_wrapper(BS->AllocatePages, 4, 0, 2, 1, (EFI_PHYSICAL_ADDRESS*)&bootboot);
|
status = uefi_call_wrapper(BS->AllocatePages, 4, 0, 2, 1, (EFI_PHYSICAL_ADDRESS*)&bootboot);
|
||||||
|
Print(L"LINE %d\n", (int)__LINE__ );
|
||||||
if (EFI_ERROR(status) || bootboot == NULL)
|
if (EFI_ERROR(status) || bootboot == NULL)
|
||||||
return report(EFI_OUT_OF_RESOURCES,L"AllocatePages");
|
return report(EFI_OUT_OF_RESOURCES,L"AllocatePages");
|
||||||
|
Print(L"LINE %d\n", (int)__LINE__ );
|
||||||
ZeroMem((void*)bootboot,PAGESIZE);
|
ZeroMem((void*)bootboot,PAGESIZE);
|
||||||
|
Print(L"LINE %d\n", (int)__LINE__ );
|
||||||
CopyMem(bootboot->magic,BOOTBOOT_MAGIC,4);
|
CopyMem(bootboot->magic,BOOTBOOT_MAGIC,4);
|
||||||
|
Print(L"LINE %d\n", (int)__LINE__ );
|
||||||
// unlike BIOS+MultiBoot bootboot, no need to check if we have
|
// unlike BIOS+MultiBoot bootboot, no need to check if we have
|
||||||
// PAE + MSR + LME, as we're already in long mode.
|
// PAE + MSR + LME, as we're already in long mode.
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
|
|
@ -1515,10 +1521,14 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
|
||||||
"shrl $24, %%ebx;"
|
"shrl $24, %%ebx;"
|
||||||
"mov %%bx,%0"
|
"mov %%bx,%0"
|
||||||
: "=b"(bootboot->bspid) : : );
|
: "=b"(bootboot->bspid) : : );
|
||||||
|
Print(L"LINE %d\n", (int)__LINE__ );
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !defined(USE_MP_SERVICES) || !USE_MP_SERVICES
|
#if !defined(USE_MP_SERVICES) || !USE_MP_SERVICES
|
||||||
// should be no need to check for RDSTC, available since Pentium, therefore
|
// should be no need to check for RDSTC, available since Pentium, therefore
|
||||||
// all long mode capable CPUs should have it. But just to be on the safe side
|
// all long mode capable CPUs should have it. But just to be on the safe side
|
||||||
__asm__ __volatile__ ("mov $1, %%eax; cpuid;" : "=d"(a) : : );
|
__asm__ __volatile__ ("mov $1, %%eax; cpuid;" : "=d"(a) : : );
|
||||||
|
Print(L"LINE %d\n", (int)__LINE__ );
|
||||||
if(a & (1<<4)) {
|
if(a & (1<<4)) {
|
||||||
// calibrate CPU clock cycles
|
// calibrate CPU clock cycles
|
||||||
__asm__ __volatile__ ( "rdtsc" : "=a"(a),"=d"(b)); currtime=((UINT64)b << 32)|a;
|
__asm__ __volatile__ ( "rdtsc" : "=a"(a),"=d"(b)); currtime=((UINT64)b << 32)|a;
|
||||||
|
|
@ -1531,6 +1541,7 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
|
||||||
// fallback to dummy loops without RDTSC (should never happen)
|
// fallback to dummy loops without RDTSC (should never happen)
|
||||||
ncycles = 0;
|
ncycles = 0;
|
||||||
}
|
}
|
||||||
|
Print(L"LINE %d\n", (int)__LINE__ );
|
||||||
#define sleep(n) do { \
|
#define sleep(n) do { \
|
||||||
if(ncycles) { \
|
if(ncycles) { \
|
||||||
__asm__ __volatile__ ( "rdtsc" : "=a"(a),"=d"(b)); endtime=(((UINT64)b << 32)|a) + n*ncycles; \
|
__asm__ __volatile__ ( "rdtsc" : "=a"(a),"=d"(b)); endtime=(((UINT64)b << 32)|a) + n*ncycles; \
|
||||||
|
|
@ -1546,6 +1557,7 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
|
||||||
*((volatile uint32_t*)(lapic_addr + 0x300)) = (*((volatile uint32_t*)(lapic_addr + 0x300)) & m) | v; \
|
*((volatile uint32_t*)(lapic_addr + 0x300)) = (*((volatile uint32_t*)(lapic_addr + 0x300)) & m) | v; \
|
||||||
} while(0)
|
} while(0)
|
||||||
#endif
|
#endif
|
||||||
|
Print(L"LINE %d\n", (int)__LINE__ );
|
||||||
|
|
||||||
// Try to locate HTTP service binding protocol
|
// Try to locate HTTP service binding protocol
|
||||||
DBG(L" * Locating HTTP service binding protocol%s\n", L"");
|
DBG(L" * Locating HTTP service binding protocol%s\n", L"");
|
||||||
|
|
@ -1553,6 +1565,7 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
|
||||||
if (EFI_ERROR(status)) {
|
if (EFI_ERROR(status)) {
|
||||||
return report(status, L"LocateProtocol");
|
return report(status, L"LocateProtocol");
|
||||||
}
|
}
|
||||||
|
Print(L"LINE %d\n", (int)__LINE__ );
|
||||||
|
|
||||||
// Create a HTTP protocol handle
|
// Create a HTTP protocol handle
|
||||||
DBG(L" * Creating HTTP protocol handle%s\n", L"");
|
DBG(L" * Creating HTTP protocol handle%s\n", L"");
|
||||||
|
|
@ -1561,6 +1574,7 @@ efi_main (EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
|
||||||
if (EFI_ERROR(status)) {
|
if (EFI_ERROR(status)) {
|
||||||
return report(status, L"CreateChild");
|
return report(status, L"CreateChild");
|
||||||
}
|
}
|
||||||
|
Print(L"LINE %d\n", (int)__LINE__ );
|
||||||
|
|
||||||
status=EFI_LOAD_ERROR;
|
status=EFI_LOAD_ERROR;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue