Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3c164e8af | ||
|
|
76c419336e | ||
|
|
5e9d0004d7 | ||
|
|
2ad0ae8420 | ||
|
|
c0c199bfe6 | ||
|
|
7ec3bcb9b9 | ||
|
|
4bd0a2dfbf | ||
|
|
431e5bc8f4 | ||
|
|
8169d93a9c | ||
|
|
547251dbd0 | ||
|
|
7bbcc44c5e | ||
|
|
25475a88a7 | ||
|
|
db49c29627 | ||
|
|
c237553508 | ||
|
|
0c96d32754 | ||
|
|
3f83f279d7 | ||
|
|
82fe9fa6df | ||
|
|
983d9a428d | ||
|
|
2fa77d8295 | ||
|
|
f53afc1d2d | ||
|
|
cb7144f282 | ||
|
|
afdc83eaf6 |
+8
-1
@@ -1 +1,8 @@
|
||||
* text=auto eol=lf
|
||||
* text=auto eol=lf
|
||||
lvglh/** linguist-vendored
|
||||
lvgl/** linguist-vendored
|
||||
.vscode/* linguist-vendored
|
||||
lib/* linguist-generated
|
||||
release/* linguist-generated
|
||||
iso/* linguist-generated
|
||||
*.asm linguist-detectable
|
||||
@@ -15,3 +15,4 @@ localenv.json
|
||||
dockerout.txt
|
||||
AGENTS.md
|
||||
*.log
|
||||
/doc/*.md
|
||||
+1
-1
@@ -4,4 +4,4 @@ echo "======================="
|
||||
echo " "
|
||||
echo "Compiling FPC Sources..."
|
||||
echo " "
|
||||
fpc -Aelf -gw -g -gl -n -v0ew -O3 -OpPENTIUM3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/* -Fusrc/driver/net/* src/kernel.pas
|
||||
fpc -Aelf -gw -g -gl -n -v0ew -O3 -OpPENTIUM3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/* -Fusrc/driver/net/* -Fusrc/driver/bus/* -Fusrc/driver/bus/usb/* -Fusrc/driver/hid/* src/kernel.pas
|
||||
@@ -1,65 +0,0 @@
|
||||
// Copyright 2021 Kieron Morris
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
{
|
||||
Driver->Bus->EHCI - Enhanced Host Controller Interface Driver.
|
||||
|
||||
@author(Kieron Morris <[email protected]>)
|
||||
}
|
||||
unit EHCI;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
tracer,
|
||||
syslog,
|
||||
PCI,
|
||||
drivertypes,
|
||||
pmemorymanager,
|
||||
vmemorymanager,
|
||||
util,
|
||||
drivermanagement;
|
||||
|
||||
function load : boolean;
|
||||
|
||||
implementation
|
||||
|
||||
function load : boolean;
|
||||
var
|
||||
devices : TDeviceArray;
|
||||
count : uint32;
|
||||
i : uint32;
|
||||
|
||||
begin
|
||||
tracer.push_trace('EHCI.load');
|
||||
devices:= PCI.getDeviceInfo($0C, $03, $20, count);
|
||||
syslog.log('USB-EHCI Driver', 'Found ');
|
||||
syslog.writeint(count);
|
||||
syslog.writestringln(' USB Controller(s).');
|
||||
if count > 0 then begin
|
||||
for i:=0 to count-1 do begin
|
||||
syslog.log('USB-EHCI Driver', 'Controller[');
|
||||
syslog.writeint(i);
|
||||
syslog.writestring(']: ');
|
||||
syslog.writehex(devices[i].device_id);
|
||||
syslog.writestring(' ');
|
||||
syslog.writehex(devices[i].vendor_id);
|
||||
syslog.writestring(' ');
|
||||
syslog.writehexln(devices[i].prog_if);
|
||||
end;
|
||||
end;
|
||||
load:= true;
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -1,96 +0,0 @@
|
||||
// Copyright 2021 Kieron Morris
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
{
|
||||
Driver->Bus->OHCI - Open Host Controller Interface Driver.
|
||||
|
||||
@author(Kieron Morris <[email protected]>)
|
||||
}
|
||||
unit OHCI;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
tracer,
|
||||
syslog,
|
||||
PCI,
|
||||
drivertypes,
|
||||
pmemorymanager,
|
||||
vmemorymanager,
|
||||
util,
|
||||
drivermanagement;
|
||||
|
||||
type
|
||||
POHCI_MMR = ^TOHCI_MMR;
|
||||
TOHCI_MMR = packed record
|
||||
HcRevision : uint32;
|
||||
HcControl : uint32;
|
||||
HcCommandStatus : uint32;
|
||||
HcIntStatus : uint32;
|
||||
HcIntEnable : uint32;
|
||||
HcIntDisable : uint32;
|
||||
HcHCCA : uint32;
|
||||
HcPeriodCurrentED : uint32;
|
||||
HcControlHeadED : uint32;
|
||||
HcControlCurrentED : uint32;
|
||||
HcBulkHeadED : uint32;
|
||||
HcBulkCurrentED : uint32;
|
||||
HcDoneHead : uint32;
|
||||
HcFmRemaining : uint32;
|
||||
HcFmNumber : uint32;
|
||||
HcPeriodicStart : uint32;
|
||||
HcLSThreshold : uint32;
|
||||
HcRhDescriptorA : uint32;
|
||||
HcRhDescriptorB : uint32;
|
||||
HcRhStatus : uint32;
|
||||
end;
|
||||
|
||||
function load : boolean;
|
||||
|
||||
implementation
|
||||
|
||||
function load : boolean;
|
||||
var
|
||||
devices : TDeviceArray;
|
||||
count : uint32;
|
||||
i : uint32;
|
||||
block : uint32;
|
||||
MMR : POHCI_MMR;
|
||||
|
||||
begin
|
||||
tracer.push_trace('OHCI.load');
|
||||
devices:= PCI.getDeviceInfo($0C, $03, $10, count);
|
||||
syslog.log('USB-OHCI Driver', 'Found ');
|
||||
syslog.writeint(count);
|
||||
syslog.writestringln(' USB Controller(s).');
|
||||
if count > 0 then begin
|
||||
for i:=0 to count-1 do begin
|
||||
syslog.log('USB-OHCI Driver', 'Controller[');
|
||||
syslog.writeint(i);
|
||||
syslog.writestring(']: ');
|
||||
syslog.writehex(devices[i].device_id);
|
||||
syslog.writestring(' ');
|
||||
syslog.writehex(devices[i].vendor_id);
|
||||
syslog.writestring(' ');
|
||||
syslog.writehexln(devices[i].prog_if);
|
||||
block:= devices[i].address0 SHR 22;
|
||||
force_alloc_block(block, 0);
|
||||
map_page(block, block);
|
||||
MMR:= POHCI_MMR(devices[i].address0);
|
||||
end;
|
||||
end;
|
||||
load:= true;
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -18,7 +18,7 @@
|
||||
@author(Aaron Hance <[email protected]>)
|
||||
@author(Kieron Morris <[email protected]>)
|
||||
}
|
||||
unit PCI;
|
||||
unit pci;
|
||||
|
||||
interface
|
||||
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
// Copyright 2021 Kieron Morris
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
{
|
||||
Driver->Bus->UHCI - Universal Host Controller Interface Driver.
|
||||
|
||||
@author(Kieron Morris <[email protected]>)
|
||||
}
|
||||
unit UHCI;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
tracer,
|
||||
syslog,
|
||||
PCI,
|
||||
drivertypes,
|
||||
pmemorymanager,
|
||||
vmemorymanager,
|
||||
util,
|
||||
drivermanagement;
|
||||
|
||||
function load : boolean;
|
||||
|
||||
implementation
|
||||
|
||||
function load : boolean;
|
||||
var
|
||||
devices : TDeviceArray;
|
||||
count : uint32;
|
||||
i : uint32;
|
||||
|
||||
begin
|
||||
tracer.push_trace('UHCI.load');
|
||||
devices:= PCI.getDeviceInfo($0C, $03, $00, count);
|
||||
syslog.log('USB-UHCI Driver','Found ');
|
||||
syslog.writeint(count);
|
||||
syslog.writestringln(' USB Controller(s).');
|
||||
if count > 0 then begin
|
||||
for i:=0 to count-1 do begin
|
||||
syslog.log('USB-UHCI Driver','Controller[');
|
||||
syslog.writeint(i);
|
||||
syslog.writestring(']: ');
|
||||
syslog.writehex(devices[i].device_id);
|
||||
syslog.writestring(' ');
|
||||
syslog.writehex(devices[i].vendor_id);
|
||||
syslog.writestring(' ');
|
||||
syslog.writehexln(devices[i].prog_if);
|
||||
end;
|
||||
end;
|
||||
load:= true;
|
||||
end;
|
||||
|
||||
end.
|
||||
@@ -1,65 +0,0 @@
|
||||
// Copyright 2021 Kieron Morris
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
{
|
||||
Driver->Bus->XHCI - eXtensible Host Controller Interface Driver.
|
||||
|
||||
@author(Kieron Morris <[email protected]>)
|
||||
}
|
||||
unit XHCI;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
tracer,
|
||||
syslog,
|
||||
PCI,
|
||||
drivertypes,
|
||||
pmemorymanager,
|
||||
vmemorymanager,
|
||||
util,
|
||||
drivermanagement;
|
||||
|
||||
function load : boolean;
|
||||
|
||||
implementation
|
||||
|
||||
function load : boolean;
|
||||
var
|
||||
devices : TDeviceArray;
|
||||
count : uint32;
|
||||
i : uint32;
|
||||
|
||||
begin
|
||||
tracer.push_trace('XHCI.load');
|
||||
devices:= PCI.getDeviceInfo($0C, $03, $30, count);
|
||||
syslog.log('USB-XHCI Driver', 'Found ');
|
||||
syslog.writeint(count);
|
||||
syslog.writestringln(' USB Controller(s).');
|
||||
if count > 0 then begin
|
||||
for i:=0 to count-1 do begin
|
||||
syslog.log('USB-XHCI Driver', 'Controller[');
|
||||
syslog.writeint(i);
|
||||
syslog.writestring(']: ');
|
||||
syslog.writehex(devices[i].device_id);
|
||||
syslog.writestring(' ');
|
||||
syslog.writehex(devices[i].vendor_id);
|
||||
syslog.writestring(' ');
|
||||
syslog.writehexln(devices[i].prog_if);
|
||||
end;
|
||||
end;
|
||||
load:= true;
|
||||
end;
|
||||
|
||||
end.
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@
|
||||
|
||||
@author(Kieron Morris <kjm@kieronmorris.me>)
|
||||
}
|
||||
unit USB;
|
||||
unit usb;
|
||||
|
||||
interface
|
||||
|
||||
@@ -30,6 +30,12 @@ uses
|
||||
vmemorymanager,
|
||||
util,
|
||||
drivermanagement,
|
||||
usbtypes,
|
||||
usbcore,
|
||||
usbhub,
|
||||
usb_keyboard,
|
||||
usb_mouse,
|
||||
usb_storage,
|
||||
OHCI, UHCI, EHCI, XHCI;
|
||||
|
||||
procedure init;
|
||||
@@ -40,24 +46,28 @@ function loadXHCI(ptr : void) : boolean;
|
||||
begin
|
||||
push_trace('USB.loadXHCI');
|
||||
loadXHCI:= XHCI.load;
|
||||
pop_trace;
|
||||
end;
|
||||
|
||||
function loadEHCI(ptr : void) : boolean;
|
||||
begin
|
||||
push_trace('USB.loadEHCI');
|
||||
loadEHCI:= EHCI.load;
|
||||
pop_trace;
|
||||
end;
|
||||
|
||||
function loadOHCI(ptr : void) : boolean;
|
||||
begin
|
||||
push_trace('USB.loadOHCI');
|
||||
loadOHCI:= OHCI.load;
|
||||
pop_trace;
|
||||
end;
|
||||
|
||||
function loadUHCI(ptr : void) : boolean;
|
||||
begin
|
||||
push_trace('USB.loadUHCI');
|
||||
loadUHCI:= UHCI.load;
|
||||
pop_trace;
|
||||
end;
|
||||
|
||||
procedure init;
|
||||
@@ -70,6 +80,19 @@ var
|
||||
begin
|
||||
push_trace('USB.init');
|
||||
syslog.logln('USB Driver', 'INIT BEGIN.');
|
||||
|
||||
{ Initialize USB core (HC list, etc.) }
|
||||
usbcore.init;
|
||||
|
||||
{ Initialize hub driver (registers class driver for $09) }
|
||||
usbhub.init;
|
||||
|
||||
{ Initialize HID class drivers }
|
||||
usb_keyboard.init;
|
||||
usb_mouse.init;
|
||||
|
||||
{ Initialize storage class driver }
|
||||
usb_storage.init;
|
||||
|
||||
UHCI_ID.Bus:= biPCI;
|
||||
UHCI_ID.id0:= idANY;
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
+29
-340
File diff suppressed because it is too large
Load Diff
+108
-309
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user