DriverManagement done? Dummy Driver loaded successfully.
git-svn-id: https://spexeah.com:8443/svn/Asuro@291 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
parent
648a6153e8
commit
a805f22354
@ -15,7 +15,9 @@ uses
|
||||
util,
|
||||
console,
|
||||
drivertypes,
|
||||
ATA;
|
||||
ATA,
|
||||
lmemorymanager,
|
||||
drivermanagement;
|
||||
|
||||
type
|
||||
|
||||
@ -211,6 +213,7 @@ function loadDeviceConfig(bus : uint8; slot : uint8; func : uint8) : boolean;
|
||||
var
|
||||
device : TPCI_Device;
|
||||
data : uint32;
|
||||
DevID : PDeviceIdentifier;
|
||||
|
||||
begin
|
||||
|
||||
@ -290,6 +293,13 @@ begin
|
||||
device.interrupt_pin := getbyte(data, 2);
|
||||
device.interrupt_line := getbyte(data, 3);
|
||||
|
||||
DevID:= PDeviceIdentifier(kalloc(sizeof(TDeviceIdentifier)));
|
||||
DevID^.Bus:= biPCI;
|
||||
DevID^.id0:= device.device_id;
|
||||
DevID^.id1:= device.class_code;
|
||||
DevID^.id2:= device.subclass_class;
|
||||
DevID^.id3:= device.prog_if;
|
||||
DevID^.ex:= nil;
|
||||
|
||||
console.writestring('PCI: Found Device: ');
|
||||
console.writehex(device.header_type);
|
||||
@ -302,6 +312,8 @@ begin
|
||||
console.writestring(' ');
|
||||
console.writehexln(device.prog_if);
|
||||
|
||||
drivermanagement.register_device(DevID, @device);
|
||||
|
||||
devices[device_count] := device;
|
||||
device_count := device_count + 1;
|
||||
|
||||
|
31
src/driver/testdriver.pas
Normal file
31
src/driver/testdriver.pas
Normal file
@ -0,0 +1,31 @@
|
||||
unit testdriver;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
console, drivermanagement;
|
||||
|
||||
procedure init;
|
||||
|
||||
implementation
|
||||
|
||||
function load(ptr : void) : boolean;
|
||||
begin
|
||||
console.writestringln('DUMMY DRIVER LOADED.')
|
||||
end;
|
||||
|
||||
procedure init;
|
||||
var
|
||||
devID : TDeviceIdentifier;
|
||||
|
||||
begin
|
||||
devID.bus:= biPCI;
|
||||
devID.id0:= $00008086;
|
||||
devID.id1:= $00000006;
|
||||
devID.id2:= $00000000;
|
||||
devID.id3:= $00000000;
|
||||
devID.ex:= nil;
|
||||
drivermanagement.register_driver(@devID, @load);
|
||||
end;
|
||||
|
||||
end.
|
@ -11,7 +11,7 @@ unit drivermanagement;
|
||||
interface
|
||||
|
||||
uses
|
||||
util, strings, lmemorymanager;
|
||||
console, util, strings, lmemorymanager;
|
||||
|
||||
type
|
||||
PDevEx = ^TDevEx;
|
||||
|
@ -33,7 +33,8 @@ uses
|
||||
Terminal,
|
||||
strings,
|
||||
ATA,
|
||||
USB;
|
||||
USB,
|
||||
testdriver;
|
||||
|
||||
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
|
||||
|
||||
@ -107,6 +108,7 @@ begin
|
||||
lmemorymanager.init();
|
||||
tss.init();
|
||||
scheduler.init();
|
||||
testdriver.init();
|
||||
|
||||
//asm INT 13 end;
|
||||
STI;
|
||||
|
Loading…
x
Reference in New Issue
Block a user