Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81d1b97cd0 | ||
|
|
84b589c856 | ||
|
|
8b80b6864b | ||
|
|
232f6b5485 |
No files matched your search
+1
-1
@@ -4,4 +4,4 @@ echo "======================="
|
||||
echo " "
|
||||
echo "Compiling FPC Sources..."
|
||||
echo " "
|
||||
fpc -Aelf -gw -n -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/storage/* -Fusrc/driver/storage/AHCI/* -Fusrc/driver/* -Fusrc/driver/net/* src/kernel.pas
|
||||
fpc -Aelf -gw -n -O3 -Op3 -Si -Sc -Sg -Xd -CX -XXs -CfSSE -CfSSE2 -Rintel -Pi386 -Tlinux -FElib/ -Fusrc/* -Fusrc/driver/storage/* -Fusrc/driver/storage/AHCI/* -Fusrc/driver/* -Fusrc/driver/net/* -Fusrc/prog/* src/kernel.pas
|
||||
@@ -0,0 +1 @@
|
||||
Hello from the Asuro ISO!
|
||||
+585
File diff suppressed because it is too large.
Load diff
+402
-209
File diff suppressed because it is too large.
Load diff
@@ -20,15 +20,15 @@
|
||||
unit AHCITypes;
|
||||
interface
|
||||
uses
|
||||
util,
|
||||
PCI,
|
||||
drivertypes,
|
||||
drivermanagement,
|
||||
lmemorymanager,
|
||||
console,
|
||||
vmemorymanager,
|
||||
drivermanagement,
|
||||
drivertypes,
|
||||
idetypes,
|
||||
lists;
|
||||
lists,
|
||||
lmemorymanager,
|
||||
PCI,
|
||||
util,
|
||||
vmemorymanager;
|
||||
|
||||
const
|
||||
AHCI_CONTROLLER_MODE = $80000000;
|
||||
|
||||
@@ -23,14 +23,15 @@ interface
|
||||
|
||||
uses
|
||||
console,
|
||||
storagemanagement,
|
||||
util, terminal,
|
||||
lmemorymanager,
|
||||
strings,
|
||||
lists,
|
||||
tracer,
|
||||
lmemorymanager,
|
||||
rtc,
|
||||
serial,
|
||||
rtc;
|
||||
storagemanagement,
|
||||
strings,
|
||||
terminal,
|
||||
tracer,
|
||||
util;
|
||||
|
||||
type
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,120 @@
|
||||
{
|
||||
Driver->Storage->FilesystemManager - Filesystem driver registry and routing.
|
||||
|
||||
Filesystem drivers (FAT32, FlatFS, etc.) register themselves here.
|
||||
When VolumeManager discovers a volume, FilesystemManager probes it
|
||||
against all registered filesystem drivers to detect the filesystem type.
|
||||
|
||||
@author(Aaron Hance <[email protected]>)
|
||||
}
|
||||
unit filesystemmanager;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
lists,
|
||||
lmemorymanager,
|
||||
storagetypes,
|
||||
strings,
|
||||
tracer,
|
||||
util;
|
||||
|
||||
var
|
||||
filesystems : PLinkedListBase;
|
||||
|
||||
procedure init();
|
||||
procedure register_filesystem(filesystem : PFilesystem);
|
||||
function get_filesystem_count() : uint32;
|
||||
function get_filesystem(index : uint32) : PFilesystem;
|
||||
function find_filesystem_by_name(name : pchar) : PFilesystem;
|
||||
function find_filesystem_by_id(system_id : uint8) : PFilesystem;
|
||||
procedure probe_volume(volume : PStorage_Volume);
|
||||
|
||||
implementation
|
||||
|
||||
procedure init();
|
||||
begin
|
||||
push_trace('FilesystemManager.init');
|
||||
filesystems := LL_New(sizeof(TFilesystem));
|
||||
end;
|
||||
|
||||
procedure register_filesystem(filesystem : PFilesystem);
|
||||
var
|
||||
elm : void;
|
||||
begin
|
||||
push_trace('FilesystemManager.register_filesystem');
|
||||
|
||||
elm := LL_Add(filesystems);
|
||||
memcpy(uint32(filesystem), uint32(elm), sizeof(TFilesystem));
|
||||
end;
|
||||
|
||||
function get_filesystem_count() : uint32;
|
||||
begin
|
||||
get_filesystem_count := LL_Size(filesystems);
|
||||
end;
|
||||
|
||||
function get_filesystem(index : uint32) : PFilesystem;
|
||||
begin
|
||||
if index < LL_Size(filesystems) then
|
||||
get_filesystem := PFilesystem(LL_Get(filesystems, index))
|
||||
else
|
||||
get_filesystem := nil;
|
||||
end;
|
||||
|
||||
function find_filesystem_by_name(name : pchar) : PFilesystem;
|
||||
var
|
||||
i : uint32;
|
||||
fs : PFilesystem;
|
||||
begin
|
||||
push_trace('FilesystemManager.find_filesystem_by_name');
|
||||
find_filesystem_by_name := nil;
|
||||
|
||||
for i := 0 to LL_Size(filesystems) - 1 do begin
|
||||
fs := PFilesystem(LL_Get(filesystems, i));
|
||||
if stringEquals(fs^.sName, name) then begin
|
||||
find_filesystem_by_name := fs;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
function find_filesystem_by_id(system_id : uint8) : PFilesystem;
|
||||
var
|
||||
i : uint32;
|
||||
fs : PFilesystem;
|
||||
begin
|
||||
push_trace('FilesystemManager.find_filesystem_by_id');
|
||||
find_filesystem_by_id := nil;
|
||||
|
||||
for i := 0 to LL_Size(filesystems) - 1 do begin
|
||||
fs := PFilesystem(LL_Get(filesystems, i));
|
||||
if fs^.system_id = system_id then begin
|
||||
find_filesystem_by_id := fs;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure probe_volume(volume : PStorage_Volume);
|
||||
var
|
||||
i : uint32;
|
||||
fs : PFilesystem;
|
||||
begin
|
||||
push_trace('FilesystemManager.probe_volume.enter');
|
||||
|
||||
{ Try each registered filesystem's identify callback against this volume }
|
||||
for i := 0 to LL_Size(filesystems) - 1 do begin
|
||||
fs := PFilesystem(LL_Get(filesystems, i));
|
||||
if fs^.identifyCallback <> nil then begin
|
||||
push_trace('FilesystemManager.probe_volume.tryFS');
|
||||
if fs^.identifyCallback(volume) then begin
|
||||
volume^.filesystem := fs;
|
||||
push_trace('FilesystemManager.probe_volume.found');
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
push_trace('FilesystemManager.probe_volume.exit');
|
||||
end;
|
||||
|
||||
end.
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -109,7 +109,7 @@ type
|
||||
base : uint16;
|
||||
ctrl : uint16;
|
||||
bmide : uint16;
|
||||
noInter : uint8
|
||||
noInter : uint8;
|
||||
end;
|
||||
|
||||
TIDE_Status = bitpacked record
|
||||
@@ -122,6 +122,7 @@ type
|
||||
IDDEX : Boolean;
|
||||
ERROR : Boolean;
|
||||
end;
|
||||
|
||||
PIDE_Status = ^TIDE_Status;
|
||||
|
||||
TIDE_Device = record
|
||||
@@ -44,8 +44,27 @@ implementation
|
||||
function LBA_2_CHS(lba : uint32) : T24bit;
|
||||
var
|
||||
dat : T24bit;
|
||||
cylinder, head, sector : uint16;
|
||||
sectors_per_track : uint16;
|
||||
heads_per_cylinder : uint16;
|
||||
begin
|
||||
//TODO impliment procedure
|
||||
// Standard CHS geometry values
|
||||
sectors_per_track := 63;
|
||||
heads_per_cylinder := 255;
|
||||
|
||||
// Calculate CHS values from LBA
|
||||
sector := (lba mod sectors_per_track) + 1; // Sectors are 1-indexed
|
||||
head := (lba div sectors_per_track) mod heads_per_cylinder;
|
||||
cylinder := (lba div sectors_per_track) div heads_per_cylinder;
|
||||
|
||||
// Pack into MBR CHS format (3 bytes):
|
||||
// Byte 0: Head (8 bits)
|
||||
// Byte 1: Sector (bits 0-5) | Cylinder high 2 bits (bits 6-7)
|
||||
// Byte 2: Cylinder low 8 bits
|
||||
dat[0] := head;
|
||||
dat[1] := (sector and $3F) or ((cylinder shr 8) shl 6);
|
||||
dat[2] := (cylinder and $FF);
|
||||
|
||||
LBA_2_CHS := dat;
|
||||
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
File diff suppressed because it is too large.
Load diff
Loaded 20 of 36 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user