Updated code

This commit is contained in:
Alex 2022-11-28 08:21:51 +02:00
parent cac91d5895
commit 0091fe5965
Signed by untrusted user who does not match committer: enderice2
GPG Key ID: EACC3AD603BAB4DD
3 changed files with 6 additions and 6 deletions

View File

@ -116,7 +116,7 @@ struct HBACommandHeader
uint8_t CommandFISLength : 5;
uint8_t ATAPI : 1;
uint8_t Write : 1;
uint8_t Prefetchable : 1;
uint8_t Preferable : 1;
uint8_t Reset : 1;
uint8_t BIST : 1;
uint8_t ClearBusy : 1;

View File

@ -21,7 +21,7 @@ __attribute__((section(".extended"))) FexExtended ExtendedHeader = {
.Bind = {
.Type = BIND_INTERRUPT,
.Interrupt = {
.Vector = {0xFE},
.Vector = {0xFF},
}}}};
// Global variable that holds the kernel API

View File

@ -251,13 +251,13 @@ MediaAccessControl GetMAC()
void InitializeRX()
{
uint8_t *Ptr = (uint8_t *)KAPI->Memory.RequestPage((sizeof(RXDescriptor) * E1000_NUM_RX_DESC + 16) / KAPI->Memory.PageSize + 1);
uint8_t *Ptr = (uint8_t *)KAPI->Memory.RequestPage((((sizeof(RXDescriptor) * E1000_NUM_RX_DESC + 16)) / KAPI->Memory.PageSize) + 1);
RXDescriptor *Descriptor = (RXDescriptor *)Ptr;
for (int i = 0; i < E1000_NUM_RX_DESC; i++)
{
RX[i] = (RXDescriptor *)((uint8_t *)Descriptor + i * 16);
RX[i]->Address = (uint64_t)(uint8_t *)KAPI->Memory.RequestPage((8192 + 16) / KAPI->Memory.PageSize + 1);
RX[i]->Address = (uint64_t)(uint8_t *)KAPI->Memory.RequestPage(((8192 + 16) / KAPI->Memory.PageSize) + 1);
RX[i]->Status = 0;
}
@ -277,7 +277,7 @@ void InitializeRX()
void InitializeTX()
{
uint8_t *Ptr = (uint8_t *)KAPI->Memory.RequestPage((sizeof(TXDescriptor) * E1000_NUM_RX_DESC + 16) / KAPI->Memory.PageSize + 1);
uint8_t *Ptr = (uint8_t *)KAPI->Memory.RequestPage(((sizeof(TXDescriptor) * E1000_NUM_RX_DESC + 16) / KAPI->Memory.PageSize) + 1);
TXDescriptor *Descriptor = (TXDescriptor *)Ptr;
for (int i = 0; i < E1000_NUM_TX_DESC; i++)
@ -349,7 +349,7 @@ int CallbackHandler(KernelCallback *Data)
if (!GetMAC().Valid())
return NOT_AVAILABLE;
else
KAPI->Util.DebugPrint(((char *)"MAC adddress found." + KAPI->Info.Offset), KAPI->Info.DriverUID);
KAPI->Util.DebugPrint(((char *)"MAC address found." + KAPI->Info.Offset), KAPI->Info.DriverUID);
MAC = GetMAC();
// Start link