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:
kieron 2018-04-04 20:53:13 +00:00
parent 648a6153e8
commit a805f22354
4 changed files with 48 additions and 3 deletions

View File

@ -15,7 +15,9 @@ uses
util, util,
console, console,
drivertypes, drivertypes,
ATA; ATA,
lmemorymanager,
drivermanagement;
type type
@ -211,6 +213,7 @@ function loadDeviceConfig(bus : uint8; slot : uint8; func : uint8) : boolean;
var var
device : TPCI_Device; device : TPCI_Device;
data : uint32; data : uint32;
DevID : PDeviceIdentifier;
begin begin
@ -290,6 +293,13 @@ begin
device.interrupt_pin := getbyte(data, 2); device.interrupt_pin := getbyte(data, 2);
device.interrupt_line := getbyte(data, 3); 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.writestring('PCI: Found Device: ');
console.writehex(device.header_type); console.writehex(device.header_type);
@ -302,6 +312,8 @@ begin
console.writestring(' '); console.writestring(' ');
console.writehexln(device.prog_if); console.writehexln(device.prog_if);
drivermanagement.register_device(DevID, @device);
devices[device_count] := device; devices[device_count] := device;
device_count := device_count + 1; device_count := device_count + 1;

31
src/driver/testdriver.pas Normal file
View 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.

View File

@ -11,7 +11,7 @@ unit drivermanagement;
interface interface
uses uses
util, strings, lmemorymanager; console, util, strings, lmemorymanager;
type type
PDevEx = ^TDevEx; PDevEx = ^TDevEx;

View File

@ -33,7 +33,8 @@ uses
Terminal, Terminal,
strings, strings,
ATA, ATA,
USB; USB,
testdriver;
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall; procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
@ -107,6 +108,7 @@ begin
lmemorymanager.init(); lmemorymanager.init();
tss.init(); tss.init();
scheduler.init(); scheduler.init();
testdriver.init();
//asm INT 13 end; //asm INT 13 end;
STI; STI;