Drivers now using DriverManagement.
git-svn-id: https://spexeah.com:8443/svn/Asuro@302 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c
This commit is contained in:
1 parent
6b3c4fb634
commit
e3c96aa9f8
6 files changed
+270
-38
No files matched your search
+17
-3
@@ -75,14 +75,13 @@ function getDeviceInfo(class_code : uint8; subclass_code : uint8; prog_if : uint
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
procedure init();
|
function load(ptr : void) : boolean;
|
||||||
var
|
var
|
||||||
current_bus : uint8;
|
current_bus : uint8;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
console.writestringln('PCI: INIT BEGIN.');
|
|
||||||
console.writestringln('PCI: Scanning Bus: 0');
|
console.writestringln('PCI: Scanning Bus: 0');
|
||||||
scanBus(0);
|
scanBus(0);
|
||||||
|
|
||||||
//while unscanned busses scan busses
|
//while unscanned busses scan busses
|
||||||
current_bus := 1;
|
current_bus := 1;
|
||||||
while true do begin
|
while true do begin
|
||||||
@@ -93,7 +92,22 @@ begin
|
|||||||
current_bus := current_bus + 1;
|
current_bus := current_bus + 1;
|
||||||
end else break;
|
end else break;
|
||||||
end;
|
end;
|
||||||
|
load:= true;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure init();
|
||||||
|
var
|
||||||
|
DevID : TDeviceIdentifier;
|
||||||
|
|
||||||
|
begin
|
||||||
|
console.writestringln('PCI: INIT BEGIN.');
|
||||||
|
DevID.Bus:= biUnknown;
|
||||||
|
DevID.id0:= 0;
|
||||||
|
DevID.id1:= 0;
|
||||||
|
DevID.id2:= 0;
|
||||||
|
DevID.id3:= 0;
|
||||||
|
DevID.ex:= nil;
|
||||||
|
drivermanagement.register_driver_ex('PCI Driver', @DevID, @load, true);
|
||||||
console.writestringln('PCI: INIT END.');
|
console.writestringln('PCI: INIT END.');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
+53
-21
@@ -8,7 +8,8 @@ uses
|
|||||||
drivertypes,
|
drivertypes,
|
||||||
pmemorymanager,
|
pmemorymanager,
|
||||||
vmemorymanager,
|
vmemorymanager,
|
||||||
util;
|
util,
|
||||||
|
drivermanagement;
|
||||||
|
|
||||||
type
|
type
|
||||||
POHCI_MMR = ^TOHCI_MMR;
|
POHCI_MMR = ^TOHCI_MMR;
|
||||||
@@ -39,7 +40,7 @@ procedure init;
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
procedure init;
|
function loadOHCI(ptr : void) : boolean;
|
||||||
var
|
var
|
||||||
devices : TDeviceArray;
|
devices : TDeviceArray;
|
||||||
count : uint32;
|
count : uint32;
|
||||||
@@ -48,25 +49,6 @@ var
|
|||||||
MMR : POHCI_MMR;
|
MMR : POHCI_MMR;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
console.writestringln('USB: INIT BEGIN.');
|
|
||||||
|
|
||||||
devices:= PCI.getDeviceInfo($0C, $03, $00, count);
|
|
||||||
console.writestring('USB-UHCI: Found ');
|
|
||||||
console.writeint(count);
|
|
||||||
console.writestringln(' USB Controller(s).');
|
|
||||||
if count > 0 then begin
|
|
||||||
for i:=0 to count-1 do begin
|
|
||||||
console.writestring('USB: Controller[');
|
|
||||||
console.writeint(i);
|
|
||||||
console.writestring(']: ');
|
|
||||||
console.writehex(devices[i].device_id);
|
|
||||||
console.writestring(' ');
|
|
||||||
console.writehex(devices[i].vendor_id);
|
|
||||||
console.writestring(' ');
|
|
||||||
console.writehexln(devices[i].prog_if);
|
|
||||||
end;
|
|
||||||
end;
|
|
||||||
|
|
||||||
devices:= PCI.getDeviceInfo($0C, $03, $10, count);
|
devices:= PCI.getDeviceInfo($0C, $03, $10, count);
|
||||||
console.writestring('USB-OHCI: Found ');
|
console.writestring('USB-OHCI: Found ');
|
||||||
console.writeint(count);
|
console.writeint(count);
|
||||||
@@ -87,7 +69,57 @@ begin
|
|||||||
MMR:= POHCI_MMR(devices[i].address0);
|
MMR:= POHCI_MMR(devices[i].address0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
function loadUHCI(ptr : void) : boolean;
|
||||||
|
var
|
||||||
|
devices : TDeviceArray;
|
||||||
|
count : uint32;
|
||||||
|
i : uint32;
|
||||||
|
|
||||||
|
begin
|
||||||
|
devices:= PCI.getDeviceInfo($0C, $03, $00, count);
|
||||||
|
console.writestring('USB-UHCI: Found ');
|
||||||
|
console.writeint(count);
|
||||||
|
console.writestringln(' USB Controller(s).');
|
||||||
|
if count > 0 then begin
|
||||||
|
for i:=0 to count-1 do begin
|
||||||
|
console.writestring('USB: Controller[');
|
||||||
|
console.writeint(i);
|
||||||
|
console.writestring(']: ');
|
||||||
|
console.writehex(devices[i].device_id);
|
||||||
|
console.writestring(' ');
|
||||||
|
console.writehex(devices[i].vendor_id);
|
||||||
|
console.writestring(' ');
|
||||||
|
console.writehexln(devices[i].prog_if);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure init;
|
||||||
|
var
|
||||||
|
UHCI_ID, OHCI_ID : TDeviceIdentifier;
|
||||||
|
|
||||||
|
begin
|
||||||
|
console.writestringln('USB: INIT BEGIN.');
|
||||||
|
|
||||||
|
UHCI_ID.Bus:= biPCI;
|
||||||
|
UHCI_ID.id0:= idANY;
|
||||||
|
UHCI_ID.id1:= $0000000C;
|
||||||
|
UHCI_ID.id2:= $00000003;
|
||||||
|
UHCI_ID.id3:= $00000000;
|
||||||
|
UHCI_ID.ex:= nil;
|
||||||
|
|
||||||
|
OHCI_ID.Bus:= biPCI;
|
||||||
|
OHCI_ID.id0:= idANY;
|
||||||
|
OHCI_ID.id1:= $0000000C;
|
||||||
|
OHCI_ID.id2:= $00000003;
|
||||||
|
OHCI_ID.id3:= $00000010;
|
||||||
|
OHCI_ID.ex:= nil;
|
||||||
|
|
||||||
|
drivermanagement.register_driver('USB-UHCI Driver', @UHCI_ID, @loadUHCI);
|
||||||
|
drivermanagement.register_driver('USB-OHCI Driver', @OHCI_ID, @loadOHCI);
|
||||||
|
|
||||||
console.writestringln('USB: INIT END.');
|
console.writestringln('USB: INIT END.');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
+19
-2
@@ -32,7 +32,6 @@ var
|
|||||||
key_matrix_shift : array [1..256] of TKeyInfo;
|
key_matrix_shift : array [1..256] of TKeyInfo;
|
||||||
captin_hook : pp_hook_method = nil;
|
captin_hook : pp_hook_method = nil;
|
||||||
is_shift : boolean = false;
|
is_shift : boolean = false;
|
||||||
|
|
||||||
|
|
||||||
procedure init(keyboard_layout : array of TKeyInfo);
|
procedure init(keyboard_layout : array of TKeyInfo);
|
||||||
procedure hook(proc : pp_hook_method);
|
procedure hook(proc : pp_hook_method);
|
||||||
@@ -40,6 +39,8 @@ procedure lang_USA();
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
uses
|
||||||
|
drivermanagement;
|
||||||
|
|
||||||
procedure callback(scan_code : void);
|
procedure callback(scan_code : void);
|
||||||
begin
|
begin
|
||||||
@@ -58,11 +59,27 @@ begin
|
|||||||
if uint8(scan_code) = 170 then is_shift := false;
|
if uint8(scan_code) = 170 then is_shift := false;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function load(ptr : void) : boolean;
|
||||||
|
begin
|
||||||
|
isr33.hook(uint32(@callback));
|
||||||
|
console.writestringln('PS/2 KEYBOARD: LOADED.');
|
||||||
|
load:= true;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure init(keyboard_layout : array of TKeyInfo);
|
procedure init(keyboard_layout : array of TKeyInfo);
|
||||||
|
var
|
||||||
|
devid : TDeviceIdentifier;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
console.writestringln('PS/2 KEYBOARD: INIT BEGIN.');
|
console.writestringln('PS/2 KEYBOARD: INIT BEGIN.');
|
||||||
if keyboard_layout[1].key_code = 0 then lang_USA();
|
if keyboard_layout[1].key_code = 0 then lang_USA();
|
||||||
isr33.hook(uint32(@callback));
|
devid.bus:= biUnknown;
|
||||||
|
devid.id0:= 0;
|
||||||
|
devid.id1:= 0;
|
||||||
|
devid.id2:= 0;
|
||||||
|
devid.id3:= 0;
|
||||||
|
devid.ex:= nil;
|
||||||
|
drivermanagement.register_driver_ex('PS/2 Keyboard', @devid, @load, true);
|
||||||
console.writestringln('PS/2 KEYBOARD: INIT END.');
|
console.writestringln('PS/2 KEYBOARD: INIT END.');
|
||||||
end;
|
end;
|
||||||
//2A AA
|
//2A AA
|
||||||
|
|||||||
+19
-2
@@ -16,7 +16,8 @@ uses
|
|||||||
util,
|
util,
|
||||||
isr44,
|
isr44,
|
||||||
lmemorymanager,
|
lmemorymanager,
|
||||||
strings;
|
strings,
|
||||||
|
drivermanagement;
|
||||||
|
|
||||||
type
|
type
|
||||||
PMousePacket = ^TMousePacket;
|
PMousePacket = ^TMousePacket;
|
||||||
@@ -103,10 +104,26 @@ begin
|
|||||||
//console.writehexln(DWORD(raw));
|
//console.writehexln(DWORD(raw));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function load(ptr : void) : boolean;
|
||||||
|
begin
|
||||||
|
isr44.hook(uint32(@callback));
|
||||||
|
console.writestringln('PS/2 MOUSE: LOADED.');
|
||||||
|
load:= true;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure init();
|
procedure init();
|
||||||
|
var
|
||||||
|
devid : TDeviceIdentifier;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
console.writestringln('PS/2 MOUSE: INIT BEGIN.');
|
console.writestringln('PS/2 MOUSE: INIT BEGIN.');
|
||||||
isr44.hook(uint32(@callback));
|
devid.bus:= biUnknown;
|
||||||
|
devid.id0:= 0;
|
||||||
|
devid.id1:= 0;
|
||||||
|
devid.id2:= 0;
|
||||||
|
devid.id3:= 0;
|
||||||
|
devid.ex:= nil;
|
||||||
|
drivermanagement.register_driver_ex('PS/2 Mouse', @devid, @load, true);
|
||||||
console.writestringln('PS/2 MOUSE: INIT END.');
|
console.writestringln('PS/2 MOUSE: INIT END.');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
+160
-10
File diff suppressed because it is too large.
Load diff
@@ -78,6 +78,8 @@ begin
|
|||||||
terminal.init();
|
terminal.init();
|
||||||
terminal.registerCommand('MEMINFO', @terminal_command_meminfo, 'Print Simple Memory Information.');
|
terminal.registerCommand('MEMINFO', @terminal_command_meminfo, 'Print Simple Memory Information.');
|
||||||
|
|
||||||
|
drivermanagement.init();
|
||||||
|
|
||||||
console.init();
|
console.init();
|
||||||
|
|
||||||
console.writestringln('Booting Asuro...');
|
console.writestringln('Booting Asuro...');
|
||||||
|
|||||||
Reference in new issue
Block a user