Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!cs.utexas.edu!asuvax!noao!ncar!gatech!prism!mailer.cc.fsu.edu!loligo!onyx From: onyx@loligo (Jeff Phillips) Newsgroups: comp.sys.ibm.pc.hardware Subject: Re: hard 80386 questions Keywords: 80386 (80286) Message-ID: <1991Mar29.091522.18681@mailer.cc.fsu.edu> Date: 29 Mar 91 14:28:07 GMT References: <5468@archive.BBN.COM> Sender: Jeffrey D. Phillips (onyx@loligo.cc.fsu.edu, onyx@128.186.2.99) Organization: Florida State University Lines: 114 In article <5468@archive.BBN.COM> grossman@star-trek.bbn.com (Martin Grossman) writes: >On my 80386 (DX) I have 4 MB ram mem. I assume its physicaly addressed >startin at 0 (ie 00000000:0000 ). This is a proper assumption. >Theirs also some RAM chips (10 of them) for the cache and shaddow ram. The chips on the mainboard that you are speaking of are strictly Cache. See below for my description of Shadow RAM... >Their are 2 rom area that nortons SI tells me about in the whole system. >One is on the SVGA board and its address is at C000:0 L 8000 (ie 32K) >The other is on the system board (AMI bios) and is addressed at >F000:0000 L FFFF (ie 64K). > > >1) Where are those roms within the 80386 address space? I know it can't > be within the first 4MB since youd have memory conflicts. They are located at the absolute addresses C000:0000 and F000:0000, which on 286 or better machines, is converted to a 20 bit segment and a 16 bit offset, or 0C000:0000 and 0F000:0000. >2) When I run the extended CMOS setup and turn off shaddow ram then I can > tell the system runs slowwer, BUT after I turn it back on, I go into > debug and that mem C000:0L8000 and F000:0LFFFF still looks like ROM > (ie I use the 'e' command to change unused words but the original > values are still their when I dump it) (ie It looks like when > shadow is enabled it copies the rom to fast ram, maps the ram in > as the rom addresses but disables write accessing...is this right) This is much closer to the point... I will summarize at the bottom of this followup... >3) When I run a TSR that came with the SVGA that copies the VGA ROM > (I've compared it byte for byte) into low ram (ie within the TSR) > then video accesses are even faster that using shadow ram. Why is > this. I assumed that shadow ram was some of that (10 chips fast > ram used also for cache) > >4) When cache/shadowram/etc..etc are all turned off SI gives and index > of 39.9 (this is a 33MHZ system).....when cache.etc.etc are all turned > on then SI reports 52.3......I don't remember the actual numbers > but landmarks cpuspeed program show a high improvment BUT only when I > switch (turbo) to lower 16MHZ setting (cpuspeed bombs out when run > in high speed mode) > >PS does anyone know where I can get ahold of (ANY) source code (assembler) > of any 80386 BIOS (even one for a different system). I want to use > this (in congunction with reading the 80386 hardware manuals) to learn > all about paging/segments/linear addressing/vitual 8086 mode/protected > mode etc etc etc I am posting this reply in the newsgroup because I think it might help a few more people understand the concepts of cache/shadow, etc... The earliest computers in the IBM PC line were designed to address 1 megabyte of memory, specifically, a 20-bit address containing a 16 bit offset and a 16 bit segment, or "paragraph" number. When an address is posted like B800:0000, it can be converted in the following way to a simple hex absolute offset: 0000 (offset) +B800 (segment) ------ B8000 (absolute address) The area between 640k and one megabyte, however, was strictly reserved for the computer's ROM, BIOS, and other critical operation memory, such as Video. When the 286 came out, the addressable RAM jumped from 1 meg to 16 meg, having added another hex digit to the address, making the total a 24-bit address. Since people expanding their memory to 1 megabyte STILL couldn't use the RAM between 640 and 1024k (384k of dead space), motherboards started to take ad- vantage of this by using the "unusable" RAM to reflect the contents of ROM, which are NOTICEABLE slower for this reason: RAM has 0-1 wait states, if the proper chips are put in... ROM has 3-4! Therefore, the ROM is copied into the faster RAM at boot-up, and the RAM is made to emulate the ROM in write-protect and addressing. Therefore, the term SHADOW ram, is RAM in this "dead space" that is reallocated to take the place of system ROMs and BIOS. Current development on the 286/386 allows programs like QEMM by Quarterdeck to reassign the address of all remain- ing memory in this area (Shadow only takes up 128k) for program use. Cache memory, however, is a bank of *FAST* RAM chips, usually 20-25 nanoseconds, (normal RAM is 60-80 at best) into which current RAM contents are copied, very similar to a disk cache: when a new area of memory is requested, cache contents are flushed back into the RAM from which it was taken, modifications included, and the new area is read into the Cache. From that point on, all memory read/ write is performed on the cache, making memory I/O much faster, and speeding up the operation of the computer substantially. The reason computers aren't built with 20-25 nanosecond RAMs to begin with is simply cost and size... It would be quite a feat to fit even 2 megabytes of fast DRAMs onto a babysize motherboard! So this is the how and why of your system... any questions? (grin) As for 386 BIOS, the BIOS isn't what you need the code for, since only some BIOSes have page-swapping etc... (this is handled by the software) There are several 80386 assembly language books on the market, you might drop into a bookstore sometime and look at the 80386 Microprocessor Handbook (Publisher: Osborne McGraw-Hill, Authors: Pappas & Murray) as well as the other titles out there... I have found most of Osborne/MH books to be very good in these areas as well as high-mid level programming languages. Good Luck! =----------------------------------------------------------= = Jeff Phillips onyx@loligo.cc.fsu.edu = = jeff!phillips@f100.n3605.z1.fidonet.org = =----------------------------------------------------------=