git-svn-id: https://spexeah.com:8443/svn/Asuro@655 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
kieron 2018-05-03 23:43:24 +00:00
parent 6ae51ac70d
commit 42d23dd8c9
58 changed files with 30 additions and 6 deletions

BIN
Asuro.iso

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -78,6 +78,7 @@ type
end; end;
TClockSpeed = record TClockSpeed = record
Hz : uint32; Hz : uint32;
KHz : uint32;
MHz : uint32; MHz : uint32;
GHz : uint32; GHz : uint32;
end; end;
@ -154,19 +155,24 @@ end;
procedure getCPUClockSpeed; procedure getCPUClockSpeed;
var var
t1, t2 : TDateTime; t1, t2 : TDateTime;
c1, c2 : uint64;
c : uint32; c : uint32;
begin begin
c:= 0; c:= 0;
t1:= getDateTime; if CPUID.Capabilities0^.TSC then begin
t2:= getDateTime; t1:= getDateTime;
while (t1.Seconds = t2.Seconds) do begin
inc(c);
t2:= getDateTime; t2:= getDateTime;
c1:= getTSC;
while (t1.Seconds = t2.Seconds) do begin
t2:= getDateTime;
end;
c2:= getTSC;
c:= c2 - c1;
end; end;
CPUID.ClockSpeed.Hz:= c; CPUID.ClockSpeed.Hz:= c;
CPUID.ClockSpeed.MHz:= CPUID.ClockSpeed.Hz div 1000; CPUID.ClockSpeed.KHz:= CPUID.ClockSpeed.Hz div 1000;
CPUID.ClockSpeed.MHz:= CPUID.ClockSpeed.KHz div 1000;
CPUID.ClockSpeed.GHz:= CPUID.ClockSpeed.MHz div 1000; CPUID.ClockSpeed.GHz:= CPUID.ClockSpeed.MHz div 1000;
end; end;

View File

@ -49,6 +49,7 @@ procedure sleep(seconds : uint32);
function get16bitcounter : uint16; function get16bitcounter : uint16;
function get32bitcounter : uint32; function get32bitcounter : uint32;
function get64bitcounter : uint64; function get64bitcounter : uint64;
function getTSC : uint64;
function BCDToUint8(bcd : uint8) : uint8; function BCDToUint8(bcd : uint8) : uint8;
@ -358,6 +359,23 @@ begin
get64bitcounter:= bios_data_area.Counters.c64; get64bitcounter:= bios_data_area.Counters.c64;
end; end;
function getTSC : uint64;
var
hi, lo : uint32;
begin
asm
PUSH EAX
PUSH EDX
RDTSC
MOV hi, EDX
MOV lo, EAX
POP EDX
POP EAX
end;
getTSC:= (hi SHL 32) OR lo;
end;
procedure BSOD(fault : pchar; info : pchar); procedure BSOD(fault : pchar; info : pchar);
var var
trace : pchar; trace : pchar;