for( i = 0; i < mbInfo->ModuleCount; i ++ )
{
int ofs;
-
+
+ Log_Log("Arch", "Multiboot Module at 0x%08x, 0x%08x bytes (String at 0x%08x)",
+ mods[i].Start, mods[i].End-mods[i].Start, mods[i].String);
+
// Always HW map the module data
gaArch_BootModules[i].Size = mods[i].End - mods[i].Start;
{
// Assumes the string is < 4096 bytes long)
gaArch_BootModules[i].ArgString = (void*)(
- MM_MapHWPages((tVAddr)mods[i].String, 2)
- + ((tVAddr)mods[i].String&0xFFF)
+ MM_MapHWPages(mods[i].String, 2) + (mods[i].String&0xFFF)
);
}
else
#include <tpl_drv_disk.h>
#include "common.h"
-// --- Flags ---
-#define START_BEFORE_CMD 0
-
// === STRUCTURES ===
typedef struct
{
int gATA_IRQPri = 14;
int gATA_IRQSec = 15;
int giaATA_ControllerLock[2] = {0}; //!< Spinlocks for each controller
-Uint8 gATA_Buffers[2][4096] __attribute__ ((section(".padata")));
+Uint8 gATA_Buffers[2][(MAX_DMA_SECTORS+0xFFF)&~0xFFF] __attribute__ ((section(".padata")));
volatile int gaATA_IRQs[2] = {0};
tPRDT_Ent gATA_PRDTs[2] = {
{0, 512, IDE_PRDT_LAST},
LOG("gATA_Disks[ Disk ].Sectors = 0x%x", gATA_Disks[ Disk ].Sectors);
- if( gATA_Disks[ Disk ].Sectors / (2048*1024) )
- Log("Disk %i: 0x%llx Sectors (%i GiB)", Disk,
- gATA_Disks[ Disk ].Sectors, gATA_Disks[ Disk ].Sectors / (2048*1024));
- else if( gATA_Disks[ Disk ].Sectors / 2048 )
- Log("Disk %i: 0x%llx Sectors (%i MiB)", Disk,
- gATA_Disks[ Disk ].Sectors, gATA_Disks[ Disk ].Sectors / 2048);
- else
- Log("Disk %i: 0x%llx Sectors (%i KiB)", Disk,
- gATA_Disks[ Disk ].Sectors, gATA_Disks[ Disk ].Sectors / 2);
+ {
+ Uint64 val = gATA_Disks[ Disk ].Sectors / 2;
+ char *units = "KiB";
+ if( val > 4*1024 ) {
+ val /= 1024;
+ units = "MiB";
+ }
+ else if( val > 4*1024 ) {
+ val /= 1024;
+ units = "GiB";
+ }
+ else if( val > 4*1024 ) {
+ val /= 1024;
+ units = "TiB";
+ }
+ Log_Log("ATA", "Disk %i: 0x%llx Sectors (%i %s)", Disk,
+ gATA_Disks[ Disk ].Sectors, val, units);
+ }
// Create Name
gATA_Disks[ Disk ].Name[0] = 'A'+Disk;
// Complete Transfer
ATA_int_BusMasterWriteByte( cont << 3, 8 ); // Read and stop
+ val = inb(base+0x7);
+ LOG("Status byte = 0x%02x", val);
+
LOG("Transfer Completed & Acknowledged");
// Copy to destination buffer