tMBoot_Module *mods;
tMBoot_Info *mbInfo;
- LogF("Acess2 x86_65 v"EXPAND_STR(KERNEL_VERSION)"\n");
+ LogF("Acess2 x86 v"EXPAND_STR(KERNEL_VERSION)"\n");
LogF(" Build %i, Git Hash %s\n", BUILD_NUM, gsGitHash);
Log("MbMagic = %08x, MbInfoPtr = %p", MbMagic, MbInfoPtr);
}
}
// Success
- Log("MM_NewKStack - Allocated %p", base + KERNEL_STACK_SIZE);
+// Log("MM_NewKStack - Allocated %p", base + KERNEL_STACK_SIZE);
return base+KERNEL_STACK_SIZE;
}
// No stacks left
- Warning("MM_NewKStack - No address space left");
+ Log_Warning("MMVirt", "MM_NewKStack - No address space left");
return 0;
}
int giProc_BootProcessorID = 0;
tTSS gaTSSs[MAX_CPUS]; // TSS Array
#endif
-tCPU gaCPUs[MAX_CPUS];
+tCPU gaCPUs[MAX_CPUS] = {
+ {.Current = &gThreadZero}
+ };
tTSS *gTSSs = NULL; // Pointer to TSS array
tTSS gTSS0 = {0};
// --- Error Recovery ---
outb(0x40, TIMER_DIVISOR&0xFF); // Low Byte of Divisor
outb(0x40, (TIMER_DIVISOR>>8)&0xFF); // High Byte
- Log("Timer Frequency %i.%03i Hz",
+ Log_Debug("Proc", "PIT Frequency %i.%03i Hz",
TIMER_BASE/TIMER_DIVISOR,
((Uint64)TIMER_BASE*1000/TIMER_DIVISOR)%1000
);
newThread->SavedState.ESP = esp;
newThread->SavedState.EIP = (Uint)&NewTaskHeader;
newThread->SavedState.SSE = NULL;
- Log("New (KThread) %p, esp = %p\n", newThread->SavedState.EIP, newThread->SavedState.ESP);
+// Log("New (KThread) %p, esp = %p", newThread->SavedState.EIP, newThread->SavedState.ESP);
// MAGIC_BREAK();
Threads_AddActive(newThread);
// Sanity Check values\r
if(mode < 0 || mode > giVesaModeCount) return -1;\r
\r
- Log_Log("VESA", "Setting mode to %i (%ix%i %ibpp)",\r
- mode,\r
- gVesa_Modes[mode].width, gVesa_Modes[mode].height,\r
- gVesa_Modes[mode].bpp\r
- );\r
- \r
// Check for fast return\r
if(mode == giVesaCurrentMode) return 1;\r
\r
gpVesa_BiosState->AX = 0x4F02;\r
gpVesa_BiosState->BX = gVesa_Modes[mode].code;\r
if(gVesa_Modes[mode].flags & FLAG_LFB) {\r
- Log_Log("VESA", "Using LFB");\r
gpVesa_BiosState->BX |= 0x4000; // Bit 14 - Use LFB\r
}\r
\r
giVesaPageCount = (gVesa_Modes[mode].fbSize + 0xFFF) >> 12;\r
gpVesa_Framebuffer = (void*)MM_MapHWPages(gVesa_Modes[mode].framebuffer, giVesaPageCount);\r
\r
- Log_Log("VESA", "Framebuffer (Phys) = 0x%x, (Virt) = 0x%x, Size = 0x%x",\r
- gVesa_Modes[mode].framebuffer, gpVesa_Framebuffer, giVesaPageCount << 12);\r
+ Log_Log("VESA", "Setting mode to %i (%ix%i %ibpp) %p[0x%x] maps %P",\r
+ mode,\r
+ gVesa_Modes[mode].width, gVesa_Modes[mode].height,\r
+ gVesa_Modes[mode].bpp,\r
+ gpVesa_Framebuffer, giVesaPageCount << 12, gVesa_Modes[mode].framebuffer\r
+ );\r
\r
// Record Mode Set\r
giVesaCurrentMode = mode;\r
giNe2k_CardCount += PCI_CountDevices( csaCOMPAT_DEVICES[i].Vendor, csaCOMPAT_DEVICES[i].Device );
}
- if( giNe2k_CardCount == 0 ) {
- Log_Warning("Ne2k", "No cards detected");
- return MODULE_ERR_NOTNEEDED;
- }
+ if( giNe2k_CardCount == 0 ) return MODULE_ERR_NOTNEEDED;
// Enumerate Cards
k = 0;
tCard *card;
giRTL8139_CardCount = PCI_CountDevices(VENDOR_ID, DEVICE_ID);
- Log_Debug("RTL8139", "%i cards", giRTL8139_CardCount);
if( giRTL8139_CardCount == 0 ) return MODULE_ERR_NOTNEEDED;
-
+
+ Log_Debug("RTL8139", "%i cards", giRTL8139_CardCount);
gaRTL8139_Cards = calloc( giRTL8139_CardCount, sizeof(tCard) );
for( i = 0 ; (id = PCI_GetDevice(VENDOR_ID, DEVICE_ID, i)) != -1; i ++ )
LOG("gATA_Disks[ %i ].Sectors = 0x%x", Disk, gATA_Disks[ Disk ].Sectors);
+ // Create Name
+ gATA_Disks[ Disk ].Name[0] = 'A'+Disk;
+ gATA_Disks[ Disk ].Name[1] = '\0';
+
+ #if 1
{
Uint64 val = gATA_Disks[ Disk ].Sectors / 2;
char *units = "KiB";
val /= 1024;
units = "TiB";
}
- Log_Log("ATA", "Disk %i: 0x%llx Sectors (%lli %s)", Disk,
- gATA_Disks[ Disk ].Sectors, val, units);
+ Log_Notice("ATA", "Disk %s: 0x%llx Sectors (%lli %s)",
+ gATA_Disks[ Disk ].Name, gATA_Disks[ Disk ].Sectors, val, units);
}
-
- // Create Name
- gATA_Disks[ Disk ].Name[0] = 'A'+Disk;
- gATA_Disks[ Disk ].Name[1] = '\0';
+ #endif
// Get pointer to vfs node and populate it
node = &gATA_Disks[ Disk ].Node;
Part->Node.Read = ATA_ReadFS;
Part->Node.Write = ATA_WriteFS;
Part->Node.IOCtl = ATA_IOCtl;
- Log_Notice("ATA", "Note '%s' at 0x%llx, 0x%llx long", Part->Name, Part->Start, Part->Length);
+ Log_Notice("ATA", "Partition %s at 0x%llx+0x%llx", Part->Name, Part->Start, Part->Length);
LOG("Made '%s' (&Node=%p)", Part->Name, &Part->Node);
LEAVE('-');
}
if( ATA_ReadDMA( Disk, Addr, 1, &mbr ) != 0 )
return -1; // Stop on Errors
-
for( i = 0; i < 4; i ++ )
{
if( mbr.Parts[i].SystemID == 0 ) continue;
len = (mbr.Parts[i].LengthHi << 16) | mbr.Parts[i].LBALength;
}
else {
- Warning("Unknown partition type, Disk %i 0x%llx Part %i",
- Disk, Addr, i);
+ Log_Warning("ATA MBR",
+ "Unknown partition type 0x%x, Disk %i Ext 0x%llx Part %i",
+ mbr.Parts[i].Boot, Disk, Addr, i
+ );
return -1;
}
case 0xF:
case 0x5:
if(link != 0) {
- Warning("Disk %i has two forward links in the extended partition",
- Disk);
+ Log_Warning("ATA MBR",
+ "Disk %i has two forward links in the extended partition",
+ Disk
+ );
return -1;
}
link = base;
break;
default:
if(bFoundPart) {
- Warning("Disk %i has more than one partition in the extended partition at 0x%llx",
- Disk, Addr);
+ Warning("ATA MBR",
+ "Disk %i has more than one partition in the extended partition at 0x%llx",
+ Disk, Addr
+ );
return -1;
}
bFoundPart = 1;
}
if(!bFoundPart) {
- Warning("No partition in extended partiton, Disk %i 0x%llx",
+ Log_Warning("ATA MBR",
+ "No partition in extended partiton, Disk %i 0x%llx",
Disk, Addr);
return -1;
}