diff --git a/Asuro.iso b/Asuro.iso index da5a4b10..18fec293 100644 Binary files a/Asuro.iso and b/Asuro.iso differ diff --git a/bin/kernel.bin b/bin/kernel.bin index 15b76f65..a358e442 100755 Binary files a/bin/kernel.bin and b/bin/kernel.bin differ diff --git a/iso/boot/asuro.bin b/iso/boot/asuro.bin index 15b76f65..a358e442 100755 Binary files a/iso/boot/asuro.bin and b/iso/boot/asuro.bin differ diff --git a/lib/E1000.ppu b/lib/E1000.ppu index 3c649f25..d2635fde 100644 Binary files a/lib/E1000.ppu and b/lib/E1000.ppu differ diff --git a/lib/PCI.ppu b/lib/PCI.ppu index 1a295b37..dbb4bf82 100644 Binary files a/lib/PCI.ppu and b/lib/PCI.ppu differ diff --git a/lib/USB.ppu b/lib/USB.ppu index af5ca494..a7f12dc2 100644 Binary files a/lib/USB.ppu and b/lib/USB.ppu differ diff --git a/lib/kernel.ppu b/lib/kernel.ppu index 193a20f3..7423f323 100644 Binary files a/lib/kernel.ppu and b/lib/kernel.ppu differ diff --git a/lib/libpconsole.a b/lib/libpconsole.a index 99c16cc8..e6dd9d4f 100644 Binary files a/lib/libpconsole.a and b/lib/libpconsole.a differ diff --git a/lib/libpmultiboot.a b/lib/libpmultiboot.a index df1b3284..b557d9be 100644 Binary files a/lib/libpmultiboot.a and b/lib/libpmultiboot.a differ diff --git a/lib/libpsystem.a b/lib/libpsystem.a index 1f3a5c68..bb4cf78e 100644 Binary files a/lib/libpsystem.a and b/lib/libpsystem.a differ diff --git a/src/driver/bus/PCI.pas b/src/driver/bus/PCI.pas index eb1aabbb..bf7b05c8 100644 --- a/src/driver/bus/PCI.pas +++ b/src/driver/bus/PCI.pas @@ -15,7 +15,7 @@ uses util, console, drivertypes, - lmemorymanager, + lmemorymanager, vmemorymanager, drivermanagement; @@ -78,6 +78,7 @@ function loadDeviceConfig(bus : uint8; slot : uint8; func : uint8) : boolean; function getDeviceInfo(class_code : uint8; subclass_code : uint8; prog_if : uint8; var count : uint32) : TdeviceArray; //(Will in future)returns TPCI_DEVICE.vendor_id := 0xFFFF if no device found. procedure requestConfig(bus : uint8; slot : uint8; func : uint8; row : uint8); procedure writeConfig(bus: uint8; slot : uint8; func : uint8; row : uint8; val : uint32); +procedure setBusMaster(bus : uint8; slot : uint8; func : uint8; master : boolean); implementation @@ -166,6 +167,23 @@ begin outl(PCI_PORT_CONF_DATA, val); end; +procedure setBusMaster(bus : uint8; slot : uint8; func : uint8; master : boolean); +var + data : uint32; + +begin + requestConfig(bus, slot, func, 1); + data := inl($CFC); + if master then begin + data := data OR $00000004; + end else begin + data := data AND $FFFFFFFB; + end; + writeConfig(bus, slot, func, 1, data); + requestConfig(bus, slot, func, 1); + data := inl($CFC); +end; + procedure requestConfig(bus : uint8; slot : uint8; func : uint8; row : uint8); var addr : uint32; diff --git a/src/driver/network/E1000.pas b/src/driver/network/E1000.pas index a5839a43..2cabe83c 100644 --- a/src/driver/network/E1000.pas +++ b/src/driver/network/E1000.pas @@ -308,7 +308,7 @@ var i : uint32; begin - ptr:= puint8(kalloc(sizeof(TE1000_tx_desc) * E1000_NUM_TX_DESC + 16)); + ptr:= puint8(kalloc(sizeof(TE1000_tx_desc) * (E1000_NUM_TX_DESC + 16))); descs:= PE1000_tx_desc(ptr); for i:=0 to E1000_NUM_TX_DESC do begin tx_descs[i]:= PE1000_tx_desc(uint32(descs + i*16)); @@ -432,7 +432,9 @@ begin kpalloc(io_base); kpalloc(mem_base); + setBusMaster(PCI_Info^.bus, PCI_Info^.slot, PCI_Info^.func, true); eeprom_exists:= false; + detectEEPROM(); if eeprom_exists then console.outputln('E1000 Driver', 'EEPROM Exists: YES.') else console.outputln('E1000 Driver', 'EEPROM Exists: NO.'); if not readMACAddress() then begin @@ -449,14 +451,14 @@ begin writeCommand($5200 + i*4, 0); end; - //IDT.set_gate(32 + PCI_Info^.interrupt_line, uint32(@fire), $08, ISR_RING_0); - //enableInturrupt(); + IDT.set_gate(32 + PCI_Info^.interrupt_line, uint32(@fire), $08, ISR_RING_0); + enableInturrupt(); rxinit(); txinit(); load:= true; - if load then registercommand('E1000_SEND_TEST', @console_command_sendtest, 'Test sending a ARP Request'); + if load then registercommand('E1000', @console_command_sendtest, 'Test sending a ARP Request'); console.outputln('E1000 Driver', 'Load Finish.'); end; @@ -518,7 +520,7 @@ var old_cur : uint8; begin - tx_descs[tx_curr]^.address:= uint64(p_data - KERNEL_VIRTUAL_BASE); + tx_descs[tx_curr]^.address:= uint32(uint32(p_data) - KERNEL_VIRTUAL_BASE); tx_descs[tx_curr]^.length:= p_len; tx_descs[tx_curr]^.cmd:= CMD_EOP OR CMD_IFCS OR CMD_RS OR CMD_RPS; tx_descs[tx_curr]^.status:= 0;