Unknown

new topic     » goto parent     » topic index » view thread      » older message » newer message

WS> Does anyone know how to detect XMS/EMS?  I've used something
documented in
 WS> my PC INTERRUPTS book, but I can't seem to get it to work.

The following code was *mostly* right. Go back to your original
source to
compare the changes I made:

 procedure check_ems (VAR installed:boolean; VAR ver,ver2:byte); var
   regs  :  registers;
 begin
   regs.ax := $46;
   intr($67,regs);
   installed := regs.ah = $00;
   if (installed = true) then
     begin
       ver := hi(regs.al);
       ver2 := lo(regs.al);
     end;
 end;

 procedure check_xms (VAR installed:boolean; VAR ver,ver2:byte); var
   regs  :  registers;
 begin
   regs.ax := $4300;
   intr($2F,regs);
   installed := regs.al = $80;
   if (installed = true) then
     begin
       regs.ax := $4310;
       regs.ah := $00;
       intr($2F,regs);
       ver := regs.ax;
       ver2 := regs.bx;
     end;
 end;

 WS> I am pretty sure I'm calling the interrupts right, but it always
returns
 WS> false, indicating that I do NOT have EMS/XMS, although I do.
Can anyone
 WS> help me out?

You were. Mostly. What you forgot was that when a real world book
like PC
Interrupts says "Load the AX register with the value 4300h", it means
to us
Pascal programmers "Load the AX variable with the value $4300". Note
the dollar
sign. That means hexadecimal (like the little h on the end means
hexadecimal to
assembly programmers).

Chris KB7RNL =->

--- GoldED 2.41
 * Origin: SlugPoint * Coos Bay, OR USA (1:356/18.2)

********** next code for looking at CMOS information **********
{ >I heard many times about people talking about CMOS password ?
>Is it a password that comes with the hardware ???
>
I'll try to make a long story short. One of the crucial parts of the
PC
is the MC146818 RTC chip. Although this primarily is a real time
clock,
it also contains 64 bytes of RAM, which conveniently are buffered by a
battery or an accu, so they keep the volatile info even when you turn
the PC off (at least as long the battery hasn't turned into fluid smile
All the setup options of the BIOS are stored in those 64 bytes. Modern
BIOSes usually allow to have a password option set for either at every
booting or just when entering the setup. Below you find the standard
CMOS
layout as it was defined by IBM. AMI, Phoenix and others have added
some
options called "Advanced Setup" and used the bytes which are marked
reserved
here. Somewhere in this reserved range the password gets stored.

Maybe there are PCs with some other RTC chip with more RAM, but at
least
around here even the latest buys still carry this old but worthy chip.

From: skolnik at kapsch.co.at (Gerhard Skolnik)

+---------------------------------------------------------------------
-+
a                       CMOS Storage Layout                      more
 a
+---------------------------------------------------------------------
-+

00H-0dH used by real-time clock
0eH     POST diagnostics status byte
0fH     shutdown status byte
10H     diskette drive type      -----+
11H     reserved                      a
12H     hard disk drive type          a
13H     reserved                      a- checksum-protected
14H     equipment byte                a   configuration record (10H-
20H)
15H-16H Base memory size              a
17H-18H extended memory above 1M      a
19H     hard disk 1 type (if > 15)    a
1aH     hard disk 2 type (if > 15)    a
1bH-2dH reserved                 -----+
2eH-2fH storage for checksum of CMOS addresses 10H through 20H
30H-31H extended memory above 1M
32H     current century in BCD (eg, 19H)
33H     miscellaneous info.
34H-3fH reserved

+----------------+
aUsing CMOS Data a
+----------------+
To read a byte from CMOS, do an OUT 70H,addr; followed by IN 71H.
To write a byte to CMOS,  do an OUT 70H,addr; followed by OUT
71H,value.

Example: ;------- read what type of hard disk is installed
       mov     al,12H
       out     70H,al   ;select CMOS address 12H
       jmp     $+2      ;this forces a slight delay to settle things
       in      al,71H   ;AL now has drive type (0-15)
}

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu