git-svn-id: https://spexeah.com:8443/svn/Asuro@401 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
parent
2f5f4a1173
commit
1eb4c3190e
BIN
bin/kernel.bin
BIN
bin/kernel.bin
Binary file not shown.
Binary file not shown.
BIN
lib/E1000.ppu
BIN
lib/E1000.ppu
Binary file not shown.
BIN
lib/PCI.ppu
BIN
lib/PCI.ppu
Binary file not shown.
BIN
lib/USB.ppu
BIN
lib/USB.ppu
Binary file not shown.
BIN
lib/kernel.ppu
BIN
lib/kernel.ppu
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
lib/libpsystem.a
BIN
lib/libpsystem.a
Binary file not shown.
@ -15,7 +15,7 @@ uses
|
|||||||
util,
|
util,
|
||||||
console,
|
console,
|
||||||
drivertypes,
|
drivertypes,
|
||||||
lmemorymanager,
|
lmemorymanager,
|
||||||
vmemorymanager,
|
vmemorymanager,
|
||||||
drivermanagement;
|
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.
|
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 requestConfig(bus : uint8; slot : uint8; func : uint8; row : uint8);
|
||||||
procedure writeConfig(bus: uint8; slot : uint8; func : uint8; row : uint8; val : uint32);
|
procedure writeConfig(bus: uint8; slot : uint8; func : uint8; row : uint8; val : uint32);
|
||||||
|
procedure setBusMaster(bus : uint8; slot : uint8; func : uint8; master : boolean);
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -166,6 +167,23 @@ begin
|
|||||||
outl(PCI_PORT_CONF_DATA, val);
|
outl(PCI_PORT_CONF_DATA, val);
|
||||||
end;
|
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);
|
procedure requestConfig(bus : uint8; slot : uint8; func : uint8; row : uint8);
|
||||||
var
|
var
|
||||||
addr : uint32;
|
addr : uint32;
|
||||||
|
@ -308,7 +308,7 @@ var
|
|||||||
i : uint32;
|
i : uint32;
|
||||||
|
|
||||||
begin
|
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);
|
descs:= PE1000_tx_desc(ptr);
|
||||||
for i:=0 to E1000_NUM_TX_DESC do begin
|
for i:=0 to E1000_NUM_TX_DESC do begin
|
||||||
tx_descs[i]:= PE1000_tx_desc(uint32(descs + i*16));
|
tx_descs[i]:= PE1000_tx_desc(uint32(descs + i*16));
|
||||||
@ -432,7 +432,9 @@ begin
|
|||||||
kpalloc(io_base);
|
kpalloc(io_base);
|
||||||
kpalloc(mem_base);
|
kpalloc(mem_base);
|
||||||
|
|
||||||
|
setBusMaster(PCI_Info^.bus, PCI_Info^.slot, PCI_Info^.func, true);
|
||||||
eeprom_exists:= false;
|
eeprom_exists:= false;
|
||||||
|
|
||||||
detectEEPROM();
|
detectEEPROM();
|
||||||
if eeprom_exists then console.outputln('E1000 Driver', 'EEPROM Exists: YES.') else console.outputln('E1000 Driver', 'EEPROM Exists: NO.');
|
if eeprom_exists then console.outputln('E1000 Driver', 'EEPROM Exists: YES.') else console.outputln('E1000 Driver', 'EEPROM Exists: NO.');
|
||||||
if not readMACAddress() then begin
|
if not readMACAddress() then begin
|
||||||
@ -449,14 +451,14 @@ begin
|
|||||||
writeCommand($5200 + i*4, 0);
|
writeCommand($5200 + i*4, 0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//IDT.set_gate(32 + PCI_Info^.interrupt_line, uint32(@fire), $08, ISR_RING_0);
|
IDT.set_gate(32 + PCI_Info^.interrupt_line, uint32(@fire), $08, ISR_RING_0);
|
||||||
//enableInturrupt();
|
enableInturrupt();
|
||||||
rxinit();
|
rxinit();
|
||||||
txinit();
|
txinit();
|
||||||
|
|
||||||
load:= true;
|
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.');
|
console.outputln('E1000 Driver', 'Load Finish.');
|
||||||
end;
|
end;
|
||||||
@ -518,7 +520,7 @@ var
|
|||||||
old_cur : uint8;
|
old_cur : uint8;
|
||||||
|
|
||||||
begin
|
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]^.length:= p_len;
|
||||||
tx_descs[tx_curr]^.cmd:= CMD_EOP OR CMD_IFCS OR CMD_RS OR CMD_RPS;
|
tx_descs[tx_curr]^.cmd:= CMD_EOP OR CMD_IFCS OR CMD_RS OR CMD_RPS;
|
||||||
tx_descs[tx_curr]^.status:= 0;
|
tx_descs[tx_curr]^.status:= 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user