Solved

Detecting size of L2 Cache,...

Posted on 1998-09-24
12
351 Views
Last Modified: 2010-04-06
kind of tag-RAM, type and acces rates of RAM.

purpose: determine if the current config makes sense (cacheable area...)

Windows 9x & Windows NT

can anybody help me with this?
0
Comment
Question by:BlackDeath
  • 7
  • 3
  • 2
12 Comments
 
LVL 1

Author Comment

by:BlackDeath
Comment Utility
Edited text of question
0
 
LVL 5

Expert Comment

by:inter
Comment Utility
I can not find any info but I know that on Pentium II systems the L2 cache is built into the processor assembly, and handles the cache function for up to 2GB of DRAM. So for only pentium II we may make sure that the current config makes sense.
regards, igor
0
 
LVL 1

Author Comment

by:BlackDeath
Comment Utility
hi, igor.

yo (with pentium II).

you cannot find any info: at home or any url?
i dunno which keyword to use in order to retrieve senseful results.
when i'm looking for "+l2 +cache +detection" i get tons of crap but not what i'm looking for.
i'd be very thankful if you'd keep on looking & post it here when found anything...

thanxsofar & til l8r,

Black Death.
0
 
LVL 5

Expert Comment

by:inter
Comment Utility
Hi again,
I mean there is no relevant info-I think I know what you want-. I found how to detect it on MAC but not on PC.(there is no registry entry on pc either rather than a Session Managers Memory Manager caching)...I am on the subject...
c.u. igor
0
 
LVL 1

Accepted Solution

by:
jecksom earned 100 total points
Comment Utility
Hi , BlackDeath !

I didn't found standart function to determinate secondary cache size , it's vary
from one vender to other + you must also select Chipset , example :

Bitfields for Intel 82437/82439HX cache control register:
Bit(s)  Description    
 7-6    secondary cache size
        00 none
        01 256K
        10 512K
        11 reserved,

guess PII with 440LX , BX , NX , etc would be different also.

I can show you how to do this for VIA Technologies and Intel (different functions),
and selected chipset. O'coz , you can also check out "Interrupt list" yourself ,
(INT 1A,AX - B10A : PCI BIOS v2.0c+ - READ CONFIGURATION DWORD)

Best way , as far as i could see, would be checking data transfer time from
one point of memory to other with incremeting write/read block by 64KB.
In the point where transfer slow down more than 20% from previous same operation it
will be end of L2 cache.
if  previous_time/100*20+previous_time)/64KB_block_prev<current_time/64KB_block_cur
then L2_cache continue

Jecksom
0
 
LVL 1

Author Comment

by:BlackDeath
Comment Utility
hoi, jecksom.

afa interrupts are concerned, i doubt it would work with nt.

regarding your 2nd suggestion (measure transfer times):
i think this can only work if there's more ram installed than cacheable.
if this is so, then how will you detect the slowing down of data transfer when it won't occur?

or didn't i dig your answer?


0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Expert Comment

by:jecksom
Comment Utility
Hehe ,

Hm, no, PCI BIOS doesn't depend from NT , WIN9X , UNIX or whatever , o'coz if you
didn't reverse engeenered your Flashed ROM and cleared 1A BIOS interrupt support ;)

2nd : Well ,  as i remember WIN95 required 8 MB memory (!MB) minimal , and currently
x86 L2 caches have maximum 2MB (Klamath - 256 or 512KB) , so i sure it possible
allocate 2MB*2 to test on it ! (o'coz, if you talking about x86, not things like some models of SUN with have up to 2GB! caches already :) )

Jecksom

PS :By the way , looks like Linux using this (transfer time) metod to determinate L2 cache size.

0
 
LVL 1

Author Comment

by:BlackDeath
Comment Utility
well, i'll give it a try. i'll be back soon. thanxsofar.


Black Death.
0
 
LVL 1

Author Comment

by:BlackDeath
Comment Utility
hi, jecksom.

sorry i didn't reply for so long.
i couldn't get this (determining cache size by data transfer rate) to work. would you be so nice as to post a code example in form of a function returning a value indicating the size of l2 cache? if you do so and i get it to work i'll increase to 100 and rate a.

tia & sorry again.

Black Death.
0
 
LVL 1

Expert Comment

by:jecksom
Comment Utility
hi BlackDeath!

Here is procedure :

procedure TForm1.Button1Click(Sender: TObject);
var L2_size:byte;L2_size_str:string;
begin
asm
mov eax,2
db  0fh, 0a2h //CPUID
mov L2_size,dl
end;
case L2_size of
$40:L2_size_str:='No L2 Cache';
$41:L2_size_str:=
    'Unified cache, 32 byte cache line, 4-way set associative, 128K';
$42:L2_size_str:=
    'Unified cache, 32 byte cache line, 4-way set associative, 256K';
$43:L2_size_str:=
    'Unified cache, 32 byte cache line, 4-way set associative, 512K';
$44:L2_size_str:=
    'Unified cache, 32 byte cache line, 4-way set associative, 1M';
$45:L2_size_str:=
    'Unified cache, 32 byte cache line, 4-way set associative, 2M';
end;
showmessage(l2_size_str);
end;

  I must give you appologizes , i've tryed my own ( :) memory transfer time) method and
failed , so i guess this solution could be more useful for ya . I also must warn you
to detect L2 cache size using this method (CPUID) on IDT , RISE , CYRIX , AMD CPUs,
they little bit different, if they ever exist .
  In this example i've showing only L2 cache size , i can give you all info that i found over
inet + books+PDFs , so you can detect some required conditions , ie :
CPUID opcodes  supported ? ,
CPU family,
L1 cache size,
preventing crashs on different x86 platforms,
etc;

Jecksom

PS: i also feel that you already known CPUID method :)  

0
 
LVL 1

Author Comment

by:BlackDeath
Comment Utility
hi, jecksom.

i've tested this on my ppro 200 - it works on 95 and nt.
i've tested it on several other machines -
well, sometimes it works, sometimes not (External Exception) - all intel x86.

>>
  In this example i've showing only L2 cache size , i can give you all info that i found over
       inet + books+PDFs , so you can detect some required conditions , ie :
       CPUID opcodes  supported ? ,
       CPU family,
       L1 cache size,
       preventing crashs on different x86 platforms,
       etc;
<<

would you mail me these info, please?
andreas.naguschewski@vt.siemens.de

tia,

Black Death.
0
 
LVL 1

Author Comment

by:BlackDeath
Comment Utility
thanxalot.

where did you get this pdf from?
is there more info like that?

thanx for your offer regarding your eMail.
i'll most porbably make use of it...

thanx again & have a nice day,

Black Death.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now