refactor: namespace restructure of entire codebase
continuous-integration/drone/push Build is passing
continuous-integration/drone/push Build is passing
Reorganize all source files into a hierarchical namespace structure with dot-separated unit names matching directory paths. Major changes: - src/prog/ -> src/app/ (app.*.pas) - src/fault/ -> src/arch/x86/fault/ (arch.x86.fault.*.pas) - src/isr/ -> src/arch/x86/isr/ (arch.x86.isr.*.pas) - src/include/ -> src/core/ (core.*.pas) + src/arch/x86/ - src/driver/ subtree reorganized with driver.* namespace prefixes - src/driver/storage/con/ -> src/driver/storage/ctl/ (Windows reserved name fix) - src/driver/storage/ split into con(ctl)/fs/vol/ subdirectories - src/driver/net/ flattened from l1-l5 layers to driver.net.*.pas - kernel.pas -> asuro.pas, faults.pas -> arch.x86.faults.pas - stdio.pas/syslog.pas -> io/io.stdio.pas, io/io.syslog.pas - processmanager.pas -> proc/proc.mgr.pas - lmemorymanager.pas -> memory/memory.heap.pas - Build scripts moved to toolchain/ - Added compat/ shims for lmemorymanager and types - Added doc/namespace.md tracking the refactor 197 files changed, 6292 insertions(+), 5526 deletions(-)
This commit is contained in:
1 parent
e922f086c2
commit
6fa008ed79
197 files changed
+6291
-5525
No files matched your search
@@ -0,0 +1,88 @@
|
||||
// Copyright 2021 Aaron Hance
|
||||
//
|
||||
// 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->driver.bus.usb->USB_Storage - driver.bus.usb Mass Storage Class Driver (stub).
|
||||
|
||||
Registers with driver.mgr as a driver.bus.usb class driver matching
|
||||
mass storage devices (class $08, subclass $06 SCSI, protocol $50 BBB).
|
||||
Currently a skeleton that recognises the device but performs no I/O —
|
||||
full Bulk-Only Transport support is planned.
|
||||
|
||||
@author(Aaron Hance <[email protected]>)
|
||||
}
|
||||
unit driver.storage.ctl.usb;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
driver.mgr,
|
||||
memory.heap,
|
||||
driver.storage.types,
|
||||
io.syslog,
|
||||
debug.tracer,
|
||||
driver.bus.usb.core,
|
||||
driver.bus.usb.types,
|
||||
core.util, arch.x86.util;
|
||||
|
||||
procedure init;
|
||||
|
||||
implementation
|
||||
|
||||
{ ========================= Constants ========================= }
|
||||
|
||||
const
|
||||
USB_CLASS_MASS_STORAGE = $08;
|
||||
USB_SC_SCSI = $06; { SCSI transparent command set }
|
||||
USB_PROTO_BBB = $50; { Bulk-Only (BBB) transport }
|
||||
|
||||
{ ========================= Class driver callback ========================= }
|
||||
|
||||
{ Called by driver.mgr when a mass-storage interface is matched.
|
||||
For now we just log it. }
|
||||
function load(ptr : void) : boolean;
|
||||
begin
|
||||
push_trace('driver.storage.ctl.usb.load');
|
||||
io.syslog.logln('driver.bus.usb-Storage', 'Mass-storage device detected (stub - no I/O yet).');
|
||||
|
||||
{ TODO: read Max LUN, set up Bulk-Only endpoints, register with
|
||||
driver.storage.mgr via driver.storage.mgr.register_device. }
|
||||
|
||||
load := true;
|
||||
pop_trace;
|
||||
end;
|
||||
|
||||
{ ========================= Init ========================= }
|
||||
|
||||
procedure init;
|
||||
var
|
||||
MSID : TDeviceIdentifier;
|
||||
begin
|
||||
push_trace('driver.storage.ctl.usb.init');
|
||||
io.syslog.logln('driver.bus.usb-Storage', 'INIT BEGIN.');
|
||||
|
||||
MSID.Bus := biUSB;
|
||||
MSID.id0 := idANY; { Any VID:PID }
|
||||
MSID.id1 := $FFFFFFFF; { Any device class }
|
||||
MSID.id2 := USB_CLASS_MASS_STORAGE;{ bInterfaceClass = $08 }
|
||||
MSID.id3 := USB_SC_SCSI; { bInterfaceSubClass = $06 }
|
||||
MSID.id4 := USB_PROTO_BBB; { bInterfaceProtocol = $50 }
|
||||
MSID.ex := nil;
|
||||
|
||||
driver.mgr.register_driver('driver.bus.usb Storage Driver', @MSID, @load);
|
||||
|
||||
io.syslog.logln('driver.bus.usb-Storage', 'INIT END.');
|
||||
pop_trace;
|
||||
end;
|
||||
|
||||
end.
|
||||
Reference in new issue
Block a user